コード例 #1
0
        protected override void CreateChildControls()
        {
            base.ControlMode = SPContext.Current.FormContext.FormMode;
            base.CreateChildControls();

            typeField = (SchemaTypeField)ItemFieldValue;

            if (typeField == null)
            {
                typeField = new SchemaTypeField { Type = "http://Schema.Org/WebPage" };
            }

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

                if (tbx_type != null)
                {
                    tbx_type.Text = typeField.Type;
                }
            }
            else
            {
                scope = (HtmlGenericControl)this.TemplateContainer.FindControl("scope");
                scope.Attributes["itemtype"] = typeField.Type;
            }
        }
コード例 #2
0
ファイル: SchemaType.cs プロジェクト: hemrika/SharePresence
        public override string GetFieldValueAsText(object value)
        {
            SchemaTypeField field = (SchemaTypeField)value;

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