protected ResXEditorListViewContent(ResXData data) : base(data)
        {
            store = new Gtk.ListStore(typeof(ResXNode));
            store.Data[ResXDataKey] = data;
            treeView = new Gtk.TreeView(store)
            {
                EnableGridLines = Gtk.TreeViewGridLines.Both,
            };
            crt = new Gtk.CellRendererText();

            treeView.ButtonPressEvent += OnTreeViewButtonPress;
            foreach (var node in data.Nodes)
            {
                names.Add(node.Name);
                if (SkipNode(node))
                {
                    continue;
                }

                store.InsertWithValues(-1, node);
            }

            AddPlaceholder();

            AddTreeViewColumns();
        }
示例#2
0
        protected override void OnDataChanged(ResXData data)
        {
            base.OnDataChanged(data);

            store.Clear();

            foreach (var node in data.Nodes)
            {
                names.Add(node.Name);
                if (SkipNode(node))
                {
                    continue;
                }

                var row = store.AddRow();
                OnAddValues(store, row, node);
            }

            AddPlaceholder();
        }
示例#3
0
        static void HandleDocumentOpened(object sender, DocumentEventArgs e)
        {
            var document = e.Document;

            if (document == null ||
                !document.IsFile ||
                !".resx".Equals(document.FileName.Extension, StringComparison.OrdinalIgnoreCase) ||
                DesktopService.GetMimeTypeForUri(document.FileName) != "text/microsoft-resx")
            {
                return;
            }

            // Load resx data.
            var resx  = ResXData.FromFile(document.FileName);
            int index = 0;

            foreach (var editor in AddinManager.GetExtensionObjects <ResXEditorBinding>(ResXEditorsExtensionPath))
            {
                var viewContent = editor.CreateViewContent(resx);
                document.Window.InsertViewContent(index++, viewContent);
            }
        }
 public ResXEditorStringsViewContent(ResXData data) : base(data)
 {
     treeView.ShowAll();
 }
示例#5
0
 protected ResXEditorViewContent(ResXData data)
 {
     Data = data;
 }
 public ResXEditorOtherViewContent(ResXData data) : base(data)
 {
     treeView.ShowAll();
 }
 public ResXEditorImageViewContent(ResXData data) : base(data)
 {
     box = new Gtk.HBox();
     box.Add(new Gtk.Label("Hello world"));
     box.ShowAll();
 }
 public abstract ResXEditorViewContent CreateViewContent(ResXData data);
 public override ResXEditorViewContent CreateViewContent(ResXData data)
 {
     return(new ResXEditorOtherViewContent(data));
 }
示例#10
0
 protected internal abstract ResXEditorViewContent CreateViewContent(List <ResXData> data, ResXData mainResx);