Exemple #1
0
        public static ColorSheme LoadFrom(XmlReader reader)
        {
            var result = new ColorSheme();

            XmlReadHelper.ReadList(reader, "EditorStyle", delegate() {
                switch (reader.LocalName)
                {
                case "EditorStyle":
                    result.Name        = reader.GetAttribute(NameAttribute);
                    result.Description = reader.GetAttribute("_description");
                    return(true);

                case "Color":
                    result.customPalette [reader.GetAttribute("name")] = reader.GetAttribute("value");
                    return(true);

                case "Style":
                    ReadStyleTree(reader, result, null, null, null, null);
                    return(true);
                }
                return(false);
            });
            result.GetChunkStyle(DefaultString).ChunkProperties |= ChunkProperties.TransparentBackground;
            return(result);
        }
Exemple #2
0
		public virtual bool GetIsValid (ColorSheme style)
		{
			if (style.GetChunkStyle (Color) == null) {
				System.Console.WriteLine("color:" + Color + " not found.");
				return false;
			}
			return true;
		}
Exemple #3
0
 public virtual bool GetIsValid(ColorSheme style)
 {
     if (style.GetChunkStyle(Color) == null)
     {
         System.Console.WriteLine("color:" + Color + " not found.");
         return(false);
     }
     return(true);
 }
Exemple #4
0
 public virtual bool GetIsValid(ColorSheme style)
 {
     return(style.GetChunkStyle(Color) != null);
 }
Exemple #5
0
		public virtual bool GetIsValid (ColorSheme style)
		{
			return style.GetChunkStyle (Color) != null;
		}
		public void SetSheme (ColorSheme style)
		{
			if (style == null)
				throw new ArgumentNullException ("style");
			this.fileName = Mono.TextEditor.Highlighting.SyntaxModeService.GetFileNameForStyle (style);
			this.colorSheme = style;
			this.entryName.Text = style.Name;
			this.entryDescription.Text = style.Description;
			this.textEditor.Document.MimeType = "text/x-csharp";
			this.textEditor.GetTextEditorData ().ColorStyle = style;
			this.textEditor.Text = @"using System;

// This is an example
class Example
{
	public static void Main (string[] args)
	{
		Console.WriteLine (""Hello World"");
	}
}";
			foreach (var data in metaData) {
				colorStore.AppendValues (data.Description, style.GetChunkStyle (data.Name), data);
			}
			Stylechanged (null, null);
		}
Exemple #7
0
 public virtual bool GetIsValid(ColorSheme style)
 {
     return((string.IsNullOrEmpty(Color) || style.GetChunkStyle(Color) != null) &&
            (string.IsNullOrEmpty(TagColor) || style.GetChunkStyle(TagColor) != null) &&
            (string.IsNullOrEmpty(NextColor) || style.GetChunkStyle(NextColor) != null));
 }
Exemple #8
0
		public virtual ChunkStyle GetChunkStyle (ColorSheme style)
		{
			if (style == null)
				return null;
			return style.GetChunkStyle (Style);
		}
Exemple #9
0
		public static ColorSheme LoadFrom (XmlReader reader)
		{
			var result = new ColorSheme ();
			XmlReadHelper.ReadList (reader, "EditorStyle", delegate () {
				switch (reader.LocalName) {
				case "EditorStyle":
					result.Name = reader.GetAttribute (NameAttribute);
					result.Description = reader.GetAttribute ("_description");
					return true;
				case "Color":
					result.customPalette [reader.GetAttribute ("name")] = reader.GetAttribute ("value");
					return true;
				case "Style":
					ReadStyleTree (reader, result, null, null, null, null);
					return true;
				}
				return false;
			});
			result.GetChunkStyle (DefaultString).ChunkProperties |= ChunkProperties.TransparentBackground;
			return result;
		}
Exemple #10
0
		public virtual bool GetIsValid (ColorSheme style)
		{
			return (string.IsNullOrEmpty (Color) || style.GetChunkStyle (Color) != null) &&
			        (string.IsNullOrEmpty (TagColor) || style.GetChunkStyle (TagColor) != null) &&
			        (string.IsNullOrEmpty (NextColor) || style.GetChunkStyle (NextColor) != null);
		}