public static void Write(this RunObjectProperty property, bool isLastProperty, PropertiesStyle style, CSideWriter writer) { switch (isLastProperty) { case true: writer.Write("{0}={1} {2} ", property.Name, FormatRunObjectType(property.Value.Type.Value), property.Value.ID); break; case false: writer.WriteLine("{0}={1} {2};", property.Name, FormatRunObjectType(property.Value.Type.Value), property.Value.ID); break; } }
internal static void SetObjectReferenceProperty(this RunObjectProperty property, string propertyValue) { if (string.IsNullOrWhiteSpace(propertyValue)) { return; } var match = Regex.Match(propertyValue, @"(\S+)\s(\d+)"); if (!match.Success) { throw new ArgumentOutOfRangeException(string.Format("Invalid object reference: {0}.", propertyValue)); } property.Value.Type = match.Groups[1].Value.ToNullableEnum <RunObjectType>(); property.Value.ID = match.Groups[2].Value.ToInteger(); }