Ejemplo n.º 1
0
        public virtual IViewContent CreateContentForLanguage(string language, string content)
        {
            TextEditorDisplayBindingWrapper b2 = new TextEditorDisplayBindingWrapper();

            b2.textAreaControl.Document.TextContent          = content;
            b2.textAreaControl.Document.HighlightingStrategy = HighlightingStrategyFactory.CreateHighlightingStrategy(language);
            b2.textAreaControl.InitializeAdvancedHighlighter();
            b2.textAreaControl.InitializeFormatter();
            b2.textAreaControl.ActivateQuickClassBrowserOnDemand();
            return(b2);
        }
		public virtual IViewContent CreateContentForLanguage(string language, string content)
		{
			TextEditorDisplayBindingWrapper b2 = new TextEditorDisplayBindingWrapper();
			
			b2.textAreaControl.Document.TextContent = content;
			b2.textAreaControl.Document.HighlightingStrategy = HighlightingStrategyFactory.CreateHighlightingStrategy(language);
			b2.textAreaControl.InitializeAdvancedHighlighter();
			b2.textAreaControl.InitializeFormatter();
			b2.textAreaControl.ActivateQuickClassBrowserOnDemand();
			return b2;
		}
Ejemplo n.º 3
0
        public virtual IViewContent CreateContentForFile(string fileName)
        {
            TextEditorDisplayBindingWrapper b2 = new TextEditorDisplayBindingWrapper();

            b2.textAreaControl.Dock = DockStyle.Fill;
            b2.Load(fileName);
            b2.textAreaControl.Document.HighlightingStrategy = HighlightingStrategyFactory.CreateHighlightingStrategyForFile(fileName);
            b2.textAreaControl.InitializeAdvancedHighlighter();
            b2.textAreaControl.InitializeFormatter();
            b2.ForceFoldingUpdate();
            b2.textAreaControl.ActivateQuickClassBrowserOnDemand();

            return(b2);
        }
		public virtual IViewContent CreateContentForFile(string fileName)
		{
			TextEditorDisplayBindingWrapper b2 = new TextEditorDisplayBindingWrapper();
			
			b2.textAreaControl.Dock = DockStyle.Fill;
			b2.Load(fileName);
			b2.textAreaControl.Document.HighlightingStrategy = HighlightingStrategyFactory.CreateHighlightingStrategyForFile(fileName);
			b2.textAreaControl.InitializeAdvancedHighlighter();
			b2.textAreaControl.InitializeFormatter();
			b2.ForceFoldingUpdate();
			b2.textAreaControl.ActivateQuickClassBrowserOnDemand();
			
			return b2;
		}
        public virtual IViewContent CreateContentForFile(OpenedFile file)
        {
            TextEditorDisplayBindingWrapper b2 = CreateWrapper(file);

            file.ForceInitializeView(b2);             // load file to initialize folding etc.

            b2.textEditorControl.Dock = DockStyle.Fill;
            try {
                b2.textEditorControl.Document.HighlightingStrategy = HighlightingStrategyFactory.CreateHighlightingStrategyForFile(file.FileName);
                b2.textEditorControl.InitializeAdvancedHighlighter();
            } catch (HighlightingDefinitionInvalidException ex) {
                b2.textEditorControl.Document.HighlightingStrategy = HighlightingStrategyFactory.CreateHighlightingStrategy();
                MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            b2.textEditorControl.InitializeFormatter();
            b2.textEditorControl.ActivateQuickClassBrowserOnDemand();

            return(b2);
        }