GetProperty() public method

public GetProperty ( string name, object defaultReturn = null, System.StringComparison scompare = StringComparison.InvariantCulture, string alternate = null ) : object
name string
defaultReturn object
scompare System.StringComparison
alternate string
return object
Example #1
0
        public object CardAlternateProperty(int id, string alt, string property)
        {
            Card c = Card.Find(id);

            property = property.ToLowerInvariant();
            return(c.GetProperty(property, "", StringComparison.InvariantCultureIgnoreCase, alt));
        }
Example #2
0
        public object CardProperty(int id, string property)
        {
            Card c = Card.Find(id);

            property = property.ToLowerInvariant();
            var value = c.GetProperty(property, "", StringComparison.InvariantCultureIgnoreCase, c.Alternate());

            if (value is RichTextPropertyValue richText)
            {
                return(richText.ToString());
            }
            return(value);
        }