예제 #1
0
        /// <summary>
        /// Check In Node
        /// </summary>
        private void ACTION_CheckInNode()
        {
            VXmlNode new_node = null;
            string   fname    = VSUICommonFunctions.SelectFile(DEFX.KEY_SNAP, "Select snap file for check-in", "Snap files (*." + DEFX.XML_EXPORT_FILE_TYPE + ")|*." + DEFX.XML_EXPORT_FILE_TYPE);

            if (fname != "")
            {
                VXmlNode n     = cont.GetNode(VSLib.ConvertStringToLong(tvCat.SelectedNode.Name));
                bool     state = true;
                tsNode.Text = "Checking in " + fname + " ...";

                Application.DoEvents();

                cont.Begin();
                try
                {
                    new_node = n.ChargeIn(fname);
                }
                catch (VXmlException e1)
                {
                    state = false;
                    MessageBox.Show(e1.Message, "Error", MessageBoxButtons.OK);
                }
                cont.Commit();
                if (state)
                {
                    SHOW_NodeInTree(new_node);
                }
            }
        }
예제 #2
0
        /// <summary>
        /// Load XML
        /// </summary>
        private void ACTION_LoadXML()
        {
            string fname = VSUICommonFunctions.SelectFile(DEFX.KEY_LOAD_XML, "Select XML file for load", "XML files (*.xml" + ")|*.xml");

            if (fname != "")
            {
                VXmlNode n = cont.GetNode(VSLib.ConvertStringToLong(tvCat.SelectedNode.Name));
                tsNode.Text = "Loading " + fname + " ...";
                Application.DoEvents();
                Cursor.Current = Cursors.WaitCursor;
                cont.Begin();
                string rc = "";
                try
                {
                    if (n.NodeTypeCode == DEFX.NODE_TYPE_DOCUMENT)
                    {
                        VXmlDocument d = (VXmlDocument )cont.GetNode(n.Id);
                        rc = d.Load(fname);
                    }
                    else
                    {
                        rc = n.Load(fname);
                    }
                }
                catch (VXmlException e1)
                {
                    rc = e1.Message;
                }

                if (rc == "")
                {
                    cont.Commit();
                    SHOW_NodeInTree(n);
                }
                else
                {
                    cont.RollBack();
                    MessageBox.Show(rc, "Load error", MessageBoxButtons.OK);
                }
            }
            Cursor.Current = Cursors.Default;
            SELECT_Node();
        }
예제 #3
0
        /// <summary>
        /// View XML
        /// </summary>
        private void ACTION_ViewXML()
        {
            VXmlNode n = cont.GetNode(VSLib.ConvertStringToLong(tvCat.SelectedNode.Name));

            VSUICommonFunctions.DisplayText(n.Name, n.Xml);
        }