コード例 #1
0
		public SchemaElement (string name, string description, SchemaElement[] children = null, SchemaAttribute[] attributes = null)
		{
			Name = name;
			Description = description;

			if (children != null) {
				this.children = new Dictionary<string, SchemaElement> ();
				foreach (var c in children) {
					this.children.Add (c.Name, c);
				}
			}

			if (attributes != null) {
				this.attributes = new Dictionary<string, SchemaAttribute> ();
				foreach (var a in attributes) {
					this.attributes.Add (a.Name, a);
				}
			}
		}
コード例 #2
0
		protected override SchemaElement CreateSchema ()
		{
			var project = (AddinProject)Document.Project;

			var addinContents = new SchemaElement[] {
				new RuntimeSchemaElement (),
				new DependenciesSchemaElement (),
				new LocalizerSchemaElement (),
				new ExtensionElement (project),
				new ExtensionPointSchemaElement (project),
				new SchemaElement ("ExtensionNodeSet", "Declares an extension node set"),
				new SchemaElement ("ConditionType", "Declares a global condition type"),
			};

			return new SchemaElement (null, null, new[] {
				new SchemaElement (
					"Addin",
					"Root element for add-in and add-in root descriptions",
					addinContents,
					new[] {
						new SchemaAttribute ("id", "The identifier of the add-in. It is mandatory for add-in roots and for add-ins that can be extended, optional for other add-ins."),
						new SchemaAttribute ("namespace", "Namespace of the add-in. The full ID of an add-in is composed by 'namespace.name'."),
						new SchemaAttribute ("version", "The version of the add-in. It is mandatory for add-in roots and for add-ins that can be extended."),
						new SchemaAttribute ("compatVersion", "Version of the add-in with which this add-in is backwards compatible (optional)."),
						new SchemaAttribute ("name", "Display name of the add-in."),
						new SchemaAttribute ("description", "Description of the add-in."),
						new SchemaAttribute ("author", "Author of the add-in."),
						new SchemaAttribute ("url", "Url of a web page with more information about the add-in."),
						new SchemaAttribute ("defaultEnabled", "When set to 'false', the add-in won't be enabled until it is explicitly enabled by the user. The default is 'true'."),
						//TODO: enable this if we ever support arbitrary addins
						//new SchemaAttribute ("isroot", "Must be true if this manifest belongs to an add-in root.")
					}
				),
				new SchemaElement ("ExtensionModel", "Root element for add-in and add-in root descriptions", addinContents)
			});
		}
コード例 #3
0
		public override void Initialize ()
		{
			base.Initialize ();
			schema = CreateSchema ();
		}
		protected override void Initialize ()
		{
			base.Initialize ();
			schema = CreateSchema ();
		}