예제 #1
0
        private void AddAllButton_click(object sender, EventArgs e)
        {
            foreach (TreeNode cn in treeView1.Nodes)
            {
                NodeManager.ClearColor(cn);
            }
            foreach (TreeNode cn in treeView2.Nodes)
            {
                NodeManager.ClearColor(cn);
            }
            var data = new NodeData();

            data.KeyName          = KeyEdit.Text;
            data.Text             = ValueEdit.Text;
            data.Comment          = MasterCommentEdit.Text;
            data.TranslateComment = TranslateCommentEdit.Text;

            var selectedResxNode = treeView1.Nodes[0];

            NodeManager.AddNewNodeToTreeNode(true, data, selectedResxNode, true);
            var nodes = treeView2.Nodes;

            foreach (TreeNode tn in nodes)
            {
                NodeManager.AddNewNodeToTreeNode(true, data, tn, false);
            }

            AddAllButton.Visible  = false;
            ControlsPanel.Visible = false;
            treeView1.Sort();
            treeView2.Sort();
        }
예제 #2
0
 private void AddButton_Click(object sender, EventArgs e)
 {
     foreach (TreeNode cn in treeView1.Nodes)
     {
         NodeManager.ClearColor(cn);
     }
     foreach (TreeNode cn in treeView2.Nodes)
     {
         NodeManager.ClearColor(cn);
     }
     openFileDialog.FileName = "*Strings.resx";
     if (openFileDialog.ShowDialog() == DialogResult.OK)
     {
         string addingGenericResxFile = openFileDialog.FileName;
         NodeManager.AddResxToTreeView(true, baseResxFile, addingGenericResxFile, null, treeView1, GenerateMissingCheckbox.Checked, MergeCb.Checked, true);
         var languages = NodeManager.GetLanguages();
         foreach (string language in languages)
         {
             string fileName = NodeManager.LangToFileName(addingGenericResxFile, language);
             if (File.Exists(fileName))
             {
                 NodeManager.AddResxToTreeView(true, baseResxFile, addingGenericResxFile, language, treeView2, GenerateMissingCheckbox.Checked, MergeCb.Checked, false);
             }
         }
         NewButton.Visible = true;
     }
 }
예제 #3
0
        private void ApplyChangeButton_click(object sender, EventArgs e)
        {
            foreach (TreeNode cn in treeView1.Nodes)
            {
                NodeManager.ClearColor(cn);
            }
            foreach (TreeNode cn in treeView2.Nodes)
            {
                NodeManager.ClearColor(cn);
            }

            this.Cursor = Cursors.WaitCursor;
            var data = new NodeData();

            data.KeyName          = KeyEdit.Text;
            data.Text             = ValueEdit.Text;
            data.Comment          = MasterCommentEdit.Text;
            data.TranslateComment = TranslateCommentEdit.Text;

            var parentNode = treeView1.Nodes[0];

            NodeManager.SetNodeData(data, parentNode, true);
            var nodes = treeView2.Nodes;

            foreach (TreeNode tn in nodes)
            {
                NodeManager.SetNodeData(data, tn, false);
            }
            this.Cursor = Cursors.Default;
        }
예제 #4
0
 private void SaveButton_click(object sender, EventArgs e)
 {
     foreach (TreeNode cn in treeView1.Nodes)
     {
         NodeManager.ClearColor(cn);
     }
     foreach (TreeNode cn in treeView2.Nodes)
     {
         NodeManager.ClearColor(cn);
     }
     NodeManager.SaveAllFiles(treeView1, treeView2);
 }
예제 #5
0
 private void PasteTddButton_Click(object sender, EventArgs e)
 {
     foreach (TreeNode cn in treeView1.Nodes)
     {
         NodeManager.ClearColor(cn);
     }
     foreach (TreeNode cn in treeView2.Nodes)
     {
         NodeManager.ClearColor(cn);
     }
     this.Cursor = Cursors.WaitCursor;
     NodeManager.InsertUpdateNodeTddClipboard(selectedNode, treeView2, MergeCb.Checked);
     this.Cursor = Cursors.Default;
 }