public AddNoLock ( IronPython.Runtime.DictionaryStorage &storage, object key, object value ) : void | ||
storage | IronPython.Runtime.DictionaryStorage | |
key | object | |
value | object | |
return | void |
public override void AddNoLock(ref DictionaryStorage storage, object key, object value) { if (key is string && TrySetExtraValue((string)key, value)) { return; } _storage.AddNoLock(ref storage, key, value); }
internal PythonDictionary(IDictionary dict) { var storage = new CommonDictionaryStorage(); foreach (DictionaryEntry de in dict) { storage.AddNoLock(de.Key, de.Value); } _storage = storage; }
public void __init__(object setData) { CommonDictionaryStorage newStorage = new CommonDictionaryStorage(); IEnumerator ie = PythonOps.GetEnumerator(setData); while (ie.MoveNext()) { object current = ie.Current; newStorage.AddNoLock(current, current); } _items = newStorage; }
public override void Add(ref DictionaryStorage storage, object key, object value) { lock (this) { if (storage == this) { CommonDictionaryStorage newStorage = new CommonDictionaryStorage(); newStorage.AddNoLock(key, value); storage = newStorage; return; } } // race, try again... storage.Add(ref storage, key, value); }
public override void Add(ref DictionaryStorage storage, object key, object value) { lock (this) { if (storage == this) { CommonDictionaryStorage newStorage = new CommonDictionaryStorage(); newStorage.AddNoLock(key, value); storage = newStorage; return; } } // race, try again... storage.Add(ref storage, key, value); }
internal static PythonDictionary CertificateToPython(CodeContext context, X509Certificate cert, bool complete) { var dict = new CommonDictionaryStorage(); dict.AddNoLock("notAfter", ToPythonDateFormat(cert.GetExpirationDateString())); dict.AddNoLock("subject", IssuerToPython(context, cert.Subject)); if (complete) { dict.AddNoLock("notBefore", ToPythonDateFormat(cert.GetEffectiveDateString())); dict.AddNoLock("serialNumber", SerialNumberToPython(cert)); dict.AddNoLock("version", cert.GetCertHashString()); dict.AddNoLock("issuer", IssuerToPython(context, cert.Issuer)); } return new PythonDictionary(dict); }
private MSAst.Expression ReduceConstant() { for (int index = 0; index < _items.Length; index++) { SliceExpression slice = _items[index]; if (!slice.SliceStop.IsConstant || !slice.SliceStart.IsConstant) { return null; } } CommonDictionaryStorage storage = new CommonDictionaryStorage(); for (int index = 0; index < _items.Length; index++) { SliceExpression slice = _items[index]; storage.AddNoLock(slice.SliceStart.GetConstantValue(), slice.SliceStop.GetConstantValue()); } return Ast.Call(AstMethods.MakeConstantDict, Ast.Constant(new ConstantDictionaryStorage(storage), typeof(object))); }
private static void AddSubjectAltNames(CommonDictionaryStorage dict, X509Certificate2 cert2) { foreach (var extension in cert2.Extensions) { if (extension.Oid.Value != "2.5.29.17") { // Subject Alternative Name continue; } var altNames = new List<object>(); var sr = new StringReader(extension.Format(true)); string line; while (null != (line = sr.ReadLine())) { line = line.Trim(); var keyValue = line.Split('='); if (keyValue[0] == "DNS Name" && keyValue.Length == 2) { altNames.Add(PythonTuple.MakeTuple("DNS", keyValue[1])); } } dict.AddNoLock("subjectAltName", PythonTuple.MakeTuple(altNames.ToArray())); break; } }