Exemplo n.º 1
0
        private void InstanceOnAtmlObjectNameChanged(object sender, AtmlNameChangedEventArgs atmlNameChangedEventArgs)
        {
            string oldName = atmlNameChangedEventArgs.OldName;
            string newName = atmlNameChangedEventArgs.NewName;
            //LoadTree();
            TreeNode node   = FindNodeByFileName(testSetNavigationTree.Nodes, oldName);
            TreeNode parent = node.Parent;
            var      fi     = node.Tag as FileInfo;

            node.Remove();
            AddNode(parent, new FileInfo(Path.Combine(fi.DirectoryName, newName)));
            testSetNavigationTree.SelectedNode = node;
        }
Exemplo n.º 2
0
        private void InstanceOnAtmlObjectNameChanged(object sender, AtmlNameChangedEventArgs atmlNameChangedEventArgs)
        {
            string   oldName  = atmlNameChangedEventArgs.OldName;
            string   newName  = atmlNameChangedEventArgs.NewName;
            string   uuid     = atmlNameChangedEventArgs.Uuid;
            Document document = DocumentManager.GetDocument(uuid);

            if (document != null && _currentTestProgramSet != null)
            {
                string path = Path.Combine(ATMLContext.TESTSET_PATH, _currentTestProgramSet.TestSetName, "atml");
                FileManager.WriteFile(Path.Combine(path, newName), document.DocumentContent);
                FileManager.DeleteFile(Path.Combine(path, oldName));
            }
        }
        protected virtual void OnAtmlObjectNameChanged(string oldName, string newName, string uuid,
                                                       AtmlFileType fileType)
        {
            AtmlNameChangedEventHandler handler = AtmlObjectNameChanged;
            var args = new AtmlNameChangedEventArgs();

            args.OldName      = oldName;
            args.NewName      = newName;
            args.AtmlFileType = fileType;
            args.Uuid         = uuid;
            if (handler != null)
            {
                handler(this, args);
            }
        }