示例#1
0
文件: View.cs 项目: SiteView/ECC8.13
 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);
             }
         }
     }
 }