Exemple #1
0
 private void ReconfigFVA()
 {
     if (this.columns.Count == 1 && (this.columns[0].Width.Equals(Unit.Empty) || (this.columns[0].Width.Type == UnitType.Percentage && this.columns[0].Width.Value > 0.95)))
     {
         using (List <SlabControl> .Enumerator enumerator = this.columns[0].Slabs.GetEnumerator())
         {
             while (enumerator.MoveNext())
             {
                 SlabControl slabControl = enumerator.Current;
                 if (this.IsSimpleFormWithFVAEnabled(slabControl))
                 {
                     WebControl webControl  = slabControl.Parent as WebControl;
                     WebControl webControl2 = webControl;
                     webControl2.CssClass += " reservedSpaceForFVA";
                 }
             }
             return;
         }
     }
     if (this.columns.Count > 1)
     {
         foreach (SlabColumn slabColumn in this.columns)
         {
             foreach (SlabControl slabControl2 in slabColumn.Slabs)
             {
                 if (this.IsSimpleFormWithFVAEnabled(slabControl2))
                 {
                     slabControl2.FieldValidationAssistantExtender.Canvas = this.contentPanel.ClientID;
                 }
             }
         }
     }
 }
Exemple #2
0
        internal SlabFrame(SlabControl slab) : base(HtmlTextWriterTag.Div)
        {
            if (slab == null)
            {
                throw new ArgumentNullException("slab", "Slab cannot be null");
            }
            this.Slab     = slab;
            this.CssClass = "slbFrm";
            if (this.Slab.HideSlabBorder)
            {
                this.CssClass = "slbFrm noBorderAlways";
            }
            else
            {
                this.CssClass = "slbFrm";
            }
            base.Style[HtmlTextWriterStyle.Visibility] = "hidden";
            this.CaptionPanel = new CaptionPanel();
            this.ShowHelp     = false;
            this.PublishHelp  = false;
            Unit height = slab.Height;

            if (!height.IsEmpty && height.Type == UnitType.Percentage)
            {
                base.Attributes.Add("fill", ((int)height.Value).ToString());
                return;
            }
            this.Height = slab.Height;
        }
Exemple #3
0
 private void PopulateSlabRows(Table table, List <SlabRow> rows)
 {
     foreach (SlabRow slabRow in rows)
     {
         foreach (Control control in slabRow.Content)
         {
             TableRow tableRow = new TableRow();
             table.Rows.Add(tableRow);
             TableCell tableCell = new TableCell();
             tableRow.Cells.Add(tableCell);
             this.fullRowCells.Add(tableCell);
             SlabControl slabControl = control as SlabControl;
             if (slabControl != null)
             {
                 SlabFrame slabFrame  = new SlabFrame(slabControl);
                 SlabFrame slabFrame2 = slabFrame;
                 slabFrame2.CssClass += " slbLf";
                 if (slabControl.UsePropertyPageStyle)
                 {
                     SlabFrame slabFrame3 = slabFrame;
                     slabFrame3.CssClass += " slbPrpg";
                 }
                 tableCell.Controls.Add(slabFrame);
                 this.slabFrames.Add(slabFrame);
             }
             else
             {
                 tableCell.Controls.Add(control);
             }
         }
     }
 }
Exemple #4
0
 private void PrepareSlabsForScreenReader()
 {
     foreach (SlabFrame slabFrame in this.slabFrames)
     {
         SlabControl slab = slabFrame.Slab;
         slabFrame.Attributes["tabindex"]        = "0";
         slabFrame.Attributes["role"]            = "region";
         slabFrame.Attributes["aria-labelledby"] = slabFrame.CaptionLabel.ClientID;
     }
 }
Exemple #5
0
        internal void Refactor()
        {
            IPrincipal user = this.Context.User;

            for (int i = this.Content.Count - 1; i >= 0; i--)
            {
                SlabControl slabControl = this.Content[i] as SlabControl;
                if (slabControl != null && !slabControl.AccessibleToUser(user))
                {
                    this.Content.RemoveAt(i);
                    slabControl.Visible = false;
                }
            }
        }
Exemple #6
0
        internal void Refactor()
        {
            IPrincipal user = this.Context.User;
            double     num  = 0.0;
            double     num2 = 0.0;
            bool       flag = false;

            for (int i = this.Slabs.Count - 1; i >= 0; i--)
            {
                SlabControl slabControl = this.Slabs[i];
                bool        flag2       = false;
                slabControl.InitializeAsUserControl(this.Page);
                if (!slabControl.AccessibleToUser(user))
                {
                    this.Slabs.RemoveAt(i);
                    flag2 = true;
                    slabControl.Visible = false;
                }
                if (slabControl.Height.Type == UnitType.Percentage)
                {
                    num += slabControl.Height.Value;
                    if (flag2)
                    {
                        flag = true;
                    }
                    else
                    {
                        num2 += slabControl.Height.Value;
                    }
                }
            }
            if (flag && num2 != 0.0)
            {
                double num3 = num / num2;
                foreach (SlabControl slabControl2 in this.Slabs)
                {
                    if (slabControl2.Height.Type == UnitType.Percentage)
                    {
                        slabControl2.Height = new Unit(slabControl2.Height.Value * num3, UnitType.Percentage);
                    }
                }
            }
        }
Exemple #7
0
 private bool IsSimpleFormWithFVAEnabled(SlabControl slab)
 {
     return(slab.FieldValidationAssistantExtender != null && slab.PropertiesControl != null);
 }