protected virtual void CreateQuickLinkBar()
        {
            if (Mode != ObjectListMode.ObjectList)
            {
                return;
            }

            try
            {
                var entityQuickItems = GetEntityLinkMenuItems();
                if (entityQuickItems != null && entityQuickItems.Count > 0)
                {
                    var quickLink = new SubListMenuItem
                    {
                        Name             = "SubListMenuItemQuickLink",
                        IsDynamicBarItem = true,
                        Caption          = StringResources.QuickLink,
                        ImageSmall       = ImageResources.DCLQuickLink16.GetBitmapImage(),
                        ImageLarge       = ImageResources.DCLQuickLink32.GetBitmapImage(),
                        GlyphAlignment   = GlyphAlignmentType.Top,
                        DisplayMode      = DisplayModeType.Default,
                        Priority         = 1000,
                        IsEnable         = true
                    };
                    var quickBar = new BarItem
                    {
                        Caption          = StringResources.QuickLink,
                        Priority         = 1000,
                        Name             = "BarItemQuickLink",
                        IsDynamicBarItem = true
                    };

                    foreach (var mi in entityQuickItems)
                    {
                        var cmi = (mi as CommonMenuItemBase);
                        if (cmi != null)
                        {
                            cmi.GlyphSize = GlyphSizeType.Small;
                        }
                        quickLink.MenuItems.Add(mi);
                    }

                    quickLink.MenuItems.Add(new SeparatorMenuItem());

                    quickBar.MenuItems.Add(quickLink);
                    Menu.Bars.Add(quickBar);
                }
            }
            catch (Exception ex)
            {
                if (!ExceptionHandler(ex, ExceptionResources.ContextMenuError))
                {
                    throw;
                }
            }
        }
Exemplo n.º 2
0
        private void InitializeMenu()
        {
            if (Menu == null)
            {
                Menu = new MenuViewModel("iwbposinput");
            }

            var  barProcess  = Menu.GetOrCreateBarItem("Actions");
            bool isBatchNeed = !string.IsNullOrEmpty(ParentViewModel.BatchcodeWorkflowCode);

            if (isBatchNeed)
            {
                var btnBatchOps = new SubListMenuItem
                {
                    Caption    = "Batch-код",
                    ImageSmall = ImageResources.DCLBatchProcessFull16.GetBitmapImage(),
                    ImageLarge = ImageResources.DCLBatchProcessFull32.GetBitmapImage(),
                    Command    = BatchProcessCommand
                };
                barProcess.MenuItems.Add(btnBatchOps);

                var btnParseBatchCode = new CommandMenuItem
                {
                    Caption    = "Расшифровать",
                    Command    = ShowBatchCommand,
                    ImageSmall = ImageResources.DCLBatchProcessParse16.GetBitmapImage(),
                    ImageLarge = ImageResources.DCLBatchProcessParse32.GetBitmapImage()
                };
                btnBatchOps.MenuItems.Add(btnParseBatchCode);

                var btnApplyBatchCode = new CommandMenuItem
                {
                    Caption    = "Применить",
                    Command    = ApplyBatchCommand,
                    ImageSmall = ImageResources.DCLBatchProcessApply16.GetBitmapImage(),
                    ImageLarge = ImageResources.DCLBatchProcessApply32.GetBitmapImage()
                };
                btnBatchOps.MenuItems.Add(btnApplyBatchCode);
            }

            var btnChangeSku = new CommandMenuItem
            {
                Caption        = StringResources.ChangeOvxSkuCaption,
                Command        = ParentViewModel.ChangeSkuParamsCommand,
                ImageSmall     = ImageResources.DCLChangeOvxSku16.GetBitmapImage(),
                ImageLarge     = ImageResources.DCLChangeOvxSku32.GetBitmapImage(),
                GlyphAlignment = GlyphAlignmentType.Top,
                DisplayMode    = DisplayModeType.Default,
            };

            barProcess.MenuItems.Add(btnChangeSku);
        }
Exemplo n.º 3
0
        private void InitializeMenu()
        {
            if (Menu == null)
            {
                Menu = new MenuViewModel("iwbposinput");
            }

            if (CanUseBatch)
            {
                var actionMenu  = Menu.GetOrCreateBarItem("Actions");
                var btnBatchOps = new SubListMenuItem
                {
                    Caption    = StringResources.BatchCodeBarCaption,
                    ImageSmall = ImageResources.DCLBatchProcessFull16.GetBitmapImage(),
                    ImageLarge = ImageResources.DCLBatchProcessFull32.GetBitmapImage(),
                    Command    = BatchProcessCommand
                };
                actionMenu.MenuItems.Add(btnBatchOps);

                var btnParseBatchCode = new CommandMenuItem
                {
                    Caption    = StringResources.Decrypt,
                    Command    = ShowBatchCommand,
                    ImageSmall = ImageResources.DCLBatchProcessParse16.GetBitmapImage(),
                    ImageLarge = ImageResources.DCLBatchProcessParse32.GetBitmapImage()
                };
                btnBatchOps.MenuItems.Add(btnParseBatchCode);

                var btnApplyBatchCode = new CommandMenuItem
                {
                    Caption    = StringResources.Accept,
                    Command    = ApplyBatchCommand,
                    ImageSmall = ImageResources.DCLBatchProcessApply16.GetBitmapImage(),
                    ImageLarge = ImageResources.DCLBatchProcessApply32.GetBitmapImage()
                };
                btnBatchOps.MenuItems.Add(btnApplyBatchCode);
            }

            var barChangeOvxSku = Menu.GetOrCreateBarItem(StringResources.SkuCaption, 3);

            barChangeOvxSku.MenuItems.Add(new CommandMenuItem
            {
                Caption        = StringResources.ChangeOvxSkuCaption,
                Command        = ChangeOvxSkuCommand,
                ImageSmall     = ImageResources.DCLChangeOvxSku16.GetBitmapImage(),
                ImageLarge     = ImageResources.DCLChangeOvxSku32.GetBitmapImage(),
                GlyphAlignment = GlyphAlignmentType.Top,
                DisplayMode    = DisplayModeType.Default,
                Priority       = 2
            });
        }