Пример #1
0
        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;
            }
        }
Пример #2
0
        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();
        }