|
using System;
using System.Collections.Generic;
using System.Text;
using Fluid.Controls;
using System.Drawing;
using PasswordSafe.Templates;
using PasswordSafe.Xml;
using PasswordSafe.Classes;
namespace PasswordSafe
{
public class PasswordsListBox : ListBoxBase
{
protected override void InitControl()
{
base.InitControl();
//ShowHeader = false;
ItemHeight = 32;
Template = new PasswordTemplate();
}
private NotifyList passwords;
public NotifyList Passwords
{
get { return passwords; }
set
{
if (passwords != value)
{
passwords = value;
//ShowHeader = value != null && value.Count > 3 && value[0] is IGroupHeader;
DataSource = value;
}
}
}
protected override void OnItemClick(int index)
{
base.OnItemClick(index);
SelectedItemIndex = index;
NavigateForward();
}
public override bool NavigateForward()
{
PasswordData password = passwords[SelectedItemIndex] as PasswordData;
SelectedPassword = password;
if (password != null)
{
if (PasswordSelected != null) PasswordSelected(this, EventArgs.Empty);
}
return true;
}
public PasswordData SelectedPassword { get; private set; }
public event EventHandler PasswordSelected;
public override void AddItem()
{
}
}
}
|
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.