예제 #1
0
        public string GetStringProperty(string key, string defaultValue = null)
        {
            SourceControlProperty property = this.Properties.FirstOrDefault( p => p.Key.ToLower() == key.ToLower());

            if (property == null)
            {
                return defaultValue;
            }

            return property.Value ?? defaultValue;
        }
예제 #2
0
        public void SetStringProperty(string key, string value)
        {
            SourceControlProperty property = this.Properties.FirstOrDefault( p => p.Key.ToLower() == key.ToLower());

            if (property == null)
            {
                property = new SourceControlProperty();
                property.SourceControl = this;
                property.Key = key;
                this.Properties.Add(property);
            }

            property.Value = value;
        }