Beispiel #1
0
        /// <Summary>
        /// BuildVisibility creates the visibility part of the Control
        /// </Summary>
        /// <Param name="editInfo">The EditorInfo object for this control</Param>
        private VisibilityControl BuildVisibility(EditorInfo editInfo)
        {
            VisibilityControl visControl = null;

            if (ShowVisibility)
            {
                visControl         = new VisibilityControl();
                visControl.ID      = this.ID + "_vis";
                visControl.Caption = Localization.GetString("Visibility");
                visControl.Name    = editInfo.Name;
                visControl.Value   = editInfo.Visibility;
                visControl.ControlStyle.CopyFrom(VisibilityStyle);
                visControl.VisibilityChanged += new PropertyChangedEventHandler(this.VisibilityChanged);
            }

            return(visControl);
        }
Beispiel #2
0
        /// <summary>
        /// BuildVisibility creates the visibility part of the Control
        /// </summary>
        /// <param name="editInfo">The EditorInfo object for this control</param>
        private VisibilityControl BuildVisibility(EditorInfo editInfo)
        {
            VisibilityControl visControl = null;

            if (ShowVisibility)
            {
                visControl = new VisibilityControl
                {
                    ID    = "_visibility",
                    Name  = editInfo.Name,
                    User  = User,
                    Value = editInfo.ProfileVisibility
                };
                visControl.ControlStyle.CopyFrom(VisibilityStyle);
                visControl.VisibilityChanged += VisibilityChanged;
            }
            return(visControl);
        }
Beispiel #3
0
        /// -----------------------------------------------------------------------------
        /// <summary>
        /// BuildTable creates the Control as a Table
        /// </summary>
        /// <param name="editInfo">The EditorInfo object for this control</param>
        /// -----------------------------------------------------------------------------
        private void BuildTable(EditorInfo editInfo)
        {
            var tbl        = new Table();
            var labelCell  = new TableCell();
            var editorCell = new TableCell();

            //Build Label Cell
            labelCell.VerticalAlign = VerticalAlign.Top;
            labelCell.Controls.Add(BuildLabel(editInfo));
            if (editInfo.LabelMode == LabelMode.Left || editInfo.LabelMode == LabelMode.Right)
            {
                labelCell.Width = LabelWidth;
            }
            //Build Editor Cell
            editorCell.VerticalAlign = VerticalAlign.Top;
            EditControl propEditor   = BuildEditor(editInfo);
            Image       requiredIcon = BuildRequiredIcon(editInfo);

            editorCell.Controls.Add(propEditor);
            if (requiredIcon != null)
            {
                editorCell.Controls.Add(requiredIcon);
            }
            if (editInfo.LabelMode == LabelMode.Left || editInfo.LabelMode == LabelMode.Right)
            {
                editorCell.Width = EditControlWidth;
            }
            VisibilityControl visibility = BuildVisibility(editInfo);

            if (visibility != null)
            {
                editorCell.Controls.Add(new LiteralControl("&nbsp;&nbsp;"));
                editorCell.Controls.Add(visibility);
            }

            //Add cells to table
            var editorRow = new TableRow();
            var labelRow  = new TableRow();

            if (editInfo.LabelMode == LabelMode.Bottom || editInfo.LabelMode == LabelMode.Top || editInfo.LabelMode == LabelMode.None)
            {
                editorCell.ColumnSpan = 2;
                editorRow.Cells.Add(editorCell);
                if (editInfo.LabelMode == LabelMode.Bottom || editInfo.LabelMode == LabelMode.Top)
                {
                    labelCell.ColumnSpan = 2;
                    labelRow.Cells.Add(labelCell);
                }
                if (editInfo.LabelMode == LabelMode.Top)
                {
                    tbl.Rows.Add(labelRow);
                }
                tbl.Rows.Add(editorRow);
                if (editInfo.LabelMode == LabelMode.Bottom)
                {
                    tbl.Rows.Add(labelRow);
                }
            }
            else if (editInfo.LabelMode == LabelMode.Left)
            {
                editorRow.Cells.Add(labelCell);
                editorRow.Cells.Add(editorCell);
                tbl.Rows.Add(editorRow);
            }
            else if (editInfo.LabelMode == LabelMode.Right)
            {
                editorRow.Cells.Add(editorCell);
                editorRow.Cells.Add(labelCell);
                tbl.Rows.Add(editorRow);
            }

            //Build the Validators
            BuildValidators(editInfo, propEditor.ID);

            var validatorsRow  = new TableRow();
            var validatorsCell = new TableCell();

            validatorsCell.ColumnSpan = 2;
            //Add the Validators to the editor cell
            foreach (BaseValidator validator in Validators)
            {
                validatorsCell.Controls.Add(validator);
            }
            validatorsRow.Cells.Add(validatorsCell);
            tbl.Rows.Add(validatorsRow);

            //Add the Table to the Controls Collection
            Controls.Add(tbl);
        }
		/// <summary>
		/// BuildVisibility creates the visibility part of the Control
		/// </summary>
		/// <param name="editInfo">The EditorInfo object for this control</param>
		/// <history>
		///     [cnurse]	05/08/2006	created
		/// </history>
		private VisibilityControl BuildVisibility(EditorInfo editInfo)
		{
			VisibilityControl visControl = null;

			if (ShowVisibility)
			{
			    visControl = new VisibilityControl
			                     {
			                         ID = "_visibility", 
                                     Name = editInfo.Name, 
                                     User = User, 
                                     Value = editInfo.ProfileVisibility
			                     };
			    visControl.ControlStyle.CopyFrom(VisibilityStyle);
				visControl.VisibilityChanged += VisibilityChanged;
			}
			return visControl;
		}
Beispiel #5
0
        /// <Summary>BuildDiv creates the Control as a Div</Summary>
        /// <Param name="editInfo">The EditorInfo object for this control</Param>
        private void BuildDiv(EditorInfo editInfo)
        {
            HtmlGenericControl divLabel = null;

            if (editInfo.LabelMode != LabelMode.None)
            {
                divLabel = new HtmlGenericControl("div");
                string style = "float: " + editInfo.LabelMode.ToString().ToLower();
                if (editInfo.LabelMode == LabelMode.Left || editInfo.LabelMode == LabelMode.Right)
                {
                    style += "; width: " + LabelWidth.ToString();
                }
                divLabel.Attributes.Add("style", style);
                divLabel.Controls.Add(BuildLabel(editInfo));
            }

            HtmlGenericControl divEdit = new HtmlGenericControl("div");
            string             side    = GetOppositeSide(editInfo.LabelMode);

            // HACK : Modified to not error if object is null.
            //if (side.Length > 0)
            if (!String.IsNullOrEmpty(side))
            {
                string style = "float: " + side;
                style += "; width: " + EditControlWidth.ToString();
                divEdit.Attributes.Add("style", style);
            }

            EditControl       propEditor = BuildEditor(editInfo);
            VisibilityControl visibility = BuildVisibility(editInfo);

            if (visibility != null)
            {
                visibility.Attributes.Add("style", "float: right;");
                divEdit.Controls.Add(visibility);
            }
            divEdit.Controls.Add(propEditor);
            Image requiredIcon = BuildRequiredIcon(editInfo);

            divEdit.Controls.Add(propEditor);
            if (requiredIcon != null)
            {
                divEdit.Controls.Add(requiredIcon);
            }

            if (editInfo.LabelMode == LabelMode.Left || editInfo.LabelMode == LabelMode.Top)
            {
                Controls.Add(divLabel);
                Controls.Add(divEdit);
            }
            else
            {
                Controls.Add(divEdit);
                if (divLabel != null)
                {
                    Controls.Add(divLabel);
                }
            }

            //Build the Validators
            BuildValidators(editInfo, propEditor.ID);

            if (Validators.Count > 0)
            {
                //Add the Validators to the editor cell
                foreach (BaseValidator validator in Validators)
                {
                    validator.Width = this.Width;
                    Controls.Add(validator);
                }
            }
        }
        /// <Summary>
        /// BuildVisibility creates the visibility part of the Control
        /// </Summary>
        /// <Param name="editInfo">The EditorInfo object for this control</Param>
        private VisibilityControl BuildVisibility( EditorInfo editInfo )
        {
            VisibilityControl visControl = null;

            if (ShowVisibility)
            {
                visControl = new VisibilityControl();
                visControl.ID = this.ID + "_vis";
                visControl.Caption = Localization.GetString("Visibility");
                visControl.Name = editInfo.Name;
                visControl.Value = editInfo.Visibility;
                visControl.ControlStyle.CopyFrom(VisibilityStyle);
                visControl.VisibilityChanged += new PropertyChangedEventHandler(this.VisibilityChanged);
            }

            return visControl;
        }