Пример #1
0
        /// <summary>Gets the field value.</summary>
        /// <param name="args">The arguments.</param>
        /// <contract>
        ///   <requires name="args" condition="none" />
        /// </contract>
        public void Process(RenderFieldArgs args)
        {
            Assert.ArgumentNotNull((object)args, "args");
            if (!this.CanWebEdit(args) && !args.WebEditParameters.ContainsKey("sc-highlight-contentchange") || (args.Item == null || !this.CanEditItem(args.Item)))
            {
                return;
            }
            Field field = args.Item.Fields[args.FieldName];

            if (field == null || !this.CanEditField(field))
            {
                return;
            }
            Item           obj               = field.Item;
            string         str               = obj[FieldIDs.Revision].Replace("-", string.Empty);
            string         controlID         = "fld_" + (object)obj.ID.ToShortID() + "_" + (object)field.ID.ToShortID() + "_" + (object)obj.Language + "_" + (object)obj.Version + "_" + str + "_" + (object)MainUtil.GetSequencer();
            HtmlTextWriter output            = new HtmlTextWriter((TextWriter) new StringWriter());
            string         rawValueContainer = this.GetRawValueContainer(field, controlID);

            output.Write(rawValueContainer);
            if (args.DisableWebEditContentEditing && args.DisableWebEditFieldWrapping)
            {
                this.RenderWrapperlessField(output, args, field, controlID);
            }
            else
            {
                this.RenderWrappedField(output, args, field, controlID);
            }
        }