private static RibbonButton AddSmallButton(PlinesFunction function) { try { var ribbonToolTip = new RibbonToolTip { IsHelpEnabled = false, Content = function.Description, Command = function.Name, Title = function.LocalName }; var ribbonButton = new RibbonButton { CommandParameter = function.Name, Name = function.Name, CommandHandler = new RibbonCommandHandler(), Orientation = Orientation.Horizontal, Size = RibbonItemSize.Standard, ShowImage = true, ShowText = false, ToolTip = ribbonToolTip, Image = _colorTheme == 1 ? function.ImageSmall : function.ImageDarkSmall }; return(ribbonButton); } catch (Exception) { return(null); } }
public List <PlinesFunction> GetListOfFunctions() { var list = new List <PlinesFunction>(); // mpPl-3Dto2D var func = new PlinesFunction { Name = "mpPl-3Dto2D", LocalName = Language.GetItem(LangItem, "l1"), Description = Language.GetItem(LangItem, "d1"), P2D = false, P3D = true, Plw = false }; list.Add(func); // mpPl-VxMatchRemove func = new PlinesFunction { Name = "mpPl-VxMatchRemove", LocalName = Language.GetItem(LangItem, "l2"), Description = Language.GetItem(LangItem, "d2"), P2D = true, P3D = true, Plw = true }; list.Add(func); // mpPl-VxCollin func = new PlinesFunction { Name = "mpPl-VxCollin", LocalName = Language.GetItem(LangItem, "l3"), Description = Language.GetItem(LangItem, "d3"), P2D = true, P3D = true, Plw = true }; list.Add(func); // mpPl-ObjectToVx func = new PlinesFunction { Name = "mpPl-ObjectToVx", LocalName = Language.GetItem(LangItem, "l4"), Description = Language.GetItem(LangItem, "d4"), P2D = false, P3D = false, Plw = true }; list.Add(func); // mpPl-Arc2Line func = new PlinesFunction { Name = "mpPl-Arc2Line", LocalName = Language.GetItem(LangItem, "l5"), Description = Language.GetItem(LangItem, "d5"), P2D = false, P3D = false, Plw = true }; list.Add(func); // mpPl-Line2Arc func = new PlinesFunction { Name = "mpPl-Line2Arc", LocalName = Language.GetItem(LangItem, "l6"), Description = Language.GetItem(LangItem, "d6"), P2D = false, P3D = false, Plw = true }; list.Add(func); // mpPl-AddVertex func = new PlinesFunction { Name = "mpPl-AddVertex", LocalName = Language.GetItem(LangItem, "l7"), Description = Language.GetItem(LangItem, "d8"), P2D = false, P3D = false, Plw = true }; list.Add(func); // mpPl-Rect3Pt func = new PlinesFunction { Name = "mpPl-Rect3Pt", LocalName = Language.GetItem(LangItem, "l8"), Description = Language.GetItem(LangItem, "l8"), P2D = false, P3D = false, Plw = true }; list.Add(func); // mpPl-NoArc func = new PlinesFunction { Name = "mpPl-NoArc", LocalName = Language.GetItem(LangItem, "l9"), Description = Language.GetItem(LangItem, "d9"), P2D = false, P3D = false, Plw = true }; list.Add(func); // mpPl-MiddleLine func = new PlinesFunction { Name = "mpPl-MiddleLine", LocalName = Language.GetItem(LangItem, "l10"), Description = Language.GetItem(LangItem, "d10"), P2D = true, P3D = true, Plw = true }; list.Add(func); // icons foreach (var plinesFunction in list) { plinesFunction.ImageBig = new BitmapImage(new Uri( "pack://application:,,,/mpPlinesEdit_" + ModPlusConnector.Instance.AvailProductExternalVersion + ";component/Icons/" + plinesFunction.Name + "_32x32.png")); plinesFunction.ImageSmall = new BitmapImage(new Uri( "pack://application:,,,/mpPlinesEdit_" + ModPlusConnector.Instance.AvailProductExternalVersion + ";component/Icons/" + plinesFunction.Name + "_16x16.png")); plinesFunction.ImageDarkSmall = new BitmapImage(new Uri( "pack://application:,,,/mpPlinesEdit_" + ModPlusConnector.Instance.AvailProductExternalVersion + ";component/Icons/" + plinesFunction.Name + "_16x16_dark.png")); } return(list); }