Пример #1
0
 public virtual void Localize()
 {
     if (Bar != null)
     {
         GuiService.Localize(this, Bar.Name, Name);
     }
 }
Пример #2
0
        public static ILayoutCellEditor GetCellEditor(ILayoutCell cell)
        {
            var type = cell?.DataType;

            if (type == null)
            {
                return(null);
            }
            type = TypeHelper.CheckNullable(type);
            ILayoutCellEditor editor = null;

            if (CellEditorFabric.TryGetValue(type, out var generator))
            {
                editor = generator(cell);
            }
            if (editor == null)
            {
                foreach (var entry in CellEditorFabric)
                {
                    if (TypeHelper.IsBaseType(type, entry.Key))
                    {
                        editor = entry.Value(cell);
                    }
                }
            }

            //if (type.IsEnum)
            //{
            //    editor = new CellEditorEnum();
            //}
            if (editor == null)
            {
                if (TypeHelper.IsList(type))
                {
                    editor = new CellEditorFields()
                    {
                        Header = type.Name
                    };
                }
                else if (GuiService.IsCompound(type))
                {
                    editor = new CellEditorFields()
                    {
                        Header = type.Name
                    };
                }
                else
                {
                    editor = new CellEditorText()
                    {
                        Format         = cell.Format,
                        MultiLine      = false,
                        DropDownWindow = false
                    };
                }
            }
            editor.DataType = type;
            return(editor);
        }
Пример #3
0
        public override void Localize()
        {
            GuiService.Localize(toolLoad, "LogExplorer", "Load", GlyphType.FolderOpen);
            GuiService.Localize(toolSave, "LogExplorer", "Save", GlyphType.SaveAlias);
            GuiService.Localize(this, "LogExplorer", "Logs", GlyphType.InfoCircle);

            list.Localize();
        }
Пример #4
0
        public override void Localize()
        {
            base.Localize();
            var name = GetType().Name;

            GuiService.Localize(this, name, "Localize Editor");
            GuiService.Localize(toolLoadImages, name, "Load Images");
            GuiService.Localize(toolSave, name, "Save", GlyphType.SaveAlias);
        }
Пример #5
0
        public override void Localize()
        {
            base.Localize();
            if (fields != null)
            {
                fields.Localize();
            }
            list.Localize();

            GuiService.Localize(this, lockName, "Property Editor", GlyphType.Pencil);
        }
Пример #6
0
        public DockBoxHitTest DockHitTest(double x, double y, double size)
        {
            var htest = new DockBoxHitTest();

            foreach (DockItem item in items.GetVisibleItems())
            {
                if (item.Bound.Contains(x, y))
                {
                    htest.Item  = item;
                    htest.Bound = item.Bound;
                    break;
                }
            }
            if (htest.Item != null)
            {
                var rect = Rectangle.Zero;
                htest.Align      = GuiService.GetAlignRect(htest.Item.Bound, size, x, y, ref rect);
                htest.AlignBound = rect;
            }
            return(htest);
        }
Пример #7
0
 public override void Localize()
 {
     base.Localize();
     GuiService.Localize(this, GetType().Name, "Localize Editor");
 }