Пример #1
0
        public LempDemoPanel(ITextEditorProperties editorSettings)
        {
            InitializeComponent();

            _inEditor      = new TextEditorControl();
            _inEditor.Dock = System.Windows.Forms.DockStyle.Fill;
            _inEditor.Document.DocumentChanged += OnDocumentChanged;

            _outEditor      = new TextEditorControl();
            _outEditor.Dock = System.Windows.Forms.DockStyle.Fill;

            innerSplitContainer.Panel1.Controls.Add(_inEditor);
            innerSplitContainer.Panel2.Controls.Add(_outEditor);

            if ((EditorSettings = editorSettings) == null)
            {
                EditorSettings = _inEditor.TextEditorProperties;
            }
            else
            {
                _inEditor.TextEditorProperties = EditorSettings;
            }
            _outEditor.TextEditorProperties = EditorSettings;

            // ICSharpCode.TextEditor doesn't have any built-in code folding
            // strategies, so I've included a simple one. Apparently, the
            // foldings are not updated automatically, so in this demo the user
            // cannot add or remove folding regions after loading the file.
            Editor.Document.FoldingManager.FoldingStrategy = new RegionFoldingStrategy();
            timer.Start();             // initially update foldings & run LeMP

            _inEditor.SetHighlighting("C#");
            _outEditor.SetHighlighting("C#");
        }
Пример #2
0
        private TextEditorControl AddNewTextEditor(string title)
        {
            var tab    = new TabPage(title);
            var editor = new TextEditorControl();

            editor.Dock       = System.Windows.Forms.DockStyle.Fill;
            editor.IsReadOnly = false;
            editor.SetHighlighting("TSQL");
            editor.Document.DocumentChanged +=
                new DocumentEventHandler((sender, e) => { SetModifiedFlag(editor, true); });
            // When a tab page gets the focus, move the focus to the editor control
            // instead when it gets the Enter (focus) event. I use BeginInvoke
            // because changing the focus directly in the Enter handler doesn't
            // work.
            tab.Enter +=
                new EventHandler((sender, e) => {
                var page = ((TabPage)sender);
                page.BeginInvoke(new Action <TabPage>(p => p.Controls[0].Focus()), page);
            });
            tab.Controls.Add(editor);
            fileTabs.Controls.Add(tab);

            if (_editorSettings == null)
            {
                _editorSettings = editor.TextEditorProperties;
                OnSettingsChanged();
            }
            else
            {
                editor.TextEditorProperties = _editorSettings;
            }
            return(editor);
        }
Пример #3
0
        private LempDemoPanel AddNewTextEditor(string title, string initialText = "")
        {
            var tab = new TabPage(title);

            // When a tab page gets the focus, move the focus to the editor control
            // instead when it gets the Enter (focus) event. I use BeginInvoke
            // because changing the focus directly in the Enter handler doesn't
            // work.
            tab.Enter +=
                new EventHandler((sender, e) => {
                var page = ((TabPage)sender);
                page.BeginInvoke(new Action <TabPage>(p => p.Controls[0].Focus()), page);
            });

            var panel = new LempDemoPanel(_editorSettings);

            _editorSettings = panel.EditorSettings;
            panel.Dock      = System.Windows.Forms.DockStyle.Fill;

            tab.Controls.Add(panel);
            fileTabs.Controls.Add(tab);

            panel.Editor.Text = initialText;
            panel.SetModifiedFlag(false);
            return(panel);
        }
Пример #4
0
        bool UpdateOpenFileWithRootDirectoryChanges(WixDocument wixDocument, TextAreaControl textAreaControl)
        {
            // Get the xml for the root directory.
            WixDirectoryElement rootDirectory = wixDocument.RootDirectory;
            string xml = GetWixXml(rootDirectory);

            // Find the root directory location.
            bool updated = ReplaceElement(rootDirectory.Id, WixDirectoryElement.DirectoryElementName, textAreaControl, xml);

            if (updated)
            {
                return(true);
            }

            // Find the product end element location.
            IDocument document = textAreaControl.Document;
            Location  location = WixDocument.GetEndElementLocation(new StringReader(document.TextContent), "Product", wixDocument.Product.GetAttribute("Id"));

            if (!location.IsEmpty)
            {
                // Insert the xml with an extra new line at the end.
                ITextEditorProperties properties     = SharpDevelopTextEditorProperties.Instance;
                WixDocumentEditor     documentEditor = new WixDocumentEditor(textAreaControl);
                documentEditor.Insert(location.Y, location.X, String.Concat(xml, properties.LineTerminator));
                return(true);
            }
            return(false);
        }
Пример #5
0
 public void Write(WixDocument document)
 {
     if (!UpdateOpenFile(document))
     {
         ITextEditorProperties properties = SharpDevelopTextEditorProperties.Instance;
         document.Save(properties.LineTerminator, properties.ConvertTabsToSpaces, properties.IndentationSize);
     }
     packageFilesControl.IsDirty = false;
 }
Пример #6
0
        protected void Run(IWorkbench workbench, ITextEditorProperties textEditorProperties)
        {
            // Get the code to convert.
            IViewContent viewContent = workbench.ActiveWorkbenchWindow.ActiveViewContent;
            IEditable    editable    = viewContent as IEditable;

            // Generate the python code.
            NRefactoryToPythonConverter converter = NRefactoryToPythonConverter.Create(viewContent.PrimaryFileName);

            converter.IndentString = NRefactoryToPythonConverter.GetIndentString(textEditorProperties);
            string pythonCode = converter.Convert(editable.Text);

            // Show the python code in a new window.
            NewFile("Generated.py", "Python", pythonCode);
        }
Пример #7
0
        public IViewContent[] CreateSecondaryViewContent(IViewContent viewContent, ITextEditorProperties textEditorProperties)
        {
            foreach (IViewContent existingView in viewContent.SecondaryViewContents)
            {
                if (existingView.GetType() == typeof(FormsDesignerViewContent))
                {
                    return(new IViewContent[0]);
                }
            }

            IDesignerLoaderProvider loader    = new PythonDesignerLoaderProvider();
            IDesignerGenerator      generator = new PythonDesignerGenerator(textEditorProperties);

            return(new IViewContent[] { new FormsDesignerViewContent(viewContent, loader, generator) });
        }
Пример #8
0
        public EditorTabPage(string title, ITextEditorProperties properties)
            : base(title)
        {
            ScriptEditorPanel pnl = new ScriptEditorPanel();

            pnl.Dock = DockStyle.Fill;

            pnl.Editor.IsReadOnly           = false;
            pnl.Editor.TextEditorProperties = properties;
            pnl.Editor.Document.FoldingManager.FoldingStrategy = new RegionFoldingStrategy();
            pnl.Editor.Document.DocumentChanged += new DocumentEventHandler(Document_DocumentChanged);
            pnl.Editor.ActiveTextAreaControl.TextArea.KeyEventHandler += TextArea_KeyDown;
            pnl.Editor.Document.HighlightingStrategy = HighlightingStrategyFactory.CreateHighlightingStrategy("eAthena");

            mScriptToolTip = new ScriptToolTipProvider(pnl.Editor);

            Controls.Add(pnl);
        }
Пример #9
0
        public ctrlDisassembler()
        {
            InitializeComponent();
            HighlightingManager.Manager.AddSyntaxModeFileProvider(new FileSyntaxModeProvider(Application.StartupPath));
            editor.Document.HighlightingStrategy = HighlightingManager.Manager.FindHighlighter("ASM");
            editor.IsReadOnly = false;
            //editor.ActiveTextAreaControl.TextArea.SelectionManager.SelectionChanged +=
            editor.ActiveTextAreaControl.Caret.PositionChanged += new EventHandler(Caret_PositionChanged);

            editor.Document.DocumentChanged += new DocumentEventHandler((senderX, eX) => { SetModifiedFlag(editor, true); });
            if (_editorSettings == null)
            {
                _editorSettings = editor.TextEditorProperties;
                OnSettingsChanged();
            }
            else
                editor.TextEditorProperties = _editorSettings;
        }
Пример #10
0
        private void InitForm()
        {
            if (_editorSettings == null)
            {
                _editorSettings = ActiveEditor.TextEditorProperties;
                OnSettingsChanged();
            }
            else
            {
                ActiveEditor.TextEditorProperties = _editorSettings;
            }

            if (!(ActiveEditor.Document.FoldingManager.FoldingStrategy is XmlFoldingStrategy))
            {
                ActiveEditor.Document.FoldingManager.FoldingStrategy = new XmlFoldingStrategy();
            }
            UpdateFolding();
        }
Пример #11
0
        /// <summary>
        /// Merges the changes made to the wix document by overwriting the dialog element.
        /// </summary>
        void IWixDialogDesignerGenerator.MergeFormChanges(string dialogId, XmlElement dialogElement)
        {
            // Get the text region we are replacing.
            IDocument document = view.DesignerCodeFileDocument;
            DomRegion region   = WixDocument.GetElementRegion(new StringReader(document.TextContent), "Dialog", dialogId);

            if (region.IsEmpty)
            {
                throw new FormsDesignerLoadException(String.Format(StringParser.Parse("${res:ICSharpCode.WixBinding.DialogDesignerGenerator.DialogIdNotFoundMessage}"), dialogId));
            }
            // Get the replacement dialog xml.
            TextEditorControl     textEditorControl = ((ITextEditorControlProvider)view.PrimaryViewContent).TextEditorControl;
            ITextEditorProperties properties        = textEditorControl.TextEditorProperties;
            string replacementXml = WixDocument.GetXml(dialogElement, properties.LineTerminator, properties.ConvertTabsToSpaces, properties.IndentationSize);

            // Replace the xml and select the inserted text.
            WixDocumentEditor editor = new WixDocumentEditor(textEditorControl.ActiveTextAreaControl);

            editor.Replace(region, replacementXml);
        }
Пример #12
0
        private EditorTabPage AddNewTextEditor(string title)
        {
            if (mEditorSettings == null)
            {
                mEditorSettings = new DefaultTextEditorProperties();
                mEditorSettings.AllowCaretBeyondEOL    = false;
                mEditorSettings.AutoInsertCurlyBracket = true;
                mEditorSettings.BracketMatchingStyle   = BracketMatchingStyle.After;
                mEditorSettings.ConvertTabsToSpaces    = false;
                mEditorSettings.CutCopyWholeLine       = true;
                mEditorSettings.DocumentSelectionMode  = DocumentSelectionMode.Normal;
                mEditorSettings.EnableFolding          = true;
                mEditorSettings.HideMouseCursor        = false;
                mEditorSettings.IndentStyle            = IndentStyle.Smart;
                mEditorSettings.IsIconBarVisible       = true;
                mEditorSettings.LineTerminator         = Environment.NewLine;
                mEditorSettings.LineViewerStyle        = LineViewerStyle.None;
                mEditorSettings.MouseWheelScrollDown   = true;
                mEditorSettings.MouseWheelTextZoom     = true;
                mEditorSettings.ShowEOLMarker          = false;
                mEditorSettings.ShowHorizontalRuler    = false;
                mEditorSettings.ShowInvalidLines       = false;
                mEditorSettings.ShowLineNumbers        = true;
                mEditorSettings.ShowMatchingBracket    = true;
                mEditorSettings.ShowSpaces             = false;
                mEditorSettings.ShowTabs                = false;
                mEditorSettings.ShowVerticalRuler       = false;
                mEditorSettings.SupportReadOnlySegments = false;
                mEditorSettings.TabIndent               = 4;
                mEditorSettings.TextRenderingHint       = System.Drawing.Text.TextRenderingHint.SystemDefault;
            }
            var tab = new EditorTabPage(title, mEditorSettings);

            fileTabs.Controls.Add(tab);
            fileTabs.SelectTab(tab);

            return(tab);
        }
Пример #13
0
		private LempDemoPanel AddNewTextEditor(string title, string initialText = "")
		{
			var tab = new TabPage(title);
			// When a tab page gets the focus, move the focus to the editor control
			// instead when it gets the Enter (focus) event. I use BeginInvoke 
			// because changing the focus directly in the Enter handler doesn't 
			// work.
			tab.Enter +=
				new EventHandler((sender, e) => { 
					var page = ((TabPage)sender);
					page.BeginInvoke(new Action<TabPage>(p => p.Controls[0].Focus()), page);
				});

			var panel = new LempDemoPanel(_editorSettings);
			_editorSettings = panel.EditorSettings;
			panel.Dock = System.Windows.Forms.DockStyle.Fill;
	
			tab.Controls.Add(panel);
			fileTabs.Controls.Add(tab);

			panel.Editor.Text = initialText;
			return panel;
		}
Пример #14
0
 /// <summary>
 /// Applies the given text editor properties
 /// </summary>
 /// <param name="props"></param>
 public void ApplySettings(ITextEditorProperties props)
 {
     this.TextEditorProperties = props;
 }
Пример #15
0
        private FrmDocument CreateNewDocument(string text)
        {
            FrmDocument dummyDoc = new FrmDocument();
            dummyDoc.Text = text;

            _editor = dummyDoc.Controls[0] as TextEditorControl;           
            if (_editorSettings == null)
            {
                _editorSettings = _editor.TextEditorProperties;
                OnSettingsChanged();
            }
            else
                _editor.TextEditorProperties = _editorSettings;

            return dummyDoc;
        }
Пример #16
0
        /// <summary>
        /// Gets the Wix xml for the specified element.
        /// </summary>
        string GetWixXml(XmlElement element)
        {
            ITextEditorProperties properties = SharpDevelopTextEditorProperties.Instance;

            return(WixDocument.GetXml(element, properties.LineTerminator, properties.ConvertTabsToSpaces, properties.IndentationSize));
        }
Пример #17
0
        private void InitForm()
        {
            //IDictionary syntaxModes = new Dictionary(){{"",""}};
            Dictionary <string, string> syntaxModes = new Dictionary <string, string>()
            {
                { "XML", "XML" },
                { "C#", "C#" },
                { "BAT", "BAT" },
                { "HTML", "HTML" },
                { "TSQL", "TSQL" },
            };

            if (syntaxModes != null)
            {
                foreach (string key in syntaxModes.Keys)
                {
                    ToolStripMenuItem miNewMode = new ToolStripMenuItem();
                    miNewMode.Name = "mi" + key;
                    //this.miNewMode.Size = new System.Drawing.Size(174, 22);
                    miNewMode.Text   = key;
                    miNewMode.Tag    = syntaxModes[key];
                    miNewMode.Click += new System.EventHandler(
                        delegate(object sender, EventArgs e)
                    {
                        ToolStripMenuItem miThis = sender as ToolStripMenuItem;
                        if (miThis != null && miThis.Tag != null)
                        {
                            ToolStripDropDownMenu owner = miThis.Owner as ToolStripDropDownMenu;
                            if (owner != null && owner.Items.Count > 0)
                            {
                                foreach (ToolStripMenuItem mi in owner.Items)
                                {
                                    mi.Checked = false;
                                }
                                miThis.Checked = true;
                            }
                            if (ActiveEditor != null)
                            {
                                ActiveEditor.Document.HighlightingStrategy = HighlightingStrategyFactory.CreateHighlightingStrategy(miThis.Tag as string);
                            }
                        }
                    });
                    if (key == "XML")
                    {
                        miNewMode.Checked = true;
                        ActiveEditor.Document.HighlightingStrategy = HighlightingStrategyFactory.CreateHighlightingStrategy("XML");
                    }
                    this.miViewMode.DropDownItems.Add(miNewMode);
                }
            }

            if (_editorSettings == null)
            {
                _editorSettings = ActiveEditor.TextEditorProperties;
                OnSettingsChanged();
            }
            else
            {
                ActiveEditor.TextEditorProperties = _editorSettings;
            }

            if (!(ActiveEditor.Document.FoldingManager.FoldingStrategy is XmlFoldingStrategy))
            {
                ActiveEditor.Document.FoldingManager.FoldingStrategy = new XmlFoldingStrategy();
            }
            UpdateFolding();
        }
Пример #18
0
 /// <summary>
 /// Applies the given text editor properties
 /// </summary>
 /// <param name="props"></param>
 public void ApplySettings(ITextEditorProperties props)
 {
     this.TextEditorProperties = props;
 }
Пример #19
0
 public PythonDesignerGenerator(ITextEditorProperties textEditorProperties)
 {
     this.textEditorProperties = textEditorProperties;
 }
Пример #20
0
        /// <summary>
        /// Merges the generated code into the specified document.
        /// </summary>
        /// <param name="component">The designer host.</param>
        /// <param name="document">The document that the generated code will be merged into.</param>
        /// <param name="parseInfo">The current compilation unit for the <paramref name="document"/>.</param>
        public static void Merge(IDesignerHost host, IDocument document, ICompilationUnit compilationUnit, ITextEditorProperties textEditorProperties, IDesignerSerializationManager serializationManager)
        {
            // Get the document's initialize components method.
            IMethod method = GetInitializeComponents(compilationUnit);

            // Generate the python source code.
            PythonCodeDomSerializer serializer = new PythonCodeDomSerializer(NRefactoryToPythonConverter.GetIndentString(textEditorProperties));
            int indent = method.Region.BeginColumn;

            if (textEditorProperties.ConvertTabsToSpaces)
            {
                indent = (indent / textEditorProperties.IndentationSize);
                if (textEditorProperties.IndentationSize > 1)
                {
                    indent += 1;
                }
            }
            string rootNamespace = GetProjectRootNamespace(compilationUnit);
            string methodBody    = serializer.GenerateInitializeComponentMethodBody(host, serializationManager, rootNamespace, indent);

            // Merge the code.
            DomRegion methodRegion = GetBodyRegionInDocument(method);
            int       startOffset  = GetStartOffset(document, methodRegion);
            int       endOffset    = GetEndOffset(document, methodRegion);

            document.Replace(startOffset, endOffset - startOffset, methodBody);
        }
Пример #21
0
 public DerivedConvertProjectToRubyProjectCommand(ITextEditorProperties textEditorProperties)
     : base(textEditorProperties)
 {
 }
Пример #22
0
        private TextEditorControl AddNewTextEditor( string title )
        {
            var tab = new TabPage( title );
            var editor = new TextEditorControl();
            editor.Dock = System.Windows.Forms.DockStyle.Fill;
            editor.IsReadOnly = false;

            editor.Document.DocumentChanged +=
                new DocumentEventHandler( ( sender, e ) => { SetModifiedFlag( editor, true ); } );
            // When a tab page gets the focus, move the focus to the editor control
            // instead when it gets the Enter (focus) event. I use BeginInvoke
            // because changing the focus directly in the Enter handler doesn't
            // work.
            tab.Enter +=
                new EventHandler( ( sender, e ) =>
                {
                    var page = ( (TabPage) sender );
                    page.BeginInvoke( new Action<TabPage>( p => p.Controls[0].Focus() ), page );
                } );
            tab.Controls.Add( editor );

            fileTabs.Controls.Add( tab );

            if( _editorSettings == null )
            {
                _editorSettings = editor.TextEditorProperties;
                OnSettingsChanged();
            }
            else
                editor.TextEditorProperties = _editorSettings;
            return editor;
        }
Пример #23
0
		private EditorTabPage AddNewTextEditor(string title) {
			if (mEditorSettings == null) {
				mEditorSettings = new DefaultTextEditorProperties();
				mEditorSettings.AllowCaretBeyondEOL = false;
				mEditorSettings.AutoInsertCurlyBracket = true;
				mEditorSettings.BracketMatchingStyle = BracketMatchingStyle.After;
				mEditorSettings.ConvertTabsToSpaces = false;
				mEditorSettings.CutCopyWholeLine = true;
				mEditorSettings.DocumentSelectionMode = DocumentSelectionMode.Normal;
				mEditorSettings.EnableFolding = true;
				mEditorSettings.HideMouseCursor = false;
				mEditorSettings.IndentStyle = IndentStyle.Smart;
				mEditorSettings.IsIconBarVisible = true;
				mEditorSettings.LineTerminator = Environment.NewLine;
				mEditorSettings.LineViewerStyle = LineViewerStyle.None;
				mEditorSettings.MouseWheelScrollDown = true;
				mEditorSettings.MouseWheelTextZoom = true;
				mEditorSettings.ShowEOLMarker = false;
				mEditorSettings.ShowHorizontalRuler = false;
				mEditorSettings.ShowInvalidLines = false;
				mEditorSettings.ShowLineNumbers = true;
				mEditorSettings.ShowMatchingBracket = true;
				mEditorSettings.ShowSpaces = false;
				mEditorSettings.ShowTabs = false;
				mEditorSettings.ShowVerticalRuler = false;
				mEditorSettings.SupportReadOnlySegments = false;
				mEditorSettings.TabIndent = 4;
				mEditorSettings.TextRenderingHint = System.Drawing.Text.TextRenderingHint.SystemDefault;
			}
			var tab = new EditorTabPage(title, mEditorSettings);

			fileTabs.Controls.Add(tab);
			fileTabs.SelectTab(tab);

			return tab;
		}
 public ConvertProjectToPythonProjectCommand(ITextEditorProperties textEditorProperties)
 {
     this.textEditorProperties = textEditorProperties;
 }
Пример #25
0
        public MainForm()
        {
            //
            // The InitializeComponent() call is required for Windows Forms designer support.
            //
            InitializeComponent();
            groupBoxSearch_Resize(null, null);
            isblLoader = new Loader();

            string sqlServer;
            string dataBase;
            string login;
            bool   isWinAuth;

            if (Configuration.Load(out sqlServer, out dataBase, out login, out isWinAuth))
            {
                textBoxSQLServer.Text = sqlServer;
                textBoxDB.Text        = dataBase;
                textBoxLogin.Text     = login;
                if (isWinAuth)
                {
                    checkBoxWinAuth.Checked = isWinAuth;
                }
                else
                {
                    textBoxPassword.Text = "";
                }
            }
            //
            // TODO: Добавить хороший список предопределённых строк.
            //
            string[] defaultSearchStrings =
            {
                "AddWhere      AddFrom  AddOrderBy  AddSelect     SQL(     CSQL   drop    xp_",
                "Выполнить     Execute  Exec        CreateObject",
                "Login         Логин    Pass        Пароль        Admin    Админ",
                "AccessRights  Grant    Control     Encrypt       Decrypt  Шифр   Secret  Секрет",
                ""
            };
            foreach (string searchString in defaultSearchStrings)
            {
                this.textEditorControlSearchText.Document.TextContent += (searchString + this.textEditorControlSearchText.Document.TextEditorProperties.LineTerminator);
            }
            string[] defaultRegExp =
            {
                "index.*=",
                ".*= *СценарийПарам *[(]",
                "Incorrect RegEx Sample: .*((("
            };
            foreach (string searchString in defaultRegExp)
            {
                this.textEditorControlRegExp.Document.TextContent += (searchString + this.textEditorControlRegExp.Document.TextEditorProperties.LineTerminator);
            }

            //
            // TODO: Добавить хорошую стправку на начальной странице
            //
            ApplicationInfo applicationInfo = new ApplicationInfo();
            //this.richTextBoxResult.Text = string.Format("{0} {1}\n{2}", applicationInfo.ProductName, applicationInfo.Version, applicationInfo.Description);
            //HighLight("", null);

            string str = "Ly8vIElTQkxTY2FuIENvZGVWaWV3Ci8vLyBUb29sIGZvciB2aWV3IHNvdXJjZSBjb2RlIG9mIEVDTSBzeXN0ZW1zIGJhc2VkIG9uIElTLUJ1aWxkZXIgNyAoRElSRUNUVU0sIE9yaWVuZ2UgQ29udGVycmEpIG" +
                         "FuZCBDUE0gc3lzdGVtcyBiYXNlZCBvbiBJUy1CdWlsZGVyIDUgKFByZXN0aW1hKS4KLy8vIFNhbXBsZSBJU0JMIHNvdXJjZSBjb2RlOgoKICBRVUVSWV9GSUVMRFNfREVMSU1JVEVSID0gIiwiCiAgRUxFTUVO" +
                         "VFNfRE9FU19OT1RfRVhJU1QgPSAwCiAgU1RSSU5HX0xFTkdUSCA9IDgwIAogIFNUUklOR19TVEFSVF9JTkRFWCA9IDEKICBCQV9FVkVOVFNfVEFCTEVfTkFNRV9URU1QTEFURSA9ICJCQUV2ZW50cyVzIgogIE" +
                         "5VTExfVkFMVUUgPSAiTlVMTCIgICAgICAKICBUQUJMRV9OQU1FX1JFUExBQ0VfRlJPTV9URVhUID0gIl0iCiAgVEFCTEVfTkFNRV9SRVBMQUNFX1RPX1RFWFQgPSAiXV0iICAKICBCQUV2ZW50c1RhYmxlTmFt" +
                         "ZSA9IEZvcm1hdChCQV9FVkVOVFNfVEFCTEVfTkFNRV9URU1QTEFURTsgU3RhbmRhcmRSb3V0ZUNvZGUpCiAgQkFFdmVudHNUYWJsZU5hbWUgPSBSZXBsYWNlKEJBRXZlbnRzVGFibGVOYW1lOyBUQUJMRV9OQU" +
                         "1FX1JFUExBQ0VfRlJPTV9URVhUOyBUQUJMRV9OQU1FX1JFUExBQ0VfVE9fVEVYVCkKICBpZiBGaWVsZExpc3QuQ291bnQgPiBFTEVNRU5UU19ET0VTX05PVF9FWElTVAogICAgLy8g0J/QvtC70YPRh9C40YLR" +
                         "jCDRiNCw0LHQu9C+0L3RiyDQt9Cw0L/RgNC+0YHQvtCyINC00LvRjyDQstGB0YLQsNCy0LrQuCDQuCDQvtCx0L3QvtCy0LvQtdC90LjRjyDQt9Cw0L/QuNGB0LXQuSDQsiDRgtCw0LHQu9C40YbQtS4g0J7Qsd" +
                         "C90L7QstC70Y/RjtGC0YHRjyDQv9C+0LvRjywg0L/QtdGA0LXQtNCw0L3QvdGL0LUg0LIg0L/QsNGA0LDQvNC10YLRgNC1IEZpZWxkTGlzdAogICAgLy8g0KTQvtGA0LzQsNGCINGB0L/QuNGB0LrQsCBGaWVs" +
                         "ZExpc3Q6CiAgICAvLyBOYW1lIC0g0JjQvNGPINC/0L7Qu9GPCiAgICAvLyBWYWx1ZSAtINCX0L3QsNGH0LXQvdC40LUg0L/QvtC70Y8KICAgIEluZGV4ID0gMAogICAgVXBkYXRlU2V0Rm9yVXBkYXRlUXVlcn" +
                         "kgPSAiIgogICAgRmllbGROYW1lc0Zvckluc2VydFF1ZXJ5ID0gIiIKICAgIEZpZWxkVmFsdWVzRm9ySW5zZXJ0UXVlcnkgPSAiIgogICAgZm9yZWFjaCBGaWVsZFZhbHVlI" +
                         "GluIEZpZWxkTGlzdAogICAgICBGaWVsZE5hbWUgPSBGaWVsZExpc3QuTmFtZXMoSW5kZXgpCiAgICAgIGlmIEFzc2lnbmVkKEZpZWxkVmFsdWUpCiAgICAgICAgRmllbGRWYWx1ZSA9IEZvcm1hdCgiJyVzJyI" +
                         "7IENvcHkoRmllbGRWYWx1ZTsgU1RSSU5HX1NUQVJUX0lOREVYOyBTVFJJTkdfTEVOR1RIKSkKICAgICAgZWxzZQogICAgICAgIEZpZWxkVmFsdWUgPSBOVUxMX1ZBTFVFICAKICAgICAgZW5kaWYKICAgICAgV" +
                         "XBkYXRlU2V0Rm9yVXBkYXRlUXVlcnkgPSBBZGRTdWJTdHJpbmcoRm9ybWF0KCIlcyA9ICVzIjsgQXJyYXlPZihGaWVsZE5hbWU7IEZpZWxkVmFsdWUpKTsgVXBkYXRlU2V0Rm9yVXBkYXRlUXVlcnk7IFFVRVJ" +
                         "ZX0ZJRUxEU19ERUxJTUlURVIpCiAgICAgIEZpZWxkTmFtZXNGb3JJbnNlcnRRdWVyeSA9IEFkZFN1YlN0cmluZyhGaWVsZE5hbWU7IEZpZWxkTmFtZXNGb3JJbnNlcnRRdWVyeTsgUVVFUllfRklFTERTX0RFT" +
                         "ElNSVRFUikKICAgICAgRmllbGRWYWx1ZXNGb3JJbnNlcnRRdWVyeSA9IEFkZFN1YlN0cmluZyhGaWVsZFZhbHVlOyBGaWVsZFZhbHVlc0Zvckluc2VydFF1ZXJ5OyBRVUVSWV9GSUVMRFNfREVMSU1JVEVSKSA" +
                         "KICAgICAgSW5kZXggPSBJbmRleCArIDEKICAgIGVuZGZvcmVhY2gKICAgIFNlbGVjdFF1ZXJ5VGVtcGxhdGUgPSAiCiAgICAgIHNlbGVjdCAKICAgICAgICAxCiAgICAgIGZyb20KICAgICAgICBbJTA6c10KI" +
                         "CAgICAgd2hlcmUKICAgICAgICBUYXNrSUQgPSAlMTpzCiAgICAgICAgYW5kIEJsb2NrSUQgPSAlMjpzCiAgICAgICAgYW5kIEl0ZXJhdGlvbiA9ICUzOnMiCiAgICBRdWVyeVJlc3VsdCA9IFNRTChGb3JtYXQ" +
                         "oU2VsZWN0UXVlcnlUZW1wbGF0ZTsgQXJyYXlPZihCQUV2ZW50c1RhYmxlTmFtZTsgVGFza0lEOyBCbG9ja0lEOyBJdGVyYXRpb24pKSkKICAgIGlmIEFzc2lnbmVkKFF1ZXJ5UmVzdWx0KQogICAgICAvLyDQl" +
                         "dGB0LvQuCDQt9Cw0L/QuNGB0Ywg0LXRgdGC0YwsINGC0L4g0L7QsdC90L7QstC40YLRjAogICAgICBVcGRhdGVRdWVyeVRlbXBsYXRlID0gIgogICAgICAgIHVwZGF0ZSBbJTA6c10gc2V0CiAgICAgICAgICA" +
                         "lNDpzCiAgICAgICAgd2hlcmUKICAgICAgICAgIFRhc2tJRCA9ICUxOnMKICAgICAgICAgIGFuZCBCbG9ja0lEID0gJTI6cwogICAgICAgICAgYW5kIEl0ZXJhdGlvbiA9ICUzOnMiCiAgICAgIFNRTChGb3JtY" +
                         "XQoVXBkYXRlUXVlcnlUZW1wbGF0ZTsgQXJyYXlPZihCQUV2ZW50c1RhYmxlTmFtZTsgVGFza0lEOyBCbG9ja0lEOyBJdGVyYXRpb247IFVwZGF0ZVNldEZvclVwZGF0ZVF1ZXJ5KSkpCiAgICBlbmRpZiAgIAo" +
                         "gIGVuZGlmCgoKICAhVEFTS19TVEFURV9ET05FID0gItCS0YvQv9C+0LvQvdC10L3QsCIKICAhUFJPSkVDVF9UQVNLX0NPTVBMRVRFX1BFUkNFTlQgPSAxMDAKCiAvLyAhUHJvamVjdD3QodGG0LXQvdCw0YDQu" +
                         "NC50J/QsNGA0LDQvCgiUHJvamVjdCIpCiAgIU1TVGFza3MgPSDQodGG0LXQvdCw0YDQuNC50J/QsNGA0LDQvCgiVGFza3Mi" +
                         "KSAKICAhSUREb2MgPSDQodGG0LXQvdCw0YDQuNC50J/QsNGA0LDQvCgiSUQiKQogLy8g0LXRgdC70Lgg0L3QtdGCINC60LDQutC+0LPQvi3Qu9C40LHQviDQv9Cw0YDQsNC80LXRgtGA0LAsINGC0L4g0LfQvd" +
                         "Cw0YfQuNGCINGB0YbQtdC90LDRgNC40Lkg0LLRi9C30YvQstCw0LXRgtGB0Y8g0L3QtSDQuNC3IE1TIE9mZmljZSAgIAogIGlmICghTVNUYXNrcyA9PSAiIikgb3IgKCFJRERvYyA9PSAiIikKICAgICFNZXNz" +
                         "YWdlID0gTG9hZFN0cmluZygiRElSU1RSXzQwIjsgIkVETSIpCiAgICBSYWlzZShDcmVhdGVFeGNlcHRpb24oIiI7ICFNZXNzYWdlOyBlY1dhcm5pbmcpKSAvLyBb0JrQsNGC0LXQs9C+0YDQuNGPXSA9IGVjRX" +
                         "hjZXB0aW9uIE9SIGVjV2FybmluZyBPUiBlY0luZm9ybWF0aW9uIAogIGVuZGlmCiAgCiAvLyDQv9C+0LvRg9GH0LjRgtGMINC/0YDQuNC70L7QttC10L3QuNC1CiAgIUFwcCA9ICFTZW5kZXIuQXBwbGljYXRp" +
                         "b24KIC8vINC40L3RhNC+0YDQvNCw0YbQuNGPINC+INC00L7QutGD0LzQtdC90YLQtSAo0L7QsdGK0LXQutGC0LUpIAogICFFRG9jSW5mbyA9ICFBcHAuRURvY3VtZW50RmFjdG9yeS5PYmplY3RJbmZvKCFJRE" +
                         "RvYykKCiAgIVByb2dyZXNzID0gQ3JlYXRlUHJvZ3Jlc3MoIDsgIU1TVGFza3MuQ291bnQ7KQogICFQcm9ncmVzcy5TaG93CiAgIUZpbGxlZCA9IDAKIC8vINC/0YDQvtC50LTRkdC8INC/0L4g0LLRgdC10Lwg" +
                         "0LfQsNC00LDRh9Cw0LwgCiAgIWkgPSAxCiAgd2hpbGUgIWkgPD0gIU1TVGFza3MuQ291bnQKICAgLy8g0LXRgdC70Lgg0LfQsNC00LDRh9CwINGB0L7Qt9C00LDQvdCwCiAgICAhTVNUYXNrID0gIU1TVGFza3" +
                         "MuSXRlbSghaSkKICAgIGlmIG5vdCBWYXJJc051bGwoIU1TVGFzaykgIAogICAgICBpZiAhTVNUYXNrLkZsYWcyMAogICAgICAgICFIeXBlckxpbmsgPSAhTVNUYXNrLlRleHQyMAogICAgICAgICFJRCA9IFN1" +
                         "YlN0cmluZyghSHlwZXJMaW5rOyAiPSI7IDMpCiAgICAgICAgRXhjZXB0aW9uc09mZigpCiAgICAgICAgRnJlZUV4Y2VwdGlvbigpCiAgICAgICAgIVRhc2sgPSAhQXBwLlRhc2tGYWN0b3J5LkNvbXBvbmVudC" +
                         "ghSUQpCiAgICAgICAgaWYgbm90IEV4Y2VwdGlvbkV4aXN0cygpCiAgICAgICAgIC8vINC30LDQv9C+0LvQvdC40Lwg0YTQsNC60YIg0L/QviDQt9Cw0LTQsNGH0LUg0LX" +
                         "RgdC70Lgg0LfQsNC00LDRh9CwINCy0YvQv9C+0LvQvdC10L3QsAogICAgICAgICAvLyDQvdC+INGN0YLQsNC/INC10YnQtSDQvdC1INC30LDQstC10YDRiNC10L0KICAgICAgICAgIGlmICghVGFzay5EYXRhU" +
                         "2V0LlJlcXVpc2l0ZXMoIlRhc2tTdGF0ZSIpLkFzU3RyaW5nID09ICFUQVNLX1NUQVRFX0RPTkUpIGFuZAogICAgICAgICAgICAgKCFNU1Rhc2suUGVyY2VudENvbXBsZXRlIDwgIVBST0pFQ1RfVEFTS19DT01" +
                         "QTEVURV9QRVJDRU5UKSAKICAgICAgICAgICAgIU1TVGFzay5BY3R1YWxGaW5pc2ggPSAhVGFzay5EYXRhU2V0LlJlcXVpc2l0ZXMoIkVuZERhdGUiKS5Bc1N0cmluZwogICAgICAgICAgICAhTVNUYXNrLlBlc" +
                         "mNlbnRDb21wbGV0ZSA9ICFQUk9KRUNUX1RBU0tfQ09NUExFVEVfUEVSQ0VOVAogICAgICAgICAgICAhRmlsbGVkID0gIUZpbGxlZCArIDEgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgZW5kaWYKICA" +
                         "gICAgICBlbmRpZgogICAgICAgIEV4Y2VwdGlvbnNPbigpICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgZW5kaWYKICAgIGVuZGlmICAgCiAgICAhaSA9ICFpI" +
                         "CsgMQogICAgIVByb2dyZXNzLk5leHQKICBlbmR3aGlsZSAgICAgICAKCiAgaWYgIUZpbGxlZCA+IDEKICAgLy8gItCX0LDQv9C+0LvQvdC10L0g0YTQsNC60YIg0L/QviAlcyDRjdGC0LDQv9Cw0LwuIiAgICA" +
                         "gICAgCiAgICAhUmVzdWx0ID0gTG9hZFN0cmluZ0ZtdCgiRElSOEZFOEQxRDRfNTlGN180Mzc2Xzg5QkZfNkJGQkVBMDJGNTJGIjsgIkNPTU1PTiI7IEFycmF5T2YoIUZpbGxlZCkpICAgIAogIGVuZGlmICAKI" +
                         "CBpZiAoQ29weSghRmlsbGVkOyBMZW5ndGgoIUZpbGxlZCk7IDEpID09ICIxIikgYW5kIChDb3B5KCFGaWxsZWQ7IExlbmd0aCghRmlsbGVkKS0xOyAxKSA8PD4+ICIxIikKICAgLy8gItCX0LDQv9C+0LvQvdC" +
                         "10L0g0YTQsNC60YIg0L/QviAlcyDRjdGC0LDQv9GDLiIKICAgICFSZXN1bHQgPSBMb2FkU3RyaW5nRm10KCJESVIyQThBNjE4NF9CQkZBXzQyMEVfQUFBRl84OEU0MUM5MTQ4NDQiOyAiQ09NTU9OIjsgQXJyY" +
                         "XlPZighRmlsbGVkKSkgICAgICAKICBlbmRpZgogIGlmICFGaWxsZWQgPSAxCiAgIC8vICLQl9Cw0L/QvtC70L3QtdC9INGE0LDQutGCINC/0L4g0L7QtNC90L7QvNGDIN" +
                         "GN0YLQsNC/0YMuIgogICAgIVJlc3VsdCA9IExvYWRTdHJpbmcoIkRJUjQxQkIxRUU5Xzk3NTNfNDExQl85NDVFXzNDMEIwQTFDMjE4NyI7ICJDT01NT04iKQogIGVuZGlmCiAgaWYgIUZpbGxlZCA9IDAKICAg" +
                         "Ly8gItCd0Lgg0L/QviDQvtC00L3QvtC80YMg0Y3RgtCw0L/RgyDRhNCw0LrRgiDQvdC1INCx0YvQuyDQt9Cw0L/QvtC70L3QtdC9LiIKICAgICFSZXN1bHQgPSBMb2FkU3RyaW5nKCJESVJGOUREQjlERF80QU" +
                         "M5XzRGNzRfQTgzQl8yODM0Q0M1NzU4NzkiOyAiQ09NTU9OIikgICAgCiAgZW5kaWYg";

            ActiveSearchStringControl = this.textEditorControlSearchText;

            byte[] data = System.Convert.FromBase64String(str);
            System.Text.Encoding win1251 = System.Text.Encoding.UTF8;
            string scriptText            = win1251.GetString(data);

            textEditorControlISBL.Document.TextContent          = scriptText;
            textEditorControlISBL.Document.HighlightingStrategy =
                HighlightingStrategyFactory.CreateHighlightingStrategy("ISBL");
            textEditorControlISBL.Document.FoldingManager.FoldingStrategy =
                new IndentFoldingStrategy();

            ITextEditorProperties prop = textEditorControlISBL.Document.TextEditorProperties;

            prop.AllowCaretBeyondEOL = prop.AllowCaretBeyondEOL;
            prop.IsIconBarVisible    = true;
            textEditorControlISBL.Document.TextEditorProperties = prop;
            textEditorControlISBL.Document.ReadOnly             = true;
            MarkSearchStrings();
        }
Пример #26
0
        /// <summary>
        /// Creates an XmlView that is independent of SharpDevelop. This
        /// constructor does rely on SharpDevelop being available and is
        /// only used for testing the XmlView.
        /// </summary>
        public XmlView(ITextEditorProperties textEditorProperties, XmlSchemaCompletionDataCollection schemas)
        {
            this.TabPageText = "XML";

            TextEditorDisplayBinding.InitializeSyntaxModes();

            xmlEditor = new XmlEditorControl();
            xmlEditor.Dock = DockStyle.Fill;

            xmlEditor.TextEditorProperties = textEditorProperties;
            xmlEditor.SchemaCompletionDataItems = schemas;
            xmlEditor.Document.DocumentChanged += DocumentChanged;
        }
 public DerivedRubyDesignerGenerator(ITextEditorProperties textEditorProperties)
     : base(textEditorProperties)
 {
 }