Inheritance: RequestInfo
示例#1
0
 internal void ProcessRequest(NodeRequestInfo info, IRequestStatus requestStatus)
 {
     if (!this._initialized)
     {
         throw new Exception(Microsoft.ManagementConsole.Internal.Utility.LoadResourceString(Microsoft.ManagementConsole.Internal.Strings.NodeSyncManagerNotInitialized));
     }
     ScopeNode node = this.GetNode(info.ScopeNodeId);
     if (node != null)
     {
         if (info is ExpandScopeNodeRequestInfo)
         {
             node.Expand(requestStatus);
         }
         else if (info is ActionNodeRequestInfo)
         {
             node.DoAction(((ActionNodeRequestInfo) info).ActionId, requestStatus);
         }
         else if (info is ReadSharedDataNodeRequestInfo)
         {
             node.GetSharedData((ReadSharedDataNodeRequestInfo) info, requestStatus);
         }
         else if (info is UpdateDataChangeNodeRequestInfo)
         {
             node.RequestSharedDataUpdate((UpdateDataChangeNodeRequestInfo) info, requestStatus);
         }
         else if (info is PagesForNodeRequestInfo)
         {
             node.GetPropertyPages(((PagesForNodeRequestInfo) info).SheetId, requestStatus);
         }
         else if ((((info is DeleteNodeRequestInfo) || (info is RefreshNodeRequestInfo)) || ((info is PrintNodeRequestInfo) || (info is RenameNodeRequestInfo))) || ((info is PasteNodeRequestInfo) || (info is CutOrMoveNodeRequestInfo)))
         {
             node.DoVerb(info, requestStatus);
         }
         else if (info is ExpandFromLoadScopeNodeRequestInfo)
         {
             ExpandFromLoadScopeNodeRequestResponse response = new ExpandFromLoadScopeNodeRequestResponse();
             response.Handled = node.ExpandFromLoad(requestStatus);
             requestStatus.ProcessResponse(response);
         }
         else if (info is ActivateNodeRequestInfo)
         {
             node.Activate(requestStatus);
         }
     }
 }
示例#2
0
 internal void DoVerb(NodeRequestInfo info, IRequestStatus requestStatus)
 {
     if (info is DeleteNodeRequestInfo)
     {
         this.OnDelete(new SyncStatus(requestStatus));
     }
     else if (info is RefreshNodeRequestInfo)
     {
         this.OnRefresh(new AsyncStatus(requestStatus));
     }
     else if (info is PrintNodeRequestInfo)
     {
         this.OnPrint(new SyncStatus(requestStatus));
     }
     else if (info is RenameNodeRequestInfo)
     {
         this.OnRename(((RenameNodeRequestInfo) info).NewDisplayName, new SyncStatus(requestStatus));
     }
     else if (info is PasteNodeRequestInfo)
     {
         PasteNodeRequestInfo info2 = (PasteNodeRequestInfo) info;
         Microsoft.ManagementConsole.SharedData sharedData = new Microsoft.ManagementConsole.SharedData(info2.DataObjectId);
         base.SnapIn.AddSharedData(sharedData);
         sharedData.SetSnapInPlatform(base.SnapIn.SnapInClient.SnapInPlatform);
         PasteResponse response = new PasteResponse();
         try
         {
             response.AcceptPaste = this.OnPaste(sharedData, (Microsoft.ManagementConsole.DragAndDropVerb) info2.PasteType, new SyncStatus(requestStatus));
             requestStatus.ProcessResponse(response);
         }
         finally
         {
             base.SnapIn.RemoveSharedData(sharedData);
         }
     }
     else if (info is CutOrMoveNodeRequestInfo)
     {
         this.OnCut(new AsyncStatus(requestStatus));
     }
 }