public KeywordListNode(XmlElement el)
        {
            Text        = ResNodeName("KeywordList");
            OptionPanel = new KeywordListOptionPanel(this);

            if (el == null)
            {
                return;
            }

            color = new EditorHighlightColor(el);

            XmlNodeList keys = el.GetElementsByTagName("Key");

            foreach (XmlElement node in keys)
            {
                if (node.Attributes["word"] != null)
                {
                    words.Add(node.Attributes["word"].InnerText);
                }
            }

            if (el.Attributes["name"] != null)
            {
                name = el.Attributes["name"].InnerText;
            }
            UpdateNodeText();
        }
Example #2
0
		public SpanNode(XmlElement el)
		{
			Text = ResNodeName("Span");
			
			OptionPanel = new SpanOptionPanel(this);

			if (el == null) return;
			
			color   = new EditorHighlightColor(el);
			
			if (el.Attributes["rule"] != null) 
			{
				rule = el.Attributes["rule"].InnerText;
			}
			
			if (el.Attributes["noescapesequences"] != null) 
			{
				noEscapeSequences = Boolean.Parse(el.Attributes["noescapesequences"].InnerText);
			}
			
			name    = el.Attributes["name"].InnerText;
			stopEOL = Boolean.Parse(el.Attributes["stopateol"].InnerText);
			begin   = el["Begin"].InnerText;
			beginColor = new EditorHighlightColor(el["Begin"]);
			
			if (el["End"] != null) 
			{
				end  = el["End"].InnerText;
				endColor = new EditorHighlightColor(el["End"]);
			}
			
			UpdateNodeText();
			
		}
        public KeywordListNode(string Name)
        {
            name  = Name;
            color = new EditorHighlightColor();
            UpdateNodeText();

            OptionPanel = new KeywordListOptionPanel(this);
        }
Example #4
0
        public SpanNode(string Name)
        {
            name  = Name;
            color = new EditorHighlightColor();
            UpdateNodeText();

            OptionPanel = new SpanOptionPanel(this);
        }
Example #5
0
		public MarkerNode(string What, bool prev)
		{
			what = What;
			previous = prev;
			color = new EditorHighlightColor();
			UpdateNodeText();
			
			OptionPanel = new MarkerOptionPanel(this, prev);
		}
		void chgBtnClick(object sender, EventArgs e)
		{
			using (EditHighlightingColorDialog dlg = new EditHighlightingColorDialog(color)) {
				if (dlg.ShowDialog(this) == DialogResult.OK) {
					color = dlg.Color;
					PreviewUpdate(sampleLabel, color);
				}
			}
		}
        public MarkerNode(string What, bool prev)
        {
            what     = What;
            previous = prev;
            color    = new EditorHighlightColor();
            UpdateNodeText();

            OptionPanel = new MarkerOptionPanel(this, prev);
        }
		public override void LoadSettings()
		{
			DigitsNode node = (DigitsNode)parentNode;
			
			IProperties properties = ((IProperties)PropertyService.GetProperty("NetFocus.DataStructure.TextEditor.Document.DefaultDocumentProperties", new DefaultProperties()));
			sampleLabel.Font = ParseFont(properties.GetProperty("DefaultFont", new Font("Courier New", 10).ToString()));
			color = node.HighlightColor;
			PreviewUpdate(sampleLabel, color);
		}
		public override void LoadSettings()
		{
			MarkerNode node = (MarkerNode)parentNode;
			
			PropertyService propertyService = (PropertyService)ServiceManager.Services.GetService(typeof(PropertyService));
			IProperties properties = ((IProperties)propertyService.GetProperty("NetFocus.DataStructure.TextEditor.Document.DefaultDocumentProperties", new DefaultProperties()));
			sampleLabel.Font = ParseFont(properties.GetProperty("DefaultFont", new Font("Courier New", 10).ToString()));

			color = node.HighlightColor;
			nameBox.Text = node.What;
			checkBox.Checked = node.MarkMarker;
			PreviewUpdate(sampleLabel, color);
		}
			public EnvironmentItem(int index, string name, EditorHighlightColor color, Font listFont) : base(new string[] {name, "Sample"})
			{
				Name = name;
				Color = color;
				arrayIndex = index;
				
				this.UseItemStyleForSubItems = false;
				
				IProperties properties = ((IProperties)PropertyService.GetProperty("NetFocus.DataStructure.TextEditor.Document.DefaultDocumentProperties", new DefaultProperties()));
				basefont = ParseFont(properties.GetProperty("DefaultFont", new Font("Courier New", 10).ToString()));
				listfont = listFont;
				
				ColorUpdate();
			}
Example #11
0
        public DigitsNode(XmlElement el)
        {
            if (el != null)
            {
                highlightColor = new EditorHighlightColor(el);
            }
            else
            {
                highlightColor = new EditorHighlightColor();
            }

            Text = ResNodeName("DigitsColor");

            OptionPanel = new DigitsOptionPanel(this);
        }
Example #12
0
		public DigitsNode(XmlElement el)
		{
			if (el != null) 
			{
				highlightColor = new EditorHighlightColor(el);
			} 
			else 
			{
				highlightColor = new EditorHighlightColor();
			}
			
			Text = ResNodeName("DigitsColor");
			
			OptionPanel = new DigitsOptionPanel(this);
		}
		public override void LoadSettings()
		{
			KeywordListNode node = (KeywordListNode)parentNode;
			listBox.Items.Clear();
			
			foreach (string word in node.Words) {
				listBox.Items.Add(word);
			}
			
			IProperties properties = ((IProperties)PropertyService.GetProperty("NetFocus.DataStructure.TextEditor.Document.DefaultDocumentProperties", new DefaultProperties()));
			sampleLabel.Font = ParseFont(properties.GetProperty("DefaultFont", new Font("Courier New", 10).ToString()));

			color = node.HighlightColor;
			nameBox.Text = node.Name;
			PreviewUpdate(sampleLabel, color);
		}
Example #14
0
		public MarkerNode(XmlElement el, bool prev)
		{
			Text = "Marker";
			previous = prev;
			OptionPanel = new MarkerOptionPanel(this, prev);
			
			if (el == null) return;
			
			color = new EditorHighlightColor(el);
			what  = el.InnerText;
			if (el.Attributes["markmarker"] != null) 
			{
				markMarker = Boolean.Parse(el.Attributes["markmarker"].InnerText);
			}
			
			UpdateNodeText();
			
		}
Example #15
0
        public MarkerNode(XmlElement el, bool prev)
        {
            Text        = "Marker";
            previous    = prev;
            OptionPanel = new MarkerOptionPanel(this, prev);

            if (el == null)
            {
                return;
            }

            color = new EditorHighlightColor(el);
            what  = el.InnerText;
            if (el.Attributes["markmarker"] != null)
            {
                markMarker = Boolean.Parse(el.Attributes["markmarker"].InnerText);
            }

            UpdateNodeText();
        }
		public KeywordListNode(XmlElement el)
		{
			Text = ResNodeName("KeywordList");
			OptionPanel = new KeywordListOptionPanel(this);
				
			if (el == null) return;

			color = new EditorHighlightColor(el);
			
			XmlNodeList keys = el.GetElementsByTagName("Key");
			foreach (XmlElement node in keys) 
			{
				if (node.Attributes["word"] != null) words.Add(node.Attributes["word"].InnerText);
			}
			
			if (el.Attributes["name"] != null) 
			{
				name = el.Attributes["name"].InnerText;
			}
			UpdateNodeText();
			
		}
		//更新预览标签.
		protected static void PreviewUpdate(Label label, EditorHighlightColor color)
		{
			if (label == null) return;
			
			if (color == null) {
				label.ForeColor = label.BackColor = Color.Transparent;
				return;
			}
			if (color.NoColor) {
				label.ForeColor = label.BackColor = Color.Transparent;
				return;
			}
			
			label.ForeColor = color.GetForeColor();
			label.BackColor = color.GetBackColor();
			
			FontStyle fs = FontStyle.Regular;
			if (color.Bold)   fs |= FontStyle.Bold;
			if (color.Italic) fs |= FontStyle.Italic;
			
			label.Font = new Font(label.Font, fs);
		}
Example #18
0
        public SpanNode(XmlElement el)
        {
            Text = ResNodeName("Span");

            OptionPanel = new SpanOptionPanel(this);

            if (el == null)
            {
                return;
            }

            color = new EditorHighlightColor(el);

            if (el.Attributes["rule"] != null)
            {
                rule = el.Attributes["rule"].InnerText;
            }

            if (el.Attributes["noescapesequences"] != null)
            {
                noEscapeSequences = Boolean.Parse(el.Attributes["noescapesequences"].InnerText);
            }

            name       = el.Attributes["name"].InnerText;
            stopEOL    = Boolean.Parse(el.Attributes["stopateol"].InnerText);
            begin      = el["Begin"].InnerText;
            beginColor = new EditorHighlightColor(el["Begin"]);

            if (el["End"] != null)
            {
                end      = el["End"].InnerText;
                endColor = new EditorHighlightColor(el["End"]);
            }

            UpdateNodeText();
        }
		void AcceptClick(object sender, EventArgs e)
		{
			object foreColor = null;
			object backColor = null;
			
			if (foreUser.Checked) {
				foreColor = (System.Drawing.Color)foreBtn.CenterColor;
			} else if (foreSys.Checked) {
				foreColor = (string)foreList.SelectedItem;
			}
			
			if (backUser.Checked) {
				backColor = (System.Drawing.Color)backBtn.CenterColor;
			} else if (backSys.Checked) {
				backColor = (string)backList.SelectedItem;
			}
			
			Color = new EditorHighlightColor(foreColor, backColor, boldBox.Checked, italicBox.Checked);
			
			DialogResult = DialogResult.OK;
		}
		public EditHighlightingColorDialog(EditorHighlightColor color)
		{
			SetupFromXmlFile(System.IO.Path.Combine(PropertyService.DataDirectory, 
			                          @"resources\panels\HighlightingEditor\ColorDialog.xfrm"));
			
			Color = color;
			
			boldBox   = (CheckBox)ControlDictionary["boldBox"];
			italicBox = (CheckBox)ControlDictionary["italicBox"];
			
			foreNo   = (RadioButton)ControlDictionary["foreNo"];
			foreUser = (RadioButton)ControlDictionary["foreUser"];
			foreSys  = (RadioButton)ControlDictionary["foreSys"];
			foreList = (ComboBox)ControlDictionary["foreList"];
			
			backNo   = (RadioButton)ControlDictionary["backNo"];
			backUser = (RadioButton)ControlDictionary["backUser"];
			backSys  = (RadioButton)ControlDictionary["backSys"];
			backList = (ComboBox)ControlDictionary["backList"];
			
			acceptBtn = (Button)ControlDictionary["acceptBtn"];
			
			this.foreBtn = new ColorButton();
			this.foreBtn.CenterColor = System.Drawing.Color.Empty;
			this.foreBtn.Enabled = false;
			this.foreBtn.Location = new System.Drawing.Point(30, 78);
			this.foreBtn.Name = "foreBtn";
			this.foreBtn.Size = new System.Drawing.Size(98, 24);
			
			this.ControlDictionary["foreBox"].Controls.Add(foreBtn);
			
			this.backBtn = new ColorButton();
			this.backBtn.CenterColor = System.Drawing.Color.Empty;
			this.backBtn.Enabled = false;
			this.backBtn.Location = new System.Drawing.Point(30, 78);
			this.backBtn.Name = "backBtn";
			this.backBtn.Size = new System.Drawing.Size(98, 24);
			
			this.ControlDictionary["backBox"].Controls.Add(backBtn);

			this.acceptBtn.Click += new EventHandler(AcceptClick);
			this.foreNo.CheckedChanged   += new EventHandler(foreCheck);
			this.foreSys.CheckedChanged  += new EventHandler(foreCheck);
			this.foreUser.CheckedChanged += new EventHandler(foreCheck);
			this.backNo.CheckedChanged   += new EventHandler(backCheck);
			this.backSys.CheckedChanged  += new EventHandler(backCheck);
			this.backUser.CheckedChanged += new EventHandler(backCheck);
			
			PropertyInfo[] names = typeof(System.Drawing.SystemColors).GetProperties(BindingFlags.Static | BindingFlags.Public);
			
			foreach(PropertyInfo info in names) {
				foreList.Items.Add(info.Name);
				backList.Items.Add(info.Name);
			}
			foreList.SelectedIndex = backList.SelectedIndex = 0;
			
			if (color.SysForeColor) {
				foreSys.Checked = true;
				for (int i = 0; i < foreList.Items.Count; ++i) {
					if ((string)foreList.Items[i] == color.SysForeColorName) foreList.SelectedIndex = i;
				}
			} else if (color.HasForeColor) {
				foreUser.Checked = true;
				foreBtn.CenterColor = color.ForeColor;
			} else {
				foreNo.Checked = true;
			}
			
			if (color.SysBackColor) {
				backSys.Checked = true;
				for (int i = 0; i < backList.Items.Count; ++i) {
					if ((string)backList.Items[i] == color.SysForeColorName) backList.SelectedIndex = i;
				}
			} else if (color.HasBackColor) {
				backUser.Checked = true;
				backBtn.CenterColor = color.BackColor;
			} else {
				backNo.Checked = true;
			}
			
			boldBox.Checked = color.Bold;
			italicBox.Checked = color.Italic;
		}
		public KeywordListNode(string Name)
		{
			name = Name;
			color = new EditorHighlightColor();
			UpdateNodeText();

			OptionPanel = new KeywordListOptionPanel(this);
		}
Example #22
0
		public SpanNode(string Name)
		{
			name = Name;
			color = new EditorHighlightColor();
			UpdateNodeText();
			
			OptionPanel = new SpanOptionPanel(this);
		}
		void chgEndClick(object sender, EventArgs e)
		{
			using (EditHighlightingColorDialog dlg = new EditHighlightingColorDialog(endColor)) {
				if (dlg.ShowDialog(this) == DialogResult.OK) {
					endColor = dlg.Color;
					PreviewUpdate(samEnd, endColor);
				}
			}
		}
		public override void LoadSettings()
		{
			SpanNode node = (SpanNode)parentNode;
			
			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 {}
			
			IProperties properties = ((IProperties)PropertyService.GetProperty("NetFocus.DataStructure.TextEditor.Document.DefaultDocumentProperties", new DefaultProperties()));
			samBegin.Font = samEnd.Font = samCont.Font = FontContainer.DefaultFont;

			nameBox.Text = node.Name;
			ruleBox.Text = node.Rule;
			beginBox.Text = node.Begin;
			endBox.Text = node.End;
			stopEolBox.Checked = node.StopEOL;
			noEscBox.Checked = node.NoEscapeSequences;
			
			color = node.HighlightColor;
			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);
		}