|
using System;
using System.Collections.Generic;
using System.Text;
using PasswordSafe.Xml;
namespace PasswordSafe.Classes
{
public class PasswordCategory:NotifyItemBase
{
public PasswordCategory()
: base()
{
}
public PasswordCategory(string name):base()
{
Name = name.ToLower();
Title = name;
}
public string Name { get; set; }
public string Title { get; set; }
public bool IsDefault { get; set; }
public bool ReadOnly { get; set; }
private List<FieldInfo> fields = new List<FieldInfo>();
public List<FieldInfo> Fields { get { return fields; } }
internal List<PasswordData> passwords = new List<PasswordData>();
/// <summary>
/// Gets all passwords associated with this.
/// </summary>
public IEnumerable<PasswordData> Passwords { get { return passwords; } }
public int PasswordCount { get { return passwords.Count; } }
internal void Remove(PasswordData password)
{
passwords.Remove(password);
}
internal void Add(PasswordData password)
{
passwords.Add(password);
}
/// <summary>
/// Clones the category
/// </summary>
/// <returns>A duplicate of this category.</returns>
public PasswordCategory Clone()
{
PasswordCategory clone = new PasswordCategory();
clone.Name = Name;
clone.IsDefault = IsDefault;
clone.Title = Title;
foreach (var field in Fields)
{
clone.Fields.Add(field);
}
return clone;
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.