Наследование: RequestResponse
Пример #1
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));
     }
 }
Пример #2
0
 private void DoVerb(RequestInfo requestInfo, IRequestStatus requestStatus)
 {
     if (requestInfo is CutOrMoveViewSelectionRequestInfo)
     {
         CutOrMoveViewSelectionRequestInfo info = (CutOrMoveViewSelectionRequestInfo) requestInfo;
         AuxiliarySelectionData data = this.ClipboardSelectionDatas[info.SelectionId];
         if (data != null)
         {
             this.OnCut(data.SelectionObject, new AsyncStatus(requestStatus));
         }
         else
         {
             TraceSources.ExecutiveSource.TraceEvent(TraceEventType.Warning, 12, "Request CutOrMove in view {0} ignore since selection id {1} could not be found.", new object[] { this._viewInstanceId, info.SelectionId });
         }
     }
     else
     {
         int selectionId = ((ViewSelectionRequestInfo) requestInfo).SelectionId;
         if ((this.SelectionData.SelectionCardinality == SelectionCardinality.None) || (selectionId != this.SelectionData.Id))
         {
             TraceSources.ExecutiveSource.TraceEvent(TraceEventType.Warning, 12, "Request {0} in view {1} selection id {2} ignored since selection has changed.", new object[] { requestInfo.GetType().FullName, this._viewInstanceId, selectionId });
         }
         else if (requestInfo is DeleteViewSelectionRequestInfo)
         {
             this.OnDelete(new SyncStatus(requestStatus));
         }
         else if (requestInfo is RefreshViewSelectionRequestInfo)
         {
             this.OnRefresh(new AsyncStatus(requestStatus));
         }
         else if (requestInfo is PrintViewSelectionRequestInfo)
         {
             this.OnPrint(new SyncStatus(requestStatus));
         }
         else if (requestInfo is RenameViewSelectionRequestInfo)
         {
             this.OnRename(((RenameViewSelectionRequestInfo) requestInfo).NewDisplayName, new SyncStatus(requestStatus));
         }
         else if (requestInfo is PasteViewSelectionRequestInfo)
         {
             PasteViewSelectionRequestInfo info2 = (PasteViewSelectionRequestInfo) requestInfo;
             SharedData sharedData = new SharedData(info2.DataObjectId);
             this.ScopeNode.SnapIn.AddSharedData(sharedData);
             sharedData.SetSnapInPlatform(this.ScopeNode.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
             {
                 this.ScopeNode.SnapIn.RemoveSharedData(sharedData);
             }
         }
     }
 }