src/Misc/EFTools/EntityDesignEntityDesigner/GeneratedCode/ToolboxHelper.cs
/// <summary>
/// Given a toolbox item "unique ID" and a data format identifier, returns the content of
/// the data format. 
/// </summary>
/// <param name="itemId">The unique ToolboxItem to retrieve data for</param>
/// <param name="format">The desired format of the resulting data</param>
Given a toolbox item "unique ID" and a data format identifier, returns the content of
the data format.
Given a toolbox item " unique ID " and a data format identifier returns the content of the data format .
public virtual object GetToolboxItemData(string itemId, DataFormats.Format format)
		{
			DslDesign::ModelingToolboxItem item = null;
			global::System.Resources.ResourceManager resourceManager = global::Microsoft.Data.Entity.Design.EntityDesigner.MicrosoftDataEntityDesignDomainModel.SingletonResourceManager;
			global::System.Globalization.CultureInfo resourceCulture = global::System.Globalization.CultureInfo.CurrentUICulture;
			System.Windows.Forms.IDataObject tbxDataObj;
			item = GetToolboxItem(itemId);
			if (item != null)
			{
				ToolboxItemContainer container = new ToolboxItemContainer(item);
				tbxDataObj = container.ToolboxData;
				if (tbxDataObj.GetDataPresent(format.Name))
				{
					return tbxDataObj.GetData(format.Name);
				}
				else 
				{
					string invalidFormatString = resourceManager.GetString("UnsupportedToolboxFormat", resourceCulture);
					throw new InvalidOperationException(string.Format(resourceCulture, invalidFormatString, format.Name));
				}
			}
			string errorFormatString = resourceManager.GetString("UnresolvedToolboxItem", resourceCulture);
			throw new InvalidOperationException(string.Format(resourceCulture, errorFormatString, itemId));
		}
public virtual object GetToolboxItemData ( string itemId , DataFormats . Format format ) { DslDesign :: ModelingToolboxItem item = null ; global :: System . Resources . ResourceManager resourceManager = global :: Microsoft . Data . Entity . Design . EntityDesigner . MicrosoftDataEntityDesignDomainModel . SingletonResourceManager ; global :: System . Globalization . CultureInfo resourceCulture = global :: System . Globalization . CultureInfo . CurrentUICulture ; System . Windows . Forms . IDataObject tbxDataObj ; item = GetToolboxItem ( itemId ) ; if ( item != null ) { ToolboxItemContainer container = new ToolboxItemContainer ( item ) ; tbxDataObj = container . ToolboxData ; if ( tbxDataObj . GetDataPresent ( format . Name ) ) { return tbxDataObj . GetData ( format . Name ) ; } else { string invalidFormatString = resourceManager . GetString ( " " , resourceCulture ) ; throw new InvalidOperationException ( string . Format ( resourceCulture , invalidFormatString , format . Name ) ) ; } } string errorFormatString = resourceManager . GetString ( " " , resourceCulture ) ; throw new InvalidOperationException ( string . Format ( resourceCulture , errorFormatString , itemId ) ) ; }
Given a toolbox item "unique ID" and a data format identifier, returns the content of
the data format.
Given a toolbox item " unique ID " and a data format identifier returns the content of the data format .
//get the toolbox item
itemId
string
The unique ToolboxItem to retrieve data for
The unique ToolboxItem to retrieve data for
format
DataFormats.Format
The desired format of the resulting data
The desired format of the resulting data