public string this[string key] { get { string val; if (values.TryGetValue(key, out val)) { return(val); } else { return(null); } } set { WorkbenchSingleton.AssertMainThread(); if (value != null) { values[key] = value; } else { string tmp; values.TryRemove(key, out tmp); } } }
public bool CloseWindow(bool force) { WorkbenchSingleton.AssertMainThread(); forceClose = force; Close(); return(this.ViewContents.Count == 0); }
/// <summary> /// Refreshes the property pad if the specified item is active. /// </summary> public static void RefreshItem(object obj) { WorkbenchSingleton.AssertMainThread(); if (instance != null && instance.grid.SelectedObjects.Contains(obj)) { instance.inUpdate = true; instance.grid.SelectedObjects = instance.grid.SelectedObjects; instance.inUpdate = false; } }
public void CloseAllViews() { WorkbenchSingleton.AssertMainThread(); try { closeAll = true; foreach (IWorkbenchWindow window in this.WorkbenchWindowCollection.ToArray()) { window.CloseWindow(false); } } finally { closeAll = false; OnActiveWindowChanged(this, EventArgs.Empty); } }
public void AddProgress(ProgressCollector progress) { if (progress == null) { throw new ArgumentNullException("progress"); } WorkbenchSingleton.AssertMainThread(); if (currentProgress != null) { currentProgress.ProgressMonitorDisposed -= progress_ProgressMonitorDisposed; currentProgress.PropertyChanged -= progress_PropertyChanged; } waitingProgresses.Push(currentProgress); // push even if currentProgress==null SetActiveProgress(progress); }
public PadDescriptor GetPad(Type type) { WorkbenchSingleton.AssertMainThread(); if (type == null) { throw new ArgumentNullException("type"); } foreach (PadDescriptor pad in PadContentCollection) { if (pad.Class == type.FullName) { return(pad); } } return(null); }
public void ShowView(IViewContent content, bool switchToOpenedView) { WorkbenchSingleton.AssertMainThread(); if (content == null) { throw new ArgumentNullException("content"); } if (ViewContentCollection.Contains(content)) { throw new ArgumentException("ViewContent was already shown"); } System.Diagnostics.Debug.Assert(WorkbenchLayout != null); LoadViewContentMemento(content); WorkbenchLayout.ShowView(content, switchToOpenedView); }
void SetActiveProgress(ProgressCollector progress) { WorkbenchSingleton.AssertMainThread(); currentProgress = progress; if (progress == null) { statusBar.HideProgress(); return; } progress.ProgressMonitorDisposed += progress_ProgressMonitorDisposed; if (progress.ProgressMonitorIsDisposed) { progress_ProgressMonitorDisposed(progress, null); return; } progress.PropertyChanged += progress_PropertyChanged; }
public void ShowPad(PadDescriptor content) { WorkbenchSingleton.AssertMainThread(); if (content == null) { throw new ArgumentNullException("content"); } if (padDescriptorCollection.Contains(content)) { throw new ArgumentException("Pad is already loaded"); } padDescriptorCollection.Add(content); if (WorkbenchLayout != null) { WorkbenchLayout.ShowPad(content); } }
public bool CloseAllSolutionViews() { bool result = true; WorkbenchSingleton.AssertMainThread(); try { closeAll = true; foreach (IWorkbenchWindow window in this.WorkbenchWindowCollection.ToArray()) { if (window.ActiveViewContent != null && window.ActiveViewContent.CloseWithSolution) { result &= window.CloseWindow(false); } } } finally { closeAll = false; OnActiveWindowChanged(this, EventArgs.Empty); } return(result); }