예제 #1
0
        public void GetFile(NodeFile nfi)
        {
            CommAddress ad = new CommAddress();

            NodeBase[] ndarr = new NodeBase[1];
            ndarr[0] = nfi;

            if ((nfi is NodeFile))
            {
                NodeData nd = new NodeData("x");
                nd.DataType  = scsm_MMS_TypeEnum.visible_string;
                nd.DataValue = nfi.Name;
                //    EditValue ev = new EditValue(nd);
                //      System.Windows.Forms.DialogResult r = ev.ShowDialog();
                //if (r == System.Windows.Forms.DialogResult.OK)
                //{
                //    ad.Variable = nd.StringValue;
                //    nfi.NameSet4Test(ad.Variable);
                //}
                ad.Variable = nfi.Name;
                nfi.NameSet4Test(ad.Variable);
            }
            nfi.Reset();
            iecs.Send(ndarr, ad, ActionRequested.OpenFile);
        }
예제 #2
0
        public void FileDelete(NodeFile nfi)
        {
            CommAddress ad = new CommAddress();

            NodeBase[] ndarr = new NodeBase[1];
            ndarr[0] = nfi;
            //nfi.NameSet4Test("anyfile.icd");
            nfi.Reset();
            iecs.Send(ndarr, ad, ActionRequested.FileDelete);
        }
예제 #3
0
        void OnFileSaveClick(object sender, EventArgs e)
        {
            NodeFile       nfi = (NodeFile)(sender as ToolStripItem).Tag;
            SaveFileDialog fd  = new SaveFileDialog();

            fd.FileName = nfi.Name;
            if (fd.ShowDialog() == DialogResult.OK)
            {
                try
                {
                    nfi.SaveFile(fd.FileName);
                    nfi.FileReady = false;
                }
                catch
                {
                    MessageBox.Show("An error saving MMS file " + nfi.FullName + " to file " + fd.FileName);
                }
            }
        }