protected override IEnumerable <ListItem <EnumType> > GetStandardItems() { foreach (EnumType item in Enum.GetValues(typeof(EnumType))) { yield return(new ListItem <EnumType>(ST.EnumToString(item), item)); } }
public override List <ToolStripItem> CustomTabMenuItems() { if (MindMapChart == null) { return(base.CustomTabMenuItems()); } if (MenuLayout == null) { MenuLayout = new ToolStripMenuItem(Lang._("Layout Type")); // foreach (MindMapLayoutType layout in Enum.GetValues(typeof(MindMapLayoutType))) { ToolStripMenuItem menuLayout = new ToolStripMenuItem(); menuLayout.Text = ST.EnumToString(layout); menuLayout.Tag = layout; menuLayout.Image = MindMapLayoutTypeEditor.GetIcon(layout); menuLayout.Click += new EventHandler(MenuLayout_Click); MenuLayout.DropDownItems.Add(menuLayout); } } foreach (ToolStripMenuItem mi in MenuLayout.DropDownItems) { mi.Checked = (MindMapLayoutType)mi.Tag == MindMapChart.LayoutType; mi.Enabled = !ReadOnly; } List <ToolStripItem> list = new List <ToolStripItem>(); list.Add(MenuLayout); return(list); }
void RefreshList() { Items.Clear(); foreach (T value in Enum.GetValues(typeof(T))) { Items.Add(new ListItem <T>(ST.EnumToString <T>(value), value)); } }
public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType) { if (destinationType == typeof(string)) { return(ST.EnumToString <EnumType>((EnumType)value)); } return(base.ConvertTo(context, culture, value, destinationType)); }
internal static string _ConvertToString(MindMapLayoutType lt) { return(ST.EnumToString(lt)); //switch (lt) //{ // case MindMapLayoutType.MindMap: // return LanguageManage.GetText("Mind Map Chart"); // case MindMapLayoutType.OrganizationDown: // return LanguageManage.GetText("Organization Chart (Down)"); // case MindMapLayoutType.OrganizationUp: // return LanguageManage.GetText("Organization Chart (Up)"); // case MindMapLayoutType.TreeLeft: // return LanguageManage.GetText("Tree Chart (Left)"); // case MindMapLayoutType.TreeRight: // return LanguageManage.GetText("Tree Chart (Right)"); // case MindMapLayoutType.LogicLeft: // return LanguageManage.GetText("Logic Chart (Left)"); // case MindMapLayoutType.LogicRight: // return LanguageManage.GetText("Logic Chart (Right)"); // default: // return lt.ToString(); //} }