@@ -174,22 +174,28 @@ public async Task StopEngineAsync()
174174 /// Opens Windows File Manager with both remote storage and user file system for testing.
175175 /// </summary>
176176 /// <param name="openRemoteStorage">True if the Remote Storage must be opened. False - otherwise.</param>
177+ /// <param name="engineIndex">Index used to position Windows Explorer window to show this user file system.</param>
178+ /// <param name="totalEngines">Total number of Engined that will be mounted by this app.</param>
177179 /// <remarks>This method is provided solely for the development and testing convenience.</remarks>
178- public void ShowTestEnvironment ( string userFileSystemWindowName , bool openRemoteStorage = true , CancellationToken cancellationToken = default )
180+ public void ShowTestEnvironment ( string userFileSystemWindowName , bool openRemoteStorage = true , CancellationToken cancellationToken = default , int engineIndex = 0 , int totalEngines = 1 )
179181 {
180- // Open Windows File Manager with user file system.
181- Commands . Open ( Engine . Path ) ;
182- IntPtr hWndUserFileSystem = WindowManager . FindWindow ( userFileSystemWindowName , cancellationToken ) ;
183- WindowManager . PositionFileSystemWindow ( hWndUserFileSystem , 1 , 2 ) ;
182+ int numWindowsPerEngine = 2 ; //openRemoteStorage ? 2 : 1; // Each engine shows 2 windows - remote storage and UFS.
183+ int horizintalIndex = engineIndex * numWindowsPerEngine ;
184+ int totalWindows = totalEngines * numWindowsPerEngine ;
184185
186+ // Open remote storage.
185187 if ( openRemoteStorage )
186188 {
187- // Open remote storage.
188189 Commands . Open ( RemoteStorageRootPath ) ;
189190 string rsWindowName = Path . GetFileName ( RemoteStorageRootPath . TrimEnd ( '\\ ' ) ) ;
190191 IntPtr hWndRemoteStorage = WindowManager . FindWindow ( rsWindowName , cancellationToken ) ;
191- WindowManager . PositionFileSystemWindow ( hWndRemoteStorage , 0 , 2 ) ;
192+ WindowManager . PositionFileSystemWindow ( hWndRemoteStorage , horizintalIndex , totalWindows ) ;
192193 }
194+
195+ // Open Windows File Manager with user file system.
196+ Commands . Open ( Engine . Path ) ;
197+ IntPtr hWndUserFileSystem = WindowManager . FindWindow ( userFileSystemWindowName , cancellationToken ) ;
198+ WindowManager . PositionFileSystemWindow ( hWndUserFileSystem , horizintalIndex + 1 , totalWindows ) ;
193199 }
194200
195201#endif
0 commit comments