internal CodeEditor( ICommandManager commandManager , IEditorView editorView , IEditorViewHost editorViewHost , IEditorCommands editorCommands , IUndoManager undoManager , IFindLogic findLogic , CodeOptionsModel codeOptionsModel ) { this.commandManager = commandManager; this.editorView = editorView; this.editorViewHost = editorViewHost; this.findLogic = findLogic; this.editorCommands = editorCommands; this.undoManager = undoManager; FrameworkElement element = this.Element; element.PreviewLostKeyboardFocus += new KeyboardFocusChangedEventHandler(this.Editor_LostFocus); element.LostFocus += new RoutedEventHandler(this.Editor_LostFocus); if (this.commandManager != null) { this.commandManager.CommandExecuting += new CommandExecutionEventHandler(this.Editor_LostFocus); } this.editorView.Background = Brushes.White; TextFormattingRunProperties.DefaultProperties.SetTypeface(new Typeface(FontName)); TextFormattingRunProperties.DefaultProperties.SetFontRenderingEmSize(FontSize); this.editorViewHost.LineNumberGutterForegroundColor = Colors.Black; this.editorViewHost.LineNumberGutterTypeface = new Typeface(FontName); this.editorViewHost.LineNumberGutterFontSize = FontSize; this.editorView.Invalidate(); this.codeOptionsModel = codeOptionsModel; this.codeOptionsModel.PropertyChanged += new PropertyChangedEventHandler(this.CodeOptionsModel_PropertyChanged); this.UpdateOptions(); }
protected CodeDocumentType(ICodeProjectService codeProjectService, IViewService viewService, CodeOptionsModel codeOptionsModel, IWindowService windowService) { this.codeProjectService = codeProjectService; this.viewService = viewService; this.codeOptionsModel = codeOptionsModel; this.windowService = windowService; }
internal CodeView(IDocument document, ICodeProject codeProject, IMessageDisplayService messageDisplayService, IViewService viewService, CodeOptionsModel codeOptionsModel, Microsoft.Expression.Framework.UserInterface.IWindowService windowService) : base(document) { Application.Current.Activated += new EventHandler(this.Application_Activated); this.codeDocument = (CodeDocument)document; this.messageDisplayService = messageDisplayService; this.viewService = viewService; this.codeOptionsModel = codeOptionsModel; this.actiproEditor = new ActiproEditor(this.codeDocument.Document, this.codeOptionsModel, this.messageDisplayService, this.viewService, codeProject, windowService); this.actiproEditor.CommandExecutionRequested += new EventHandler <CommandExecutionRequestedEventArgs>(this.ActiproEditor_CommandExecutionRequested); this.actiproEditor.EventInserted += new EventHandler <InsertEventHandlerEventArgs>(this.Editor_EventInserted); this.AddCommands(); }
internal CodeDocument(DocumentReference documentReference, bool isReadOnly, Encoding encoding, Stream stream, CodeDomProvider codeDomProvider, CodeDocumentType codeDocumentType, ICodeProjectService codeProjectService, ICodeProject codeProject, IProject project, IViewService viewService, IWindowService windowService) : base(documentReference, isReadOnly) { this.filename = documentReference.Path; this.codeDomProvider = codeDomProvider; this.codeDocumentType = codeDocumentType; this.codeOptionsModel = this.codeDocumentType.CodeOptionsModel; this.codeProjectService = codeProjectService; this.viewService = viewService; this.codeProject = codeProject; this.project = project; this.windowService = windowService; this.encoding = encoding; this.stream = stream; }
internal CodeEditor(IWpfTextView textView, IWpfTextViewHost textViewHost, IEditorOperations editorCommands, ITextBufferUndoManager undoService, IFindLogic findLogic, IClassificationTypeRegistry classificationRegistry, IClassificationFormatMap classificationFormatMap, ISquiggleProvider squiggleProvider, ICompletionBroker completionBroker, CodeOptionsModel codeOptionsModel, IMessageDisplayService messageDisplayService, ICodeAidProvider codeAidProvider, IEnvironment environment) { this.textView = textView; this.textViewHost = textViewHost; this.findLogic = findLogic; this.classificationRegistry = classificationRegistry; this.classificationFormatMap = classificationFormatMap; this.editorCommands = editorCommands; this.undoService = undoService; this.squiggleProvider = squiggleProvider; this.environment = environment; this.messageDisplayService = messageDisplayService; this.codeEditorOperations = new CodeEditorOperations(this, completionBroker, codeAidProvider); FrameworkElement element1 = this.Element; element1.PreviewLostKeyboardFocus += new KeyboardFocusChangedEventHandler(this.Editor_LostFocus); element1.LostFocus += new RoutedEventHandler(this.Editor_LostFocus); element1.GotFocus += new RoutedEventHandler(this.Editor_GotFocus); this.textView.Caret.PositionChanged += new EventHandler <CaretPositionChangedEventArgs>(this.Caret_PositionChanged); this.textView.Background = (Brush)Brushes.White; this.textView.Selection.UnfocusedBrush = (Brush)Brushes.LightGray; this.verticalScollBar = (IWpfTextViewMargin)this.textViewHost.GetTextViewMargin("Wpf Vertical Scrollbar"); UIElement element2 = ((IWpfTextViewMargin)this.textViewHost.GetTextViewMargin("Wpf Horizontal Scrollbar")).VisualElement.Parent as UIElement; if (element2 != null) { Grid.SetColumn(element2, 0); Grid.SetColumnSpan(element2, 2); } this.lineNumberMargin = (IWpfLineNumberMargin)this.textViewHost.GetTextViewMargin("Wpf Line Number Margin"); this.lineNumberMargin.BackgroundBrush = (Brush) new SolidColorBrush(Colors.White); Border border = this.textViewHost.GetTextViewMargin("Spacer Margin") as Border; if (border != null) { border.BorderBrush = (Brush) new SolidColorBrush(Color.FromRgb((byte)204, (byte)204, (byte)204)); border.Margin = new Thickness(2.0, 0.0, 0.0, 0.0); border.BorderThickness = new Thickness(1.0, 0.0, 0.0, 0.0); } this.textViewHost.BottomRightMarginCorner = (UIElement) new CodeEditorCorner(); this.codeOptionsModel = codeOptionsModel; this.codeOptionsModel.PropertyChanged += new PropertyChangedEventHandler(this.CodeOptionsModel_PropertyChanged); this.editorSpecificOptionsModel = this.codeOptionsModel.GetEditorModel(this.codeOptionsModel.GetEditorType(this.TextBuffer)); this.editorSpecificOptionsModel.PropertyChanged += new PropertyChangedEventHandler(this.CodeOptionsModel_PropertyChanged); this.UpdateOptions(); }
public ActiproEditor(ActiproSoftware.SyntaxEditor.Document document, CodeOptionsModel codeOptionsModel, IMessageDisplayService messageDisplayService, IViewService viewService, ICodeProject codeProject, Microsoft.Expression.Framework.UserInterface.IWindowService windowService) { this.editor = new SyntaxEditor(); this.InitializeEditor(document, codeProject); this.host = new WindowsFormsHost(); this.host.Background = (System.Windows.Media.Brush)System.Windows.Media.Brushes.White; this.editor.IndicatorMarginVisible = false; this.host.Child = (Control)this.editor; this.codeOptionsModel = codeOptionsModel; this.codeOptionsModel.PropertyChanged += new PropertyChangedEventHandler(this.Actipro_PropertyChanged); this.editorSpecificOptionsModel = this.codeOptionsModel.GetEditorModel(EditorType.CodeEditor); this.editorSpecificOptionsModel.PropertyChanged += new PropertyChangedEventHandler(this.Actipro_PropertyChanged); this.messageDisplayService = messageDisplayService; this.viewService = viewService; this.windowService = windowService; this.windowService.ThemeChanged += new EventHandler(this.WindowService_ThemeChanged); this.UpdateOptions(); }
public FSharpScriptDocumentType(ICodeProjectService codeProjectService, IViewService viewService, CodeOptionsModel codeOptionsModel, IWindowService windowService) : base(codeProjectService, viewService, codeOptionsModel, windowService) { }
public void Load(IServices services) { this.services = services; ICommandService service1 = this.services.GetService <ICommandService>(); this.services.GetService <IDocumentService>(); IDocumentTypeManager service2 = this.services.GetService <IDocumentTypeManager>(); IViewService service3 = this.services.GetService <IViewService>(); IProjectManager service4 = this.services.GetService <IProjectManager>(); IAssemblyService service5 = this.services.GetService <IAssemblyService>(); IMessageDisplayService service6 = this.services.GetService <IMessageDisplayService>(); IWindowService service7 = this.services.GetService <IWindowService>(); CodeOptionsModel codeOptionsModel = new CodeOptionsModel(); this.editingService = new EditingService((IServiceProvider)this.services, codeOptionsModel); this.services.AddService(typeof(ITextEditorService), (object)this.editingService); this.services.AddService(typeof(ITextBufferService), (object)this.editingService); ICodeProjectService codeProjectService = (ICodeProjectService) new CodeProjectService(service4, service5, service6, service3, service2); this.services.AddService(typeof(ICodeModelService), (object)new CodeModelService(this.services, codeProjectService)); if (service2 != null) { this.csharpDocumentType = (IDocumentType) new CSharpDocumentType(codeProjectService, service3, codeOptionsModel, service7); service2.Register(this.csharpDocumentType); this.visualBasicDocumentType = (IDocumentType) new VisualBasicDocumentType(codeProjectService, service3, codeOptionsModel, service7); service2.Register(this.visualBasicDocumentType); this.javascriptDocumentType = (IDocumentType) new JavascriptDocumentType(codeProjectService, service3, codeOptionsModel, service7); service2.Register(this.javascriptDocumentType); this.fSharpDocumentType = (IDocumentType) new FSharpDocumentType(codeProjectService, service3, codeOptionsModel, service7); service2.Register(this.fSharpDocumentType); this.fSharpScriptDocumentType = (IDocumentType) new FSharpScriptDocumentType(codeProjectService, service3, codeOptionsModel, service7); service2.Register(this.fSharpScriptDocumentType); this.fSharpTemplateDocumentType = (IDocumentType) new FSharpTemplateDocumentType(codeProjectService, service3, codeOptionsModel, service7); service2.Register(this.fSharpTemplateDocumentType); this.cPlusPlusDocumentType = (IDocumentType) new CPlusPlusDocumentType(codeProjectService, service3, codeOptionsModel, service7); service2.Register(this.cPlusPlusDocumentType); this.headerDocumentType = (IDocumentType) new HeaderDocumentType(codeProjectService, service3, codeOptionsModel, service7); service2.Register(this.headerDocumentType); this.htmlDocumentType = (IDocumentType) new HTMLDocumentType(this.editingService); service2.Register(this.htmlDocumentType); this.xmlDocumentType = (IDocumentType) new XmlDocumentType(this.editingService); service2.Register(this.xmlDocumentType); this.limitedXamlDocumentType = (IDocumentType) new LimitedXamlDocumentType(this.editingService); service2.Register(this.limitedXamlDocumentType); this.fxgDocumentType = (IDocumentType) new FxgDocumentType(this.editingService); service2.Register(this.fxgDocumentType); } IOptionsDialogService service8 = this.services.GetService <IOptionsDialogService>(); if (service8 != null) { this.codeOptionsPage = (IOptionsPage) new CodeOptionsPage(this.editingService); service8.OptionsPages.Add(this.codeOptionsPage); } if (service1 == null) { return; } this.commandTarget = new CommandTarget(); this.commandTarget.AddCommand("Project_EditVisualStudio", (ICommand) new EditVisualStudioCommand(service4, service1, service6)); service1.AddTarget((ICommandTarget)this.commandTarget); }
public EditingService(IServiceProvider serviceProvider, CodeOptionsModel codeOptionsModel) { this.serviceProvider = serviceProvider; this.codeOptionsModel = codeOptionsModel; }
public VisualBasicDocumentType(ICodeProjectService codeProjectService, IViewService viewService, CodeOptionsModel codeOptionsModel, IWindowService windowService) : base(codeProjectService, viewService, codeOptionsModel, windowService) { }