示例#1
0
 // ルートデバイスを返す
 internal Device GetRootDevice(DeployDiagramObject DeployDiagramObject)
 {
     // 親がExecutionEnvitomnentObjectなら現在のデバイスがルートデバイスなのでreturn
     if (ExecutionEnvironmentList.Any(ExecutionEnvironment => ExecutionEnvironment.ID == DeployDiagramObject.ParentID))
     {
         return(DeployDiagramObject as Device);
     }
     return(GetRootDevice(DeviceList.Single(Device => Device.ID == DeployDiagramObject.ParentID)));
 }
示例#2
0
 // 親のデバイスを返す
 // コンポーネントもしくはデバイスを引数にする
 internal Device GetParentDevice(DeployDiagramObject DeployDiagramObject)
 {
     // MessageBox.Show(DeployDiagramObject.ParentID.ToString());
     // DeviceList.ForEach(Device => MessageBox.Show(Device.ID.ToString()));
     return(DeviceList.Single(Device => Device.ID == DeployDiagramObject.ParentID));
 }
示例#3
0
        // 配置図の要素が属している実行環境の取得
        internal ExecutionEnvironment GetExecutionEnvironment(EA.Repository Repository, DeployDiagramObject DeployDiagramObject)
        {
            var diagram       = Repository.GetCurrentDiagram();
            var diagramObject = diagram.GetDiagramObjectByID(DeployDiagramObject.ParentID, "");

            if (DeviceList.Where(Device => Device.ID == DeployDiagramObject.ParentID).Any())
            {
                return(GetExecutionEnvironment(Repository, DeviceList.Single(Device => Device.ID == DeployDiagramObject.ParentID)));
            }
            return(ExecutionEnvironmentList.Single(ExecutionEnvironment => ExecutionEnvironment.ID == DeployDiagramObject.ParentID));
        }