public void SimpleCommandLine() { IndexerParameters indexperParamters = new IndexerParameters(); indexperParamters.DataSource = "test1"; indexperParamters.IndexPath = "test2"; indexperParamters.PreviewWidth = 10; indexperParamters.ThumbWidth = 11; string cmd = IndexerParameters.CreateCommandLine(indexperParamters); IndexerParameters parsed = IndexerParameters.ParseCommandLine(cmd.Split(' ')); Assert.AreEqual(indexperParamters.DataSource, parsed.DataSource); Assert.AreEqual(indexperParamters.IndexPath, parsed.IndexPath); Assert.AreEqual(indexperParamters.PreviewWidth, parsed.PreviewWidth); Assert.AreEqual(indexperParamters.ThumbWidth, parsed.ThumbWidth); }
protected void CreateIndexerProcess(string pathToProcess) { Process process = new Process(); process.StartInfo.FileName = "PhotoAssistant.Indexer.exe"; IndexerParameters indexperParamters = new IndexerParameters(); indexperParamters.IndexPath = pathToProcess; indexperParamters.DataSource = SettingsStore.Default.CurrentDataSource; indexperParamters.ThumbWidth = SettingsStore.Default.ThumbSize.Width; indexperParamters.PreviewWidth = SettingsStore.Default.PreviewSize.Width; string cmd = IndexerParameters.CreateCommandLine(indexperParamters); process.StartInfo.Arguments = cmd; process.StartInfo.WindowStyle = ProcessWindowStyle.Hidden; process.Start(); }