Esempio n. 1
0
        protected ToolZone(WebPartDisplayMode associatedDisplayMode) {
            if (associatedDisplayMode == null) {
                throw new ArgumentNullException("associatedDisplayMode");
            }

            _associatedDisplayModes = new WebPartDisplayModeCollection();
            _associatedDisplayModes.Add(associatedDisplayMode);
            _associatedDisplayModes.SetReadOnly(SR.ToolZone_DisplayModesReadOnly);
        }
 protected ToolZone(WebPartDisplayMode associatedDisplayMode)
 {
     if (associatedDisplayMode == null)
     {
         throw new ArgumentNullException("associatedDisplayMode");
     }
     this._associatedDisplayModes = new WebPartDisplayModeCollection();
     this._associatedDisplayModes.Add(associatedDisplayMode);
     this._associatedDisplayModes.SetReadOnly("ToolZone_DisplayModesReadOnly");
 }
Esempio n. 3
0
 private Control GetControl(WebPartDisplayMode mode)
 {
     if (!(mode.Equals(WebPartManager.EditDisplayMode) || mode.Equals(WebPartManager.DesignDisplayMode)))
     {
         TaskInboxUserControl ctrl = Page.LoadControl(_ascxPath) as TaskInboxUserControl;
         ctrl.CoolDayNumber = CoolDayNumber;
         ctrl.WarningDayNumber = WarningDayNumber;
         ctrl.MaxHistoricDayNumber = MaxHistoricDayNumber;
         return ctrl;
     }
     else { return Page.LoadControl(_ascxConfigPath); }
 }
Esempio n. 4
0
        protected override void OnInsert(int index, object value)
        {
            CheckReadOnly();
            WebPartDisplayMode displayMode = (WebPartDisplayMode)value;

            foreach (WebPartDisplayMode existingDisplayMode in List)
            {
                if (displayMode.Name == existingDisplayMode.Name)
                {
                    throw new ArgumentException(SR.GetString(SR.WebPartDisplayModeCollection_DuplicateName, displayMode.Name));
                }
            }
            base.OnInsert(index, value);
        }
        protected override void OnInsert(int index, object value)
        {
            this.CheckReadOnly();
            WebPartDisplayMode mode = (WebPartDisplayMode)value;

            foreach (WebPartDisplayMode mode2 in base.List)
            {
                if (mode.Name == mode2.Name)
                {
                    throw new ArgumentException(System.Web.SR.GetString("WebPartDisplayModeCollection_DuplicateName", new object[] { mode.Name }));
                }
            }
            base.OnInsert(index, value);
        }
        internal int AddInternal(WebPartDisplayMode value) {
            bool isReadOnly = _readOnly;

            _readOnly = false;
            // Extra try-catch block to prevent elevation of privilege attack via exception filter
            try {
                try {
                    return List.Add(value);
                }
                finally {
                    _readOnly = isReadOnly;
                }
            }
            catch {
                throw;
            }
        }
Esempio n. 7
0
        internal int AddInternal(WebPartDisplayMode value)
        {
            bool isReadOnly = _readOnly;

            _readOnly = false;
            // Extra try-catch block to prevent elevation of privilege attack via exception filter
            try {
                try {
                    return(List.Add(value));
                }
                finally {
                    _readOnly = isReadOnly;
                }
            }
            catch {
                throw;
            }
        }
 internal int AddInternal(WebPartDisplayMode value)
 {
     int num;
     bool flag = this._readOnly;
     this._readOnly = false;
     try
     {
         try
         {
             num = base.List.Add(value);
         }
         finally
         {
             this._readOnly = flag;
         }
     }
     catch
     {
         throw;
     }
     return num;
 }
        internal int AddInternal(WebPartDisplayMode value)
        {
            int  num;
            bool flag = this._readOnly;

            this._readOnly = false;
            try
            {
                try
                {
                    num = base.List.Add(value);
                }
                finally
                {
                    this._readOnly = flag;
                }
            }
            catch
            {
                throw;
            }
            return(num);
        }
 public int Add(WebPartDisplayMode value)
 {
     return(base.List.Add(value));
 }
 public void Insert(int index, WebPartDisplayMode value)
 {
 }
 public void Insert(int index, WebPartDisplayMode value)
 {
 }
 public bool Contains(WebPartDisplayMode value)
 {
     return(default(bool));
 }
 public WebPartDisplayModeCancelEventArgs(WebPartDisplayMode displayMode)
 {
     this.displayMode = displayMode;
 }
 public void Insert(int index, WebPartDisplayMode value)
 {
     base.List.Insert(index, value);
 }
 public void CopyTo(WebPartDisplayMode[] array, int index)
 {
 }
 protected ToolZone(WebPartDisplayMode associatedDisplayMode)
 {
 }
 public WebPartDisplayModeEventArgs (WebPartDisplayMode oldDisplayMode)
 {
 }
        /// <devdoc>
        /// Loads the control state for those properties that should persist across postbacks
        /// even when EnableViewState=false.
        /// </devdoc>
        protected internal override void LoadControlState(object savedState) {
            if (savedState == null) {
                base.LoadControlState(null);
            }
            else {
                object[] myState = (object[])savedState;
                if (myState.Length != controlStateArrayLength) {
                    throw new ArgumentException(SR.GetString(SR.Invalid_ControlState));
                }

                base.LoadControlState(myState[baseIndex]);

                // 

                if (myState[selectedWebPartIndex] != null) {
                    // All dynamic parts must be loaded before this point, in case a dynamic part is the
                    // SelectedWebPart.
                    WebPart selectedWebPart = WebParts[(string)myState[selectedWebPartIndex]];
                    if (selectedWebPart == null || selectedWebPart.IsClosed) {
                        // The SelectedWebPart was either closed or deleted between requests.
                        // Raise the changed event, since the SelectedWebPart was not null on the previous request.
                        SetSelectedWebPart(null);
                        OnSelectedWebPartChanged(new WebPartEventArgs(null));
                    }
                    else {
                        SetSelectedWebPart(selectedWebPart);
                    }
                }
                if (myState[displayModeIndex] != null) {
                    string modeName = (string)myState[displayModeIndex];

                    WebPartDisplayMode restoredDisplayMode = SupportedDisplayModes[modeName];
                    if (!restoredDisplayMode.IsEnabled(this)) {
                        // Throw
                    }

                    if (restoredDisplayMode == null) {
                        _displayMode = BrowseDisplayMode;
                        OnDisplayModeChanged(new WebPartDisplayModeEventArgs(null));
                    }
                    else {
                        _displayMode = restoredDisplayMode;
                    }
                }
            }
        }
 /// <devdoc>
 /// </devdoc>
 public WebPartManager() {
     _allowEventCancellation = true;
     _displayMode = BrowseDisplayMode;
     _webPartZones = new WebPartZoneCollection();
     _partAndChildControlIDs = new HybridDictionary(true /* caseInsensitive */);
     _zoneIDs = new HybridDictionary(true /* caseInsensitive */);
 }
 public int IndexOf(WebPartDisplayMode value)
 {
   return default(int);
 }
 protected ToolZone(WebPartDisplayMode associatedDisplayMode)
 {
 }
 public bool Contains(WebPartDisplayMode value)
 {
     return(base.List.Contains(value));
 }
 public int IndexOf(WebPartDisplayMode value)
 {
     return(base.List.IndexOf(value));
 }
 public WebPartDisplayModeCancelEventArgs(WebPartDisplayMode newDisplayMode)
 {
     this._newDisplayMode = newDisplayMode;
 }
 public bool Contains(WebPartDisplayMode value)
 {
   return default(bool);
 }
 public void CopyTo(WebPartDisplayMode[] array, int index)
 {
     base.List.CopyTo(array, index);
 }
 public int Add(WebPartDisplayMode value)
 {
     return(default(int));
 }
 public void Insert(int index, WebPartDisplayMode value)
 {
     base.List.Insert(index, value);
 }
 public int IndexOf(WebPartDisplayMode value)
 {
     return(default(int));
 }
 public int Add(WebPartDisplayMode value)
 {
   return default(int);
 }
		public WebPartDisplayModeCancelEventArgs (WebPartDisplayMode displayMode)
		{
			this.displayMode = displayMode; 
		}
 public WebPartDisplayModeEventArgs(WebPartDisplayMode oldDisplayMode)
 {
     this._oldDisplayMode = oldDisplayMode;
 }
 public int Add(WebPartDisplayMode value)
 {
     return base.List.Add(value);
 }
 public WebPartDisplayModeEventArgs(WebPartDisplayMode oldDisplayMode)
 {
 }
 public bool Contains(WebPartDisplayMode value)
 {
     return base.List.Contains(value);
 }
 public WebPartDisplayModeCancelEventArgs(WebPartDisplayMode newDisplayMode)
 {
     _newDisplayMode = newDisplayMode;
 }
 public int IndexOf(WebPartDisplayMode value)
 {
     return base.List.IndexOf(value);
 }
 public WebPartDisplayModeCancelEventArgs(WebPartDisplayMode newDisplayMode)
 {
 }
 protected internal override void LoadControlState(object savedState)
 {
     if (savedState == null)
     {
         base.LoadControlState(null);
     }
     else
     {
         object[] objArray = (object[]) savedState;
         if (objArray.Length != 3)
         {
             throw new ArgumentException(System.Web.SR.GetString("Invalid_ControlState"));
         }
         base.LoadControlState(objArray[0]);
         if (objArray[1] != null)
         {
             WebPart webPart = this.WebParts[(string) objArray[1]];
             if ((webPart == null) || webPart.IsClosed)
             {
                 this.SetSelectedWebPart(null);
                 this.OnSelectedWebPartChanged(new WebPartEventArgs(null));
             }
             else
             {
                 this.SetSelectedWebPart(webPart);
             }
         }
         if (objArray[2] != null)
         {
             string str = (string) objArray[2];
             WebPartDisplayMode mode = this.SupportedDisplayModes[str];
             mode.IsEnabled(this);
             if (mode == null)
             {
                 this._displayMode = BrowseDisplayMode;
                 this.OnDisplayModeChanged(new WebPartDisplayModeEventArgs(null));
             }
             else
             {
                 this._displayMode = mode;
             }
         }
     }
 }
 public WebPartDisplayModeEventArgs(WebPartDisplayMode oldDisplayMode)
 {
     this._oldDisplayMode = oldDisplayMode;
 }