/// <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)); } }
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; }
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; }
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; }
/// <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)); } }
protected virtual void OnDebugStarting(EventArgs e) { SD.Workbench.CurrentLayoutConfiguration = "Debug"; debugFeature = SD.AnalyticsMonitor.TrackFeature("Debugger"); ClearDebugMessages(); if (DebugStarting != null) { DebugStarting(null, e); } }
private static void OnDebugStarting(object sender, EventArgs e) { debugFeature = AnalyticsMonitorService.TrackFeature("Debugger"); ClearDebugMessages(); if (DebugStarting != null) { DebugStarting(null, e); } }
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); } }
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; }
protected virtual void OnDebugStarting(EventArgs e) { SD.Workbench.CurrentLayoutConfiguration = "Debug"; debugFeature = SD.AnalyticsMonitor.TrackFeature("Debugger"); ClearDebugMessages(); if (DebugStarting != null) DebugStarting(null, e); }
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); }