コード例 #1
1
ファイル: BuildEngine.cs プロジェクト: Altaxo/Altaxo
		/// <summary>
		/// Starts to run a build inside the SharpDevelop GUI.
		/// Only one build can run inside the GUI at one time.
		/// </summary>
		/// <param name="project">The project/solution to build.</param>
		/// <param name="options">The build options.</param>
		public static void BuildInGui(IBuildable project, BuildOptions options)
		{
			if (project == null)
				throw new ArgumentNullException("project");
			if (options == null)
				throw new ArgumentNullException("options");
			WorkbenchSingleton.AssertMainThread();
			if (guiBuildCancellation != null) {
				BuildResults results = new BuildResults();
				WorkbenchSingleton.StatusBar.SetMessage(Core.ResourceService.GetString("MainWindow.CompilerMessages.MSBuildAlreadyRunning"));
				BuildError error = new BuildError(null, Core.ResourceService.GetString("MainWindow.CompilerMessages.MSBuildAlreadyRunning"));
				results.Add(error);
				TaskService.Add(new Task(error));
				results.Result = BuildResultCode.MSBuildAlreadyRunning;
				if (options.Callback != null) {
					options.Callback(results);
				}
			} else {
				guiBuildCancellation = new CancellationTokenSource();
				IProgressMonitor progressMonitor = WorkbenchSingleton.StatusBar.CreateProgressMonitor(guiBuildCancellation.Token);
				guiBuildTrackedFeature = AnalyticsMonitorService.TrackFeature("ICSharpCode.SharpDevelop.Project.BuildEngine.Build");
				WorkbenchSingleton.StatusBar.SetMessage(StringParser.Parse("${res:MainWindow.CompilerMessages.BuildVerb}..."));
				ProjectService.RaiseEventBuildStarted(new BuildEventArgs(project, options));
				StartBuild(project, options,
				           new MessageViewSink(TaskService.BuildMessageViewCategory, progressMonitor, WorkbenchSingleton.StatusBar));
			}
		}
コード例 #2
0
        public AvalonEditViewContent(OpenedFile file, Encoding fixedEncodingForLoading = null)
        {
            // Use common service container for view content and primary text editor.
            // This makes all text editor services available as view content services and vice versa.
            // (with the exception of the interfaces implemented directly by this class,
            // those are available as view-content services only)
            this.Services = codeEditor.PrimaryTextEditor.GetRequiredService <IServiceContainer>();
            if (fixedEncodingForLoading != null)
            {
                codeEditor.UseFixedEncoding           = true;
                codeEditor.PrimaryTextEditor.Encoding = fixedEncodingForLoading;
            }
            this.TabPageText = "${res:FormsDesigner.DesignTabPages.SourceTabPage}";

            if (file.FileName != null)
            {
                string filetype = Path.GetExtension(file.FileName);
                if (!IsKnownFileExtension(filetype))
                {
                    filetype = ".?";
                }
                trackedFeature = SD.AnalyticsMonitor.TrackFeature(typeof(AvalonEditViewContent), "open" + filetype.ToLowerInvariant());
            }

            this.Files.Add(file);
            file.ForceInitializeView(this);

            file.IsDirtyChanged += PrimaryFile_IsDirtyChanged;
            codeEditor.Document.UndoStack.PropertyChanged += codeEditor_Document_UndoStack_PropertyChanged;
        }
コード例 #3
0
		public AvalonEditViewContent(OpenedFile file, Encoding fixedEncodingForLoading = null)
		{
			// Use common service container for view content and primary text editor.
			// This makes all text editor services available as view content services and vice versa.
			// (with the exception of the interfaces implemented directly by this class,
			// those are available as view-content services only)
			this.Services = codeEditor.PrimaryTextEditor.GetRequiredService<IServiceContainer>();
			if (fixedEncodingForLoading != null) {
				codeEditor.UseFixedEncoding = true;
				codeEditor.PrimaryTextEditor.Encoding = fixedEncodingForLoading;
			}
			this.TabPageText = "${res:FormsDesigner.DesignTabPages.SourceTabPage}";
			
			if (file.FileName != null) {
				string filetype = Path.GetExtension(file.FileName);
				if (!IsKnownFileExtension(filetype))
					filetype = ".?";
				trackedFeature = SD.AnalyticsMonitor.TrackFeature(typeof(AvalonEditViewContent), "open" + filetype.ToLowerInvariant());
			}
			
			this.Files.Add(file);
			file.ForceInitializeView(this);
			
			file.IsDirtyChanged += PrimaryFile_IsDirtyChanged;
			codeEditor.Document.UndoStack.PropertyChanged += codeEditor_Document_UndoStack_PropertyChanged;
		}
コード例 #4
0
        public AvalonEditViewContent(OpenedFile file, Encoding fixedEncodingForLoading = null)
        {
            if (fixedEncodingForLoading != null)
            {
                codeEditor.UseFixedEncoding           = true;
                codeEditor.PrimaryTextEditor.Encoding = fixedEncodingForLoading;
            }
            this.TabPageText = "${res:FormsDesigner.DesignTabPages.SourceTabPage}";

            if (file.FileName != null)
            {
                string filetype = Path.GetExtension(file.FileName);
                if (!ProjectService.GetFileFilters().Any(f => f.ContainsExtension(filetype)))
                {
                    filetype = ".?";
                }
                trackedFeature = AnalyticsMonitorService.TrackFeature(typeof(AvalonEditViewContent), "open" + filetype.ToLowerInvariant());
            }

            this.Files.Add(file);
            file.ForceInitializeView(this);

            file.IsDirtyChanged += PrimaryFile_IsDirtyChanged;
            codeEditor.Document.UndoStack.PropertyChanged += codeEditor_Document_UndoStack_PropertyChanged;
            codeEditor.CaretPositionChanged += CaretChanged;
            codeEditor.TextCopied           += codeEditor_TextCopied;
        }
コード例 #5
0
 /// <summary>
 /// Starts to run a build inside the SharpDevelop GUI.
 /// Only one build can run inside the GUI at one time.
 /// </summary>
 /// <param name="project">The project/solution to build.</param>
 /// <param name="options">The build options.</param>
 public static void BuildInGui(IBuildable project, BuildOptions options)
 {
     if (project == null)
     {
         throw new ArgumentNullException("project");
     }
     if (options == null)
     {
         throw new ArgumentNullException("options");
     }
     WorkbenchSingleton.AssertMainThread();
     if (guiBuildCancellation != null)
     {
         BuildResults results = new BuildResults();
         WorkbenchSingleton.StatusBar.SetMessage(Core.ResourceService.GetString("MainWindow.CompilerMessages.MSBuildAlreadyRunning"));
         BuildError error = new BuildError(null, Core.ResourceService.GetString("MainWindow.CompilerMessages.MSBuildAlreadyRunning"));
         results.Add(error);
         TaskService.Add(new Task(error));
         results.Result = BuildResultCode.MSBuildAlreadyRunning;
         if (options.Callback != null)
         {
             options.Callback(results);
         }
     }
     else
     {
         guiBuildCancellation = new CancellationTokenSource();
         IProgressMonitor progressMonitor = WorkbenchSingleton.StatusBar.CreateProgressMonitor(guiBuildCancellation.Token);
         guiBuildTrackedFeature = AnalyticsMonitorService.TrackFeature("ICSharpCode.SharpDevelop.Project.BuildEngine.Build");
         WorkbenchSingleton.StatusBar.SetMessage(StringParser.Parse("${res:MainWindow.CompilerMessages.BuildVerb}..."));
         ProjectService.RaiseEventBuildStarted(new BuildEventArgs(project, options));
         StartBuild(project, options,
                    new MessageViewSink(TaskService.BuildMessageViewCategory, progressMonitor, WorkbenchSingleton.StatusBar));
     }
 }
コード例 #6
0
 protected virtual void OnDebugStarting(EventArgs e)
 {
     SD.Workbench.CurrentLayoutConfiguration = "Debug";
     debugFeature = SD.AnalyticsMonitor.TrackFeature("Debugger");
     ClearDebugMessages();
     if (DebugStarting != null)
     {
         DebugStarting(null, e);
     }
 }
コード例 #7
0
        private static void OnDebugStarting(object sender, EventArgs e)
        {
            debugFeature = AnalyticsMonitorService.TrackFeature("Debugger");

            ClearDebugMessages();

            if (DebugStarting != null)
            {
                DebugStarting(null, e);
            }
        }
コード例 #8
0
        static void OnDebugStarting(object sender, EventArgs e)
        {
            WorkbenchSingleton.Workbench.WorkbenchLayout.StoreConfiguration();
            LayoutConfiguration.CurrentLayoutName = "Debug";

            debugFeature = AnalyticsMonitorService.TrackFeature("Debugger");

            ClearDebugMessages();

            if (DebugStarting != null)
            {
                DebugStarting(null, e);
            }
        }
コード例 #9
0
		public AvalonEditViewContent(OpenedFile file, Encoding fixedEncodingForLoading = null)
		{
			if (fixedEncodingForLoading != null) {
				codeEditor.UseFixedEncoding = true;
				codeEditor.PrimaryTextEditor.Encoding = fixedEncodingForLoading;
			}
			this.TabPageText = "${res:FormsDesigner.DesignTabPages.SourceTabPage}";
			
			if (file.FileName != null) {
				string filetype = Path.GetExtension(file.FileName);
				if (!ProjectService.GetFileFilters().Any(f => f.ContainsExtension(filetype)))
					filetype = ".?";
				trackedFeature = AnalyticsMonitorService.TrackFeature(typeof(AvalonEditViewContent), "open" + filetype.ToLowerInvariant());
			}
			
			this.Files.Add(file);
			file.ForceInitializeView(this);
			
			file.IsDirtyChanged += PrimaryFile_IsDirtyChanged;
			codeEditor.Document.UndoStack.PropertyChanged += codeEditor_Document_UndoStack_PropertyChanged;
			codeEditor.CaretPositionChanged += CaretChanged;
			codeEditor.TextCopied += codeEditor_TextCopied;
		}
コード例 #10
0
 protected virtual void OnDebugStarting(EventArgs e)
 {
     SD.Workbench.CurrentLayoutConfiguration = "Debug";
     debugFeature = SD.AnalyticsMonitor.TrackFeature("Debugger");
     ClearDebugMessages();
     if (DebugStarting != null)
         DebugStarting(null, e);
 }
コード例 #11
0
		static void OnDebugStarting(object sender, EventArgs e)
		{
			WorkbenchSingleton.Workbench.WorkbenchLayout.StoreConfiguration();
			LayoutConfiguration.CurrentLayoutName = "Debug";
			
			debugFeature = AnalyticsMonitorService.TrackFeature("Debugger");
			
			ClearDebugMessages();
			
			if (DebugStarting != null)
				DebugStarting(null, e);
		}