Example #1
0
        public FindReplaceDialog(IManager manager)
        {
            InitializeComponent();

            mManager = manager;

            DialogMode = Mode.Find;

            TextPlugin plugin = (TextPlugin)mManager.GetPlugin(typeof(TextPlugin));

            plugin.FindReplaceDialog = this;

            LoadFromRegistry(comboBoxFindWhat);
            LoadFromRegistry(comboBoxReplaceWith);
            LoadFromRegistry(comboBoxSearchIn);
            LoadFromRegistry(comboBoxFileTypes);

            if (comboBoxSearchIn.Items.Count == 0)
            {
                comboBoxSearchIn.Items.AddRange(new string[] { "Current Project", "All Open Documents" });
            }

            comboBoxSearchIn.Text = (string)comboBoxSearchIn.Items[0];

            if (comboBoxFileTypes.Items.Count > 0)
            {
                comboBoxFileTypes.Text = (string)comboBoxFileTypes.Items[0];
            }
            else
            {
                FileTypes = "*.*";
            }

            checkBoxIncludeSubFolders.Checked = true;
        }
Example #2
0
		public TextView(IManager manager, Document doc)
			: base(manager, doc)
		{
			InitializeComponent();

			mTextPlugin = (TextPlugin)Manager.GetPlugin(typeof(TextPlugin));

			string ext = System.IO.Path.GetExtension(doc.FileName);
			if (ext == "")
				ext = System.IO.Path.GetFileName(doc.FileName);
			else
				ext = ext.Substring(1);
			string lang = TextPlugin.ScintillaProperties.GetLanguageFromExtension(ext);
			if (lang == null)
				lang = "txt";
			string filepattern = TextPlugin.ScintillaProperties.GetExtensionListFromLanguage(lang);
			if (filepattern != null && filepattern.Contains(";"))
				filepattern = filepattern.Split(new char[] { ';' }, 2)[0];

			scintillaControl.Configuration = new Scintilla.Configuration.ScintillaConfig(TextPlugin.ScintillaProperties, filepattern);
			scintillaControl.ConfigurationLanguage = lang;

			scintillaControl.UseMonospaceFont(TextPlugin.ScintillaProperties.GetByKey("font.monospace"));
			scintillaControl.TabWidth = 4;

            scintillaControl.EndOfLineMode = Scintilla.Enums.EndOfLine.LF;

			foreach (string param in s_propertiesToForward)
			{
				if(TextPlugin.ScintillaProperties.ContainsKey(param))
				{
					scintillaControl.Property(param, TextPlugin.ScintillaProperties[param]);
				}
			}

			mSaving = false;
			TextDocument textDoc = Document as TextDocument;

			doc.PropertyChange += new PropertyChangeEventHandler(doc_PropertyChange);
			doc.Saving += new DocumentSavingEventHandler(doc_Saving);
			doc.Saved += new DocumentSavedEventHandler(doc_Saved);

			scintillaControl.SetYCaretPolicy((int) (CaretPolicy.CARET_SLOP | CaretPolicy.CARET_STRICT | CaretPolicy.CARET_EVEN), 6);

			mTextPlugin.Options.OptionsChanged += new OptionsChangedDelegate(Options_OptionsChanged);
			UpdateOptions();

			scintillaControl.Text = textDoc.Text;
			scintillaControl.EmptyUndoBuffer();
			scintillaControl.SetSavePoint();
			scintillaControl.ModEventMask = (int) (Scintilla.Enums.ModificationFlags.User | Scintilla.Enums.ModificationFlags.InsertText | Scintilla.Enums.ModificationFlags.DeleteText);
			if (textDoc.ReadOnly)
				scintillaControl.IsReadOnly = true;
		}
Example #3
0
        public TextView(IManager manager, Document doc)
            : base(manager, doc)
        {
            InitializeComponent();

            mTextPlugin = (TextPlugin)Manager.GetPlugin(typeof(TextPlugin));

            string ext = System.IO.Path.GetExtension(doc.FileName);

            if (ext == "")
            {
                ext = System.IO.Path.GetFileName(doc.FileName);
            }
            else
            {
                ext = ext.Substring(1);
            }
            string lang = TextPlugin.ScintillaProperties.GetLanguageFromExtension(ext);

            if (lang == null)
            {
                lang = "txt";
            }
            string filepattern = TextPlugin.ScintillaProperties.GetExtensionListFromLanguage(lang);

            if (filepattern != null && filepattern.Contains(";"))
            {
                filepattern = filepattern.Split(new char[] { ';' }, 2)[0];
            }

            scintillaControl.Configuration         = new Scintilla.Configuration.ScintillaConfig(TextPlugin.ScintillaProperties, filepattern);
            scintillaControl.ConfigurationLanguage = lang;

            scintillaControl.UseMonospaceFont(TextPlugin.ScintillaProperties.GetByKey("font.monospace"));
            scintillaControl.TabWidth = 4;

            scintillaControl.EndOfLineMode = Scintilla.Enums.EndOfLine.LF;

            foreach (string param in s_propertiesToForward)
            {
                if (TextPlugin.ScintillaProperties.ContainsKey(param))
                {
                    scintillaControl.Property(param, TextPlugin.ScintillaProperties[param]);
                }
            }

            mSaving = false;
            TextDocument textDoc = Document as TextDocument;

            doc.PropertyChange += new PropertyChangeEventHandler(doc_PropertyChange);
            doc.Saving         += new DocumentSavingEventHandler(doc_Saving);
            doc.Saved          += new DocumentSavedEventHandler(doc_Saved);

            scintillaControl.SetYCaretPolicy((int)(CaretPolicy.CARET_SLOP | CaretPolicy.CARET_STRICT | CaretPolicy.CARET_EVEN), 6);

            mTextPlugin.Options.OptionsChanged += new OptionsChangedDelegate(Options_OptionsChanged);
            UpdateOptions();

            scintillaControl.Text = textDoc.Text;
            scintillaControl.EmptyUndoBuffer();
            scintillaControl.SetSavePoint();
            scintillaControl.ModEventMask = (int)(Scintilla.Enums.ModificationFlags.User | Scintilla.Enums.ModificationFlags.InsertText | Scintilla.Enums.ModificationFlags.DeleteText);
            if (textDoc.ReadOnly)
            {
                scintillaControl.IsReadOnly = true;
            }
        }
Example #4
0
		public MainWindowComponents(TextPlugin plugin)
		{
			InitializeComponent();

			m_plugin = plugin;
		}
Example #5
0
        public MainWindowComponents(TextPlugin plugin)
        {
            InitializeComponent();

            m_plugin = plugin;
        }