Exemplo n.º 1
0
 public override string GetLocalizedString(StringId id)
 {
     try
     {
         var ret = DomainUtils.GetPopMenuValue(id.ToString().Replace("StringId.", string.Empty));
         if (string.IsNullOrEmpty(ret) || ret.Equals(id))
         {
             ret = base.GetLocalizedString(id);
         }
         return(ret);
     }
     catch
     {
         return(base.GetLocalizedString(id));
     }
 }
Exemplo n.º 2
0
Arquivo: XGrid.cs Projeto: JWPLAY/AUBE
        private void GridViewPopupMenuShowing(object sender, PopupMenuShowingEventArgs e)
        {
            try
            {
                var menu = e.Menu as GridViewMenu;
                if (menu == null)
                {
                    return;
                }
                if (e.MenuType == GridMenuType.Column && e.HitInfo.InColumn)
                {
                    menu.Items.Add(new DXMenuItem(DomainUtils.GetPopMenuValue("MenuColumnFrameLeftFix"), new EventHandler(GridViewMenuClicked))
                    {
                        BeginGroup = true,
                        Tag        = new XGridMenuItem()
                        {
                            Name = "FrameLeftFix", Column = e.HitInfo.Column, GridHitInfo = e.HitInfo
                        }
                    });

                    menu.Items.Add(new DXMenuItem(DomainUtils.GetPopMenuValue("MenuColumnFrameRightFix"), new EventHandler(GridViewMenuClicked))
                    {
                        Tag = new XGridMenuItem()
                        {
                            Name = "FrameRightFix", Column = e.HitInfo.Column, GridHitInfo = e.HitInfo
                        }
                    });

                    menu.Items.Add(new DXMenuItem(DomainUtils.GetPopMenuValue("MenuColumnLeftFix"), new EventHandler(GridViewMenuClicked))
                    {
                        Tag = new XGridMenuItem()
                        {
                            Name = "LeftFix", Column = e.HitInfo.Column, GridHitInfo = e.HitInfo
                        }
                    });

                    menu.Items.Add(new DXMenuItem(DomainUtils.GetPopMenuValue("MenuColumnRightFix"), new EventHandler(GridViewMenuClicked))
                    {
                        Tag = new XGridMenuItem()
                        {
                            Name = "RightFix", Column = e.HitInfo.Column, GridHitInfo = e.HitInfo
                        }
                    });

                    menu.Items.Add(new DXMenuItem(DomainUtils.GetPopMenuValue("MenuColumnUnFix"), new EventHandler(GridViewMenuClicked))
                    {
                        Tag = new XGridMenuItem()
                        {
                            Name = "UnFix", Column = e.HitInfo.Column, GridHitInfo = e.HitInfo
                        }
                    });

                    menu.Items.Add(new DXMenuItem(DomainUtils.GetPopMenuValue("MenuColumnsUnFix"), new EventHandler(GridViewMenuClicked))
                    {
                        Tag = new XGridMenuItem()
                        {
                            Name = "UnFixAll", Column = e.HitInfo.Column, GridHitInfo = e.HitInfo
                        }
                    });

                    menu.Items.Add(new DXMenuItem(DomainUtils.GetPopMenuValue("MenuSaveLayout"), new EventHandler(GridViewMenuClicked))
                    {
                        BeginGroup = true,
                        Tag        = new XGridMenuItem()
                        {
                            Name = "SaveLayout", Column = e.HitInfo.Column, GridHitInfo = e.HitInfo
                        }
                    });

                    menu.Items.Add(new DXMenuItem(DomainUtils.GetPopMenuValue("MenuDeleteLayout"), new EventHandler(GridViewMenuClicked))
                    {
                        Tag = new XGridMenuItem()
                        {
                            Name = "DeleteLayout", Column = e.HitInfo.Column, GridHitInfo = e.HitInfo
                        }
                    });

                    menu.Items.Add(new DXMenuItem(DomainUtils.GetPopMenuValue("MenuExportExcel"), new EventHandler(GridViewMenuClicked))
                    {
                        BeginGroup = true,
                        Tag        = new XGridMenuItem()
                        {
                            Name = "ExportExcel", Column = e.HitInfo.Column, GridHitInfo = e.HitInfo
                        }
                    });

                    menu.Items.Add(new DXMenuItem(DomainUtils.GetPopMenuValue("MenuCellMerge"), new EventHandler(GridViewMenuClicked))
                    {
                        BeginGroup = true,
                        Tag        = new XGridMenuItem()
                        {
                            Name = "CellMerge", Column = e.HitInfo.Column, GridHitInfo = e.HitInfo
                        }
                    });

                    if (e.HitInfo.Column.RealColumnEdit.GetType() == typeof(RepositoryItemCheckEdit) &&
                        e.HitInfo.Column.OptionsColumn.AllowEdit == true &&
                        e.HitInfo.Column.OptionsColumn.ReadOnly == false)
                    {
                        menu.Items.Add(new DXMenuItem(DomainUtils.GetPopMenuValue("MenuCheckAll"), new EventHandler(GridViewMenuClicked))
                        {
                            BeginGroup = true,
                            Tag        = new XGridMenuItem()
                            {
                                Name = "CheckAll", Column = e.HitInfo.Column, GridHitInfo = e.HitInfo
                            }
                        });
                        menu.Items.Add(new DXMenuItem(DomainUtils.GetPopMenuValue("MenuUnCheckAll"), new EventHandler(GridViewMenuClicked))
                        {
                            Tag = new XGridMenuItem()
                            {
                                Name = "UnCheckAll", Column = e.HitInfo.Column, GridHitInfo = e.HitInfo
                            }
                        });
                    }
                }

                if (e.MenuType == GridMenuType.Row && e.HitInfo.InRowCell)
                {
                    menu.Items.Add(new DXMenuItem(DomainUtils.GetPopMenuValue("MenuCopyCell"), new EventHandler(GridViewMenuClicked))
                    {
                        Tag = new XGridMenuItem()
                        {
                            Name = "CopyCell", Column = e.HitInfo.Column, GridHitInfo = e.HitInfo
                        }
                    });
                }
            }
            catch
            {
                throw;
            }
        }