Пример #1
0
 public void ShowCodeObject(NuGenIMultiLine codeObject, NuGenCodeObjectDisplayOptions options)
 {
     if (invokee.InvokeRequired)
     {
         invokee.Invoke(ShowCodeObjectMethod, new object[] { codeObject, options });
     }
     else
     {
         ShowCodeObjectMethod(codeObject, options);
     }
 }
Пример #2
0
        private void ShowCodeObject()
        {
            if (callStackView.SelectedItems.Count == 1)
            {
                ListViewItem          selectedItem     = callStackView.SelectedItems[0];
                NuGenFrameInformation frameInformation = selectedItem.Tag as NuGenFrameInformation;

                if (frameInformation != null)
                {
                    frameInformation.RefreshFrame();
                    List <NuGenBaseLineDescriptor> specialLines   = null;
                    NuGenCodeObjectDisplayOptions  displayOptions = new NuGenCodeObjectDisplayOptions();

                    if (frameInformation.IsActiveFrame)
                    {
                        if (frameInformation.IsExactLocation)
                        {
                            displayOptions.CurrentLine = new NuGenCurrentLine(frameInformation.Offset);
                        }
                        else
                        {
                            displayOptions.CurrentLine = new NuGenCallerLine(frameInformation.Offset);
                        }
                    }
                    else
                    {
                        NuGenBaseLineDescriptor lineDescriptor = null;
                        specialLines = new List <NuGenBaseLineDescriptor>(1);

                        if (frameInformation.IsExactLocation)
                        {
                            lineDescriptor = new NuGenExactCallerLine(frameInformation.Offset);
                        }
                        else
                        {
                            lineDescriptor = new NuGenCallerLine(frameInformation.Offset);
                        }

                        specialLines.Add(lineDescriptor);
                    }

                    displayOptions.SpecialLinesToAdd = specialLines;

                    NuGenUIHandler.Instance.ShowCodeObject(frameInformation.MethodDefinition, displayOptions);
                    NuGenUIHandler.Instance.FrameChangedUpdate(frameInformation.Refresher, frameInformation.Frame, false);
                }
            }
        }
Пример #3
0
        public void ShowCodeObject(NuGenIMultiLine codeObject, NuGenCodeObjectDisplayOptions options)
        {
            NuGenCodeDisplayer codeDisplayer = FindCodeDisplayer(codeObject);

            if (codeDisplayer == null)
            {
                NuGenCodeEditorForm codeEditorForm = new NuGenCodeEditorForm();
                codeEditorForm.ProjectExplorer = this;
                //PETETODO:  Why does this crash?
                //codeEditorForm.UpdateFont(Settings.Instance.CodeEditorFont.Font);
                codeEditorForm.SetWordWrap(WordWrap);

                NuGenCodeDisplayer displayer = new NuGenCodeDisplayer(codeEditorAdded, codeObject, codeEditorForm);
                codeDisplayers.Add(displayer);
                displayer.ShowCodeObject(options);
                displayer.Window.ProjectExplorer = this;
            }
            else
            {
                codeDisplayer.ShowCodeObject(options);
                codeDisplayer.Window.ProjectExplorer = this;
            }
        }
Пример #4
0
        public void ShowCodeObject(NuGenCodeObjectDisplayOptions options)
        {
            bool initialized = true;

            try
            {
                initialized = (CodeObject.CodeLines != null);

                if (!initialized)
                {
                    NuGenUIHandler.Instance.ResetProgressBar();
                    NuGenUIHandler.Instance.SetProgressBarMaximum(2);
                    NuGenUIHandler.Instance.SetProgressBarVisible(true);
                    NuGenUIHandler.Instance.SetProgressText("Creating text representation of the object... ", true);
                    CodeObject.Initialize();
                    NuGenUIHandler.Instance.StepProgressBar(1);

                    NuGenUIHandler.Instance.SetProgressText("Displaying the text... ", true);
                    Window.ShowCodeObject(codeObject);

                    //Check this : PETETODO
                    //Window.Controls.Add(DockPanel);
                    CodeDisplayerAdded(Window);

                    NuGenUIHandler.Instance.SetProgressText("Ready\n\n", true);
                }

                if (Window.IsDisposed)
                {
                    NuGenCodeEditorForm newWindow = new NuGenCodeEditorForm();
                    newWindow.UpdateFont(NuGenSettings.Instance.CodeEditorFont.Font);
                    Window.CopySettings(newWindow);
                    Window = newWindow;

                    Window.ShowCodeObject(codeObject);
                    Window.CurrentLine = options.CurrentLine;

                    //PETETODO : Check this
                    //Window.Controls.Add(DockPanel);
                    //If initialized == true then it has already been added
                    if (initialized)
                    {
                        CodeDisplayerAdded(Window);
                    }
                }
                else
                {
                    if (Window.Visible)
                    {
                        Window.CurrentLine = options.CurrentLine;
                    }
                    else
                    {
                        Window.ShowCodeObject(codeObject);
                        Window.CurrentLine = options.CurrentLine;

                        //Window.Controls.Add(DockPanel);
                        //If initialized == true then it has already been added
                        if (initialized)
                        {
                            CodeDisplayerAdded(Window);
                        }
                    }
                }

                Window.AddSpecialLines(options.SpecialLinesToAdd);

                if (options.IsNavigateSet)
                {
                    Window.RefreshEditorControl(true, options.NavigateToOffset);
                }
                else
                {
                    Window.RefreshEditorControl(true);
                }
            }
            catch (Exception exception)
            {
                NuGenUIHandler.Instance.ShowException(exception);
            }
            finally
            {
                if (!initialized)
                {
                    NuGenUIHandler.Instance.SetProgressBarVisible(false);
                }
            }
        }
		private void ShowCodeObject()
		{
			if (callStackView.SelectedItems.Count == 1)
			{
				ListViewItem selectedItem = callStackView.SelectedItems[0];
				NuGenFrameInformation frameInformation = selectedItem.Tag as NuGenFrameInformation;

				if (frameInformation != null)
				{
					frameInformation.RefreshFrame();
					List<NuGenBaseLineDescriptor> specialLines = null;
					NuGenCodeObjectDisplayOptions displayOptions = new NuGenCodeObjectDisplayOptions();

					if (frameInformation.IsActiveFrame)
					{
						if (frameInformation.IsExactLocation)
						{
							displayOptions.CurrentLine = new NuGenCurrentLine(frameInformation.Offset);
						}
						else
						{
							displayOptions.CurrentLine = new NuGenCallerLine(frameInformation.Offset);
						}
					}
					else
					{
						NuGenBaseLineDescriptor lineDescriptor = null;
						specialLines = new List<NuGenBaseLineDescriptor>(1);

						if (frameInformation.IsExactLocation)
						{
							lineDescriptor = new NuGenExactCallerLine(frameInformation.Offset);
						}
						else
						{
							lineDescriptor = new NuGenCallerLine(frameInformation.Offset);
						}

						specialLines.Add(lineDescriptor);
					}

					displayOptions.SpecialLinesToAdd = specialLines;

					NuGenUIHandler.Instance.ShowCodeObject(frameInformation.MethodDefinition, displayOptions);
					NuGenUIHandler.Instance.FrameChangedUpdate(frameInformation.Refresher, frameInformation.Frame, false);
				}
			}
		}
Пример #6
0
		public void ShowCodeObject(NuGenCodeObjectDisplayOptions options)
		{
			bool initialized = true;

			try
			{
				initialized = (CodeObject.CodeLines != null);

				if (!initialized)
				{
					NuGenUIHandler.Instance.ResetProgressBar();
					NuGenUIHandler.Instance.SetProgressBarMaximum(2);
					NuGenUIHandler.Instance.SetProgressBarVisible(true);
					NuGenUIHandler.Instance.SetProgressText("Creating text representation of the object... ", true);
					CodeObject.Initialize();
					NuGenUIHandler.Instance.StepProgressBar(1);

					NuGenUIHandler.Instance.SetProgressText("Displaying the text... ", true);
					Window.ShowCodeObject(codeObject);
                   
                    //Check this : PETETODO
					//Window.Controls.Add(DockPanel);
                    CodeDisplayerAdded(Window);

					NuGenUIHandler.Instance.SetProgressText("Ready\n\n", true);
				}

				if (Window.IsDisposed)
				{
					NuGenCodeEditorForm newWindow = new NuGenCodeEditorForm();
					newWindow.UpdateFont(NuGenSettings.Instance.CodeEditorFont.Font);
					Window.CopySettings(newWindow);
					Window = newWindow;

					Window.ShowCodeObject(codeObject);
					Window.CurrentLine = options.CurrentLine;

                    //PETETODO : Check this
					//Window.Controls.Add(DockPanel);
                    //If initialized == true then it has already been added
                    if (initialized)
                    {
                        CodeDisplayerAdded(Window);
                    }
				}
				else
				{
					if (Window.Visible)
					{
						Window.CurrentLine = options.CurrentLine;
					}
					else
					{
						Window.ShowCodeObject(codeObject);
						Window.CurrentLine = options.CurrentLine;

						//Window.Controls.Add(DockPanel);
                        //If initialized == true then it has already been added
                        if (initialized)
                        {
                            CodeDisplayerAdded(Window);
                        }
					}					
				}

				Window.AddSpecialLines(options.SpecialLinesToAdd);				

				if (options.IsNavigateSet)
				{
					Window.RefreshEditorControl(true, options.NavigateToOffset);
				}
				else
				{
					Window.RefreshEditorControl(true);
				}
			}
			catch (Exception exception)
			{
				NuGenUIHandler.Instance.ShowException(exception);
			}
			finally
			{
				if (!initialized)
				{
					NuGenUIHandler.Instance.SetProgressBarVisible(false);
				}
			}
		}
		public void ShowCodeObject(NuGenIMultiLine codeObject, NuGenCodeObjectDisplayOptions options)
		{
			NuGenCodeDisplayer codeDisplayer = FindCodeDisplayer(codeObject);

			if (codeDisplayer == null)
			{
				NuGenCodeEditorForm codeEditorForm = new NuGenCodeEditorForm();
                codeEditorForm.ProjectExplorer = this;
                //PETETODO:  Why does this crash?
				//codeEditorForm.UpdateFont(Settings.Instance.CodeEditorFont.Font);
				codeEditorForm.SetWordWrap(WordWrap);

                NuGenCodeDisplayer displayer = new NuGenCodeDisplayer(codeEditorAdded, codeObject, codeEditorForm);
				codeDisplayers.Add(displayer);
				displayer.ShowCodeObject(options);
                displayer.Window.ProjectExplorer = this;
			}
			else
			{
				codeDisplayer.ShowCodeObject(options);
                codeDisplayer.Window.ProjectExplorer = this;
			}
		}
Пример #8
0
		public void ShowCodeObject(NuGenIMultiLine codeObject, NuGenCodeObjectDisplayOptions options)
		{
            if (invokee.InvokeRequired)
                invokee.Invoke(ShowCodeObjectMethod, new object[] { codeObject, options });
            else
                ShowCodeObjectMethod(codeObject, options);
		}