コード例 #1
0
		public override IInsightWindow ShowInsightWindow(IEnumerable<IInsightItem> items)
		{
			if (items == null)
				return null;
			var insightWindow = textEditor.ActiveInsightWindow;
			bool isNewWindow = false;
			if (insightWindow == null) {
				insightWindow = new SharpDevelopInsightWindow(this.TextEditor.TextArea);
				isNewWindow = true;
			}
			var adapter = new SharpDevelopInsightWindowAdapter(insightWindow);
			adapter.Items.AddRange(items);
			if (adapter.Items.Count > 0) {
				adapter.SelectedItem = adapter.Items[0];
			} else {
				// don't open insight window when there are no items
				return null;
			}
			insightWindow.SetActiveAdapter(adapter, isNewWindow);
			if (isNewWindow)
			{
				textEditor.ShowInsightWindow(insightWindow);
			}
			return adapter;
		}
コード例 #2
0
        public override IInsightWindow ShowInsightWindow(IEnumerable <IInsightItem> items)
        {
            if (items == null)
            {
                return(null);
            }
            var  insightWindow = textEditor.ActiveInsightWindow;
            bool isNewWindow   = false;

            if (insightWindow == null)
            {
                insightWindow = new SharpDevelopInsightWindow(this.TextEditor.TextArea);
                isNewWindow   = true;
            }
            var adapter = new SharpDevelopInsightWindowAdapter(insightWindow);

            adapter.Items.AddRange(items);
            if (adapter.Items.Count > 0)
            {
                adapter.SelectedItem = adapter.Items[0];
            }
            else
            {
                // don't open insight window when there are no items
                return(null);
            }
            insightWindow.SetActiveAdapter(adapter, isNewWindow);
            if (isNewWindow)
            {
                textEditor.ShowInsightWindow(insightWindow);
            }
            return(adapter);
        }
コード例 #3
0
 internal void OnClosed()
 {
     if (Closed != null)
     {
         Closed(this, EventArgs.Empty);
     }
     insightWindow = null;
 }
コード例 #4
0
 internal SharpDevelopInsightWindowAdapter(SharpDevelopInsightWindow insightWindow)
 {
     this.insightWindow        = insightWindow;
     provider                  = new SDItemProvider(this);
     provider.PropertyChanged += delegate(object sender, PropertyChangedEventArgs e) {
         if (e.PropertyName == "SelectedIndex")
         {
             OnSelectedItemChanged(EventArgs.Empty);
         }
     };
 }
コード例 #5
0
		public override IInsightWindow ShowInsightWindow(IEnumerable<IInsightItem> items)
		{
			if (items == null)
				return null;
			var insightWindow = new SharpDevelopInsightWindow(this.TextEditor.TextArea);
			insightWindow.Items.AddRange(items);
			if (insightWindow.Items.Count > 0) {
				insightWindow.SelectedItem = insightWindow.Items[0];
			} else {
				// don't open insight window when there are no items
				return null;
			}
			textEditor.ShowInsightWindow(insightWindow);
			return insightWindow;
		}
コード例 #6
0
 internal void ShowInsightWindow(SharpDevelopInsightWindow window)
 {
     CloseExistingInsightWindow();
     insightWindow  = window;
     window.Closed += delegate {
         insightWindow = null;
     };
     Dispatcher.BeginInvoke(DispatcherPriority.Normal, new Action(
                                delegate {
         if (insightWindow == window)
         {
             window.Show();
         }
     }
                                ));
 }
コード例 #7
0
        public override IInsightWindow ShowInsightWindow(IEnumerable <IInsightItem> items)
        {
            if (items == null)
            {
                return(null);
            }
            var insightWindow = new SharpDevelopInsightWindow(this.TextEditor.TextArea);

            insightWindow.Items.AddRange(items);
            if (insightWindow.Items.Count > 0)
            {
                insightWindow.SelectedItem = insightWindow.Items[0];
            }
            else
            {
                // don't open insight window when there are no items
                return(null);
            }
            textEditor.ShowInsightWindow(insightWindow);
            return(insightWindow);
        }
コード例 #8
0
			public SDItemProvider(SharpDevelopInsightWindow insightWindow)
			{
				this.insightWindow = insightWindow;
				insightWindow.items.CollectionChanged += insightWindow_items_CollectionChanged;
			}
コード例 #9
0
 public SDItemProvider(SharpDevelopInsightWindow insightWindow)
 {
     this.insightWindow = insightWindow;
     insightWindow.items.CollectionChanged += insightWindow_items_CollectionChanged;
 }
コード例 #10
0
		internal void ShowInsightWindow(SharpDevelopInsightWindow window)
		{
			CloseExistingInsightWindow();
			insightWindow = window;
			window.Closed += delegate {
				insightWindow = null;
			};
			Dispatcher.BeginInvoke(DispatcherPriority.Normal, new Action(
				delegate {
					if (insightWindow == window) {
						window.Show();
					}
				}
			));
		}
コード例 #11
0
		internal void OnClosed()
		{
			if (Closed != null)
				Closed(this, EventArgs.Empty);
			insightWindow = null;
		}
コード例 #12
0
		internal SharpDevelopInsightWindowAdapter(SharpDevelopInsightWindow insightWindow)
		{
			this.insightWindow = insightWindow;
			provider = new SDItemProvider(this);
			provider.PropertyChanged += delegate(object sender, PropertyChangedEventArgs e) {
				if (e.PropertyName == "SelectedIndex")
					OnSelectedItemChanged(EventArgs.Empty);
			};
		}