Ejemplo n.º 1
0
 public ViewMessageClient(View view)
 {
     if (view == null)
     {
         throw new ArgumentNullException("view");
     }
     this._view = view;
 }
Ejemplo n.º 2
0
 internal SelectionData(View view)
 {
     this._id = -1;
     this._uniqueNodeTypes = new Guid[0];
     this._sharedData = new WritableSharedData();
     this._description = string.Empty;
     this._actionsPaneItems = new ActionsPaneItemCollection();
     this._actionsPaneHelpItems = new ActionsPaneItemCollection();
     this._pasteTargetInfo = new PasteTargetInfo();
     if (view == null)
     {
         throw new ArgumentNullException("view");
     }
     this._view = view;
     this._sharedData.Changed += new WritableSharedDataItem.SharedDataChangedEventHandler(this.OnSharedDataChanged);
     this._actionsPaneItems.Changed += new ActionsPaneItemCollection.ActionsPaneItemCollectionEventHandler(this.OnActionsPaneItemsChanged);
     this._actionsPaneHelpItems.Changed += new ActionsPaneItemCollection.ActionsPaneItemCollectionEventHandler(this.OnActionsPaneHelpItemsChanged);
 }
        /// <summary>
        /// Swaps a new view for the existing. 
        /// (NOTE: expects that only a single view is already defined)
        /// </summary>
        /// <param name="currentView"></param>
        /// <param name="newViewDisplayName"></param>
        /// <param name="newViewType"></param>
        public void SwapView(View currentView, string newViewDisplayName, Type newViewType)
        {
            // remove the existing view description
            this.RemoveViewDescriptionAt(0);

            // add the new view description
            this.AddViewDescription(newViewDisplayName, newViewType);

            // set the new view as the default
            this.ViewDescriptions.DefaultIndex = 0;

            // trigger MMC to show the new default view
            currentView.SelectScopeNode(this);
        }