public static bool ValidateEmbeddedImageName(AttributeInfo embeddedImageName, EmbeddedImageHashtable embeddedImages, ObjectType objectType, string objectName, string propertyName, ErrorContext errorContext) { Global.Tracer.Assert(null != embeddedImageName); if (!embeddedImageName.IsExpression) { return(PublishingValidator.ValidateEmbeddedImageName(embeddedImageName.Value, embeddedImages, objectType, objectName, propertyName, errorContext)); } return(true); }
public override bool Initialize(InitializationContext context) { context.ObjectType = this.ObjectType; context.ObjectName = base.m_name; context.ExprHostBuilder.ImageStart(base.m_name); base.Initialize(context); if (base.m_visibility != null) { base.m_visibility.Initialize(context, false, false); } if (this.m_action != null) { this.m_action.Initialize(context); } if (this.m_value != null) { this.m_value.Initialize("Value", context); context.ExprHostBuilder.GenericValue(this.m_value); if (ExpressionInfo.Types.Constant == this.m_value.Type && this.m_source == SourceType.External && !context.ReportContext.IsSupportedProtocol(this.m_value.Value, true)) { context.ErrorContext.Register(ProcessingErrorCode.rsUnsupportedProtocol, Severity.Error, this.ObjectType, base.m_name, "Value", this.m_value.Value, "http://, https://, ftp://, file:, mailto:, or news:"); } } if (this.m_MIMEType != null) { this.m_MIMEType.Initialize("MIMEType", context); context.ExprHostBuilder.ImageMIMEType(this.m_MIMEType); } if (SourceType.Embedded == this.m_source) { Global.Tracer.Assert(null != this.m_value); PublishingValidator.ValidateEmbeddedImageName(this.m_value, context.EmbeddedImages, this.ObjectType, base.m_name, "Value", context.ErrorContext); } base.ExprHostID = context.ExprHostBuilder.ImageEnd(); return(true); }
public void Initialize(InitializationContext context) { Global.Tracer.Assert(null != this.m_styleAttributes); IDictionaryEnumerator enumerator = this.m_styleAttributes.GetEnumerator(); while (enumerator.MoveNext()) { string text = (string)enumerator.Key; AttributeInfo attributeInfo = (AttributeInfo)enumerator.Value; Global.Tracer.Assert(null != text); Global.Tracer.Assert(null != attributeInfo); if (attributeInfo.IsExpression) { string name = text; switch (text) { case "BorderColorLeft": case "BorderColorRight": case "BorderColorTop": case "BorderColorBottom": text = "BorderColor"; break; case "BorderStyleLeft": case "BorderStyleRight": case "BorderStyleTop": case "BorderStyleBottom": text = "BorderStyle"; break; case "BorderWidthLeft": case "BorderWidthRight": case "BorderWidthTop": case "BorderWidthBottom": text = "BorderWidth"; break; } Global.Tracer.Assert(null != this.m_expressionList); ExpressionInfo expressionInfo = this.m_expressionList[attributeInfo.IntValue]; expressionInfo.Initialize(text, context); context.ExprHostBuilder.StyleAttribute(name, expressionInfo); } } AttributeInfo attributeInfo2 = this.m_styleAttributes["BackgroundImageSource"]; if (attributeInfo2 != null) { Global.Tracer.Assert(!attributeInfo2.IsExpression); Image.SourceType intValue = (Image.SourceType)attributeInfo2.IntValue; if (Image.SourceType.Embedded == intValue) { AttributeInfo attributeInfo3 = this.m_styleAttributes["BackgroundImageValue"]; Global.Tracer.Assert(null != attributeInfo3); PublishingValidator.ValidateEmbeddedImageName(attributeInfo3, context.EmbeddedImages, context.ObjectType, context.ObjectName, "BackgroundImageValue", context.ErrorContext); } else if (intValue == Image.SourceType.External) { AttributeInfo attributeInfo4 = this.m_styleAttributes["BackgroundImageValue"]; Global.Tracer.Assert(null != attributeInfo4); if (!attributeInfo4.IsExpression) { context.ImageStreamNames[attributeInfo4.Value] = new ImageInfo(context.ObjectName, null); } } } context.CheckInternationalSettings(this.m_styleAttributes); }