예제 #1
0
파일: Node.cs 프로젝트: SiteView/ECC8.13
 internal void Initialize(NodeData data)
 {
     this.Data = data;
     this._snapIn = SnapInBase.SnapInInstance as NamespaceSnapInBase;
     if (this._snapIn == null)
     {
         throw new Exception(Microsoft.ManagementConsole.Internal.Utility.FormatResourceString(Microsoft.ManagementConsole.Internal.Strings.ExceptionCommonWrongThread, new object[] { "Node" }));
     }
     if (_idCounter == 0x7fffffff)
     {
         TraceSources.ExecutiveSource.TraceEvent(TraceEventType.Error, 12, "The max value for Node identifiers has been reached; no new nodes can be created.");
         throw new Exception(Microsoft.ManagementConsole.Internal.Utility.LoadResourceString(Microsoft.ManagementConsole.Internal.Strings.ExceptionMMCOutOfResources));
     }
     this.Data.Id = Interlocked.Increment(ref _idCounter);
 }
예제 #2
0
 public void SetData(NodeData[] data)
 {
     this._data = data;
 }
예제 #3
0
 private void SynchronizeResultNodes(ResultNode[] items, int index, ResultNodeCollectionChangeType changeType)
 {
     ISnapInPlatform snapInPlatform = base.SnapIn.SnapInPlatform;
     if (snapInPlatform == null)
     {
         throw Microsoft.ManagementConsole.Internal.Utility.CreateClassNotInitializedException("MmcListView", "SynchronizeResultNodes");
     }
     if (items == null)
     {
         throw new ArgumentNullException("items");
     }
     if (items.Length < 1)
     {
         TraceSources.ExecutiveSource.TraceEvent(TraceEventType.Verbose, 12, "Empty result nodes update for view {0}.", new object[] { base.ViewInstanceId });
     }
     else
     {
         UpdateResultNodesCommand command = new UpdateResultNodesCommand();
         command.ViewInstanceId = base.ViewInstanceId;
         command.ChangeType = changeType;
         command.Index = index;
         NodeData[] data = new NodeData[items.Length];
         for (int i = 0; i < items.Length; i++)
         {
             data[i] = items[i].Data;
         }
         command.SetData(data);
         snapInPlatform.ProcessCommand(command);
     }
 }