예제 #1
0
        public bool SaveAs(GCTNode node, bool writeInfo)
        {
            if (dlgSave.ShowDialog(this) != DialogResult.OK)
                return false;

            string path = dlgSave.FileName;
            if (!String.IsNullOrEmpty(path))
            {
                try
                {
                    node.Children.Clear();
                    foreach (ListViewItem e in lstCodes.Items)
                        if (e.Checked)
                            node.Children.Add(e.Tag as GCTCodeEntryNode);

                    if (Path.GetExtension(path).ToUpper() == ".TXT")
                        node.ToTXT(path);
                    else
                    {
                        node._writeInfo = writeInfo;
                        node.Merge();
                        node.Export(node._origPath = path);
                        node.IsDirty = false;
                        txtPath.Text = path;
                    }
                    return true;
                }
                catch { return false; }
            }
            return false;
        }
예제 #2
0
        public bool Save(GCTNode node, bool writeInfo)
        {
            try
            {
                if (String.IsNullOrEmpty(node._origPath))
                    return SaveAs(node, writeInfo);

                node.Children.Clear();
                foreach (ListViewItem e in lstCodes.Items)
                    if (e.Checked)
                        node.Children.Add(e.Tag as GCTCodeEntryNode);

                node._writeInfo = writeInfo;
                node.Merge();
                node.Export(TargetNode._origPath);
                node.IsDirty = false;
                return true;
            }
            catch
            {
                return false;
            }
        }