protected override void CreateChildControls()
        {
            base.ControlMode = SPContext.Current.FormContext.FormMode;
            base.CreateChildControls();
            propertyField = (SchemaPropertyField)ItemFieldValue;

            if (propertyField == null)
            {
                propertyField = new SchemaPropertyField();
            }

            if (base.ControlMode == SPControlMode.Edit || base.ControlMode == SPControlMode.New)
            {
                tbx_type     = (TextBox)this.TemplateContainer.FindControl("tbx_type");
                tbx_property = (TextBox)this.TemplateContainer.FindControl("tbx_property");

                if (tbx_type != null)
                {
                    tbx_type.Text = propertyField.Type;
                }

                if (tbx_property != null)
                {
                    tbx_property.Text = propertyField.Property;
                }
            }
            else
            {
                scope = (HtmlGenericControl)this.TemplateContainer.FindControl("scope");
                scope.Attributes["itemtype"] = propertyField.Type;
                scope.Attributes["itemprop"] = propertyField.Property;
            }
        }
Beispiel #2
0
        public override string GetFieldValueAsText(object value)
        {
            SchemaPropertyField field = (SchemaPropertyField)value;

            if (field != null)
            {
                return(field.ToString());
            }
            return(string.Empty);
        }