public void Open() { SelectFolderDialogCreationArgs args = new SelectFolderDialogCreationArgs(); args.AllowCreateNewFolder = false; args.Path = _lastFolder; args.Prompt = SR.MessageSelectFolderToFilter; FileDialogResult result = base.Context.DesktopWindow.ShowSelectFolderDialogBox(args); if (result.Action == DialogBoxAction.Ok) { _lastFolder = result.FileName; StudyFilterComponent component = new StudyFilterComponent(); component.BulkOperationsMode = true; if (component.Load(base.Context.DesktopWindow, true, result.FileName)) { component.Refresh(true); base.Context.DesktopWindow.Workspaces.AddNew(component, SR.StudyFilters); } component.BulkOperationsMode = false; } }
public void Open() { var studyLoaders = new List <IStudyLoader>(); int sopCount = 0; foreach (var studyItem in base.Context.SelectedStudies) { if (!studyItem.Server.IsSupported <IStudyLoader>()) { return; } var loader = studyItem.Server.GetService <IStudyLoader>(); studyLoaders.Add(loader); sopCount += loader.Start(new StudyLoaderArgs(studyItem.StudyInstanceUid, studyItem.Server)); } bool success = false; var component = new StudyFilterComponent { BulkOperationsMode = true }; var task = new BackgroundTask(c => { c.ReportProgress(new BackgroundTaskProgress(0, sopCount, SR.MessageLoading)); if (c.CancelRequested) { c.Cancel(); } int progress = 0; foreach (IStudyLoader localStudyLoader in studyLoaders) { Sop sop; while ((sop = localStudyLoader.LoadNextSop()) != null) { component.Items.Add(new SopDataSourceStudyItem(sop)); c.ReportProgress(new BackgroundTaskProgress(Math.Min(sopCount, ++progress) - 1, sopCount, SR.MessageLoading)); if (c.CancelRequested) { c.Cancel(); } sop.Dispose(); } } success = true; component.Refresh(true); c.Complete(); }, true); ProgressDialog.Show(task, this.Context.DesktopWindow, true, ProgressBarStyle.Continuous); if (success) { component.BulkOperationsMode = false; base.Context.DesktopWindow.Workspaces.AddNew(component, SR.TitleStudyFilters); } }
public void Open() { var studyLoaders = new List<IStudyLoader>(); int sopCount = 0; foreach (var studyItem in base.Context.SelectedStudies) { if (!studyItem.Server.IsSupported<IStudyLoader>()) return; var loader = studyItem.Server.GetService<IStudyLoader>(); studyLoaders.Add(loader); sopCount += loader.Start(new StudyLoaderArgs(studyItem.StudyInstanceUid, studyItem.Server)); } bool success = false; var component = new StudyFilterComponent {BulkOperationsMode = true}; var task = new BackgroundTask(c => { c.ReportProgress(new BackgroundTaskProgress(0, sopCount, SR.MessageLoading)); if (c.CancelRequested) c.Cancel(); int progress = 0; foreach (IStudyLoader localStudyLoader in studyLoaders) { Sop sop; while ((sop = localStudyLoader.LoadNextSop()) != null) { component.Items.Add(new SopDataSourceStudyItem(sop)); c.ReportProgress(new BackgroundTaskProgress(Math.Min(sopCount, ++progress) - 1, sopCount, SR.MessageLoading)); if (c.CancelRequested) c.Cancel(); sop.Dispose(); } } success = true; component.Refresh(true); c.Complete(); }, true); ProgressDialog.Show(task, this.Context.DesktopWindow, true, ProgressBarStyle.Continuous); if (success) { component.BulkOperationsMode = false; base.Context.DesktopWindow.Workspaces.AddNew(component, SR.TitleStudyFilters); } }
public StudyFilterComponentPanel(StudyFilterComponent component) : this() { _component = component; _component.FilterPredicatesChanged += new EventHandler(_component_FilterPredicatesChanged); ActionModelRoot toolbarActions = ActionModelRoot.CreateModel("ClearCanvas.ImageViewer.Utilities.StudyFilters.View.WinForms", StudyFilterTool.DefaultToolbarActionSite, _component.ExportedActions); ToolStripBuilder.ToolStripBuilderStyle defaultStyle = new ToolStripBuilder.ToolStripBuilderStyle(); ToolStripBuilder.ToolStripBuilderStyle myStyle = new ToolStripBuilder.ToolStripBuilderStyle(ToolStripItemDisplayStyle.ImageAndText, defaultStyle.ToolStripAlignment, defaultStyle.TextImageRelation); ToolStripBuilder.BuildToolbar(_toolbar.Items, toolbarActions.ChildNodes, myStyle); _tableView.Table = component.Table; _tableView.MultiSelect = true; _tableView.ColumnFilterMenuStripClosed += new EventHandler(_tableView_ColumnFilterMenuStripClosed); _tableView.ContextActionModelDelegate = this.GetContextMenuModel; _tableView.ColumnFilterActionModelDelegate = this.GetColumnFilterMenuModel; _tableView.ReadOnly = true; }
public StudyFilterComponentPanel(StudyFilterComponent component) : this() { _component = component; _component.FilterPredicatesChanged += new EventHandler(_component_FilterPredicatesChanged); ActionModelRoot toolbarActions = ActionModelRoot.CreateModel("ClearCanvas.ImageViewer.Utilities.StudyFilters.View.WinForms", StudyFilterTool.DefaultToolbarActionSite, _component.ExportedActions); ToolStripBuilder.ToolStripBuilderStyle defaultStyle = new ToolStripBuilder.ToolStripBuilderStyle(); ToolStripBuilder.ToolStripBuilderStyle myStyle = new ToolStripBuilder.ToolStripBuilderStyle(ToolStripItemDisplayStyle.ImageAndText, defaultStyle.ToolStripAlignment, defaultStyle.TextImageRelation); ToolStripBuilder.BuildToolbar(_toolbar.Items, toolbarActions.ChildNodes, myStyle); _tableView.Table = component.Table; _tableView.MultiSelect = true; _tableView.ColumnFilterMenuStripClosed += new EventHandler(_tableView_ColumnFilterMenuStripClosed); _tableView.ContextActionModelDelegate = this.GetContextMenuModel; _tableView.ColumnFilterActionModelDelegate = this.GetColumnFilterMenuModel; _tableView.ReadOnly = true; }
public void Open() { List <string> paths = new List <string>(base.Context.SelectedPaths); if (paths.Count == 0) { return; } StudyFilterComponent component = new StudyFilterComponent(); component.BulkOperationsMode = true; if (component.Load(base.Context.DesktopWindow, true, paths)) { component.Refresh(true); base.Context.DesktopWindow.Workspaces.AddNew(component, SR.TitleStudyFilters); } component.BulkOperationsMode = false; }
public void SetComponent(IApplicationComponent component) { _component = (StudyFilterComponent)component; }
public void SetComponent(IApplicationComponent component) { _component = (StudyFilterComponent) component; }