public static string CreateExtension(IBaseEnum baseEnum) { AxEnumExtension axExtension; axExtension = BaseEnumHelper.GetFirstExtension(baseEnum.Name); if (axExtension != null) { // Add existing extension to project & quit Common.CommonUtil.AddElementToProject(axExtension); return(axExtension.Name); } var name = baseEnum.Name; // + Common.Constants.DotEXTENSION; name = Common.CommonUtil.GetNextBaseEnumExtension(name); //Create an extension object axExtension = new AxEnumExtension() { Name = name }; //var tableExts = metaModelProviders.CurrentMetadataProvider.TableExtensions.Common.CommonUtil.GetCurrentModel().Name); Common.CommonUtil.GetMetaModelProviders() .CurrentMetadataProvider .EnumExtensions.Create(axExtension, Common.CommonUtil.GetCurrentModelSaveInfo()); // Add to project Common.CommonUtil.AddElementToProject(axExtension); return(name); }
public static string CreateExtension(IBaseEnum baseEnum) { var name = baseEnum.Name + Common.Constants.DotEXTENSION; name = Common.CommonUtil.GetNextBaseEnumExtension(name); // Find current model //Create menu item in the right model var metaModelProviders = ServiceLocator.GetService(typeof(IMetaModelProviders)) as IMetaModelProviders; //Create an extension object var axExtension = new AxEnumExtension() { Name = name }; //var tableExts = metaModelProviders.CurrentMetadataProvider.TableExtensions.Common.CommonUtil.GetCurrentModel().Name); Common.CommonUtil.GetMetaModelProviders() .CurrentMetadataProvider .EnumExtensions.Create(axExtension, Common.CommonUtil.GetCurrentModelSaveInfo()); // Add to project Common.CommonUtil.AddElementToProject(axExtension); return(name); }