コード例 #1
0
 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);
         }
     }
 }
コード例 #2
0
        public bool CloseWindow(bool force)
        {
            WorkbenchSingleton.AssertMainThread();

            forceClose = force;
            Close();
            return(this.ViewContents.Count == 0);
        }
コード例 #3
0
ファイル: PropertyPad.cs プロジェクト: vu111293/pat-design
 /// <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;
     }
 }
コード例 #4
0
ファイル: WpfWorkbench.cs プロジェクト: Amichai/SharpDevelop
 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);
     }
 }
コード例 #5
0
 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);
 }
コード例 #6
0
ファイル: WpfWorkbench.cs プロジェクト: Amichai/SharpDevelop
 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);
 }
コード例 #7
0
ファイル: WpfWorkbench.cs プロジェクト: Amichai/SharpDevelop
        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);
        }
コード例 #8
0
        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;
        }
コード例 #9
0
ファイル: WpfWorkbench.cs プロジェクト: Amichai/SharpDevelop
        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);
            }
        }
コード例 #10
0
ファイル: WpfWorkbench.cs プロジェクト: Amichai/SharpDevelop
        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);
        }