@@ -71,7 +71,8 @@ static MainWindow() { }
7171
7272 public MainWindow ( )
7373 {
74- Client = new SearchClient ( new SearchConfig ( ) ) ;
74+ // Client = new SearchClient(new SearchConfig());
75+ Shared = new SharedInfo ( ) ;
7576 m_queries = new ConcurrentDictionary < string , SearchQuery > ( ) ;
7677
7778 InitializeComponent ( ) ;
@@ -147,6 +148,7 @@ public MainWindow()
147148 PropertyChangedEventManager . AddHandler ( this , OnCurrentQueueItemChanged , nameof ( CurrentQueueItem ) ) ;
148149 // m_hydrus = new HydrusClient()
149150 ParseArgs ( Args ) ;
151+
150152 }
151153
152154 #region
@@ -163,15 +165,14 @@ public MainWindow()
163165
164166 private readonly SemaphoreSlim m_us ;
165167 private readonly List < string > m_pipeBuffer ;
166- private readonly HydrusClient m_hydrus ;
167168
168169 #endregion
169170
170171 #region
171172
172- public SearchClient Client { get ; }
173+ public SearchClient Client => Shared . Client ;
173174
174- public SearchConfig Config => Client . Config ;
175+ public SearchConfig Config => Shared . Config ;
175176
176177 public ObservableCollection < ResultItem > Results { get ; private set ; }
177178
@@ -191,6 +192,8 @@ public bool InPath
191192
192193 #region
193194
195+ public SharedInfo Shared { get ; set ; }
196+
194197 private readonly ConcurrentDictionary < UniResultItem , string > m_uni ;
195198
196199 private readonly ConcurrentDictionary < string , SearchQuery > m_queries ;
@@ -210,7 +213,11 @@ public bool InPath
210213
211214 #region Queue/Query
212215
213- public SearchQuery Query { get ; internal set ; }
216+ public SearchQuery Query
217+ {
218+ get => Shared . Query ;
219+ internal set => Shared . Query = value ;
220+ }
214221
215222 private string m_currentQueueItem ;
216223
@@ -480,7 +487,7 @@ public bool UseClipboard
480487
481488 private static int _clipboardSequence ;
482489
483- // [DebuggerHidden]
490+ [ DebuggerHidden ]
484491 private void ClipboardListenAsync ( object ? s , EventArgs e )
485492 {
486493 /*if (IsInputReady() /*|| Query != SearchQuery.Null#1#) {
@@ -957,7 +964,7 @@ private async void RetryEngineAsync(ResultItem ri)
957964
958965 #endregion
959966
960- #region
967+ #region
961968
962969 public static readonly string [ ] Args = Environment . GetCommandLineArgs ( ) ;
963970
@@ -1032,7 +1039,7 @@ private void ChangeStatus2(ResultItem ri)
10321039 }
10331040 }
10341041
1035- #region
1042+ #region
10361043
10371044 private void Log ( LogEntry l )
10381045 {
@@ -1080,7 +1087,7 @@ private void OnPropertyChanged([CallerMemberName] string? propertyName = null)
10801087
10811088 public event PreviewChangedCallback? PreviewChanged;*/
10821089
1083- #region
1090+ #region
10841091
10851092 private void UpdatePreview ( ResultItem ri )
10861093 {
0 commit comments