Example #1
0
 /// <summary>
 /// Constructor
 /// </summary>
 public ProcessModel()
 {
     ProcessId           = ProjectModel.NewId();
     ProcessType         = ProcessType.None;
     Timeout             = 30;
     ScrollSpeed         = 1;
     BeforeWaitMilliTime = 0;
     AfterWaitMilliTime  = 0;
     ScrollAmount        = 2;
     ScrollCount         = 1;
     Mail_AttachList     = new Dictionary <int, string>();
     Mail_AttachList.Add(0, "");
     Mail_AttachList.Add(1, "");
     Mail_AttachList.Add(2, "");
     Mail_AttachList.Add(3, "");
     Mail_AttachList.Add(4, "");
     CaptureImage = new Dictionary <int, Bitmap>();
     CaptureImage.Add(0, null);
     CaptureImage.Add(1, null);
     CaptureImage.Add(2, null);
     CaptureImage.Add(3, null);
     CaptureImage.Add(4, null);
     CaptureImage.Add(5, null);
     CaptureImage.Add(6, null);
     CaptureImage.Add(7, null);
     CaptureImage.Add(8, null);
     CaptureImage.Add(9, null);
     CaptureImageByte = new Dictionary <int, byte[]>();
     CaptureImageByte.Add(0, null);
     CaptureImageByte.Add(1, null);
     CaptureImageByte.Add(2, null);
     CaptureImageByte.Add(3, null);
     CaptureImageByte.Add(4, null);
     CaptureImageByte.Add(5, null);
     CaptureImageByte.Add(6, null);
     CaptureImageByte.Add(7, null);
     CaptureImageByte.Add(8, null);
     CaptureImageByte.Add(9, null);
     ExcelJobList = new Dictionary <int, ExcelJobModel>();
     ExcelJobList.Add(0, new ExcelJobModel(FileReadWriteType.Read, "", "", ""));
     UrlParam = new Dictionary <string, string>();
 }
Example #2
0
        /// <summary>
        /// 全てのIDを振りなおす
        /// </summary>
        internal void RenewId()
        {
            try
            {
                this.ProjectId = NewId();
                Dictionary <string, string> idDic = new Dictionary <string, string>();
                foreach (var process in ProcessModelList)
                {
                    string newID = ProjectModel.NewId();
                    idDic.Add(process.ProcessId, newID);
                    process.ProcessId = newID;
                }
                foreach (var macro in MacroModelList)
                {
                    string newID = ProjectModel.NewId();
                    idDic.Add(macro.ProjectId, newID);
                    macro.ProjectId = newID;
                    foreach (var process in macro.ProcessModelList)
                    {
                        newID = ProjectModel.NewId();
                        idDic.Add(process.ProcessId, newID);
                        process.ProcessId = newID;
                    }
                }
                foreach (var process in ProcessModelList)
                {
                    if (process.NextProcess != null)
                    {
                        if (idDic.ContainsKey(process.NextProcess.ProcessId))
                        {
                            process.NextProcess.ProcessId = idDic[process.NextProcess.ProcessId];
                        }
                    }
                    if (process.ErrorProcess != null)
                    {
                        if (idDic.ContainsKey(process.ErrorProcess.ProcessId))
                        {
                            process.ErrorProcess.ProcessId = idDic[process.ErrorProcess.ProcessId];
                        }
                    }
                }
                for (int i = 0; i < NodeIdList.Count; i++)
                {
                    if (idDic.ContainsKey(NodeIdList[i]))
                    {
                        NodeIdList[i] = idDic[NodeIdList[i]];
                    }
                }

                for (int x = 0; x < MacroModelList.Count; x++)
                {
                    var macro = MacroModelList[x];
                    foreach (var process in macro.ProcessModelList)
                    {
                        if (process.NextProcess != null)
                        {
                            if (idDic.ContainsKey(process.NextProcess.ProcessId))
                            {
                                process.NextProcess.ProcessId = idDic[process.NextProcess.ProcessId];
                            }
                        }
                        if (process.ErrorProcess != null)
                        {
                            if (idDic.ContainsKey(process.ErrorProcess.ProcessId))
                            {
                                process.ErrorProcess.ProcessId = idDic[process.ErrorProcess.ProcessId];
                            }
                        }
                    }
                    for (int i = 0; i < macro.NodeIdList.Count; i++)
                    {
                        if (idDic.ContainsKey(macro.NodeIdList[i]))
                        {
                            macro.NodeIdList[i] = idDic[macro.NodeIdList[i]];
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                throw Program.ThrowException(ex);
            }
        }