Esempio n. 1
0
        public ModuleDescription(string moduleGroup, List <MenuDescription> menus)
        {
            this.ModuleGroup = moduleGroup;
            this.Menus       = menus;

            this.Icon = DXImageHelper.GetImageSource(DXImages.Open, ImageSize.Size32x32);
        }
        /// <summary>
        /// Show grid menu event handler
        /// </summary>
        /// <param name="sender">The sender object</param>
        /// <param name="e">Event arguments</param>
        private void ShowGridMenu(object sender, GridMenuEventArgs e)
        {
            if (e.MenuType != GridMenuType.Column)
            {
                return;
            }

            // Remove the Column Chooser menu item.
            e.Customizations.Add(new RemoveBarItemAndLinkAction()
            {
                ItemName = DefaultColumnMenuItemNames.ColumnChooser
            });

            // Create a custom menu item and add it to the context menu.
            var barButtonItem = new BarButtonItem();

            barButtonItem.Name             = "toggleHighlight";
            barButtonItem.Content          = "Toggle Highlight";
            barButtonItem.Command          = this.Command;
            barButtonItem.CommandParameter = e.MenuInfo.Column;

            barButtonItem.Glyph = DXImageHelper.GetImageSource(@"Images/Conditional Formatting/HighlightCellsRules_16x16.png");

            barButtonItem.SetValue(BarItemLinkActionBase.ItemLinkIndexProperty, 0);

            e.Customizations.Add(barButtonItem);
        }
Esempio n. 3
0
 public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
 {
     if (value != null)
     {
         if ((bool)value)
         {
             return(DXImageHelper.GetImageSource(@"Office2013\Actions\Show_16x16.png"));
         }
     }
     return(null);
 }
        protected override MenuViewModel CreateMenu()
        {
            var menu    = base.CreateMenu();
            var barEdit = menu.Bars.Single(i => i.Name == "Edit");

            var biSave = _entityViewModelFactory.Create <BarButtonInfo>();

            biSave.Caption    = "Save";
            biSave.Command    = new DelegateCommand(Save);
            biSave.SmallGlyph = DXImageHelper.GetImageSource(DevExpress.Images.DXImages.Save, ImageSize.Size16x16);
            biSave.LargeGlyph = DXImageHelper.GetImageSource(DevExpress.Images.DXImages.Save, ImageSize.Size32x32);
            barEdit.Commands.Add(biSave);

            return(menu);
        }
Esempio n. 5
0
        private void GetNodeList()
        {
            AppDomain currentAppDomain = AppDomain.CurrentDomain;

            typeList = new List <ToolboxItem>();
            //var tumcmsAssembly2 = currentAppDomain.GetAssemblies().ToList();
            var tumcmsAssembly = currentAppDomain.GetAssemblies().FirstOrDefault(x => x.FullName == "TUM.CMS.VplControl, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null");

            var tempTypeList = new List <Type>();

            tempTypeList.AddRange(Utilities.GetTypesInNamespace(tumcmsAssembly, "TUM.CMS.VplControl.Nodes").Where(type => !type.IsAbstract && !type.Name.Contains("<>")).ToList());

            var test = DXImageHelper.GetImageSource("Add", ImageSize.Size16x16, ImageType.Colored);

            typeList = tempTypeList.OrderBy(x => x.Name).Select(x => new ToolboxItem()
            {
                Name  = x.Name,
                Image = test,
                Type  = x
            }).ToList();
        }
 private void InitSampleData()
 {
     // TODO:之后改成从专门的数据层中获取数据填充
     this.ModuleList = new List <ModuleDescription>()
     {
         new ModuleDescription("模块A", new List <MenuDescription>()
         {
             new MenuDescription("用户管理")
             {
                 DocumnetType = ViewIndex.UserList, Icon = DXImageHelper.GetImageSource(DXImages.Currency, ImageSize.Size16x16)
             },
             new MenuDescription("角色管理"),
             new MenuDescription("测试页面")
         }),
         new ModuleDescription("模块B", new List <MenuDescription>()
         {
             new MenuDescription("功能菜单4"),
             new MenuDescription("功能菜单5")
         })
     };
 }
Esempio n. 7
0
        public static ImageSource GetImageSource(string name, ImageSize size)
        {
            try
            {
                return(DXImageHelper.GetImageSource(name, size));
            }
            catch
            {
            }
            Bitmap      bitmap      = Properties.Resources.ResourceManager.GetObject(name + ((size == ImageSize.Size16x16) ? "_16x16" : "_32x32")) as Bitmap;
            BitmapImage bitmapImage = new BitmapImage();

            using (MemoryStream memory = new MemoryStream())
            {
                bitmap.Save(memory, ImageFormat.Png);
                memory.Position = 0;
                bitmapImage.BeginInit();
                bitmapImage.StreamSource = memory;
                bitmapImage.CacheOption  = BitmapCacheOption.OnLoad;
                bitmapImage.EndInit();
            }
            return(bitmapImage);
        }
Esempio n. 8
0
        public MenuDescription(string menuTitle)
        {
            this.MenuTitle = menuTitle;

            this.Icon = DXImageHelper.GetImageSource(DXImages.Apply, ImageSize.Size16x16);
        }