public Entry(ICollection<Field> fields) { if (fields == null) throw new ArgumentNullException("fields"); Icon = new IconData(); _original = fields; _fields = fields.ToDictionary( x => x.Name, x => x.Clone()); _protects = new EntryProtects(_fields); }
public Entry(ICollection <Field> fields) { if (fields == null) { throw new ArgumentNullException("fields"); } Icon = new IconData(); _original = fields; _fields = fields.ToDictionary( x => x.Name, x => x.Clone()); _protects = new EntryProtects(_fields); }
/// <summary> /// Gets the overlay icon. /// </summary> /// <param name="dispatcher">The dispatcher.</param> /// <param name="icon">The icon information.</param> /// <returns> /// The overlay icon. /// </returns> public static ImageSource GetOverlay( Dispatcher dispatcher, IconData icon) { if (icon == null) throw new ArgumentNullException("icon"); ImageSource source; if (!string.IsNullOrEmpty(icon.Custom) && Database.Icons.TryGetValue(icon.Custom, out source)) return source; var id = icon.Standard; if (!_standards.TryGetValue(id, out source)) { lock (_lckStandards) { if (!_standards.TryGetValue(id, out source)) { var wait = new ManualResetEvent(false); dispatcher.BeginInvoke(() => { // "/Images/KeePass/classic/{0:00}.png", id); var uri = string.Format(_imagePath, id, _theamPrefix); source = new BitmapImage(new Uri( uri, UriKind.Relative)); _standards.Add(id, source); wait.Set(); }); wait.WaitOne(); } } } return source; }
private static IconData ParseIcon(XmlReader reader) { var data = new IconData(); if (reader.Name != "IconID") reader.ReadToNextSibling("IconID"); data.Standard = reader .ReadElementContentAsInt(); if (reader.Name == "CustomIconUUID") { data.Custom = reader .ReadElementContentAsString(); } return data; }
public Group() { Icon = new IconData(); _groups = new List <Group>(); _entries = new List <Entry>(); }
public Group() { Icon = new IconData(); _groups = new List<Group>(); _entries = new List<Entry>(); }