Esempio n. 1
0
        /// <summary>
        /// Sets the target region ID for a given control.
        /// </summary>
        /// <param name="control">To control that needs to be rendered in
        /// a specific region.</param>
        /// <param name="regionId">The ID of the target region.</param>
        public void SetTargetRegionId(Control control, object regionId)
        {
            //do nothing if no region ID was set
            if (regionId == null)
            {
                return;
            }

            //if the property was removed by the user
            if (regionId.ToString() == "")
            {
                //...remove the control from the internal list
                this.propertySets.Remove(this[control]);
            }
            else
            {
                PortalRegion region = (PortalRegion)regionId;
                if (region == PortalRegion.None)
                {
                    //..,remove the control from the internal list
                    this.propertySets.Remove(this[control]);
                }
                else
                {
                    //get the property set, if any or create a new one
                    RegionPropertySet propertySet = this[control];
                    if (propertySet == null)
                    {
                        propertySet = new RegionPropertySet(control, region, 0);
                        //store the set in the internal list
                        this.propertySets.Add(propertySet);
                    }
                    else
                    {
                        //adjust region ID
                        propertySet.TargetRegion = region;
                    }
                }
            }

            //announce change
            NotifyHost();
        }
Esempio n. 2
0
 /// <summary>
 /// Inits the property set.
 /// </summary>
 /// <param name="control"></param>
 /// <param name="region"></param>
 /// <param name="renderIndex"></param>
 public RegionPropertySet(Control control, PortalRegion region, int renderIndex)
 {
     this.control = control;
       this.targetRegion = region;
       this.renderIndex = renderIndex;
 }
Esempio n. 3
0
 /// <summary>
 /// Provides access to the templates region place holders.
 /// </summary>
 public RegionPlaceHolder this[PortalRegion region]
 {
     get {
         return(this.regions[region] as RegionPlaceHolder);
     }
 }
Esempio n. 4
0
 /// <summary>
 /// Inits the property set.
 /// </summary>
 /// <param name="control"></param>
 /// <param name="region"></param>
 /// <param name="renderIndex"></param>
 public RegionPropertySet(Control control, PortalRegion region, int renderIndex)
 {
     this.control      = control;
     this.targetRegion = region;
     this.renderIndex  = renderIndex;
 }
Esempio n. 5
0
 /// <summary>
 /// Provides access to the templates region place holders.
 /// </summary>
 public RegionPlaceHolder this[PortalRegion region]
 {
     get {
     return this.regions[region] as RegionPlaceHolder;
       }
 }