コード例 #1
0
        /// <summary>
        /// Returns a list of toolbox items for use with this DSL.
        /// </summary>
        /// Les items sont tous créés dans le designer et sont distingués par le nom du TabName qui correspond
        /// au diagramme associé.
        public override global::System.Collections.Generic.IList <DslDesign::ModelingToolboxItem> CreateToolboxItems()
        {
            IList <DslDesign::ModelingToolboxItem> toolboxItems = base.CreateToolboxItems();

            // Create store and load domain models.
            using (DslModeling::Store store = new DslModeling::Store(this.ServiceProvider))
            {
                store.LoadDomainModels(typeof(DslDiagrams::CoreDesignSurfaceDomainModel),
                                       typeof(global::DSLFactory.Candle.SystemModel.CandleDomainModel));

                global::System.Resources.ResourceManager resourceManager = global::DSLFactory.Candle.SystemModel.CandleDomainModel.SingletonResourceManager;
                global::System.Globalization.CultureInfo resourceCulture = global::System.Globalization.CultureInfo.CurrentUICulture;

                // Parcours des toolbox items les associer au bon diagramme
                using (DslModeling::Transaction t = store.TransactionManager.BeginTransaction("CreateToolboxItems for modelsLayer"))
                {
                    foreach (DslDesign::ModelingToolboxItem item in toolboxItems)
                    {
                        global::System.ComponentModel.ToolboxItemFilterAttribute[] filters = (global::System.ComponentModel.ToolboxItemFilterAttribute[])item.Filter;
                        if (item.TabName == "Models")
                        {
                            filters[0] = new global::System.ComponentModel.ToolboxItemFilterAttribute(ToolboxModelsFilterString);
                        }

                        if (item.TabName == "UILayer")
                        {
                            filters[0] = new global::System.ComponentModel.ToolboxItemFilterAttribute(ToolboxUIFilterString);
                        }
                    }

                    t.Rollback();
                }
            }

            return(toolboxItems);
        }
コード例 #2
0
        /// <summary>
        /// Returns a list of toolbox items for use with this DSL.
        /// </summary>
        public virtual global::System.Collections.Generic.IList <DslDesign::ModelingToolboxItem> CreateToolboxItems()
        {
            global::System.Collections.Generic.List <DslDesign::ModelingToolboxItem> toolboxItems = new global::System.Collections.Generic.List <DslDesign::ModelingToolboxItem>();

            // Create store and load domain models.
            using (DslModeling::Store store = new DslModeling::Store(this.ServiceProvider))
            {
                store.LoadDomainModels(typeof(DslDiagrams::CoreDesignSurfaceDomainModel),
                                       typeof(global::ConfigurationSectionDesigner.ConfigurationSectionDesignerDomainModel));
                global::System.Resources.ResourceManager resourceManager = global::ConfigurationSectionDesigner.ConfigurationSectionDesignerDomainModel.SingletonResourceManager;
                global::System.Globalization.CultureInfo resourceCulture = global::System.Globalization.CultureInfo.CurrentUICulture;

                // Open transaction so we can create model elements corresponding to toolbox items.
                using (DslModeling::Transaction t = store.TransactionManager.BeginTransaction("CreateToolboxItems"))
                {
                    // Add ConfigurationSection shape tool.
                    toolboxItems.Add(new DslDesign::ModelingToolboxItem(
                                         "ConfigurationSectionToolboxItem",                                                                                                                 // Unique identifier (non-localized) for the toolbox item.
                                         1,                                                                                                                                                 // Position relative to other items in the same toolbox tab.
                                         resourceManager.GetString("ConfigurationSectionToolboxItem", resourceCulture),                                                                     // Localized display name for the item.
                                         (global::System.Drawing.Bitmap)DslDiagrams::ImageHelper.GetImage(resourceManager.GetObject("ConfigurationSectionToolboxBitmap", resourceCulture)), // Image displayed next to the toolbox item.
                                         "Configuration Section DesignerToolboxTab",                                                                                                        // Unique identifier (non-localized) for the toolbox item tab.
                                         resourceManager.GetString("Configuration Section DesignerToolboxTab", resourceCulture),                                                            // Localized display name for the toolbox tab.
                                         "ConfigurationSection",                                                                                                                            // F1 help keyword for the toolbox item.
                                         resourceManager.GetString("ConfigurationSectionToolboxTooltip", resourceCulture),                                                                  // Localized tooltip text for the toolbox item.
                                         CreateElementToolPrototype(store, global::ConfigurationSectionDesigner.ConfigurationSection.DomainClassId),                                        // ElementGroupPrototype (data object) representing model element on the toolbox.
                                         new global::System.ComponentModel.ToolboxItemFilterAttribute[] {                                                                                   // Collection of ToolboxItemFilterAttribute objects that determine visibility of the toolbox item.
                        new global::System.ComponentModel.ToolboxItemFilterAttribute(ToolboxFilterString, global::System.ComponentModel.ToolboxItemFilterType.Require)
                    }));

                    // Add ConfigurationElement shape tool.
                    toolboxItems.Add(new DslDesign::ModelingToolboxItem(
                                         "ConfigurationElementToolboxItem",                                                                                                                 // Unique identifier (non-localized) for the toolbox item.
                                         2,                                                                                                                                                 // Position relative to other items in the same toolbox tab.
                                         resourceManager.GetString("ConfigurationElementToolboxItem", resourceCulture),                                                                     // Localized display name for the item.
                                         (global::System.Drawing.Bitmap)DslDiagrams::ImageHelper.GetImage(resourceManager.GetObject("ConfigurationElementToolboxBitmap", resourceCulture)), // Image displayed next to the toolbox item.
                                         "Configuration Section DesignerToolboxTab",                                                                                                        // Unique identifier (non-localized) for the toolbox item tab.
                                         resourceManager.GetString("Configuration Section DesignerToolboxTab", resourceCulture),                                                            // Localized display name for the toolbox tab.
                                         "ConfigurationElement",                                                                                                                            // F1 help keyword for the toolbox item.
                                         resourceManager.GetString("ConfigurationElementToolboxTooltip", resourceCulture),                                                                  // Localized tooltip text for the toolbox item.
                                         CreateElementToolPrototype(store, global::ConfigurationSectionDesigner.ConfigurationElement.DomainClassId),                                        // ElementGroupPrototype (data object) representing model element on the toolbox.
                                         new global::System.ComponentModel.ToolboxItemFilterAttribute[] {                                                                                   // Collection of ToolboxItemFilterAttribute objects that determine visibility of the toolbox item.
                        new global::System.ComponentModel.ToolboxItemFilterAttribute(ToolboxFilterString, global::System.ComponentModel.ToolboxItemFilterType.Require)
                    }));

                    // Add ConfigurationElementCollection shape tool.
                    toolboxItems.Add(new DslDesign::ModelingToolboxItem(
                                         "ConfigurationElementCollectionToolboxItem",                                                                                                                 // Unique identifier (non-localized) for the toolbox item.
                                         3,                                                                                                                                                           // Position relative to other items in the same toolbox tab.
                                         resourceManager.GetString("ConfigurationElementCollectionToolboxItem", resourceCulture),                                                                     // Localized display name for the item.
                                         (global::System.Drawing.Bitmap)DslDiagrams::ImageHelper.GetImage(resourceManager.GetObject("ConfigurationElementCollectionToolboxBitmap", resourceCulture)), // Image displayed next to the toolbox item.
                                         "Configuration Section DesignerToolboxTab",                                                                                                                  // Unique identifier (non-localized) for the toolbox item tab.
                                         resourceManager.GetString("Configuration Section DesignerToolboxTab", resourceCulture),                                                                      // Localized display name for the toolbox tab.
                                         "ConfigurationElementCollection",                                                                                                                            // F1 help keyword for the toolbox item.
                                         resourceManager.GetString("ConfigurationElementCollectionToolboxTooltip", resourceCulture),                                                                  // Localized tooltip text for the toolbox item.
                                         CreateElementToolPrototype(store, global::ConfigurationSectionDesigner.ConfigurationElementCollection.DomainClassId),                                        // ElementGroupPrototype (data object) representing model element on the toolbox.
                                         new global::System.ComponentModel.ToolboxItemFilterAttribute[] {                                                                                             // Collection of ToolboxItemFilterAttribute objects that determine visibility of the toolbox item.
                        new global::System.ComponentModel.ToolboxItemFilterAttribute(ToolboxFilterString, global::System.ComponentModel.ToolboxItemFilterType.Require)
                    }));

                    // Add CollectionItemType connector tool.
                    toolboxItems.Add(new DslDesign::ModelingToolboxItem(
                                         "CollectionItemTypeToolboxItem",                                                                                                                 // Unique identifier (non-localized) for the toolbox item.
                                         4,                                                                                                                                               // Position relative to other items in the same toolbox tab.
                                         resourceManager.GetString("CollectionItemTypeToolboxItem", resourceCulture),                                                                     // Localized display name for the item.
                                         (global::System.Drawing.Bitmap)DslDiagrams::ImageHelper.GetImage(resourceManager.GetObject("CollectionItemTypeToolboxBitmap", resourceCulture)), // Image displayed next to the toolbox item.
                                         "Configuration Section DesignerToolboxTab",                                                                                                      // Unique identifier (non-localized) for the toolbox item tab.
                                         resourceManager.GetString("Configuration Section DesignerToolboxTab", resourceCulture),                                                          // Localized display name for the toolbox tab.
                                         "CollectionItemType",                                                                                                                            // F1 help keyword for the toolbox item.
                                         resourceManager.GetString("CollectionItemTypeToolboxTooltip", resourceCulture),                                                                  // Localized tooltip text for the toolbox item.
                                         null,                                                                                                                                            // Connector toolbox items do not have an underlying data object.
                                         new global::System.ComponentModel.ToolboxItemFilterAttribute[] {                                                                                 // Collection of ToolboxItemFilterAttribute objects that determine visibility of the toolbox item.
                        new global::System.ComponentModel.ToolboxItemFilterAttribute(ToolboxFilterString, global::System.ComponentModel.ToolboxItemFilterType.Require),
                        new global::System.ComponentModel.ToolboxItemFilterAttribute(CollectionItemTypeFilterString)
                    }));

                    // Add ConfigurationSectionGroup shape tool.
                    toolboxItems.Add(new DslDesign::ModelingToolboxItem(
                                         "ConfigurationSectionGroupToolboxItem",                                                                                                                 // Unique identifier (non-localized) for the toolbox item.
                                         5,                                                                                                                                                      // Position relative to other items in the same toolbox tab.
                                         resourceManager.GetString("ConfigurationSectionGroupToolboxItem", resourceCulture),                                                                     // Localized display name for the item.
                                         (global::System.Drawing.Bitmap)DslDiagrams::ImageHelper.GetImage(resourceManager.GetObject("ConfigurationSectionGroupToolboxBitmap", resourceCulture)), // Image displayed next to the toolbox item.
                                         "Configuration Section DesignerToolboxTab",                                                                                                             // Unique identifier (non-localized) for the toolbox item tab.
                                         resourceManager.GetString("Configuration Section DesignerToolboxTab", resourceCulture),                                                                 // Localized display name for the toolbox tab.
                                         "ConfigurationSectionGroup",                                                                                                                            // F1 help keyword for the toolbox item.
                                         resourceManager.GetString("ConfigurationSectionGroupToolboxTooltip", resourceCulture),                                                                  // Localized tooltip text for the toolbox item.
                                         CreateElementToolPrototype(store, global::ConfigurationSectionDesigner.ConfigurationSectionGroup.DomainClassId),                                        // ElementGroupPrototype (data object) representing model element on the toolbox.
                                         new global::System.ComponentModel.ToolboxItemFilterAttribute[] {                                                                                        // Collection of ToolboxItemFilterAttribute objects that determine visibility of the toolbox item.
                        new global::System.ComponentModel.ToolboxItemFilterAttribute(ToolboxFilterString, global::System.ComponentModel.ToolboxItemFilterType.Require)
                    }));

                    t.Rollback();
                }
            }

            return(toolboxItems);
        }
コード例 #3
0
ファイル: ToolboxHelper.cs プロジェクト: spzenk/sfdocsamples
		/// <summary>
		/// Returns a list of toolbox items for use with this DSL.
		/// </summary>
		public virtual global::System.Collections.Generic.IList<DslDesign::ModelingToolboxItem> CreateToolboxItems()
		{
			global::System.Collections.Generic.List<DslDesign::ModelingToolboxItem> toolboxItems = new global::System.Collections.Generic.List<DslDesign::ModelingToolboxItem>();
			
			// Create store and load domain models.
			using(DslModeling::Store store = new DslModeling::Store(this.ServiceProvider))
			{
				store.LoadDomainModels(typeof(DslDiagrams::CoreDesignSurfaceDomainModel),
					typeof(global::pelsoft.FWK_Dsl.FWK_DslDomainModel));
				global::System.Resources.ResourceManager resourceManager = global::pelsoft.FWK_Dsl.FWK_DslDomainModel.SingletonResourceManager;
				global::System.Globalization.CultureInfo resourceCulture = global::System.Globalization.CultureInfo.CurrentUICulture;
			
				// Open transaction so we can create model elements corresponding to toolbox items.
				using(DslModeling::Transaction t = store.TransactionManager.BeginTransaction("CreateToolboxItems"))
				{

					// Add ModelClass shape tool.
					toolboxItems.Add(new DslDesign::ModelingToolboxItem(
						"ModelClassToolboxItem", // Unique identifier (non-localized) for the toolbox item.
						1, // Position relative to other items in the same toolbox tab.
						resourceManager.GetString("ModelClassToolboxItem", resourceCulture), // Localized display name for the item.
						(global::System.Drawing.Bitmap)DslDiagrams::ImageHelper.GetImage(resourceManager.GetObject("ModelClassToolboxBitmap", resourceCulture)), // Image displayed next to the toolbox item.
						"Class DiagramsToolboxTab", // Unique identifier (non-localized) for the toolbox item tab.
						resourceManager.GetString("Class DiagramsToolboxTab", resourceCulture), // Localized display name for the toolbox tab.
						"ModelClassF1Keyword", // F1 help keyword for the toolbox item.
						resourceManager.GetString("ModelClassToolboxTooltip", resourceCulture), // Localized tooltip text for the toolbox item.
						CreateElementToolPrototype(store, global::pelsoft.FWK_Dsl.ModelClass.DomainClassId), // ElementGroupPrototype (data object) representing model element on the toolbox.
						new global::System.ComponentModel.ToolboxItemFilterAttribute[] { // Collection of ToolboxItemFilterAttribute objects that determine visibility of the toolbox item.
							new global::System.ComponentModel.ToolboxItemFilterAttribute(ToolboxFilterString, global::System.ComponentModel.ToolboxItemFilterType.Require) 
						}));

					// Add Attribute shape tool.
					toolboxItems.Add(new DslDesign::ModelingToolboxItem(
						"AttributeToolboxItem", // Unique identifier (non-localized) for the toolbox item.
						2, // Position relative to other items in the same toolbox tab.
						resourceManager.GetString("AttributeToolboxItem", resourceCulture), // Localized display name for the item.
						(global::System.Drawing.Bitmap)DslDiagrams::ImageHelper.GetImage(resourceManager.GetObject("AttributeToolboxBitmap", resourceCulture)), // Image displayed next to the toolbox item.
						"Class DiagramsToolboxTab", // Unique identifier (non-localized) for the toolbox item tab.
						resourceManager.GetString("Class DiagramsToolboxTab", resourceCulture), // Localized display name for the toolbox tab.
						"AttributeF1Keyword", // F1 help keyword for the toolbox item.
						resourceManager.GetString("AttributeToolboxTooltip", resourceCulture), // Localized tooltip text for the toolbox item.
						CreateElementToolPrototype(store, global::pelsoft.FWK_Dsl.ModelAttribute.DomainClassId), // ElementGroupPrototype (data object) representing model element on the toolbox.
						new global::System.ComponentModel.ToolboxItemFilterAttribute[] { // Collection of ToolboxItemFilterAttribute objects that determine visibility of the toolbox item.
							new global::System.ComponentModel.ToolboxItemFilterAttribute(ToolboxFilterString, global::System.ComponentModel.ToolboxItemFilterType.Require) 
						}));

					// Add ClassOperation shape tool.
					toolboxItems.Add(new DslDesign::ModelingToolboxItem(
						"ClassOperationToolboxItem", // Unique identifier (non-localized) for the toolbox item.
						3, // Position relative to other items in the same toolbox tab.
						resourceManager.GetString("ClassOperationToolboxItem", resourceCulture), // Localized display name for the item.
						(global::System.Drawing.Bitmap)DslDiagrams::ImageHelper.GetImage(resourceManager.GetObject("ClassOperationToolboxBitmap", resourceCulture)), // Image displayed next to the toolbox item.
						"Class DiagramsToolboxTab", // Unique identifier (non-localized) for the toolbox item tab.
						resourceManager.GetString("Class DiagramsToolboxTab", resourceCulture), // Localized display name for the toolbox tab.
						"ClassOperationF1Keyword", // F1 help keyword for the toolbox item.
						resourceManager.GetString("ClassOperationToolboxTooltip", resourceCulture), // Localized tooltip text for the toolbox item.
						CreateElementToolPrototype(store, global::pelsoft.FWK_Dsl.ClassOperation.DomainClassId), // ElementGroupPrototype (data object) representing model element on the toolbox.
						new global::System.ComponentModel.ToolboxItemFilterAttribute[] { // Collection of ToolboxItemFilterAttribute objects that determine visibility of the toolbox item.
							new global::System.ComponentModel.ToolboxItemFilterAttribute(ToolboxFilterString, global::System.ComponentModel.ToolboxItemFilterType.Require) 
						}));

					// Add ModelInterface shape tool.
					toolboxItems.Add(new DslDesign::ModelingToolboxItem(
						"ModelInterfaceToolboxItem", // Unique identifier (non-localized) for the toolbox item.
						4, // Position relative to other items in the same toolbox tab.
						resourceManager.GetString("ModelInterfaceToolboxItem", resourceCulture), // Localized display name for the item.
						(global::System.Drawing.Bitmap)DslDiagrams::ImageHelper.GetImage(resourceManager.GetObject("ModelInterfaceToolboxBitmap", resourceCulture)), // Image displayed next to the toolbox item.
						"Class DiagramsToolboxTab", // Unique identifier (non-localized) for the toolbox item tab.
						resourceManager.GetString("Class DiagramsToolboxTab", resourceCulture), // Localized display name for the toolbox tab.
						"ModelInterfaceF1Keyword", // F1 help keyword for the toolbox item.
						resourceManager.GetString("ModelInterfaceToolboxTooltip", resourceCulture), // Localized tooltip text for the toolbox item.
						CreateElementToolPrototype(store, global::pelsoft.FWK_Dsl.ModelInterface.DomainClassId), // ElementGroupPrototype (data object) representing model element on the toolbox.
						new global::System.ComponentModel.ToolboxItemFilterAttribute[] { // Collection of ToolboxItemFilterAttribute objects that determine visibility of the toolbox item.
							new global::System.ComponentModel.ToolboxItemFilterAttribute(ToolboxFilterString, global::System.ComponentModel.ToolboxItemFilterType.Require) 
						}));

					// Add InterfaceOperation shape tool.
					toolboxItems.Add(new DslDesign::ModelingToolboxItem(
						"InterfaceOperationToolboxItem", // Unique identifier (non-localized) for the toolbox item.
						5, // Position relative to other items in the same toolbox tab.
						resourceManager.GetString("InterfaceOperationToolboxItem", resourceCulture), // Localized display name for the item.
						(global::System.Drawing.Bitmap)DslDiagrams::ImageHelper.GetImage(resourceManager.GetObject("InterfaceOperationToolboxBitmap", resourceCulture)), // Image displayed next to the toolbox item.
						"Class DiagramsToolboxTab", // Unique identifier (non-localized) for the toolbox item tab.
						resourceManager.GetString("Class DiagramsToolboxTab", resourceCulture), // Localized display name for the toolbox tab.
						"InterfaceOperationF1Keyword", // F1 help keyword for the toolbox item.
						resourceManager.GetString("InterfaceOperationToolboxTooltip", resourceCulture), // Localized tooltip text for the toolbox item.
						CreateElementToolPrototype(store, global::pelsoft.FWK_Dsl.InterfaceOperation.DomainClassId), // ElementGroupPrototype (data object) representing model element on the toolbox.
						new global::System.ComponentModel.ToolboxItemFilterAttribute[] { // Collection of ToolboxItemFilterAttribute objects that determine visibility of the toolbox item.
							new global::System.ComponentModel.ToolboxItemFilterAttribute(ToolboxFilterString, global::System.ComponentModel.ToolboxItemFilterType.Require) 
						}));

					// Add UnidirectionalAssociation connector tool.
					toolboxItems.Add(new DslDesign::ModelingToolboxItem(
						"UnidirectionalAssociationToolboxItem", // Unique identifier (non-localized) for the toolbox item.
						6, // Position relative to other items in the same toolbox tab.
						resourceManager.GetString("UnidirectionalAssociationToolboxItem", resourceCulture), // Localized display name for the item.
						(global::System.Drawing.Bitmap)DslDiagrams::ImageHelper.GetImage(resourceManager.GetObject("UnidirectionalAssociationToolboxBitmap", resourceCulture)), // Image displayed next to the toolbox item.				
						"Class DiagramsToolboxTab", // Unique identifier (non-localized) for the toolbox item tab.
						resourceManager.GetString("Class DiagramsToolboxTab", resourceCulture), // Localized display name for the toolbox tab.
						"ConnectUnidirectionalAssociationF1Keyword", // F1 help keyword for the toolbox item.
						resourceManager.GetString("UnidirectionalAssociationToolboxTooltip", resourceCulture), // Localized tooltip text for the toolbox item.
						null, // Connector toolbox items do not have an underlying data object.
						new global::System.ComponentModel.ToolboxItemFilterAttribute[] { // Collection of ToolboxItemFilterAttribute objects that determine visibility of the toolbox item.
							new global::System.ComponentModel.ToolboxItemFilterAttribute(ToolboxFilterString, global::System.ComponentModel.ToolboxItemFilterType.Require), 
							new global::System.ComponentModel.ToolboxItemFilterAttribute(UnidirectionalAssociationFilterString)
						}));

					// Add BidirectionalAssociation connector tool.
					toolboxItems.Add(new DslDesign::ModelingToolboxItem(
						"BidirectionalAssociationToolboxItem", // Unique identifier (non-localized) for the toolbox item.
						7, // Position relative to other items in the same toolbox tab.
						resourceManager.GetString("BidirectionalAssociationToolboxItem", resourceCulture), // Localized display name for the item.
						(global::System.Drawing.Bitmap)DslDiagrams::ImageHelper.GetImage(resourceManager.GetObject("BidirectionalAssociationToolboxBitmap", resourceCulture)), // Image displayed next to the toolbox item.				
						"Class DiagramsToolboxTab", // Unique identifier (non-localized) for the toolbox item tab.
						resourceManager.GetString("Class DiagramsToolboxTab", resourceCulture), // Localized display name for the toolbox tab.
						"ConnectBidirectionalAssociationF1Keyword", // F1 help keyword for the toolbox item.
						resourceManager.GetString("BidirectionalAssociationToolboxTooltip", resourceCulture), // Localized tooltip text for the toolbox item.
						null, // Connector toolbox items do not have an underlying data object.
						new global::System.ComponentModel.ToolboxItemFilterAttribute[] { // Collection of ToolboxItemFilterAttribute objects that determine visibility of the toolbox item.
							new global::System.ComponentModel.ToolboxItemFilterAttribute(ToolboxFilterString, global::System.ComponentModel.ToolboxItemFilterType.Require), 
							new global::System.ComponentModel.ToolboxItemFilterAttribute(BidirectionalAssociationFilterString)
						}));

					// Add Aggregation connector tool.
					toolboxItems.Add(new DslDesign::ModelingToolboxItem(
						"AggregationToolboxItem", // Unique identifier (non-localized) for the toolbox item.
						8, // Position relative to other items in the same toolbox tab.
						resourceManager.GetString("AggregationToolboxItem", resourceCulture), // Localized display name for the item.
						(global::System.Drawing.Bitmap)DslDiagrams::ImageHelper.GetImage(resourceManager.GetObject("AggregationToolboxBitmap", resourceCulture)), // Image displayed next to the toolbox item.				
						"Class DiagramsToolboxTab", // Unique identifier (non-localized) for the toolbox item tab.
						resourceManager.GetString("Class DiagramsToolboxTab", resourceCulture), // Localized display name for the toolbox tab.
						"AggregationF1Keyword", // F1 help keyword for the toolbox item.
						resourceManager.GetString("AggregationToolboxTooltip", resourceCulture), // Localized tooltip text for the toolbox item.
						null, // Connector toolbox items do not have an underlying data object.
						new global::System.ComponentModel.ToolboxItemFilterAttribute[] { // Collection of ToolboxItemFilterAttribute objects that determine visibility of the toolbox item.
							new global::System.ComponentModel.ToolboxItemFilterAttribute(ToolboxFilterString, global::System.ComponentModel.ToolboxItemFilterType.Require), 
							new global::System.ComponentModel.ToolboxItemFilterAttribute(AggregationFilterString)
						}));

					// Add Composition connector tool.
					toolboxItems.Add(new DslDesign::ModelingToolboxItem(
						"CompositionToolboxItem", // Unique identifier (non-localized) for the toolbox item.
						9, // Position relative to other items in the same toolbox tab.
						resourceManager.GetString("CompositionToolboxItem", resourceCulture), // Localized display name for the item.
						(global::System.Drawing.Bitmap)DslDiagrams::ImageHelper.GetImage(resourceManager.GetObject("CompositionToolboxBitmap", resourceCulture)), // Image displayed next to the toolbox item.				
						"Class DiagramsToolboxTab", // Unique identifier (non-localized) for the toolbox item tab.
						resourceManager.GetString("Class DiagramsToolboxTab", resourceCulture), // Localized display name for the toolbox tab.
						"CompositionF1Keyword", // F1 help keyword for the toolbox item.
						resourceManager.GetString("CompositionToolboxTooltip", resourceCulture), // Localized tooltip text for the toolbox item.
						null, // Connector toolbox items do not have an underlying data object.
						new global::System.ComponentModel.ToolboxItemFilterAttribute[] { // Collection of ToolboxItemFilterAttribute objects that determine visibility of the toolbox item.
							new global::System.ComponentModel.ToolboxItemFilterAttribute(ToolboxFilterString, global::System.ComponentModel.ToolboxItemFilterType.Require), 
							new global::System.ComponentModel.ToolboxItemFilterAttribute(CompositionFilterString)
						}));

					// Add Generalization connector tool.
					toolboxItems.Add(new DslDesign::ModelingToolboxItem(
						"GeneralizationToolboxItem", // Unique identifier (non-localized) for the toolbox item.
						10, // Position relative to other items in the same toolbox tab.
						resourceManager.GetString("GeneralizationToolboxItem", resourceCulture), // Localized display name for the item.
						(global::System.Drawing.Bitmap)DslDiagrams::ImageHelper.GetImage(resourceManager.GetObject("GeneralizationToolboxBitmap", resourceCulture)), // Image displayed next to the toolbox item.				
						"Class DiagramsToolboxTab", // Unique identifier (non-localized) for the toolbox item tab.
						resourceManager.GetString("Class DiagramsToolboxTab", resourceCulture), // Localized display name for the toolbox tab.
						"GeneralizationF1Keyword", // F1 help keyword for the toolbox item.
						resourceManager.GetString("GeneralizationToolboxTooltip", resourceCulture), // Localized tooltip text for the toolbox item.
						null, // Connector toolbox items do not have an underlying data object.
						new global::System.ComponentModel.ToolboxItemFilterAttribute[] { // Collection of ToolboxItemFilterAttribute objects that determine visibility of the toolbox item.
							new global::System.ComponentModel.ToolboxItemFilterAttribute(ToolboxFilterString, global::System.ComponentModel.ToolboxItemFilterType.Require), 
							new global::System.ComponentModel.ToolboxItemFilterAttribute(GeneralizationFilterString)
						}));

					// Add MultipleAssociation shape tool.
					toolboxItems.Add(new DslDesign::ModelingToolboxItem(
						"MultipleAssociationToolboxItem", // Unique identifier (non-localized) for the toolbox item.
						11, // Position relative to other items in the same toolbox tab.
						resourceManager.GetString("MultipleAssociationToolboxItem", resourceCulture), // Localized display name for the item.
						(global::System.Drawing.Bitmap)DslDiagrams::ImageHelper.GetImage(resourceManager.GetObject("MultipleAssociationToolboxBitmap", resourceCulture)), // Image displayed next to the toolbox item.
						"Class DiagramsToolboxTab", // Unique identifier (non-localized) for the toolbox item tab.
						resourceManager.GetString("Class DiagramsToolboxTab", resourceCulture), // Localized display name for the toolbox tab.
						"MultipleAssociationF1Keyword", // F1 help keyword for the toolbox item.
						resourceManager.GetString("MultipleAssociationToolboxTooltip", resourceCulture), // Localized tooltip text for the toolbox item.
						CreateElementToolPrototype(store, global::pelsoft.FWK_Dsl.MultipleAssociation.DomainClassId), // ElementGroupPrototype (data object) representing model element on the toolbox.
						new global::System.ComponentModel.ToolboxItemFilterAttribute[] { // Collection of ToolboxItemFilterAttribute objects that determine visibility of the toolbox item.
							new global::System.ComponentModel.ToolboxItemFilterAttribute(ToolboxFilterString, global::System.ComponentModel.ToolboxItemFilterType.Require) 
						}));

					// Add MultipleAssociationRole connector tool.
					toolboxItems.Add(new DslDesign::ModelingToolboxItem(
						"MultipleAssociationRoleToolboxItem", // Unique identifier (non-localized) for the toolbox item.
						12, // Position relative to other items in the same toolbox tab.
						resourceManager.GetString("MultipleAssociationRoleToolboxItem", resourceCulture), // Localized display name for the item.
						(global::System.Drawing.Bitmap)DslDiagrams::ImageHelper.GetImage(resourceManager.GetObject("MultipleAssociationRoleToolboxBitmap", resourceCulture)), // Image displayed next to the toolbox item.				
						"Class DiagramsToolboxTab", // Unique identifier (non-localized) for the toolbox item tab.
						resourceManager.GetString("Class DiagramsToolboxTab", resourceCulture), // Localized display name for the toolbox tab.
						"MultipleAssociationRoleF1Keyword", // F1 help keyword for the toolbox item.
						resourceManager.GetString("MultipleAssociationRoleToolboxTooltip", resourceCulture), // Localized tooltip text for the toolbox item.
						null, // Connector toolbox items do not have an underlying data object.
						new global::System.ComponentModel.ToolboxItemFilterAttribute[] { // Collection of ToolboxItemFilterAttribute objects that determine visibility of the toolbox item.
							new global::System.ComponentModel.ToolboxItemFilterAttribute(ToolboxFilterString, global::System.ComponentModel.ToolboxItemFilterType.Require), 
							new global::System.ComponentModel.ToolboxItemFilterAttribute(MultipleAssociationRoleFilterString)
						}));

					// Add AssociationClassRelationship connector tool.
					toolboxItems.Add(new DslDesign::ModelingToolboxItem(
						"AssociationClassRelationshipToolboxItem", // Unique identifier (non-localized) for the toolbox item.
						13, // Position relative to other items in the same toolbox tab.
						resourceManager.GetString("AssociationClassRelationshipToolboxItem", resourceCulture), // Localized display name for the item.
						(global::System.Drawing.Bitmap)DslDiagrams::ImageHelper.GetImage(resourceManager.GetObject("AssociationClassRelationshipToolboxBitmap", resourceCulture)), // Image displayed next to the toolbox item.				
						"Class DiagramsToolboxTab", // Unique identifier (non-localized) for the toolbox item tab.
						resourceManager.GetString("Class DiagramsToolboxTab", resourceCulture), // Localized display name for the toolbox tab.
						"AssociationClassRelationshipF1Keyword", // F1 help keyword for the toolbox item.
						resourceManager.GetString("AssociationClassRelationshipToolboxTooltip", resourceCulture), // Localized tooltip text for the toolbox item.
						null, // Connector toolbox items do not have an underlying data object.
						new global::System.ComponentModel.ToolboxItemFilterAttribute[] { // Collection of ToolboxItemFilterAttribute objects that determine visibility of the toolbox item.
							new global::System.ComponentModel.ToolboxItemFilterAttribute(ToolboxFilterString, global::System.ComponentModel.ToolboxItemFilterType.Require), 
							new global::System.ComponentModel.ToolboxItemFilterAttribute(AssociationClassRelationshipFilterString)
						}));

					// Add Comment shape tool.
					toolboxItems.Add(new DslDesign::ModelingToolboxItem(
						"CommentToolboxItem", // Unique identifier (non-localized) for the toolbox item.
						14, // Position relative to other items in the same toolbox tab.
						resourceManager.GetString("CommentToolboxItem", resourceCulture), // Localized display name for the item.
						(global::System.Drawing.Bitmap)DslDiagrams::ImageHelper.GetImage(resourceManager.GetObject("CommentToolboxBitmap", resourceCulture)), // Image displayed next to the toolbox item.
						"Class DiagramsToolboxTab", // Unique identifier (non-localized) for the toolbox item tab.
						resourceManager.GetString("Class DiagramsToolboxTab", resourceCulture), // Localized display name for the toolbox tab.
						"CommentF1Keyword", // F1 help keyword for the toolbox item.
						resourceManager.GetString("CommentToolboxTooltip", resourceCulture), // Localized tooltip text for the toolbox item.
						CreateElementToolPrototype(store, global::pelsoft.FWK_Dsl.Comment.DomainClassId), // ElementGroupPrototype (data object) representing model element on the toolbox.
						new global::System.ComponentModel.ToolboxItemFilterAttribute[] { // Collection of ToolboxItemFilterAttribute objects that determine visibility of the toolbox item.
							new global::System.ComponentModel.ToolboxItemFilterAttribute(ToolboxFilterString, global::System.ComponentModel.ToolboxItemFilterType.Require) 
						}));

					// Add CommentsReferenceTypes connector tool.
					toolboxItems.Add(new DslDesign::ModelingToolboxItem(
						"CommentsReferenceTypesToolboxItem", // Unique identifier (non-localized) for the toolbox item.
						15, // Position relative to other items in the same toolbox tab.
						resourceManager.GetString("CommentsReferenceTypesToolboxItem", resourceCulture), // Localized display name for the item.
						(global::System.Drawing.Bitmap)DslDiagrams::ImageHelper.GetImage(resourceManager.GetObject("CommentsReferenceTypesToolboxBitmap", resourceCulture)), // Image displayed next to the toolbox item.				
						"Class DiagramsToolboxTab", // Unique identifier (non-localized) for the toolbox item tab.
						resourceManager.GetString("Class DiagramsToolboxTab", resourceCulture), // Localized display name for the toolbox tab.
						"CommentsReferenceTypesF1Keyword", // F1 help keyword for the toolbox item.
						resourceManager.GetString("CommentsReferenceTypesToolboxTooltip", resourceCulture), // Localized tooltip text for the toolbox item.
						null, // Connector toolbox items do not have an underlying data object.
						new global::System.ComponentModel.ToolboxItemFilterAttribute[] { // Collection of ToolboxItemFilterAttribute objects that determine visibility of the toolbox item.
							new global::System.ComponentModel.ToolboxItemFilterAttribute(ToolboxFilterString, global::System.ComponentModel.ToolboxItemFilterType.Require), 
							new global::System.ComponentModel.ToolboxItemFilterAttribute(CommentsReferenceTypesFilterString)
						}));

					t.Rollback();
				}
			}

			return toolboxItems;
		}
コード例 #4
0
ファイル: ToolboxHelper.cs プロジェクト: cjheath/NORMA
		/// <summary>
		/// Returns a list of toolbox items for use with this DSL.
		/// </summary>
		public virtual global::System.Collections.Generic.IList<DslDesign::ModelingToolboxItem> CreateToolboxItems()
		{
			global::System.Collections.Generic.List<DslDesign::ModelingToolboxItem> toolboxItems = new global::System.Collections.Generic.List<DslDesign::ModelingToolboxItem>();
			
			// Create store and load domain models.
			using(DslModeling::Store store = new DslModeling::Store(this.ServiceProvider))
			{
				store.LoadDomainModels(typeof(DslDiagrams::CoreDesignSurfaceDomainModel),
					typeof(global::ORMSolutions.ORMArchitect.Framework.FrameworkDomainModel),
					typeof(global::ORMSolutions.ORMArchitect.Core.ObjectModel.ORMCoreDomainModel),
					typeof(global::Microsoft.VisualStudio.Modeling.Diagrams.CoreDesignSurfaceDomainModel),
					typeof(global::ORMSolutions.ORMArchitect.Core.ShapeModel.ORMShapeDomainModel));
				global::System.Resources.ResourceManager resourceManager = global::ORMSolutions.ORMArchitect.Core.ShapeModel.ORMShapeDomainModel.SingletonResourceManager;
				global::System.Globalization.CultureInfo resourceCulture = global::System.Globalization.CultureInfo.CurrentUICulture;
			
				// Open transaction so we can create model elements corresponding to toolbox items.
				using(DslModeling::Transaction t = store.TransactionManager.BeginTransaction("CreateToolboxItems"))
				{

					// Add EntityType shape tool.
					toolboxItems.Add(new DslDesign::ModelingToolboxItem(
						"EntityTypeToolboxItem", // Unique identifier (non-localized) for the toolbox item.
						1, // Position relative to other items in the same toolbox tab.
						resourceManager.GetString("EntityTypeToolboxItem", resourceCulture), // Localized display name for the item.
						(global::System.Drawing.Bitmap)DslDiagrams::ImageHelper.GetImage(resourceManager.GetObject("EntityTypeToolboxBitmap", resourceCulture)), // Image displayed next to the toolbox item.
						"ORM DesignerToolboxTab", // Unique identifier (non-localized) for the toolbox item tab.
						resourceManager.GetString("ORM DesignerToolboxTab", resourceCulture), // Localized display name for the toolbox tab.
						"EntityType", // F1 help keyword for the toolbox item.
						resourceManager.GetString("EntityTypeToolboxTooltip", resourceCulture), // Localized tooltip text for the toolbox item.
						CreateElementToolPrototype(store, global::ORMSolutions.ORMArchitect.Core.ObjectModel.ObjectType.DomainClassId), // ElementGroupPrototype (data object) representing model element on the toolbox.
						new global::System.ComponentModel.ToolboxItemFilterAttribute[] { // Collection of ToolboxItemFilterAttribute objects that determine visibility of the toolbox item.
							new global::System.ComponentModel.ToolboxItemFilterAttribute(ToolboxFilterString, global::System.ComponentModel.ToolboxItemFilterType.Require) 
						}));

					// Add ValueType shape tool.
					toolboxItems.Add(new DslDesign::ModelingToolboxItem(
						"ValueTypeToolboxItem", // Unique identifier (non-localized) for the toolbox item.
						2, // Position relative to other items in the same toolbox tab.
						resourceManager.GetString("ValueTypeToolboxItem", resourceCulture), // Localized display name for the item.
						(global::System.Drawing.Bitmap)DslDiagrams::ImageHelper.GetImage(resourceManager.GetObject("ValueTypeToolboxBitmap", resourceCulture)), // Image displayed next to the toolbox item.
						"ORM DesignerToolboxTab", // Unique identifier (non-localized) for the toolbox item tab.
						resourceManager.GetString("ORM DesignerToolboxTab", resourceCulture), // Localized display name for the toolbox tab.
						"ValueType", // F1 help keyword for the toolbox item.
						resourceManager.GetString("ValueTypeToolboxTooltip", resourceCulture), // Localized tooltip text for the toolbox item.
						CreateElementToolPrototype(store, global::ORMSolutions.ORMArchitect.Core.ObjectModel.ObjectType.DomainClassId), // ElementGroupPrototype (data object) representing model element on the toolbox.
						new global::System.ComponentModel.ToolboxItemFilterAttribute[] { // Collection of ToolboxItemFilterAttribute objects that determine visibility of the toolbox item.
							new global::System.ComponentModel.ToolboxItemFilterAttribute(ToolboxFilterString, global::System.ComponentModel.ToolboxItemFilterType.Require) 
						}));

					// Add ObjectifiedFactType shape tool.
					toolboxItems.Add(new DslDesign::ModelingToolboxItem(
						"ObjectifiedFactTypeToolboxItem", // Unique identifier (non-localized) for the toolbox item.
						3, // Position relative to other items in the same toolbox tab.
						resourceManager.GetString("ObjectifiedFactTypeToolboxItem", resourceCulture), // Localized display name for the item.
						(global::System.Drawing.Bitmap)DslDiagrams::ImageHelper.GetImage(resourceManager.GetObject("ObjectifiedFactTypeToolboxBitmap", resourceCulture)), // Image displayed next to the toolbox item.
						"ORM DesignerToolboxTab", // Unique identifier (non-localized) for the toolbox item tab.
						resourceManager.GetString("ORM DesignerToolboxTab", resourceCulture), // Localized display name for the toolbox tab.
						"ObjectifiedFactType", // F1 help keyword for the toolbox item.
						resourceManager.GetString("ObjectifiedFactTypeToolboxTooltip", resourceCulture), // Localized tooltip text for the toolbox item.
						CreateElementToolPrototype(store, global::ORMSolutions.ORMArchitect.Core.ObjectModel.ObjectType.DomainClassId), // ElementGroupPrototype (data object) representing model element on the toolbox.
						new global::System.ComponentModel.ToolboxItemFilterAttribute[] { // Collection of ToolboxItemFilterAttribute objects that determine visibility of the toolbox item.
							new global::System.ComponentModel.ToolboxItemFilterAttribute(ToolboxFilterString, global::System.ComponentModel.ToolboxItemFilterType.Require) 
						}));

					// Add UnaryFactType shape tool.
					toolboxItems.Add(new DslDesign::ModelingToolboxItem(
						"UnaryFactTypeToolboxItem", // Unique identifier (non-localized) for the toolbox item.
						4, // Position relative to other items in the same toolbox tab.
						resourceManager.GetString("UnaryFactTypeToolboxItem", resourceCulture), // Localized display name for the item.
						(global::System.Drawing.Bitmap)DslDiagrams::ImageHelper.GetImage(resourceManager.GetObject("UnaryFactTypeToolboxBitmap", resourceCulture)), // Image displayed next to the toolbox item.
						"ORM DesignerToolboxTab", // Unique identifier (non-localized) for the toolbox item tab.
						resourceManager.GetString("ORM DesignerToolboxTab", resourceCulture), // Localized display name for the toolbox tab.
						"UnaryFactType", // F1 help keyword for the toolbox item.
						resourceManager.GetString("UnaryFactTypeToolboxTooltip", resourceCulture), // Localized tooltip text for the toolbox item.
						CreateElementToolPrototype(store, global::ORMSolutions.ORMArchitect.Core.ObjectModel.FactType.DomainClassId), // ElementGroupPrototype (data object) representing model element on the toolbox.
						new global::System.ComponentModel.ToolboxItemFilterAttribute[] { // Collection of ToolboxItemFilterAttribute objects that determine visibility of the toolbox item.
							new global::System.ComponentModel.ToolboxItemFilterAttribute(ToolboxFilterString, global::System.ComponentModel.ToolboxItemFilterType.Require) 
						}));

					// Add BinaryFactType shape tool.
					toolboxItems.Add(new DslDesign::ModelingToolboxItem(
						"BinaryFactTypeToolboxItem", // Unique identifier (non-localized) for the toolbox item.
						5, // Position relative to other items in the same toolbox tab.
						resourceManager.GetString("BinaryFactTypeToolboxItem", resourceCulture), // Localized display name for the item.
						(global::System.Drawing.Bitmap)DslDiagrams::ImageHelper.GetImage(resourceManager.GetObject("BinaryFactTypeToolboxBitmap", resourceCulture)), // Image displayed next to the toolbox item.
						"ORM DesignerToolboxTab", // Unique identifier (non-localized) for the toolbox item tab.
						resourceManager.GetString("ORM DesignerToolboxTab", resourceCulture), // Localized display name for the toolbox tab.
						"BinaryFactType", // F1 help keyword for the toolbox item.
						resourceManager.GetString("BinaryFactTypeToolboxTooltip", resourceCulture), // Localized tooltip text for the toolbox item.
						CreateElementToolPrototype(store, global::ORMSolutions.ORMArchitect.Core.ObjectModel.FactType.DomainClassId), // ElementGroupPrototype (data object) representing model element on the toolbox.
						new global::System.ComponentModel.ToolboxItemFilterAttribute[] { // Collection of ToolboxItemFilterAttribute objects that determine visibility of the toolbox item.
							new global::System.ComponentModel.ToolboxItemFilterAttribute(ToolboxFilterString, global::System.ComponentModel.ToolboxItemFilterType.Require) 
						}));

					// Add TernaryFactType shape tool.
					toolboxItems.Add(new DslDesign::ModelingToolboxItem(
						"TernaryFactTypeToolboxItem", // Unique identifier (non-localized) for the toolbox item.
						6, // Position relative to other items in the same toolbox tab.
						resourceManager.GetString("TernaryFactTypeToolboxItem", resourceCulture), // Localized display name for the item.
						(global::System.Drawing.Bitmap)DslDiagrams::ImageHelper.GetImage(resourceManager.GetObject("TernaryFactTypeToolboxBitmap", resourceCulture)), // Image displayed next to the toolbox item.
						"ORM DesignerToolboxTab", // Unique identifier (non-localized) for the toolbox item tab.
						resourceManager.GetString("ORM DesignerToolboxTab", resourceCulture), // Localized display name for the toolbox tab.
						"TernaryFactType", // F1 help keyword for the toolbox item.
						resourceManager.GetString("TernaryFactTypeToolboxTooltip", resourceCulture), // Localized tooltip text for the toolbox item.
						CreateElementToolPrototype(store, global::ORMSolutions.ORMArchitect.Core.ObjectModel.FactType.DomainClassId), // ElementGroupPrototype (data object) representing model element on the toolbox.
						new global::System.ComponentModel.ToolboxItemFilterAttribute[] { // Collection of ToolboxItemFilterAttribute objects that determine visibility of the toolbox item.
							new global::System.ComponentModel.ToolboxItemFilterAttribute(ToolboxFilterString, global::System.ComponentModel.ToolboxItemFilterType.Require) 
						}));

					// Add RoleConnector connector tool.
					toolboxItems.Add(new DslDesign::ModelingToolboxItem(
						"RoleConnectorToolboxItem", // Unique identifier (non-localized) for the toolbox item.
						7, // Position relative to other items in the same toolbox tab.
						resourceManager.GetString("RoleConnectorToolboxItem", resourceCulture), // Localized display name for the item.
						(global::System.Drawing.Bitmap)DslDiagrams::ImageHelper.GetImage(resourceManager.GetObject("RoleConnectorToolboxBitmap", resourceCulture)), // Image displayed next to the toolbox item.				
						"ORM DesignerToolboxTab", // Unique identifier (non-localized) for the toolbox item tab.
						resourceManager.GetString("ORM DesignerToolboxTab", resourceCulture), // Localized display name for the toolbox tab.
						"RoleConnector", // F1 help keyword for the toolbox item.
						resourceManager.GetString("RoleConnectorToolboxTooltip", resourceCulture), // Localized tooltip text for the toolbox item.
						null, // Connector toolbox items do not have an underlying data object.
						new global::System.ComponentModel.ToolboxItemFilterAttribute[] { // Collection of ToolboxItemFilterAttribute objects that determine visibility of the toolbox item.
							new global::System.ComponentModel.ToolboxItemFilterAttribute(ToolboxFilterString, global::System.ComponentModel.ToolboxItemFilterType.Require), 
							new global::System.ComponentModel.ToolboxItemFilterAttribute(RoleConnectorFilterString)
						}));

					// Add SubtypeConnector connector tool.
					toolboxItems.Add(new DslDesign::ModelingToolboxItem(
						"SubtypeConnectorToolboxItem", // Unique identifier (non-localized) for the toolbox item.
						8, // Position relative to other items in the same toolbox tab.
						resourceManager.GetString("SubtypeConnectorToolboxItem", resourceCulture), // Localized display name for the item.
						(global::System.Drawing.Bitmap)DslDiagrams::ImageHelper.GetImage(resourceManager.GetObject("SubtypeConnectorToolboxBitmap", resourceCulture)), // Image displayed next to the toolbox item.				
						"ORM DesignerToolboxTab", // Unique identifier (non-localized) for the toolbox item tab.
						resourceManager.GetString("ORM DesignerToolboxTab", resourceCulture), // Localized display name for the toolbox tab.
						"SubtypeConnector", // F1 help keyword for the toolbox item.
						resourceManager.GetString("SubtypeConnectorToolboxTooltip", resourceCulture), // Localized tooltip text for the toolbox item.
						null, // Connector toolbox items do not have an underlying data object.
						new global::System.ComponentModel.ToolboxItemFilterAttribute[] { // Collection of ToolboxItemFilterAttribute objects that determine visibility of the toolbox item.
							new global::System.ComponentModel.ToolboxItemFilterAttribute(ToolboxFilterString, global::System.ComponentModel.ToolboxItemFilterType.Require), 
							new global::System.ComponentModel.ToolboxItemFilterAttribute(SubtypeConnectorFilterString)
						}));

					// Add InternalUniquenessConstraint shape tool.
					toolboxItems.Add(new DslDesign::ModelingToolboxItem(
						"InternalUniquenessConstraintToolboxItem", // Unique identifier (non-localized) for the toolbox item.
						9, // Position relative to other items in the same toolbox tab.
						resourceManager.GetString("InternalUniquenessConstraintToolboxItem", resourceCulture), // Localized display name for the item.
						(global::System.Drawing.Bitmap)DslDiagrams::ImageHelper.GetImage(resourceManager.GetObject("InternalUniquenessConstraintToolboxBitmap", resourceCulture)), // Image displayed next to the toolbox item.
						"ORM DesignerToolboxTab", // Unique identifier (non-localized) for the toolbox item tab.
						resourceManager.GetString("ORM DesignerToolboxTab", resourceCulture), // Localized display name for the toolbox tab.
						"InternalUniquenessConstraint", // F1 help keyword for the toolbox item.
						resourceManager.GetString("InternalUniquenessConstraintToolboxTooltip", resourceCulture), // Localized tooltip text for the toolbox item.
						CreateElementToolPrototype(store, global::ORMSolutions.ORMArchitect.Core.ObjectModel.UniquenessConstraint.DomainClassId), // ElementGroupPrototype (data object) representing model element on the toolbox.
						new global::System.ComponentModel.ToolboxItemFilterAttribute[] { // Collection of ToolboxItemFilterAttribute objects that determine visibility of the toolbox item.
							new global::System.ComponentModel.ToolboxItemFilterAttribute(ToolboxFilterString, global::System.ComponentModel.ToolboxItemFilterType.Require) 
						}));

					// Add ExternalUniquenessConstraint shape tool.
					toolboxItems.Add(new DslDesign::ModelingToolboxItem(
						"ExternalUniquenessConstraintToolboxItem", // Unique identifier (non-localized) for the toolbox item.
						10, // Position relative to other items in the same toolbox tab.
						resourceManager.GetString("ExternalUniquenessConstraintToolboxItem", resourceCulture), // Localized display name for the item.
						(global::System.Drawing.Bitmap)DslDiagrams::ImageHelper.GetImage(resourceManager.GetObject("ExternalUniquenessConstraintToolboxBitmap", resourceCulture)), // Image displayed next to the toolbox item.
						"ORM DesignerToolboxTab", // Unique identifier (non-localized) for the toolbox item tab.
						resourceManager.GetString("ORM DesignerToolboxTab", resourceCulture), // Localized display name for the toolbox tab.
						"ExternalUniquenessConstraint", // F1 help keyword for the toolbox item.
						resourceManager.GetString("ExternalUniquenessConstraintToolboxTooltip", resourceCulture), // Localized tooltip text for the toolbox item.
						CreateElementToolPrototype(store, global::ORMSolutions.ORMArchitect.Core.ObjectModel.UniquenessConstraint.DomainClassId), // ElementGroupPrototype (data object) representing model element on the toolbox.
						new global::System.ComponentModel.ToolboxItemFilterAttribute[] { // Collection of ToolboxItemFilterAttribute objects that determine visibility of the toolbox item.
							new global::System.ComponentModel.ToolboxItemFilterAttribute(ToolboxFilterString, global::System.ComponentModel.ToolboxItemFilterType.Require) 
						}));

					// Add EqualityConstraint shape tool.
					toolboxItems.Add(new DslDesign::ModelingToolboxItem(
						"EqualityConstraintToolboxItem", // Unique identifier (non-localized) for the toolbox item.
						11, // Position relative to other items in the same toolbox tab.
						resourceManager.GetString("EqualityConstraintToolboxItem", resourceCulture), // Localized display name for the item.
						(global::System.Drawing.Bitmap)DslDiagrams::ImageHelper.GetImage(resourceManager.GetObject("EqualityConstraintToolboxBitmap", resourceCulture)), // Image displayed next to the toolbox item.
						"ORM DesignerToolboxTab", // Unique identifier (non-localized) for the toolbox item tab.
						resourceManager.GetString("ORM DesignerToolboxTab", resourceCulture), // Localized display name for the toolbox tab.
						"EqualityConstraint", // F1 help keyword for the toolbox item.
						resourceManager.GetString("EqualityConstraintToolboxTooltip", resourceCulture), // Localized tooltip text for the toolbox item.
						CreateElementToolPrototype(store, global::ORMSolutions.ORMArchitect.Core.ObjectModel.EqualityConstraint.DomainClassId), // ElementGroupPrototype (data object) representing model element on the toolbox.
						new global::System.ComponentModel.ToolboxItemFilterAttribute[] { // Collection of ToolboxItemFilterAttribute objects that determine visibility of the toolbox item.
							new global::System.ComponentModel.ToolboxItemFilterAttribute(ToolboxFilterString, global::System.ComponentModel.ToolboxItemFilterType.Require) 
						}));

					// Add ExclusionConstraint shape tool.
					toolboxItems.Add(new DslDesign::ModelingToolboxItem(
						"ExclusionConstraintToolboxItem", // Unique identifier (non-localized) for the toolbox item.
						12, // Position relative to other items in the same toolbox tab.
						resourceManager.GetString("ExclusionConstraintToolboxItem", resourceCulture), // Localized display name for the item.
						(global::System.Drawing.Bitmap)DslDiagrams::ImageHelper.GetImage(resourceManager.GetObject("ExclusionConstraintToolboxBitmap", resourceCulture)), // Image displayed next to the toolbox item.
						"ORM DesignerToolboxTab", // Unique identifier (non-localized) for the toolbox item tab.
						resourceManager.GetString("ORM DesignerToolboxTab", resourceCulture), // Localized display name for the toolbox tab.
						"ExclusionConstraint", // F1 help keyword for the toolbox item.
						resourceManager.GetString("ExclusionConstraintToolboxTooltip", resourceCulture), // Localized tooltip text for the toolbox item.
						CreateElementToolPrototype(store, global::ORMSolutions.ORMArchitect.Core.ObjectModel.ExclusionConstraint.DomainClassId), // ElementGroupPrototype (data object) representing model element on the toolbox.
						new global::System.ComponentModel.ToolboxItemFilterAttribute[] { // Collection of ToolboxItemFilterAttribute objects that determine visibility of the toolbox item.
							new global::System.ComponentModel.ToolboxItemFilterAttribute(ToolboxFilterString, global::System.ComponentModel.ToolboxItemFilterType.Require) 
						}));

					// Add InclusiveOrConstraint shape tool.
					toolboxItems.Add(new DslDesign::ModelingToolboxItem(
						"InclusiveOrConstraintToolboxItem", // Unique identifier (non-localized) for the toolbox item.
						13, // Position relative to other items in the same toolbox tab.
						resourceManager.GetString("InclusiveOrConstraintToolboxItem", resourceCulture), // Localized display name for the item.
						(global::System.Drawing.Bitmap)DslDiagrams::ImageHelper.GetImage(resourceManager.GetObject("InclusiveOrConstraintToolboxBitmap", resourceCulture)), // Image displayed next to the toolbox item.
						"ORM DesignerToolboxTab", // Unique identifier (non-localized) for the toolbox item tab.
						resourceManager.GetString("ORM DesignerToolboxTab", resourceCulture), // Localized display name for the toolbox tab.
						"InclusiveOrConstraint", // F1 help keyword for the toolbox item.
						resourceManager.GetString("InclusiveOrConstraintToolboxTooltip", resourceCulture), // Localized tooltip text for the toolbox item.
						CreateElementToolPrototype(store, global::ORMSolutions.ORMArchitect.Core.ObjectModel.MandatoryConstraint.DomainClassId), // ElementGroupPrototype (data object) representing model element on the toolbox.
						new global::System.ComponentModel.ToolboxItemFilterAttribute[] { // Collection of ToolboxItemFilterAttribute objects that determine visibility of the toolbox item.
							new global::System.ComponentModel.ToolboxItemFilterAttribute(ToolboxFilterString, global::System.ComponentModel.ToolboxItemFilterType.Require) 
						}));

					// Add ExclusiveOrConstraint shape tool.
					toolboxItems.Add(new DslDesign::ModelingToolboxItem(
						"ExclusiveOrConstraintToolboxItem", // Unique identifier (non-localized) for the toolbox item.
						14, // Position relative to other items in the same toolbox tab.
						resourceManager.GetString("ExclusiveOrConstraintToolboxItem", resourceCulture), // Localized display name for the item.
						(global::System.Drawing.Bitmap)DslDiagrams::ImageHelper.GetImage(resourceManager.GetObject("ExclusiveOrConstraintToolboxBitmap", resourceCulture)), // Image displayed next to the toolbox item.
						"ORM DesignerToolboxTab", // Unique identifier (non-localized) for the toolbox item tab.
						resourceManager.GetString("ORM DesignerToolboxTab", resourceCulture), // Localized display name for the toolbox tab.
						"ExclusiveOrConstraint", // F1 help keyword for the toolbox item.
						resourceManager.GetString("ExclusiveOrConstraintToolboxTooltip", resourceCulture), // Localized tooltip text for the toolbox item.
						CreateElementToolPrototype(store, global::ORMSolutions.ORMArchitect.Core.ObjectModel.ExclusiveOrConstraintCoupler.DomainClassId), // ElementGroupPrototype (data object) representing model element on the toolbox.
						new global::System.ComponentModel.ToolboxItemFilterAttribute[] { // Collection of ToolboxItemFilterAttribute objects that determine visibility of the toolbox item.
							new global::System.ComponentModel.ToolboxItemFilterAttribute(ToolboxFilterString, global::System.ComponentModel.ToolboxItemFilterType.Require) 
						}));

					// Add SubsetConstraint shape tool.
					toolboxItems.Add(new DslDesign::ModelingToolboxItem(
						"SubsetConstraintToolboxItem", // Unique identifier (non-localized) for the toolbox item.
						15, // Position relative to other items in the same toolbox tab.
						resourceManager.GetString("SubsetConstraintToolboxItem", resourceCulture), // Localized display name for the item.
						(global::System.Drawing.Bitmap)DslDiagrams::ImageHelper.GetImage(resourceManager.GetObject("SubsetConstraintToolboxBitmap", resourceCulture)), // Image displayed next to the toolbox item.
						"ORM DesignerToolboxTab", // Unique identifier (non-localized) for the toolbox item tab.
						resourceManager.GetString("ORM DesignerToolboxTab", resourceCulture), // Localized display name for the toolbox tab.
						"SubsetConstraint", // F1 help keyword for the toolbox item.
						resourceManager.GetString("SubsetConstraintToolboxTooltip", resourceCulture), // Localized tooltip text for the toolbox item.
						CreateElementToolPrototype(store, global::ORMSolutions.ORMArchitect.Core.ObjectModel.SubsetConstraint.DomainClassId), // ElementGroupPrototype (data object) representing model element on the toolbox.
						new global::System.ComponentModel.ToolboxItemFilterAttribute[] { // Collection of ToolboxItemFilterAttribute objects that determine visibility of the toolbox item.
							new global::System.ComponentModel.ToolboxItemFilterAttribute(ToolboxFilterString, global::System.ComponentModel.ToolboxItemFilterType.Require) 
						}));

					// Add FrequencyConstraint shape tool.
					toolboxItems.Add(new DslDesign::ModelingToolboxItem(
						"FrequencyConstraintToolboxItem", // Unique identifier (non-localized) for the toolbox item.
						16, // Position relative to other items in the same toolbox tab.
						resourceManager.GetString("FrequencyConstraintToolboxItem", resourceCulture), // Localized display name for the item.
						(global::System.Drawing.Bitmap)DslDiagrams::ImageHelper.GetImage(resourceManager.GetObject("FrequencyConstraintToolboxBitmap", resourceCulture)), // Image displayed next to the toolbox item.
						"ORM DesignerToolboxTab", // Unique identifier (non-localized) for the toolbox item tab.
						resourceManager.GetString("ORM DesignerToolboxTab", resourceCulture), // Localized display name for the toolbox tab.
						"FrequencyConstraint", // F1 help keyword for the toolbox item.
						resourceManager.GetString("FrequencyConstraintToolboxTooltip", resourceCulture), // Localized tooltip text for the toolbox item.
						CreateElementToolPrototype(store, global::ORMSolutions.ORMArchitect.Core.ObjectModel.FrequencyConstraint.DomainClassId), // ElementGroupPrototype (data object) representing model element on the toolbox.
						new global::System.ComponentModel.ToolboxItemFilterAttribute[] { // Collection of ToolboxItemFilterAttribute objects that determine visibility of the toolbox item.
							new global::System.ComponentModel.ToolboxItemFilterAttribute(ToolboxFilterString, global::System.ComponentModel.ToolboxItemFilterType.Require) 
						}));

					// Add RingConstraint shape tool.
					toolboxItems.Add(new DslDesign::ModelingToolboxItem(
						"RingConstraintToolboxItem", // Unique identifier (non-localized) for the toolbox item.
						17, // Position relative to other items in the same toolbox tab.
						resourceManager.GetString("RingConstraintToolboxItem", resourceCulture), // Localized display name for the item.
						(global::System.Drawing.Bitmap)DslDiagrams::ImageHelper.GetImage(resourceManager.GetObject("RingConstraintToolboxBitmap", resourceCulture)), // Image displayed next to the toolbox item.
						"ORM DesignerToolboxTab", // Unique identifier (non-localized) for the toolbox item tab.
						resourceManager.GetString("ORM DesignerToolboxTab", resourceCulture), // Localized display name for the toolbox tab.
						"RingConstraint", // F1 help keyword for the toolbox item.
						resourceManager.GetString("RingConstraintToolboxTooltip", resourceCulture), // Localized tooltip text for the toolbox item.
						CreateElementToolPrototype(store, global::ORMSolutions.ORMArchitect.Core.ObjectModel.RingConstraint.DomainClassId), // ElementGroupPrototype (data object) representing model element on the toolbox.
						new global::System.ComponentModel.ToolboxItemFilterAttribute[] { // Collection of ToolboxItemFilterAttribute objects that determine visibility of the toolbox item.
							new global::System.ComponentModel.ToolboxItemFilterAttribute(ToolboxFilterString, global::System.ComponentModel.ToolboxItemFilterType.Require) 
						}));

					// Add ExternalConstraintConnector connector tool.
					toolboxItems.Add(new DslDesign::ModelingToolboxItem(
						"ExternalConstraintConnectorToolboxItem", // Unique identifier (non-localized) for the toolbox item.
						18, // Position relative to other items in the same toolbox tab.
						resourceManager.GetString("ExternalConstraintConnectorToolboxItem", resourceCulture), // Localized display name for the item.
						(global::System.Drawing.Bitmap)DslDiagrams::ImageHelper.GetImage(resourceManager.GetObject("ExternalConstraintConnectorToolboxBitmap", resourceCulture)), // Image displayed next to the toolbox item.				
						"ORM DesignerToolboxTab", // Unique identifier (non-localized) for the toolbox item tab.
						resourceManager.GetString("ORM DesignerToolboxTab", resourceCulture), // Localized display name for the toolbox tab.
						"ExternalConstraintConnector", // F1 help keyword for the toolbox item.
						resourceManager.GetString("ExternalConstraintConnectorToolboxTooltip", resourceCulture), // Localized tooltip text for the toolbox item.
						null, // Connector toolbox items do not have an underlying data object.
						new global::System.ComponentModel.ToolboxItemFilterAttribute[] { // Collection of ToolboxItemFilterAttribute objects that determine visibility of the toolbox item.
							new global::System.ComponentModel.ToolboxItemFilterAttribute(ToolboxFilterString, global::System.ComponentModel.ToolboxItemFilterType.Require), 
							new global::System.ComponentModel.ToolboxItemFilterAttribute(ExternalConstraintConnectorFilterString)
						}));

					// Add ModelNote shape tool.
					toolboxItems.Add(new DslDesign::ModelingToolboxItem(
						"ModelNoteToolboxItem", // Unique identifier (non-localized) for the toolbox item.
						19, // Position relative to other items in the same toolbox tab.
						resourceManager.GetString("ModelNoteToolboxItem", resourceCulture), // Localized display name for the item.
						(global::System.Drawing.Bitmap)DslDiagrams::ImageHelper.GetImage(resourceManager.GetObject("ModelNoteToolboxBitmap", resourceCulture)), // Image displayed next to the toolbox item.
						"ORM DesignerToolboxTab", // Unique identifier (non-localized) for the toolbox item tab.
						resourceManager.GetString("ORM DesignerToolboxTab", resourceCulture), // Localized display name for the toolbox tab.
						"ModelNote", // F1 help keyword for the toolbox item.
						resourceManager.GetString("ModelNoteToolboxTooltip", resourceCulture), // Localized tooltip text for the toolbox item.
						CreateElementToolPrototype(store, global::ORMSolutions.ORMArchitect.Core.ObjectModel.ModelNote.DomainClassId), // ElementGroupPrototype (data object) representing model element on the toolbox.
						new global::System.ComponentModel.ToolboxItemFilterAttribute[] { // Collection of ToolboxItemFilterAttribute objects that determine visibility of the toolbox item.
							new global::System.ComponentModel.ToolboxItemFilterAttribute(ToolboxFilterString, global::System.ComponentModel.ToolboxItemFilterType.Require) 
						}));

					// Add ModelNoteConnector connector tool.
					toolboxItems.Add(new DslDesign::ModelingToolboxItem(
						"ModelNoteConnectorToolboxItem", // Unique identifier (non-localized) for the toolbox item.
						20, // Position relative to other items in the same toolbox tab.
						resourceManager.GetString("ModelNoteConnectorToolboxItem", resourceCulture), // Localized display name for the item.
						(global::System.Drawing.Bitmap)DslDiagrams::ImageHelper.GetImage(resourceManager.GetObject("ModelNoteConnectorToolboxBitmap", resourceCulture)), // Image displayed next to the toolbox item.				
						"ORM DesignerToolboxTab", // Unique identifier (non-localized) for the toolbox item tab.
						resourceManager.GetString("ORM DesignerToolboxTab", resourceCulture), // Localized display name for the toolbox tab.
						"ModelNoteConnector", // F1 help keyword for the toolbox item.
						resourceManager.GetString("ModelNoteConnectorToolboxTooltip", resourceCulture), // Localized tooltip text for the toolbox item.
						null, // Connector toolbox items do not have an underlying data object.
						new global::System.ComponentModel.ToolboxItemFilterAttribute[] { // Collection of ToolboxItemFilterAttribute objects that determine visibility of the toolbox item.
							new global::System.ComponentModel.ToolboxItemFilterAttribute(ToolboxFilterString, global::System.ComponentModel.ToolboxItemFilterType.Require), 
							new global::System.ComponentModel.ToolboxItemFilterAttribute(ModelNoteConnectorFilterString)
						}));

					t.Rollback();
				}
			}

			return toolboxItems;
		}
コード例 #5
0
		/// <summary>
		/// Returns a list of toolbox items for use with this DSL.
		/// </summary>
		public virtual global::System.Collections.Generic.IList<DslDesign::ModelingToolboxItem> CreateToolboxItems()
		{
			global::System.Collections.Generic.List<DslDesign::ModelingToolboxItem> toolboxItems = new global::System.Collections.Generic.List<DslDesign::ModelingToolboxItem>();
			
			// Create store and load domain models.
			using(DslModeling::Store store = new DslModeling::Store(this.ServiceProvider))
			{
				store.LoadDomainModels(typeof(DslDiagrams::CoreDesignSurfaceDomainModel),
					typeof(global::DmitriNesteruk.AsyncDsl.AsyncDslDomainModel));
				global::System.Resources.ResourceManager resourceManager = global::DmitriNesteruk.AsyncDsl.AsyncDslDomainModel.SingletonResourceManager;
				global::System.Globalization.CultureInfo resourceCulture = global::System.Globalization.CultureInfo.CurrentUICulture;
			
				// Open transaction so we can create model elements corresponding to toolbox items.
				using(DslModeling::Transaction t = store.TransactionManager.BeginTransaction("CreateToolboxItems"))
				{

					// Add Process shape tool.
					toolboxItems.Add(new DslDesign::ModelingToolboxItem(
						"ProcessToolboxItem", // Unique identifier (non-localized) for the toolbox item.
						1, // Position relative to other items in the same toolbox tab.
						resourceManager.GetString("ProcessToolboxItem", resourceCulture), // Localized display name for the item.
						(global::System.Drawing.Bitmap)DslDiagrams::ImageHelper.GetImage(resourceManager.GetObject("ProcessToolboxBitmap", resourceCulture)), // Image displayed next to the toolbox item.
						"AsyncDslToolboxTab", // Unique identifier (non-localized) for the toolbox item tab.
						resourceManager.GetString("AsyncDslToolboxTab", resourceCulture), // Localized display name for the toolbox tab.
						"Process", // F1 help keyword for the toolbox item.
						resourceManager.GetString("ProcessToolboxTooltip", resourceCulture), // Localized tooltip text for the toolbox item.
						CreateElementToolPrototype(store, global::DmitriNesteruk.AsyncDsl.Process.DomainClassId), // ElementGroupPrototype (data object) representing model element on the toolbox.
						new global::System.ComponentModel.ToolboxItemFilterAttribute[] { // Collection of ToolboxItemFilterAttribute objects that determine visibility of the toolbox item.
							new global::System.ComponentModel.ToolboxItemFilterAttribute(ToolboxFilterString, global::System.ComponentModel.ToolboxItemFilterType.Require) 
						}));

					// Add Comment shape tool.
					toolboxItems.Add(new DslDesign::ModelingToolboxItem(
						"CommentToolboxItem", // Unique identifier (non-localized) for the toolbox item.
						2, // Position relative to other items in the same toolbox tab.
						resourceManager.GetString("CommentToolboxItem", resourceCulture), // Localized display name for the item.
						(global::System.Drawing.Bitmap)DslDiagrams::ImageHelper.GetImage(resourceManager.GetObject("CommentToolboxBitmap", resourceCulture)), // Image displayed next to the toolbox item.
						"AsyncDslToolboxTab", // Unique identifier (non-localized) for the toolbox item tab.
						resourceManager.GetString("AsyncDslToolboxTab", resourceCulture), // Localized display name for the toolbox tab.
						"Comment", // F1 help keyword for the toolbox item.
						resourceManager.GetString("CommentToolboxTooltip", resourceCulture), // Localized tooltip text for the toolbox item.
						CreateElementToolPrototype(store, global::DmitriNesteruk.AsyncDsl.Comment.DomainClassId), // ElementGroupPrototype (data object) representing model element on the toolbox.
						new global::System.ComponentModel.ToolboxItemFilterAttribute[] { // Collection of ToolboxItemFilterAttribute objects that determine visibility of the toolbox item.
							new global::System.ComponentModel.ToolboxItemFilterAttribute(ToolboxFilterString, global::System.ComponentModel.ToolboxItemFilterType.Require) 
						}));

					// Add Operation shape tool.
					toolboxItems.Add(new DslDesign::ModelingToolboxItem(
						"OperationToolboxItem", // Unique identifier (non-localized) for the toolbox item.
						3, // Position relative to other items in the same toolbox tab.
						resourceManager.GetString("OperationToolboxItem", resourceCulture), // Localized display name for the item.
						(global::System.Drawing.Bitmap)DslDiagrams::ImageHelper.GetImage(resourceManager.GetObject("OperationToolboxBitmap", resourceCulture)), // Image displayed next to the toolbox item.
						"AsyncDslToolboxTab", // Unique identifier (non-localized) for the toolbox item tab.
						resourceManager.GetString("AsyncDslToolboxTab", resourceCulture), // Localized display name for the toolbox tab.
						"Operation", // F1 help keyword for the toolbox item.
						resourceManager.GetString("OperationToolboxTooltip", resourceCulture), // Localized tooltip text for the toolbox item.
						CreateElementToolPrototype(store, global::DmitriNesteruk.AsyncDsl.Operation.DomainClassId), // ElementGroupPrototype (data object) representing model element on the toolbox.
						new global::System.ComponentModel.ToolboxItemFilterAttribute[] { // Collection of ToolboxItemFilterAttribute objects that determine visibility of the toolbox item.
							new global::System.ComponentModel.ToolboxItemFilterAttribute(ToolboxFilterString, global::System.ComponentModel.ToolboxItemFilterType.Require) 
						}));

					// Add FinishToStartConnector connector tool.
					toolboxItems.Add(new DslDesign::ModelingToolboxItem(
						"FinishToStartConnectorToolboxItem", // Unique identifier (non-localized) for the toolbox item.
						4, // Position relative to other items in the same toolbox tab.
						resourceManager.GetString("FinishToStartConnectorToolboxItem", resourceCulture), // Localized display name for the item.
						(global::System.Drawing.Bitmap)DslDiagrams::ImageHelper.GetImage(resourceManager.GetObject("FinishToStartConnectorToolboxBitmap", resourceCulture)), // Image displayed next to the toolbox item.				
						"AsyncDslToolboxTab", // Unique identifier (non-localized) for the toolbox item tab.
						resourceManager.GetString("AsyncDslToolboxTab", resourceCulture), // Localized display name for the toolbox tab.
						"FinishToStartConnector", // F1 help keyword for the toolbox item.
						resourceManager.GetString("FinishToStartConnectorToolboxTooltip", resourceCulture), // Localized tooltip text for the toolbox item.
						null, // Connector toolbox items do not have an underlying data object.
						new global::System.ComponentModel.ToolboxItemFilterAttribute[] { // Collection of ToolboxItemFilterAttribute objects that determine visibility of the toolbox item.
							new global::System.ComponentModel.ToolboxItemFilterAttribute(ToolboxFilterString, global::System.ComponentModel.ToolboxItemFilterType.Require), 
							new global::System.ComponentModel.ToolboxItemFilterAttribute(FinishToStartConnectorFilterString)
						}));

					// Add Start shape tool.
					toolboxItems.Add(new DslDesign::ModelingToolboxItem(
						"StartToolboxItem", // Unique identifier (non-localized) for the toolbox item.
						5, // Position relative to other items in the same toolbox tab.
						resourceManager.GetString("StartToolboxItem", resourceCulture), // Localized display name for the item.
						(global::System.Drawing.Bitmap)DslDiagrams::ImageHelper.GetImage(resourceManager.GetObject("StartToolboxBitmap", resourceCulture)), // Image displayed next to the toolbox item.
						"AsyncDslToolboxTab", // Unique identifier (non-localized) for the toolbox item tab.
						resourceManager.GetString("AsyncDslToolboxTab", resourceCulture), // Localized display name for the toolbox tab.
						"Start", // F1 help keyword for the toolbox item.
						resourceManager.GetString("StartToolboxTooltip", resourceCulture), // Localized tooltip text for the toolbox item.
						CreateElementToolPrototype(store, global::DmitriNesteruk.AsyncDsl.Start.DomainClassId), // ElementGroupPrototype (data object) representing model element on the toolbox.
						new global::System.ComponentModel.ToolboxItemFilterAttribute[] { // Collection of ToolboxItemFilterAttribute objects that determine visibility of the toolbox item.
							new global::System.ComponentModel.ToolboxItemFilterAttribute(ToolboxFilterString, global::System.ComponentModel.ToolboxItemFilterType.Require) 
						}));

					// Add Finish shape tool.
					toolboxItems.Add(new DslDesign::ModelingToolboxItem(
						"FinishToolboxItem", // Unique identifier (non-localized) for the toolbox item.
						6, // Position relative to other items in the same toolbox tab.
						resourceManager.GetString("FinishToolboxItem", resourceCulture), // Localized display name for the item.
						(global::System.Drawing.Bitmap)DslDiagrams::ImageHelper.GetImage(resourceManager.GetObject("FinishToolboxBitmap", resourceCulture)), // Image displayed next to the toolbox item.
						"AsyncDslToolboxTab", // Unique identifier (non-localized) for the toolbox item tab.
						resourceManager.GetString("AsyncDslToolboxTab", resourceCulture), // Localized display name for the toolbox tab.
						"Finish", // F1 help keyword for the toolbox item.
						resourceManager.GetString("FinishToolboxTooltip", resourceCulture), // Localized tooltip text for the toolbox item.
						CreateElementToolPrototype(store, global::DmitriNesteruk.AsyncDsl.Finish.DomainClassId), // ElementGroupPrototype (data object) representing model element on the toolbox.
						new global::System.ComponentModel.ToolboxItemFilterAttribute[] { // Collection of ToolboxItemFilterAttribute objects that determine visibility of the toolbox item.
							new global::System.ComponentModel.ToolboxItemFilterAttribute(ToolboxFilterString, global::System.ComponentModel.ToolboxItemFilterType.Require) 
						}));

					// Add CommentConnection connector tool.
					toolboxItems.Add(new DslDesign::ModelingToolboxItem(
						"CommentConnectionToolboxItem", // Unique identifier (non-localized) for the toolbox item.
						7, // Position relative to other items in the same toolbox tab.
						resourceManager.GetString("CommentConnectionToolboxItem", resourceCulture), // Localized display name for the item.
						(global::System.Drawing.Bitmap)DslDiagrams::ImageHelper.GetImage(resourceManager.GetObject("CommentConnectionToolboxBitmap", resourceCulture)), // Image displayed next to the toolbox item.				
						"AsyncDslToolboxTab", // Unique identifier (non-localized) for the toolbox item tab.
						resourceManager.GetString("AsyncDslToolboxTab", resourceCulture), // Localized display name for the toolbox tab.
						"CommentConnection", // F1 help keyword for the toolbox item.
						resourceManager.GetString("CommentConnectionToolboxTooltip", resourceCulture), // Localized tooltip text for the toolbox item.
						null, // Connector toolbox items do not have an underlying data object.
						new global::System.ComponentModel.ToolboxItemFilterAttribute[] { // Collection of ToolboxItemFilterAttribute objects that determine visibility of the toolbox item.
							new global::System.ComponentModel.ToolboxItemFilterAttribute(ToolboxFilterString, global::System.ComponentModel.ToolboxItemFilterType.Require), 
							new global::System.ComponentModel.ToolboxItemFilterAttribute(CommentConnectionFilterString)
						}));

					// Add StartToStartConnector connector tool.
					toolboxItems.Add(new DslDesign::ModelingToolboxItem(
						"StartToStartConnectorToolboxItem", // Unique identifier (non-localized) for the toolbox item.
						8, // Position relative to other items in the same toolbox tab.
						resourceManager.GetString("StartToStartConnectorToolboxItem", resourceCulture), // Localized display name for the item.
						(global::System.Drawing.Bitmap)DslDiagrams::ImageHelper.GetImage(resourceManager.GetObject("StartToStartConnectorToolboxBitmap", resourceCulture)), // Image displayed next to the toolbox item.				
						"AsyncDslToolboxTab", // Unique identifier (non-localized) for the toolbox item tab.
						resourceManager.GetString("AsyncDslToolboxTab", resourceCulture), // Localized display name for the toolbox tab.
						"StartToStartConnector", // F1 help keyword for the toolbox item.
						resourceManager.GetString("StartToStartConnectorToolboxTooltip", resourceCulture), // Localized tooltip text for the toolbox item.
						null, // Connector toolbox items do not have an underlying data object.
						new global::System.ComponentModel.ToolboxItemFilterAttribute[] { // Collection of ToolboxItemFilterAttribute objects that determine visibility of the toolbox item.
							new global::System.ComponentModel.ToolboxItemFilterAttribute(ToolboxFilterString, global::System.ComponentModel.ToolboxItemFilterType.Require), 
							new global::System.ComponentModel.ToolboxItemFilterAttribute(StartToStartConnectorFilterString)
						}));

					t.Rollback();
				}
			}

			return toolboxItems;
		}
コード例 #6
0
ファイル: ToolboxHelper.cs プロジェクト: Br3nda/sfdocsamples
        /// <summary>
        /// Returns a list of toolbox items for use with this DSL.
        /// </summary>
        public virtual global::System.Collections.Generic.IList <DslDesign::ModelingToolboxItem> CreateToolboxItems()
        {
            global::System.Collections.Generic.List <DslDesign::ModelingToolboxItem> toolboxItems = new global::System.Collections.Generic.List <DslDesign::ModelingToolboxItem>();

            // Create store and load domain models.
            using (DslModeling::Store store = new DslModeling::Store(this.ServiceProvider))
            {
                store.LoadDomainModels(typeof(DslDiagrams::CoreDesignSurfaceDomainModel),
                                       typeof(global::pelsoft.FWK_Dsl.FWK_DslDomainModel));
                global::System.Resources.ResourceManager resourceManager = global::pelsoft.FWK_Dsl.FWK_DslDomainModel.SingletonResourceManager;
                global::System.Globalization.CultureInfo resourceCulture = global::System.Globalization.CultureInfo.CurrentUICulture;

                // Open transaction so we can create model elements corresponding to toolbox items.
                using (DslModeling::Transaction t = store.TransactionManager.BeginTransaction("CreateToolboxItems"))
                {
                    // Add ModelClass shape tool.
                    toolboxItems.Add(new DslDesign::ModelingToolboxItem(
                                         "ModelClassToolboxItem",                                                                                                                 // Unique identifier (non-localized) for the toolbox item.
                                         1,                                                                                                                                       // Position relative to other items in the same toolbox tab.
                                         resourceManager.GetString("ModelClassToolboxItem", resourceCulture),                                                                     // Localized display name for the item.
                                         (global::System.Drawing.Bitmap)DslDiagrams::ImageHelper.GetImage(resourceManager.GetObject("ModelClassToolboxBitmap", resourceCulture)), // Image displayed next to the toolbox item.
                                         "Class DiagramsToolboxTab",                                                                                                              // Unique identifier (non-localized) for the toolbox item tab.
                                         resourceManager.GetString("Class DiagramsToolboxTab", resourceCulture),                                                                  // Localized display name for the toolbox tab.
                                         "ModelClassF1Keyword",                                                                                                                   // F1 help keyword for the toolbox item.
                                         resourceManager.GetString("ModelClassToolboxTooltip", resourceCulture),                                                                  // Localized tooltip text for the toolbox item.
                                         CreateElementToolPrototype(store, global::pelsoft.FWK_Dsl.ModelClass.DomainClassId),                                                     // ElementGroupPrototype (data object) representing model element on the toolbox.
                                         new global::System.ComponentModel.ToolboxItemFilterAttribute[] {                                                                         // Collection of ToolboxItemFilterAttribute objects that determine visibility of the toolbox item.
                        new global::System.ComponentModel.ToolboxItemFilterAttribute(ToolboxFilterString, global::System.ComponentModel.ToolboxItemFilterType.Require)
                    }));

                    // Add Attribute shape tool.
                    toolboxItems.Add(new DslDesign::ModelingToolboxItem(
                                         "AttributeToolboxItem",                                                                                                                 // Unique identifier (non-localized) for the toolbox item.
                                         2,                                                                                                                                      // Position relative to other items in the same toolbox tab.
                                         resourceManager.GetString("AttributeToolboxItem", resourceCulture),                                                                     // Localized display name for the item.
                                         (global::System.Drawing.Bitmap)DslDiagrams::ImageHelper.GetImage(resourceManager.GetObject("AttributeToolboxBitmap", resourceCulture)), // Image displayed next to the toolbox item.
                                         "Class DiagramsToolboxTab",                                                                                                             // Unique identifier (non-localized) for the toolbox item tab.
                                         resourceManager.GetString("Class DiagramsToolboxTab", resourceCulture),                                                                 // Localized display name for the toolbox tab.
                                         "AttributeF1Keyword",                                                                                                                   // F1 help keyword for the toolbox item.
                                         resourceManager.GetString("AttributeToolboxTooltip", resourceCulture),                                                                  // Localized tooltip text for the toolbox item.
                                         CreateElementToolPrototype(store, global::pelsoft.FWK_Dsl.ModelAttribute.DomainClassId),                                                // ElementGroupPrototype (data object) representing model element on the toolbox.
                                         new global::System.ComponentModel.ToolboxItemFilterAttribute[] {                                                                        // Collection of ToolboxItemFilterAttribute objects that determine visibility of the toolbox item.
                        new global::System.ComponentModel.ToolboxItemFilterAttribute(ToolboxFilterString, global::System.ComponentModel.ToolboxItemFilterType.Require)
                    }));

                    // Add ClassOperation shape tool.
                    toolboxItems.Add(new DslDesign::ModelingToolboxItem(
                                         "ClassOperationToolboxItem",                                                                                                                 // Unique identifier (non-localized) for the toolbox item.
                                         3,                                                                                                                                           // Position relative to other items in the same toolbox tab.
                                         resourceManager.GetString("ClassOperationToolboxItem", resourceCulture),                                                                     // Localized display name for the item.
                                         (global::System.Drawing.Bitmap)DslDiagrams::ImageHelper.GetImage(resourceManager.GetObject("ClassOperationToolboxBitmap", resourceCulture)), // Image displayed next to the toolbox item.
                                         "Class DiagramsToolboxTab",                                                                                                                  // Unique identifier (non-localized) for the toolbox item tab.
                                         resourceManager.GetString("Class DiagramsToolboxTab", resourceCulture),                                                                      // Localized display name for the toolbox tab.
                                         "ClassOperationF1Keyword",                                                                                                                   // F1 help keyword for the toolbox item.
                                         resourceManager.GetString("ClassOperationToolboxTooltip", resourceCulture),                                                                  // Localized tooltip text for the toolbox item.
                                         CreateElementToolPrototype(store, global::pelsoft.FWK_Dsl.ClassOperation.DomainClassId),                                                     // ElementGroupPrototype (data object) representing model element on the toolbox.
                                         new global::System.ComponentModel.ToolboxItemFilterAttribute[] {                                                                             // Collection of ToolboxItemFilterAttribute objects that determine visibility of the toolbox item.
                        new global::System.ComponentModel.ToolboxItemFilterAttribute(ToolboxFilterString, global::System.ComponentModel.ToolboxItemFilterType.Require)
                    }));

                    // Add ModelInterface shape tool.
                    toolboxItems.Add(new DslDesign::ModelingToolboxItem(
                                         "ModelInterfaceToolboxItem",                                                                                                                 // Unique identifier (non-localized) for the toolbox item.
                                         4,                                                                                                                                           // Position relative to other items in the same toolbox tab.
                                         resourceManager.GetString("ModelInterfaceToolboxItem", resourceCulture),                                                                     // Localized display name for the item.
                                         (global::System.Drawing.Bitmap)DslDiagrams::ImageHelper.GetImage(resourceManager.GetObject("ModelInterfaceToolboxBitmap", resourceCulture)), // Image displayed next to the toolbox item.
                                         "Class DiagramsToolboxTab",                                                                                                                  // Unique identifier (non-localized) for the toolbox item tab.
                                         resourceManager.GetString("Class DiagramsToolboxTab", resourceCulture),                                                                      // Localized display name for the toolbox tab.
                                         "ModelInterfaceF1Keyword",                                                                                                                   // F1 help keyword for the toolbox item.
                                         resourceManager.GetString("ModelInterfaceToolboxTooltip", resourceCulture),                                                                  // Localized tooltip text for the toolbox item.
                                         CreateElementToolPrototype(store, global::pelsoft.FWK_Dsl.ModelInterface.DomainClassId),                                                     // ElementGroupPrototype (data object) representing model element on the toolbox.
                                         new global::System.ComponentModel.ToolboxItemFilterAttribute[] {                                                                             // Collection of ToolboxItemFilterAttribute objects that determine visibility of the toolbox item.
                        new global::System.ComponentModel.ToolboxItemFilterAttribute(ToolboxFilterString, global::System.ComponentModel.ToolboxItemFilterType.Require)
                    }));

                    // Add InterfaceOperation shape tool.
                    toolboxItems.Add(new DslDesign::ModelingToolboxItem(
                                         "InterfaceOperationToolboxItem",                                                                                                                 // Unique identifier (non-localized) for the toolbox item.
                                         5,                                                                                                                                               // Position relative to other items in the same toolbox tab.
                                         resourceManager.GetString("InterfaceOperationToolboxItem", resourceCulture),                                                                     // Localized display name for the item.
                                         (global::System.Drawing.Bitmap)DslDiagrams::ImageHelper.GetImage(resourceManager.GetObject("InterfaceOperationToolboxBitmap", resourceCulture)), // Image displayed next to the toolbox item.
                                         "Class DiagramsToolboxTab",                                                                                                                      // Unique identifier (non-localized) for the toolbox item tab.
                                         resourceManager.GetString("Class DiagramsToolboxTab", resourceCulture),                                                                          // Localized display name for the toolbox tab.
                                         "InterfaceOperationF1Keyword",                                                                                                                   // F1 help keyword for the toolbox item.
                                         resourceManager.GetString("InterfaceOperationToolboxTooltip", resourceCulture),                                                                  // Localized tooltip text for the toolbox item.
                                         CreateElementToolPrototype(store, global::pelsoft.FWK_Dsl.InterfaceOperation.DomainClassId),                                                     // ElementGroupPrototype (data object) representing model element on the toolbox.
                                         new global::System.ComponentModel.ToolboxItemFilterAttribute[] {                                                                                 // Collection of ToolboxItemFilterAttribute objects that determine visibility of the toolbox item.
                        new global::System.ComponentModel.ToolboxItemFilterAttribute(ToolboxFilterString, global::System.ComponentModel.ToolboxItemFilterType.Require)
                    }));

                    // Add UnidirectionalAssociation connector tool.
                    toolboxItems.Add(new DslDesign::ModelingToolboxItem(
                                         "UnidirectionalAssociationToolboxItem",                                                                                                                 // Unique identifier (non-localized) for the toolbox item.
                                         6,                                                                                                                                                      // Position relative to other items in the same toolbox tab.
                                         resourceManager.GetString("UnidirectionalAssociationToolboxItem", resourceCulture),                                                                     // Localized display name for the item.
                                         (global::System.Drawing.Bitmap)DslDiagrams::ImageHelper.GetImage(resourceManager.GetObject("UnidirectionalAssociationToolboxBitmap", resourceCulture)), // Image displayed next to the toolbox item.
                                         "Class DiagramsToolboxTab",                                                                                                                             // Unique identifier (non-localized) for the toolbox item tab.
                                         resourceManager.GetString("Class DiagramsToolboxTab", resourceCulture),                                                                                 // Localized display name for the toolbox tab.
                                         "ConnectUnidirectionalAssociationF1Keyword",                                                                                                            // F1 help keyword for the toolbox item.
                                         resourceManager.GetString("UnidirectionalAssociationToolboxTooltip", resourceCulture),                                                                  // Localized tooltip text for the toolbox item.
                                         null,                                                                                                                                                   // Connector toolbox items do not have an underlying data object.
                                         new global::System.ComponentModel.ToolboxItemFilterAttribute[] {                                                                                        // Collection of ToolboxItemFilterAttribute objects that determine visibility of the toolbox item.
                        new global::System.ComponentModel.ToolboxItemFilterAttribute(ToolboxFilterString, global::System.ComponentModel.ToolboxItemFilterType.Require),
                        new global::System.ComponentModel.ToolboxItemFilterAttribute(UnidirectionalAssociationFilterString)
                    }));

                    // Add BidirectionalAssociation connector tool.
                    toolboxItems.Add(new DslDesign::ModelingToolboxItem(
                                         "BidirectionalAssociationToolboxItem",                                                                                                                 // Unique identifier (non-localized) for the toolbox item.
                                         7,                                                                                                                                                     // Position relative to other items in the same toolbox tab.
                                         resourceManager.GetString("BidirectionalAssociationToolboxItem", resourceCulture),                                                                     // Localized display name for the item.
                                         (global::System.Drawing.Bitmap)DslDiagrams::ImageHelper.GetImage(resourceManager.GetObject("BidirectionalAssociationToolboxBitmap", resourceCulture)), // Image displayed next to the toolbox item.
                                         "Class DiagramsToolboxTab",                                                                                                                            // Unique identifier (non-localized) for the toolbox item tab.
                                         resourceManager.GetString("Class DiagramsToolboxTab", resourceCulture),                                                                                // Localized display name for the toolbox tab.
                                         "ConnectBidirectionalAssociationF1Keyword",                                                                                                            // F1 help keyword for the toolbox item.
                                         resourceManager.GetString("BidirectionalAssociationToolboxTooltip", resourceCulture),                                                                  // Localized tooltip text for the toolbox item.
                                         null,                                                                                                                                                  // Connector toolbox items do not have an underlying data object.
                                         new global::System.ComponentModel.ToolboxItemFilterAttribute[] {                                                                                       // Collection of ToolboxItemFilterAttribute objects that determine visibility of the toolbox item.
                        new global::System.ComponentModel.ToolboxItemFilterAttribute(ToolboxFilterString, global::System.ComponentModel.ToolboxItemFilterType.Require),
                        new global::System.ComponentModel.ToolboxItemFilterAttribute(BidirectionalAssociationFilterString)
                    }));

                    // Add Aggregation connector tool.
                    toolboxItems.Add(new DslDesign::ModelingToolboxItem(
                                         "AggregationToolboxItem",                                                                                                                 // Unique identifier (non-localized) for the toolbox item.
                                         8,                                                                                                                                        // Position relative to other items in the same toolbox tab.
                                         resourceManager.GetString("AggregationToolboxItem", resourceCulture),                                                                     // Localized display name for the item.
                                         (global::System.Drawing.Bitmap)DslDiagrams::ImageHelper.GetImage(resourceManager.GetObject("AggregationToolboxBitmap", resourceCulture)), // Image displayed next to the toolbox item.
                                         "Class DiagramsToolboxTab",                                                                                                               // Unique identifier (non-localized) for the toolbox item tab.
                                         resourceManager.GetString("Class DiagramsToolboxTab", resourceCulture),                                                                   // Localized display name for the toolbox tab.
                                         "AggregationF1Keyword",                                                                                                                   // F1 help keyword for the toolbox item.
                                         resourceManager.GetString("AggregationToolboxTooltip", resourceCulture),                                                                  // Localized tooltip text for the toolbox item.
                                         null,                                                                                                                                     // Connector toolbox items do not have an underlying data object.
                                         new global::System.ComponentModel.ToolboxItemFilterAttribute[] {                                                                          // Collection of ToolboxItemFilterAttribute objects that determine visibility of the toolbox item.
                        new global::System.ComponentModel.ToolboxItemFilterAttribute(ToolboxFilterString, global::System.ComponentModel.ToolboxItemFilterType.Require),
                        new global::System.ComponentModel.ToolboxItemFilterAttribute(AggregationFilterString)
                    }));

                    // Add Composition connector tool.
                    toolboxItems.Add(new DslDesign::ModelingToolboxItem(
                                         "CompositionToolboxItem",                                                                                                                 // Unique identifier (non-localized) for the toolbox item.
                                         9,                                                                                                                                        // Position relative to other items in the same toolbox tab.
                                         resourceManager.GetString("CompositionToolboxItem", resourceCulture),                                                                     // Localized display name for the item.
                                         (global::System.Drawing.Bitmap)DslDiagrams::ImageHelper.GetImage(resourceManager.GetObject("CompositionToolboxBitmap", resourceCulture)), // Image displayed next to the toolbox item.
                                         "Class DiagramsToolboxTab",                                                                                                               // Unique identifier (non-localized) for the toolbox item tab.
                                         resourceManager.GetString("Class DiagramsToolboxTab", resourceCulture),                                                                   // Localized display name for the toolbox tab.
                                         "CompositionF1Keyword",                                                                                                                   // F1 help keyword for the toolbox item.
                                         resourceManager.GetString("CompositionToolboxTooltip", resourceCulture),                                                                  // Localized tooltip text for the toolbox item.
                                         null,                                                                                                                                     // Connector toolbox items do not have an underlying data object.
                                         new global::System.ComponentModel.ToolboxItemFilterAttribute[] {                                                                          // Collection of ToolboxItemFilterAttribute objects that determine visibility of the toolbox item.
                        new global::System.ComponentModel.ToolboxItemFilterAttribute(ToolboxFilterString, global::System.ComponentModel.ToolboxItemFilterType.Require),
                        new global::System.ComponentModel.ToolboxItemFilterAttribute(CompositionFilterString)
                    }));

                    // Add Generalization connector tool.
                    toolboxItems.Add(new DslDesign::ModelingToolboxItem(
                                         "GeneralizationToolboxItem",                                                                                                                 // Unique identifier (non-localized) for the toolbox item.
                                         10,                                                                                                                                          // Position relative to other items in the same toolbox tab.
                                         resourceManager.GetString("GeneralizationToolboxItem", resourceCulture),                                                                     // Localized display name for the item.
                                         (global::System.Drawing.Bitmap)DslDiagrams::ImageHelper.GetImage(resourceManager.GetObject("GeneralizationToolboxBitmap", resourceCulture)), // Image displayed next to the toolbox item.
                                         "Class DiagramsToolboxTab",                                                                                                                  // Unique identifier (non-localized) for the toolbox item tab.
                                         resourceManager.GetString("Class DiagramsToolboxTab", resourceCulture),                                                                      // Localized display name for the toolbox tab.
                                         "GeneralizationF1Keyword",                                                                                                                   // F1 help keyword for the toolbox item.
                                         resourceManager.GetString("GeneralizationToolboxTooltip", resourceCulture),                                                                  // Localized tooltip text for the toolbox item.
                                         null,                                                                                                                                        // Connector toolbox items do not have an underlying data object.
                                         new global::System.ComponentModel.ToolboxItemFilterAttribute[] {                                                                             // Collection of ToolboxItemFilterAttribute objects that determine visibility of the toolbox item.
                        new global::System.ComponentModel.ToolboxItemFilterAttribute(ToolboxFilterString, global::System.ComponentModel.ToolboxItemFilterType.Require),
                        new global::System.ComponentModel.ToolboxItemFilterAttribute(GeneralizationFilterString)
                    }));

                    // Add MultipleAssociation shape tool.
                    toolboxItems.Add(new DslDesign::ModelingToolboxItem(
                                         "MultipleAssociationToolboxItem",                                                                                                                 // Unique identifier (non-localized) for the toolbox item.
                                         11,                                                                                                                                               // Position relative to other items in the same toolbox tab.
                                         resourceManager.GetString("MultipleAssociationToolboxItem", resourceCulture),                                                                     // Localized display name for the item.
                                         (global::System.Drawing.Bitmap)DslDiagrams::ImageHelper.GetImage(resourceManager.GetObject("MultipleAssociationToolboxBitmap", resourceCulture)), // Image displayed next to the toolbox item.
                                         "Class DiagramsToolboxTab",                                                                                                                       // Unique identifier (non-localized) for the toolbox item tab.
                                         resourceManager.GetString("Class DiagramsToolboxTab", resourceCulture),                                                                           // Localized display name for the toolbox tab.
                                         "MultipleAssociationF1Keyword",                                                                                                                   // F1 help keyword for the toolbox item.
                                         resourceManager.GetString("MultipleAssociationToolboxTooltip", resourceCulture),                                                                  // Localized tooltip text for the toolbox item.
                                         CreateElementToolPrototype(store, global::pelsoft.FWK_Dsl.MultipleAssociation.DomainClassId),                                                     // ElementGroupPrototype (data object) representing model element on the toolbox.
                                         new global::System.ComponentModel.ToolboxItemFilterAttribute[] {                                                                                  // Collection of ToolboxItemFilterAttribute objects that determine visibility of the toolbox item.
                        new global::System.ComponentModel.ToolboxItemFilterAttribute(ToolboxFilterString, global::System.ComponentModel.ToolboxItemFilterType.Require)
                    }));

                    // Add MultipleAssociationRole connector tool.
                    toolboxItems.Add(new DslDesign::ModelingToolboxItem(
                                         "MultipleAssociationRoleToolboxItem",                                                                                                                 // Unique identifier (non-localized) for the toolbox item.
                                         12,                                                                                                                                                   // Position relative to other items in the same toolbox tab.
                                         resourceManager.GetString("MultipleAssociationRoleToolboxItem", resourceCulture),                                                                     // Localized display name for the item.
                                         (global::System.Drawing.Bitmap)DslDiagrams::ImageHelper.GetImage(resourceManager.GetObject("MultipleAssociationRoleToolboxBitmap", resourceCulture)), // Image displayed next to the toolbox item.
                                         "Class DiagramsToolboxTab",                                                                                                                           // Unique identifier (non-localized) for the toolbox item tab.
                                         resourceManager.GetString("Class DiagramsToolboxTab", resourceCulture),                                                                               // Localized display name for the toolbox tab.
                                         "MultipleAssociationRoleF1Keyword",                                                                                                                   // F1 help keyword for the toolbox item.
                                         resourceManager.GetString("MultipleAssociationRoleToolboxTooltip", resourceCulture),                                                                  // Localized tooltip text for the toolbox item.
                                         null,                                                                                                                                                 // Connector toolbox items do not have an underlying data object.
                                         new global::System.ComponentModel.ToolboxItemFilterAttribute[] {                                                                                      // Collection of ToolboxItemFilterAttribute objects that determine visibility of the toolbox item.
                        new global::System.ComponentModel.ToolboxItemFilterAttribute(ToolboxFilterString, global::System.ComponentModel.ToolboxItemFilterType.Require),
                        new global::System.ComponentModel.ToolboxItemFilterAttribute(MultipleAssociationRoleFilterString)
                    }));

                    // Add AssociationClassRelationship connector tool.
                    toolboxItems.Add(new DslDesign::ModelingToolboxItem(
                                         "AssociationClassRelationshipToolboxItem",                                                                                                                 // Unique identifier (non-localized) for the toolbox item.
                                         13,                                                                                                                                                        // Position relative to other items in the same toolbox tab.
                                         resourceManager.GetString("AssociationClassRelationshipToolboxItem", resourceCulture),                                                                     // Localized display name for the item.
                                         (global::System.Drawing.Bitmap)DslDiagrams::ImageHelper.GetImage(resourceManager.GetObject("AssociationClassRelationshipToolboxBitmap", resourceCulture)), // Image displayed next to the toolbox item.
                                         "Class DiagramsToolboxTab",                                                                                                                                // Unique identifier (non-localized) for the toolbox item tab.
                                         resourceManager.GetString("Class DiagramsToolboxTab", resourceCulture),                                                                                    // Localized display name for the toolbox tab.
                                         "AssociationClassRelationshipF1Keyword",                                                                                                                   // F1 help keyword for the toolbox item.
                                         resourceManager.GetString("AssociationClassRelationshipToolboxTooltip", resourceCulture),                                                                  // Localized tooltip text for the toolbox item.
                                         null,                                                                                                                                                      // Connector toolbox items do not have an underlying data object.
                                         new global::System.ComponentModel.ToolboxItemFilterAttribute[] {                                                                                           // Collection of ToolboxItemFilterAttribute objects that determine visibility of the toolbox item.
                        new global::System.ComponentModel.ToolboxItemFilterAttribute(ToolboxFilterString, global::System.ComponentModel.ToolboxItemFilterType.Require),
                        new global::System.ComponentModel.ToolboxItemFilterAttribute(AssociationClassRelationshipFilterString)
                    }));

                    // Add Comment shape tool.
                    toolboxItems.Add(new DslDesign::ModelingToolboxItem(
                                         "CommentToolboxItem",                                                                                                                 // Unique identifier (non-localized) for the toolbox item.
                                         14,                                                                                                                                   // Position relative to other items in the same toolbox tab.
                                         resourceManager.GetString("CommentToolboxItem", resourceCulture),                                                                     // Localized display name for the item.
                                         (global::System.Drawing.Bitmap)DslDiagrams::ImageHelper.GetImage(resourceManager.GetObject("CommentToolboxBitmap", resourceCulture)), // Image displayed next to the toolbox item.
                                         "Class DiagramsToolboxTab",                                                                                                           // Unique identifier (non-localized) for the toolbox item tab.
                                         resourceManager.GetString("Class DiagramsToolboxTab", resourceCulture),                                                               // Localized display name for the toolbox tab.
                                         "CommentF1Keyword",                                                                                                                   // F1 help keyword for the toolbox item.
                                         resourceManager.GetString("CommentToolboxTooltip", resourceCulture),                                                                  // Localized tooltip text for the toolbox item.
                                         CreateElementToolPrototype(store, global::pelsoft.FWK_Dsl.Comment.DomainClassId),                                                     // ElementGroupPrototype (data object) representing model element on the toolbox.
                                         new global::System.ComponentModel.ToolboxItemFilterAttribute[] {                                                                      // Collection of ToolboxItemFilterAttribute objects that determine visibility of the toolbox item.
                        new global::System.ComponentModel.ToolboxItemFilterAttribute(ToolboxFilterString, global::System.ComponentModel.ToolboxItemFilterType.Require)
                    }));

                    // Add CommentsReferenceTypes connector tool.
                    toolboxItems.Add(new DslDesign::ModelingToolboxItem(
                                         "CommentsReferenceTypesToolboxItem",                                                                                                                 // Unique identifier (non-localized) for the toolbox item.
                                         15,                                                                                                                                                  // Position relative to other items in the same toolbox tab.
                                         resourceManager.GetString("CommentsReferenceTypesToolboxItem", resourceCulture),                                                                     // Localized display name for the item.
                                         (global::System.Drawing.Bitmap)DslDiagrams::ImageHelper.GetImage(resourceManager.GetObject("CommentsReferenceTypesToolboxBitmap", resourceCulture)), // Image displayed next to the toolbox item.
                                         "Class DiagramsToolboxTab",                                                                                                                          // Unique identifier (non-localized) for the toolbox item tab.
                                         resourceManager.GetString("Class DiagramsToolboxTab", resourceCulture),                                                                              // Localized display name for the toolbox tab.
                                         "CommentsReferenceTypesF1Keyword",                                                                                                                   // F1 help keyword for the toolbox item.
                                         resourceManager.GetString("CommentsReferenceTypesToolboxTooltip", resourceCulture),                                                                  // Localized tooltip text for the toolbox item.
                                         null,                                                                                                                                                // Connector toolbox items do not have an underlying data object.
                                         new global::System.ComponentModel.ToolboxItemFilterAttribute[] {                                                                                     // Collection of ToolboxItemFilterAttribute objects that determine visibility of the toolbox item.
                        new global::System.ComponentModel.ToolboxItemFilterAttribute(ToolboxFilterString, global::System.ComponentModel.ToolboxItemFilterType.Require),
                        new global::System.ComponentModel.ToolboxItemFilterAttribute(CommentsReferenceTypesFilterString)
                    }));

                    t.Rollback();
                }
            }

            return(toolboxItems);
        }