public override object this[string keyword] { get { return(GetAt(GetIndex(keyword))); } set { if (value == null) { Remove(keyword); return; } switch (GetIndex(keyword)) { case Keywords.DataSource: DataSource = Convert.ToString(value, CultureInfo.InvariantCulture); return; case Keywords.Cache: SqliteConnectionCacheMode mode; if (!Enum.TryParse(value as string, out mode)) { throw new ArgumentException(Strings.FormatInvalidCacheMode(value)); } Cache = mode; return; default: Debug.Fail("Unexpected keyword: " + keyword); return; } } }
private void Reset(Keywords index) { switch (index) { case Keywords.DataSource: _dataSource = string.Empty; return; case Keywords.Cache: _cacheMode = SqliteConnectionCacheMode.Private; return; default: Debug.Fail("Unexpected keyword: " + index); return; } }
public override object this[string keyword] { get { return GetAt(GetIndex(keyword)); } set { if (value == null) { Remove(keyword); return; } switch (GetIndex(keyword)) { case Keywords.DataSource: DataSource = Convert.ToString(value, CultureInfo.InvariantCulture); return; case Keywords.Cache: SqliteConnectionCacheMode mode; if (!Enum.TryParse(value as string, out mode)) { throw new ArgumentException(Strings.FormatInvalidCacheMode(value)); } Cache = mode; return; default: Debug.Fail("Unexpected keyword: " + keyword); return; } } }