Exemplo n.º 1
0
 /// <summary>
 /// ノードのIDをセットする
 /// </summary>
 /// <param name="addId"></param>
 /// <param name="id"></param>
 internal void SetNodeId(string addId, string id)
 {
     try
     {
         for (int i = 0; i < NodeIdList.Count; i++)
         {
             if (NodeIdList[i] == id)
             {
                 NodeIdList.Insert(i + 1, addId);
                 return;
             }
         }
         NodeIdList.Insert(0, addId);
     }
     catch (Exception ex)
     {
         throw Program.ThrowException(ex);
     }
 }
Exemplo n.º 2
0
 /// <summary>
 /// モデルを削除する
 /// </summary>
 /// <param name="procModel"></param>
 internal void RemoveModel(List <ProcessModel> modelList, ProcessModel procModel)
 {
     try
     {
         for (int i = 0; i < modelList.Count; i++)
         {
             if (modelList[i].Equals(procModel))
             {
                 //ノードIDリストのIDも削除する
                 NodeIdList.Remove(modelList[i].ProcessId);
                 modelList.RemoveAt(i);
                 return;
             }
         }
     }
     catch (Exception ex)
     {
         throw Program.ThrowException(ex);
     }
 }
Exemplo n.º 3
0
 /// <summary>
 /// ツリーノードを再帰的に作成する
 /// </summary>
 /// <param name="node"></param>
 /// <param name="procList"></param>
 public void CreateChildNode(TreeNode node)
 {
     try
     {
         for (int i = 0; i < NodeIdList.Count; i++)
         {
             string       id        = NodeIdList[i];
             ProcessModel procModel = ProcessModelList.FirstOrDefault(a => a.ProcessId == id);
             if (procModel != null)
             {
                 TreeNode newNode = new TreeNode(procModel.Name);
                 newNode.Tag                = procModel;
                 newNode.ImageIndex         = GetImageIndex(procModel.ProcessType);
                 newNode.SelectedImageIndex = newNode.ImageIndex;
                 node.Nodes.Add(newNode);
                 continue;
             }
             ProjectModel projModel = MacroModelList.FirstOrDefault(a => a.ProjectId == id);
             if (projModel != null)
             {
                 TreeNode newNode = new TreeNode(projModel.Name);
                 newNode.Tag                = projModel;
                 newNode.ImageIndex         = 1;
                 newNode.SelectedImageIndex = 1;
                 node.Nodes.Add(newNode);
                 projModel.CreateChildNode(newNode);
                 continue;
             }
             //該当しない場合は削除する
             NodeIdList.RemoveAt(i);
             i--;
         }
     }
     catch (Exception ex)
     {
         throw Program.ThrowException(ex);
     }
 }