Core2D.Data.XContext.this C# (CSharp) Method

this() public method

Gets or sets XProperty.Value using name as key for Properties array values.
If property with the specified key does not exist it is created.
public this ( string name ) : string
name string The property value.
return string
        public string this[string name]
        {
            get
            {
                var result = _properties.FirstOrDefault(p => p.Name == name);
                if (result != null)
                {
                    return result.Value;
                }
                return null;
            }
            set
            {
                if (value != null)
                {
                    var result = _properties.FirstOrDefault(p => p.Name == name);
                    if (result != null)
                    {
                        result.Value = value;
                    }
                    else
                    {
                        var property = XProperty.Create(this, name, value);
                        Properties = Properties.Add(property);
                    }
                }
            }
        }