public override string BuildSetFieldXml(string[] values, EwsAttributes attributes) { if (values.Length == 0 || values.Length > 1) { throw new ArgumentException("Only single value are valid"); } const string template = "<t:SetItemField>" + " {0}" + " <t:Item{1}>" + " <t:ExtendedProperty>" + " {0}" + " <t:Value>{2}</t:Value>" + " </t:ExtendedProperty>" + " </t:Item>" + "</t:SetItemField>"; string xmlDefinition = this.GetXml(); string xml = string.Format( template, xmlDefinition, attributes, values[0]); return(xml); }
public override string BuildSetFieldValueXml(string[] value, EwsAttributes attributes) { if (attributes != null && attributes.Count > 0) { return(string.Format("<t:{0} {1}>{2}</t:{0}>", this.FieldUri, attributes, value[0])); } else { return(string.Format("<t:{0}>{1}</t:{0}>", this.FieldUri, value[0])); } }
public override string BuildSetFieldValueXml(string[] values, EwsAttributes attributes) { const string template = "<t:{0}>{1}</t:{0}>"; var builder = new StringBuilder(); foreach (string value in values) { builder.AppendLine(string.Format("<t:String>{0}</t:String>\n", value)); } return(string.Format(template, this.FieldUri, builder)); }
public override string BuildSetFieldXml(string[] values, EwsAttributes attributes) { const string template = "<t:SetItemField>" + " {0}" + " {1}" + "</t:SetItemField>"; string xmlDefinition = this.GetXml(); string xml = string.Format( template, xmlDefinition, this.GetFieldValueXml(values, attributes)); return(xml); }
public virtual string GetFieldValueXml(string[] values, EwsAttributes attributes) { if (values.Length == 0 || values.Length > 1) { throw new ArgumentException("Only single value are valid"); } const string template = " <t:{0}>" + " <t:{1}{2}>{3}</t:{1}>" + " </t:{0}>"; string xml = string.Format( template, this.type, this.FieldUri, attributes, values[0]); return(xml); }
public override string GetFieldValueXml(string[] values, EwsAttributes attributes) { const string template = " <t:Item>" + " <t:{0}{1}>" + " {2}" + " </t:{0}>" + " </t:Item>"; var builder = new StringBuilder(); foreach (string value in values) { builder.AppendLine(string.Format("<t:String>{0}</t:String>", value)); } string xml = string.Format( template, this.FieldUri, attributes, builder); return(xml); }
public override string BuildSetFieldValueXml(string[] value, EwsAttributes attributes) { string innerXml = this.GetXml(); return(string.Format("<t:ExtendedProperty>{0} <t:Value>{1}</t:Value>" + "</t:ExtendedProperty>", innerXml, value[0])); }
public static string BuildUpdateFieldValueXml(EwsFieldUri fieldUri, string[] values, EwsAttributes attributes = null) { var definition = GetPropertyDefinition(fieldUri); return(definition.BuildSetFieldXml(values.Select(v => v.ToEscapedXml()).ToArray(), attributes)); }
public static string BuildUpdateFieldRawValueXml(EwsFieldUri fieldUri, string value, EwsAttributes attributes = null) { var definition = GetPropertyDefinition(fieldUri); return(definition.BuildSetFieldXml(new [] { value }, attributes)); }
public static string BuildUpdateFieldValueXml(EwsFieldUri fieldUri, string value, EwsAttributes attributes = null) { return(BuildUpdateFieldValueXml(fieldUri, new[] { value.ToEscapedXml() }, attributes)); }
public static string BuildSetFieldValueXml(EwsFieldUri fieldUri, string value, EwsAttributes attributes = null) { return(BuildSetFieldValueXml(fieldUri, new[] { value }, attributes)); }
public virtual string BuildSetFieldValueXml(string[] value, EwsAttributes attributes) { throw new NotSupportedException(); }