private void AddEnvironmentVars() { try { foreach (DictionaryEntry de in Environment.GetEnvironmentVariables()) { _storage.Add(de.Key, de.Value); } } catch (SecurityException) { // environment isn't available under partial trust } }
public virtual DictionaryStorage Clone() { CommonDictionaryStorage storage = new CommonDictionaryStorage(); foreach (KeyValuePair<object, object> kvp in GetItems()) { storage.Add(kvp.Key, kvp.Value); } return storage; }
void ISet.SetData(IEnumerable set) { _items = new CommonDictionaryStorage(); foreach (object o in set) { _items.Add(o, o); } }
public void Add(object key, object value) { if (key is string && TrySetExtraValue((string)key, value)) { return; } _storage.Add(key, value); }
public override void Add(ref DictionaryStorage storage, object key, object value) { if (key is string && TrySetExtraValue((string)key, value)) { return; } _storage.Add(key, value); }
public virtual DictionaryStorage Clone() { CommonDictionaryStorage storage = new CommonDictionaryStorage(); foreach (KeyValuePair <object, object> kvp in GetItems()) { storage.Add(kvp.Key, kvp.Value); } return(storage); }
private static CommonDictionaryStorage ListToDictionary(object set) { IEnumerator setData = PythonOps.GetEnumerator(set); CommonDictionaryStorage items = new CommonDictionaryStorage(); while (setData.MoveNext()) { object o = setData.Current; items.Add(o, o); } return(items); }
public override void Add(object key, object value) { _storage.Add(key, value); string s1 = key as string; string s2 = value as string; if (s1 != null && s2 != null) { Environment.SetEnvironmentVariable(s1, s2); } }
public DebuggerDictionaryStorage(IDictionary<object, object> data) { Debug.Assert(data != null); _hidden = new CommonDictionaryStorage(); foreach (var key in data.Keys) { string strKey = key as string; if (strKey != null && strKey.Length > 0 && strKey[0] == '$') { _hidden.Add(strKey, null); } } _data = data; }
public DebuggerDictionaryStorage(IDictionary <object, object> data) { Debug.Assert(data != null); _hidden = new CommonDictionaryStorage(); foreach (var key in data.Keys) { if (key is string strKey && strKey.Length > 0 && strKey[0] == '$') { _hidden.Add(strKey, null); } } _data = data; }
public AttributesDictionaryStorage(IAttributesCollection data) { Debug.Assert(data != null); _hidden = new CommonDictionaryStorage(); foreach (var key in data.Keys) { string strKey = key as string; if (strKey != null && strKey.Length > 0 && strKey[0] == '$') { _hidden.Add(strKey, null); } } _data = data; }
public void add(object o) { _items.Add(o, o); }
void ISet.PrivAdd(object adding) { PythonOps.Hash(DefaultContext.Default, adding);// make sure we're hashable _items.Add(adding, adding); }