예제 #1
0
 public void LoadCommand(string file, JobCommand cmd)
 {
     m_jobconn = new JobConnection(file);
     m_cmd     = m_jobconn.GetCommand(cmd.GroupId);
     RefreshFactories();
     RefreshConfigs();
 }
예제 #2
0
        private void CopyCommand(AppObject appobj, int d, bool deleteold)
        {
            var cmdobj = appobj as JobCommandAppObject;
            var cmd    = cmdobj.GetCommand();
            int idx    = IndexInParent;

            Parent.JobConn.Reload();

            if (idx < 0)
            {
                Parent.Command.m_commands.Insert(0, cmd.Clone(true));
            }
            else if (idx + d >= Parent.Command.m_commands.Count)
            {
                Parent.Command.m_commands.Add(cmd.Clone(true));
            }
            else
            {
                Parent.Command.m_commands.Insert(idx + d, cmd.Clone(true));
            }
            Parent.JobConn.SaveToFile();
            if (deleteold)
            {
                var parconn = new JobConnection(cmdobj.JobFile);
                parconn.GetJob().Root.m_commands.RemoveIf(c => c.GroupId == cmd.GroupId);
                parconn.SaveToFile();
                cmdobj.CallCompleteChanged();
            }
            Parent.CompleteRefresh();
        }
예제 #3
0
 public JobCommandEditorFrame(JobConnection jobconn, JobCommand command)
 {
     InitializeComponent();
     m_jobconn = jobconn;
     m_command = command;
     propertyFrame1.SelectedObject = m_command;
 }
예제 #4
0
 public JobReportFrame(string file)
 {
     InitializeComponent();
     m_jobconn = new JobConnection(file);
     m_job     = m_jobconn.GetJob();
     RefreshFactories();
     RefreshConfigs();
 }
예제 #5
0
        private void EditCommand(Dictionary <string, string> args)
        {
            Job           job     = Job.LoadFromFile(args["job"]);
            JobConnection jobconn = new JobConnection(args["job"]);
            JobCommand    cmd     = job.Root.FindCommand(args["cmd"]);

            cmd.Edit(jobconn);
        }
예제 #6
0
 public JobCommandTreeNode(PolyCommandTreeNode parent, JobConnection jobconn, JobCommand command)
     : base(parent, command.GroupId)
 {
     m_command = command;
     m_jobconn = jobconn;
     SetAppObject(new JobCommandAppObject {
         JobFile = jobconn.FileName, CommandGroupId = command.GroupId
     });
 }
예제 #7
0
 public virtual void Edit(JobConnection jobconn)
 {
     MainWindow.Instance.OpenContent(new JobCommandEditorFrame(jobconn, this));
 }
예제 #8
0
 public JobTreeNode(ITreeNode parent, IFileHandler fhandler)
     : base(parent, fhandler)
 {
     m_jobconn = new JobConnection(fhandler.FileObject.DataDiskPath);
 }
예제 #9
0
 public PolyCommandTreeNode(ITreeNode parent, JobConnection jobconn)
     : base(parent, "commands")
 {
     m_jobconn = jobconn;
 }
예제 #10
0
 public PolyCommandTreeNode(ITreeNode parent, JobConnection jobconn, JobPolyCommand command)
     : base(parent, command.GroupId)
 {
     m_command = command;
     m_jobconn = jobconn;
 }
예제 #11
0
 public static ITreeNode GetCommandTreeNode(PolyCommandTreeNode parent, JobCommand command, JobConnection jobconn)
 {
     if (command is JobPolyCommand)
     {
         return(new PolyCommandTreeNode(parent, jobconn, (JobPolyCommand)command));
     }
     else
     {
         return(new JobCommandTreeNode(parent, jobconn, command));
     }
 }
예제 #12
0
        public JobCommand GetCommand()
        {
            var conn = new JobConnection(JobFile);

            return(conn.GetCommand(CommandGroupId));
        }