Пример #1
0
 public void SetRelativePath(NodeIdData[] relativePath)
 {
     this._relativePath = relativePath;
 }
Пример #2
0
 public void SelectScopeNode(Microsoft.ManagementConsole.ScopeNode startNode, NodeId[] relativePath)
 {
     this.ThrowIfShutdown("SelectScopeNode");
     if (startNode == null)
     {
         throw new ArgumentNullException("startNode");
     }
     if (relativePath == null)
     {
         throw new ArgumentNullException("relativePath");
     }
     if (!this.Initialized || !this.Visible)
     {
         TraceSources.ExecutiveSource.TraceEvent(TraceEventType.Warning, 12, "Ignoring select scope node request since view hasn't been initialized or is hidden.");
     }
     else
     {
         ISnapInPlatform snapInPlatform = this.SnapIn.SnapInPlatform;
         if (snapInPlatform == null)
         {
             throw new InvalidOperationException(Microsoft.ManagementConsole.Internal.Utility.LoadResourceString(Microsoft.ManagementConsole.Internal.Strings.ExceptionCommonSnapInPlatformIsNull));
         }
         NodeIdData[] dataArray = new NodeIdData[relativePath.Length];
         int num = 0;
         foreach (NodeId id in relativePath)
         {
             NodeIdData data = new NodeIdData();
             if (id is DisplayNameNodeId)
             {
                 data.NameId = ((DisplayNameNodeId) id).DisplayName;
                 data.Type = NodeIdType.Display;
             }
             else if (id is LanguageIndependentNameNodeId)
             {
                 data.NameId = ((LanguageIndependentNameNodeId) id).LanguageIndependentName;
                 data.Type = NodeIdType.LanguageIndependent;
             }
             else
             {
                 if (!(id is CustomNodeId))
                 {
                     throw new ArgumentException(Microsoft.ManagementConsole.Internal.Utility.FormatResourceString(Microsoft.ManagementConsole.Internal.Strings.ViewSelectScopeNodeNullOrUnrecognizedNodeId, new object[] { num }), "relativePath");
                 }
                 data.SetCustomId(((CustomNodeId) id).GetCustomId());
                 data.Type = NodeIdType.Custom;
             }
             dataArray[num++] = data;
         }
         SelectScopeNodeCommand command = new SelectScopeNodeCommand();
         command.ViewInstanceId = this.ViewInstanceId;
         command.ScopeNodeId = startNode.Id;
         command.SetRelativePath(dataArray);
         snapInPlatform.ProcessCommand(command);
     }
 }