private void MainForm_Load(object sender, EventArgs e) { if (this.store == null) { this.store = new CredentialStore(); } this.dataGridView.DataSource = this.store.Data; }
/// <summary> /// 反序列化。 /// </summary> /// <returns></returns> public static CredentialStore DeSerializer() { string strPath = path; if (File.Exists(strPath)) { CredentialsCollection data = UtilTools.DeSerializer<CredentialsCollection>(strPath); if (data != null) { CredentialStore store = new CredentialStore(); store.collection = data; return store; } } return null; }
/// <summary> /// /// </summary> /// <param name="store"></param> internal CredentialsWindow(CredentialStore store, Credentials credit) : this() { this.store = store; this.credentials = credit; }
/// <summary> /// 构造函数。 /// </summary> public MainForm() { this.store = CredentialStore.DeSerializer(); InitializeComponent(); }