public ExtensionPointSchemaElement (AddinProject project) : base (
			"ExtensionPoint",
			"Declares an extension point",
			new [] {
				new SchemaElement ("Description", "Long description of the extension point."),
				new ExtensionNodeDefinitionElement (project),
				new ExtensionNodeSetElement (project),
			},
			new[] {
				new SchemaAttribute ("path", "Path of the extension point."),
				new SchemaAttribute ("name", "Display name of the extension point (to be shown in documentation)."),
			}
		) {}
 public ModuleSchemaItem(AddinProject project) : base(
         "Module",
         "Declares an optional extension module",
         new SchemaElement [] {
     new RuntimeSchemaElement(),
     //TODO: filter out the addins already extended by the parent
     new DependenciesSchemaElement(),
     //TODO: extensions in a module should able to extend the dependencies of the module
     new ExtensionElement(project),
 }
         )
 {
 }
		public ExtensionNodeSetElement (AddinProject project) : base (
			"ExtensionNodeSet",
			"",
			new[] {
				new SchemaElement ("Description", "Description of what this kind of node represents.")
			},
			new [] {
				new SchemaAttribute ("name", "Name of the node type. When an element is added to an extension point, its name must match one of the declared node types."),
				new SchemaAttribute ("type", "CLR type that implements this extension node type. It must be a subclass of Mono.Addins.ExtensionNode. If not specified, by default it is Mono.Addins.TypeExtensionNode.")
			}
		)
		{
			this.project = project;
		}
 public ExtensionNodeDefinitionElement(AddinProject project) : base(
         "ExtensionNode",
         "A type of node allowed in this extension point.",
         new[] {
     new SchemaElement("Description", "Description of what this kind of node represents.")
 },
         new [] {
     new SchemaAttribute("name", "Name of the node type. When an element is added to an extension point, its name must match one of the declared node types."),
     new SchemaAttribute("type", "CLR type that implements this extension node type. It must be a subclass of Mono.Addins.ExtensionNode. If not specified, by default it is Mono.Addins.TypeExtensionNode.")
 }
         )
 {
     this.project = project;
 }
Esempio n. 5
0
 public ExtensionPointSchemaElement(AddinProject project) : base(
         "ExtensionPoint",
         "Declares an extension point",
         new [] {
     new SchemaElement("Description", "Long description of the extension point."),
     new ExtensionNodeDefinitionElement(project),
     new ExtensionNodeSetElement(project),
 },
         new[] {
     new SchemaAttribute("path", "Path of the extension point."),
     new SchemaAttribute("name", "Display name of the extension point (to be shown in documentation)."),
 }
         )
 {
 }
 internal static IEnumerable <Extension> GetExtensions(AddinProject project, ExtensionPoint extensionPoint)
 {
     //TODO: handle node sets
     foreach (var addin in extensionPoint.ExtenderAddins)
     {
         var modules = project.AddinRegistry.GetAddin(addin).Description.AllModules;
         foreach (ModuleDescription module in modules)
         {
             foreach (Extension extension in module.Extensions)
             {
                 if (extension.Path == extensionPoint.Path)
                 {
                     yield return(extension);
                 }
             }
         }
     }
 }
 public ExtensionNodeElement(AddinProject proj, ExtensionPoint extensionPoint, ExtensionNodeType info) : base(info.NodeName, info.Description)
 {
     this.proj           = proj;
     this.extensionPoint = extensionPoint;
     this.info           = info;
 }
		internal static IEnumerable<Extension> GetExtensions (AddinProject project, ExtensionPoint extensionPoint)
		{
			//TODO: handle node sets
			foreach (var addin in extensionPoint.ExtenderAddins) {
				var modules = project.AddinRegistry.GetAddin (addin).Description.AllModules;
				foreach (ModuleDescription module in modules) {
					foreach (Extension extension in module.Extensions) {
						if (extension.Path == extensionPoint.Path)
							yield return extension;
					}
				}
			}
		}
		public ExtensionNodeElement (AddinProject proj, ExtensionPoint extensionPoint, ExtensionNodeType info) : base (info.NodeName, info.Description)
		{
			this.proj = proj;
			this.extensionPoint = extensionPoint;
			this.info = info;
		}
 public ExtensionElement(AddinProject project) : base("Extension", "Declares an extension")
 {
     this.project = project;
 }
		public ExtensionElement (AddinProject project) : base ("Extension", "Declares an extension")
		{
			this.project = project;
		}