Inheritance: TextFieldSetting
コード例 #1
0
        //========================================================================================= Helper methods

        private static void AddContentListField(ContentRepository.Content content)
        {
            if (content == null)
                return;

            var contentList = ContentList.GetContentListByParentWalk(content.ContentHandler);
            if (contentList == null)
                return;

            //build longtext field for custom status messages
            var fs = new LongTextFieldSetting
                         {
                             ShortName = "LongText",
                             Name =
                                 "#" + ContentNamingHelper.GetNameFromDisplayName(content.Name, content.DisplayName) +
                                 "_status",
                             DisplayName = content.DisplayName + " status",
                             Icon = content.Icon
                         };

            contentList.AddOrUpdateField(fs);
        }
コード例 #2
0
        private static FieldControl CreateDefaultLongTextControl(LongTextFieldSetting longTextSetting)
        {
            Type controlType = null;
            FieldControl control = null;

            if (longTextSetting != null)
            {
                if (longTextSetting.ControlHint == "control:ChoiceOptionEditor")
                {
                    controlType = typeof(ChoiceOptionEditor);
                }
                if (longTextSetting.ControlHint == "control:SurveyRuleEditor")
                {
                    controlType = typeof(SurveyRuleEditor);
                }
                else
                {
                    switch (longTextSetting.TextType)
                    {
                        case TextType.RichText:
                            controlType = typeof(RichText);
                            break;
                        case TextType.AdvancedRichText:
                            controlType = typeof(RichText);
                            break;
                        default:
                            controlType = typeof(LongText);
                            break;
                    }
                }

                control = (FieldControl)Activator.CreateInstance(controlType);
            }

            return control;
        }