Exemple #1
0
        public virtual void ToggleScope()
        {
            this.EnsureEnabled(false);
            Page page = this.WebPartManager.Page;

            if (page == null)
            {
                throw new InvalidOperationException(System.Web.SR.GetString("PropertyCannotBeNull", new object[] { "WebPartManager.Page" }));
            }
            if (!page.IsExportingWebPart)
            {
                Page previousPage = page.PreviousPage;
                if ((previousPage != null) && !previousPage.IsCrossPagePostBack)
                {
                    System.Web.UI.WebControls.WebParts.WebPartManager currentWebPartManager = System.Web.UI.WebControls.WebParts.WebPartManager.GetCurrentWebPartManager(previousPage);
                    if ((currentWebPartManager != null) && currentWebPartManager.Personalization.ScopeToggled)
                    {
                        return;
                    }
                }
                if (this._currentScope == PersonalizationScope.Shared)
                {
                    this.ChangeScope(PersonalizationScope.User);
                }
                else
                {
                    this.ChangeScope(PersonalizationScope.Shared);
                }
                this.TransferToCurrentPage(page);
            }
        }
 public WebPartChrome(WebPartZoneBase zone, System.Web.UI.WebControls.WebParts.WebPartManager manager)
 {
     if (zone == null)
     {
         throw new ArgumentNullException("zone");
     }
     this._zone = zone;
     this._page = zone.Page;
     this._designMode = zone.DesignMode;
     this._manager = manager;
     if (this._designMode)
     {
         this._personalizationEnabled = true;
     }
     else
     {
         this._personalizationEnabled = (manager != null) && manager.Personalization.IsModifiable;
     }
     if (manager != null)
     {
         this._personalizationScope = manager.Personalization.Scope;
     }
     else
     {
         this._personalizationScope = PersonalizationScope.Shared;
     }
 }
Exemple #3
0
 public WebPartChrome(WebPartZoneBase zone, System.Web.UI.WebControls.WebParts.WebPartManager manager)
 {
     if (zone == null)
     {
         throw new ArgumentNullException("zone");
     }
     this._zone       = zone;
     this._page       = zone.Page;
     this._designMode = zone.DesignMode;
     this._manager    = manager;
     if (this._designMode)
     {
         this._personalizationEnabled = true;
     }
     else
     {
         this._personalizationEnabled = (manager != null) && manager.Personalization.IsModifiable;
     }
     if (manager != null)
     {
         this._personalizationScope = manager.Personalization.Scope;
     }
     else
     {
         this._personalizationScope = PersonalizationScope.Shared;
     }
 }
 protected PersonalizationState(System.Web.UI.WebControls.WebParts.WebPartManager webPartManager)
 {
     if (webPartManager == null)
     {
         throw new ArgumentNullException("webPartManager");
     }
     this._webPartManager = webPartManager;
 }
 protected PersonalizationState(System.Web.UI.WebControls.WebParts.WebPartManager webPartManager)
 {
     if (webPartManager == null)
     {
         throw new ArgumentNullException("webPartManager");
     }
     this._webPartManager = webPartManager;
 }
Exemple #6
0
 public WebPartPersonalization(System.Web.UI.WebControls.WebParts.WebPartManager owner)
 {
     if (owner == null)
     {
         throw new ArgumentNullException("owner");
     }
     this._owner   = owner;
     this._enabled = true;
 }
 public WebPartPersonalization(System.Web.UI.WebControls.WebParts.WebPartManager owner)
 {
     if (owner == null)
     {
         throw new ArgumentNullException("owner");
     }
     this._owner = owner;
     this._enabled = true;
 }
Exemple #8
0
        protected internal override void OnInit(EventArgs e)
        {
            base.OnInit(e);
            Page page = this.Page;

            if (page != null)
            {
                if ((page.ControlState >= ControlState.Initialized) && !base.DesignMode)
                {
                    throw new InvalidOperationException(System.Web.SR.GetString("Zone_AddedTooLate"));
                }
                if (!base.DesignMode)
                {
                    this._webPartManager = System.Web.UI.WebControls.WebParts.WebPartManager.GetCurrentWebPartManager(page);
                    if (this._webPartManager == null)
                    {
                        throw new InvalidOperationException(System.Web.SR.GetString("WebPartManagerRequired"));
                    }
                    this._webPartManager.RegisterZone(this);
                }
            }
        }
        public static void SetPersonalizationDirty(Control control)
        {
            if (control == null)
            {
                throw new ArgumentNullException("control");
            }
            if (control.Page == null)
            {
                throw new ArgumentException(System.Web.SR.GetString("PropertyCannotBeNull", new object[] { "Page" }), "control");
            }
            System.Web.UI.WebControls.WebParts.WebPartManager currentWebPartManager = System.Web.UI.WebControls.WebParts.WebPartManager.GetCurrentWebPartManager(control.Page);
            if (currentWebPartManager == null)
            {
                throw new InvalidOperationException(System.Web.SR.GetString("WebPartManagerRequired"));
            }
            WebPart genericWebPart = currentWebPartManager.GetGenericWebPart(control);

            if (genericWebPart == null)
            {
                throw new ArgumentException(System.Web.SR.GetString("WebPart_NonWebPart"), "control");
            }
            genericWebPart.SetPersonalizationDirty();
        }
 internal void SetWebPartManager(System.Web.UI.WebControls.WebParts.WebPartManager webPartManager)
 {
     this._webPartManager = webPartManager;
 }
 internal void SetWebPartManager(System.Web.UI.WebControls.WebParts.WebPartManager webPartManager)
 {
     this._webPartManager = webPartManager;
 }
Exemple #12
0
 public AtlasWebPartChrome(System.Web.UI.WebControls.WebParts.WebPartZoneBase zone,
                           System.Web.UI.WebControls.WebParts.WebPartManager manager)
     : base(zone, manager)
 {
 }
 protected internal override void OnInit(EventArgs e)
 {
     base.OnInit(e);
     Page page = this.Page;
     if (page != null)
     {
         if ((page.ControlState >= ControlState.Initialized) && !base.DesignMode)
         {
             throw new InvalidOperationException(System.Web.SR.GetString("Zone_AddedTooLate"));
         }
         if (!base.DesignMode)
         {
             this._webPartManager = System.Web.UI.WebControls.WebParts.WebPartManager.GetCurrentWebPartManager(page);
             if (this._webPartManager == null)
             {
                 throw new InvalidOperationException(System.Web.SR.GetString("WebPartManagerRequired"));
             }
             this._webPartManager.RegisterZone(this);
         }
     }
 }