Exemplo n.º 1
0
        public override void StoreSettings()
        {
            SpanNode node = (SpanNode)parent;

            node.Name              = nameBox.Text;
            node.Begin             = beginBox.Text;
            node.End               = endBox.Text;
            node.StopEOL           = stopEolBox.Checked;
            node.IsBeginSingleWord = beginSingleWordCheckBox.Checked;
            node.IsEndSingleWord   = endSingleWordCheckBox.Checked;
            node.EscapeCharacter   = escCharTextBox.TextLength > 0 ? escCharTextBox.Text[0] : '\0';
            node.Rule              = ruleBox.Text;

            node.Color = color;

            if (useBegin.Checked)
            {
                node.BeginColor = beginColor;
            }
            else
            {
                node.BeginColor = new EditorHighlightColor(true);
            }

            if (useEnd.Checked)
            {
                node.EndColor = endColor;
            }
            else
            {
                node.EndColor = new EditorHighlightColor(true);
            }
        }
Exemplo n.º 2
0
        public SpanOptionPanel(SpanNode parent) : base(parent)
        {
            SetupFromXmlStream(this.GetType().Assembly.GetManifestResourceStream("Resources.Span.xfrm"));
            nameBox               = (TextBox)ControlDictionary["nameBox"];
            beginBox              = (TextBox)ControlDictionary["beginBox"];
            beginBox.TextChanged += BeginTextChanged;
            endBox              = (TextBox)ControlDictionary["endBox"];
            endBox.TextChanged += EndTextChanged;
            ruleBox             = (ComboBox)ControlDictionary["ruleBox"];

            useBegin = (CheckBox)ControlDictionary["useBegin"];
            useEnd   = (CheckBox)ControlDictionary["useEnd"];

            chgBegin = (Button)ControlDictionary["chgBegin"];
            chgEnd   = (Button)ControlDictionary["chgEnd"];
            chgCont  = (Button)ControlDictionary["chgCont"];

            samBegin = (Label)ControlDictionary["samBegin"];
            samEnd   = (Label)ControlDictionary["samEnd"];
            samCont  = (Label)ControlDictionary["samCont"];

            stopEolBox = (CheckBox)ControlDictionary["stopEolBox"];
            beginSingleWordCheckBox = (CheckBox)ControlDictionary["beginSingleWordCheckBox"];
            endSingleWordCheckBox   = (CheckBox)ControlDictionary["endSingleWordCheckBox"];
            escCharTextBox          = (TextBox)ControlDictionary["escCharTextBox"];

            this.chgBegin.Click += new EventHandler(chgBeginClick);
            this.chgCont.Click  += new EventHandler(chgContClick);
            this.chgEnd.Click   += new EventHandler(chgEndClick);

            this.useBegin.CheckedChanged += new EventHandler(CheckedChanged);
            this.useEnd.CheckedChanged   += new EventHandler(CheckedChanged);
        }
Exemplo n.º 3
0
		void addClick(object sender, EventArgs e)
		{
			string result = MessageService.ShowInputBox("", "${res:Dialog.HighlightingEditor.Spans.EnterName}", "");
			if (string.IsNullOrEmpty(result))
				return;
			SpanNode rsn = new SpanNode(result);
			ListViewItem lv = new ListViewItem(rsn.Text);
			lv.Tag = rsn;
			parent.Nodes.Add(rsn);
			listView.Items.Add(lv);
		}
Exemplo n.º 4
0
        public override void LoadSettings()
        {
            SpanNode node = (SpanNode)parent;

            try {
                ruleBox.Items.Clear();
                foreach (RuleSetNode rn in node.Parent.Parent.Parent.Nodes)                  // list rule sets
                {
                    if (!rn.IsRoot)
                    {
                        ruleBox.Items.Add(rn.Text);
                    }
                }
            } catch {}

            samBegin.Font = samEnd.Font = samCont.Font = ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor.SharpDevelopTextEditorProperties.Instance.FontContainer.DefaultFont;

            nameBox.Text       = node.Name;
            ruleBox.Text       = node.Rule;
            beginBox.Text      = node.Begin;
            endBox.Text        = node.End;
            stopEolBox.Checked = node.StopEOL;
            beginSingleWordCheckBox.Checked = node.IsBeginSingleWord;
            endSingleWordCheckBox.Checked   = node.IsEndSingleWord;
            escCharTextBox.Text             = (node.EscapeCharacter == '\0') ? "" : node.EscapeCharacter.ToString();

            color      = node.Color;
            beginColor = node.BeginColor;
            endColor   = node.EndColor;

            if (beginColor != null)
            {
                if (!beginColor.NoColor)
                {
                    useBegin.Checked = true;
                }
            }
            if (endColor != null)
            {
                if (!endColor.NoColor)
                {
                    useEnd.Checked = true;
                }
            }

            PreviewUpdate(samBegin, beginColor);
            PreviewUpdate(samEnd, endColor);
            PreviewUpdate(samCont, color);
            CheckedChanged(null, null);
            BeginTextChanged(null, null);
            EndTextChanged(null, null);
        }
Exemplo n.º 5
0
        void addClick(object sender, EventArgs e)
        {
            string result = MessageService.ShowInputBox("", "${res:Dialog.HighlightingEditor.Spans.EnterName}", "");

            if (string.IsNullOrEmpty(result))
            {
                return;
            }
            SpanNode     rsn = new SpanNode(result);
            ListViewItem lv  = new ListViewItem(rsn.Text);

            lv.Tag = rsn;
            parent.Nodes.Add(rsn);
            listView.Items.Add(lv);
        }
Exemplo n.º 6
0
		public SpanOptionPanel(SpanNode parent) : base(parent)
		{
			SetupFromXmlStream(this.GetType().Assembly.GetManifestResourceStream("Resources.Span.xfrm"));
			nameBox  = (TextBox)ControlDictionary["nameBox"];
			beginBox = (TextBox)ControlDictionary["beginBox"];
			beginBox.TextChanged += BeginTextChanged;
			endBox   = (TextBox)ControlDictionary["endBox"];
			endBox.TextChanged += EndTextChanged;
			ruleBox  = (ComboBox)ControlDictionary["ruleBox"];

			useBegin = (CheckBox)ControlDictionary["useBegin"];
			useEnd   = (CheckBox)ControlDictionary["useEnd"];

			chgBegin = (Button)ControlDictionary["chgBegin"];
			chgEnd   = (Button)ControlDictionary["chgEnd"];
			chgCont  = (Button)ControlDictionary["chgCont"];
			
			samBegin = (Label)ControlDictionary["samBegin"];
			samEnd   = (Label)ControlDictionary["samEnd"];
			samCont  = (Label)ControlDictionary["samCont"];

			stopEolBox = (CheckBox)ControlDictionary["stopEolBox"];
			beginSingleWordCheckBox = (CheckBox)ControlDictionary["beginSingleWordCheckBox"];
			endSingleWordCheckBox = (CheckBox)ControlDictionary["endSingleWordCheckBox"];
			escCharTextBox   = (TextBox)ControlDictionary["escCharTextBox"];

			this.chgBegin.Click += new EventHandler(chgBeginClick);
			this.chgCont.Click  += new EventHandler(chgContClick);
			this.chgEnd.Click   += new EventHandler(chgEndClick);
			
			this.useBegin.CheckedChanged += new EventHandler(CheckedChanged);
			this.useEnd.CheckedChanged += new EventHandler(CheckedChanged);
		}