21 Commits
v0.5 ... v0.5.2

Author SHA1 Message Date
abdelkader
47e5f0406f added UIToolbox to add removable component
start
2023-06-27 12:32:38 -04:00
abdelkader
cbc4a24152 Merge branch 'master' of https://github.com/abdelkader/vCardEditor 2023-06-27 12:32:26 -04:00
Abdel
2c47765a5e Update README.md 2023-06-12 22:50:59 -04:00
abdelkader
f538d3a978 remove test 2023-05-11 08:56:35 -04:00
abdelkader
a589c642d3 Merge branch 'master' of https://github.com/abdelkader/vCardEditor 2023-05-11 08:56:13 -04:00
Abdel
687b2a248a Update README.md 2023-05-11 08:53:39 -04:00
abdelkader
834c1a7243 Added test and refactor 2023-05-10 13:20:17 -04:00
abdelkader
d9657f2318 Added test 2023-05-09 22:08:49 -04:00
abdelkader
3bbe7170c4 added autofixture et other tests 2023-05-09 20:41:33 -04:00
abdelkader
48631de425 refacotring
added tests
2023-05-09 19:42:31 -04:00
abdelkader
71b5b7580a Merge branch 'master' of https://github.com/abdelkader/vCardEditor 2023-05-08 21:56:13 -04:00
abdelkader
7a4c8e9d42 fix minor fusions commit 2023-05-08 21:54:33 -04:00
abdelkader
1233425972 refactor 2023-05-08 21:43:23 -04:00
abdelkader
2885f5f5cc fusion 2023-05-08 19:57:21 -04:00
abdelkader
89c06504ee first draft of adding column
added a split container
save position and location of winform
save also visible columns
Added vcard copy to clipboard
corrected failed tests
2023-05-08 19:53:12 -04:00
Abdel
adac378b13 Update README.md 2023-05-05 17:56:07 -04:00
abdelkader
74b5400a34 Added vcard copy to clipboard 2023-05-04 21:22:37 -04:00
abdelkader
7ffb330559 corrected failed tests 2023-05-04 18:30:07 -04:00
abdelkader
3b1cfcd36b added a release file 2023-05-04 15:28:42 -04:00
Abdel
8cf9ce829c Update README.md 2023-05-04 14:36:39 -04:00
Abdel
071c967e08 Update README.md
added the screenshot
2023-05-04 14:34:35 -04:00
44 changed files with 2868 additions and 505 deletions

View File

@@ -1,51 +1,35 @@
[![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/B0B2KV8WP)
<p align="center">
<a href="https://github.com/abdelkader/vCardEditor/releases/latest/download/vCardEditor.exe"><img src="https://camo.githubusercontent.com/d83fa798b621f1e112646fcc4aa74fff1ff6a8b22f5fc1da5ed8f79ddb4a51cb/68747470733a2f2f62616467656e2e6e65742f6769746875622f72656c656173652f4e61657265656e2f5374726170646f776e2e6a73" alt="Latest release" data-canonical-src="https://badgen.net/github/release/Naereen/Strapdown.js" style="max-width: 100%;"></a>
</p>
# vCard Editor
## vCard Editor
A Simple vcf file Editor. You can export easily edit (modify, delete) entries of a vcf file with this simple tool.
The software is still in **early stage**.
<p align="center"><img src="https://user-images.githubusercontent.com/169070/236289228-106c1489-e01d-400c-968e-92d3e2be74ab.png" width="800"></p>
## ✅ Features
- [x] No need to install anything. Just head to the release section and download the last release version.
- [x] Add/Export images
## Installation
🔧 No need to install anything. Just head to the release section and download the last release version.
## Screenshots
![vcardeditorv0_5](https://user-images.githubusercontent.com/169070/236289228-106c1489-e01d-400c-968e-92d3e2be74ab.png)
## Acknowledgements
## 📚 Tech Stack
- 🧰 [Wonderful library of parsing and generating vcf format](https://github.com/drlongnecker/Thought.vCards)
- 📖 [MVP pattern from this example](https://github.com/lennykean/NoteCards)
## Release notes
#### 0.4
- Import images
- refactoring and bugs fixed
#### 0.3
- Added address section.
- refactoring and bugs fixed
#### 0.2
- Updated the vCard library to https://github.com/acastroy/Thought.vCards
- Replaced Moq with nsubstitute (Test mocking library).
## Contributing
Contributions are always welcome!
- 🧰 [SortableBindingList](http://timvw.be/2008/08/02/presenting-the-sortablebindinglistt-take-two/)
- 🧰 [Custom TabControl](https://github.com/r-aghaei/TabControlWithCloseButtonAndAddButton)
## 📑 Release notes
Check release text file for history.
## 👷 Contributing
Contributions are always welcome! Check ths projet or ths issue page for ideas.

View File

@@ -0,0 +1,9 @@
namespace vCardEditor.Model
{
public enum Column
{
Name = 0,
FamilyName,
Cellular,
}
}

View File

@@ -15,6 +15,22 @@ namespace VCFEditor.Model
NotifyPropertyChanged("Name");
}
}
[DisplayName("F.Name")]
public string FamilyName
{
get => card.FamilyName;
}
[DisplayName("Cellular")]
public string Cellular
{
get {
if (card.Phones.GetFirstChoice(vCardPhoneTypes.Cellular) != null)
return card.Phones.GetFirstChoice(vCardPhoneTypes.Cellular).FullNumber;
return string.Empty;
}
}
[Browsable(false)]

View File

@@ -0,0 +1,19 @@
using System.Collections.Generic;
namespace vCardEditor.Model
{
public struct FormState
{
public List<Column> Columns { get; set; }
public int X { get; set; }
public int Y { get; set; }
public int Height { get; set; }
public int Width { get; set; }
public int splitterPosition { get; set; }
}
}

View File

@@ -0,0 +1,48 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Reflection;
namespace vCardEditor.Model
{
public class PropertyComparer<T> : IComparer<T>
{
private readonly IComparer comparer;
private PropertyDescriptor propertyDescriptor;
private int reverse;
public PropertyComparer(PropertyDescriptor property, ListSortDirection direction)
{
this.propertyDescriptor = property;
Type comparerForPropertyType = typeof(Comparer<>).MakeGenericType(property.PropertyType);
this.comparer = (IComparer)comparerForPropertyType.InvokeMember("Default", BindingFlags.Static | BindingFlags.GetProperty | BindingFlags.Public, null, null, null);
this.SetListSortDirection(direction);
}
#region IComparer<T> Members
public int Compare(T x, T y)
{
return this.reverse * this.comparer.Compare(this.propertyDescriptor.GetValue(x), this.propertyDescriptor.GetValue(y));
}
#endregion
private void SetPropertyDescriptor(PropertyDescriptor descriptor)
{
this.propertyDescriptor = descriptor;
}
private void SetListSortDirection(ListSortDirection direction)
{
this.reverse = direction == ListSortDirection.Ascending ? 1 : -1;
}
public void SetPropertyAndDirection(PropertyDescriptor descriptor, ListSortDirection direction)
{
this.SetPropertyDescriptor(descriptor);
this.SetListSortDirection(direction);
}
}
}

View File

@@ -7,7 +7,6 @@ using vCardEditor.Repository;
using vCardEditor.Model;
using System.Linq;
using System.IO;
using System.Drawing;
using System.Collections.Generic;
namespace VCFEditor.Presenter
@@ -22,26 +21,51 @@ namespace VCFEditor.Presenter
_view = view;
_repository = repository;
_view.AddContact += AddContact;
_view.NewFileOpened += NewFileOpened;
_view.BeforeOpeningNewFile += BeforeOpeningNewFile;
_view.SaveContactsSelected += SaveContacts;
_view.ChangeContactsSelected += ChangeContactSelected;
_view.DeleteContact += DeleteContact;
_view.FilterTextChanged += FilterTextChanged;
_view.TextBoxValueChanged += TextBoxValueChanged;
_view.BeforeLeavingContact += BeforeLeavingContact;
_view.CloseForm += CloseForm;
_view.ModifyImage += ModifyImage;
_view.ExportImage += ExportImage;
_view.AddressAdded += _view_AddressAdded;
_view.AddressModified += _view_AddressModified;
_view.AddressRemoved += _view_AddressRemoved;
_view.LoadForm += LoadFormHandler;
_view.AddContact += AddContactHandler;
_view.NewFileOpened += NewFileOpenedHandler;
_view.BeforeOpeningNewFile += BeforeOpeningNewFileHandler;
_view.SaveContactsSelected += SaveContactsHandler;
_view.ChangeContactsSelected += ChangeContactSelectedHandler;
_view.DeleteContact += DeleteContactHandler;
_view.FilterTextChanged += FilterTextChangedHandler;
_view.TextBoxValueChanged += TextBoxValueChangedHandler;
_view.BeforeLeavingContact += BeforeLeavingContactHandler;
_view.CloseForm += CloseFormHandler;
_view.ModifyImage += ModifyImageHandler;
_view.ExportImage += ExportImageHandler;
_view.AddressAdded += AddressAddedHandler;
_view.AddressModified += AddressModifiedHandler;
_view.AddressRemoved += AddressRemovedHandler;
_view.CopyTextToClipboardEvent += CopyTextToClipboardHandler;
}
private void _view_AddressRemoved(object sender, EventArg<int> e)
private void CopyTextToClipboardHandler(object sender, EventArgs e)
{
if (_view.SelectedContactIndex < 0)
return;
var contact = _repository.Contacts[_view.SelectedContactIndex];
string SerializedCard = _repository.GenerateStringFromVCard(contact.card);
_view.SendTextToClipBoard(SerializedCard);
_view.DisplayMessage("vCard copied to clipboard!", "Information");
}
private void LoadFormHandler(object sender, EventArg<FormState> e)
{
e.Data = ConfigRepository.Instance.FormState;
var paths = Environment.GetCommandLineArgs();
if (paths.Length > 1)
{
var evt = new EventArg<string>(paths[1]);
NewFileOpenedHandler(sender, evt);
}
}
private void AddressRemovedHandler(object sender, EventArg<int> e)
{
var contact = _repository.Contacts[_view.SelectedContactIndex];
_repository.SetDirtyFlag(_view.SelectedContactIndex);
@@ -49,7 +73,7 @@ namespace VCFEditor.Presenter
contact.card.DeliveryAddresses.RemoveAt(e.Data);
}
private void _view_AddressAdded(object sender, EventArg<List<vCardDeliveryAddressTypes>> e)
private void AddressAddedHandler(object sender, EventArg<List<vCardDeliveryAddressTypes>> e)
{
var contact = _repository.Contacts[_view.SelectedContactIndex];
_repository.SetDirtyFlag(_view.SelectedContactIndex);
@@ -57,7 +81,7 @@ namespace VCFEditor.Presenter
contact.card.DeliveryAddresses.Add(new vCardDeliveryAddress( e.Data));
}
private void _view_AddressModified(object sender, EventArg<List<vCardDeliveryAddressTypes>> e)
private void AddressModifiedHandler(object sender, EventArg<List<vCardDeliveryAddressTypes>> e)
{
var contact = _repository.Contacts[_view.SelectedContactIndex];
_repository.SetDirtyFlag(_view.SelectedContactIndex);
@@ -65,7 +89,7 @@ namespace VCFEditor.Presenter
contact.card.DeliveryAddresses.Clear();
contact.card.DeliveryAddresses.Add(new vCardDeliveryAddress(e.Data));
}
private void ExportImage(object sender, EventArgs e)
private void ExportImageHandler(object sender, EventArgs e)
{
if (_view.SelectedContactIndex > -1)
@@ -76,23 +100,20 @@ namespace VCFEditor.Presenter
if (image != null)
{
var newPath = Path.ChangeExtension(_repository.fileName, image.Extension);
var newPath = _repository.ChangeExtension(_repository.fileName, image.Extension);
string imageFile = _view.DisplaySaveDialog(newPath);
_repository.SaveImageToDisk(imageFile, image);
}
}
}
private void ModifyImage(object sender, EventArg<string> e)
private void ModifyImageHandler(object sender, EventArg<string> e)
{
if (!string.IsNullOrEmpty(e.Data) )
{
vCardPhoto photo = new vCardPhoto(e.Data);
_repository.ModifyImage(_view.SelectedContactIndex, photo);
}
else
@@ -100,17 +121,25 @@ namespace VCFEditor.Presenter
}
void CloseForm(object sender, EventArg<bool> e)
void CloseFormHandler(object sender, EventArg<bool> e)
{
if (_repository.dirty && _view.AskMessage("Exit without saving?", "Exit"))
if (_repository.dirty && _view.AskMessage("Exit without saving?", "Exit"))
e.Data = true;
if (!e.Data)
{
var state = _view.GetFormState();
ConfigRepository.Instance.FormState = state;
ConfigRepository.Instance.SaveConfig();
}
}
public void BeforeLeavingContact(object sender, EventArg<vCard> e)
public void BeforeLeavingContactHandler(object sender, EventArg<vCard> e)
{
_repository.SaveDirtyVCard(_view.SelectedContactIndex, e.Data);
}
public void TextBoxValueChanged(object sender, EventArgs e)
public void TextBoxValueChangedHandler(object sender, EventArgs e)
{
var tb = sender as StateTextBox;
if (tb != null && tb.oldText != tb.Text)
@@ -118,30 +147,30 @@ namespace VCFEditor.Presenter
}
public void FilterTextChanged(object sender, EventArg<string> e)
public void FilterTextChangedHandler(object sender, EventArg<string> e)
{
var FilteredContacts = _repository.FilterContacts(e.Data);
_view.DisplayContacts(FilteredContacts);
}
private void AddContact(object sender, EventArgs e)
private void AddContactHandler(object sender, EventArgs e)
{
_repository.AddEmptyContact();
}
private void DeleteContact(object sender, EventArgs e)
private void DeleteContactHandler(object sender, EventArgs e)
{
_repository.DeleteContact();
}
private void SaveContacts(object sender, EventArgs e)
private void SaveContactsHandler(object sender, EventArgs e)
{
if (!string.IsNullOrEmpty(_repository.fileName))
_repository.SaveContactsToFile(_repository.fileName);
}
private void BeforeOpeningNewFile(object sender, EventArgs e)
private void BeforeOpeningNewFileHandler(object sender, EventArgs e)
{
if (_repository.Contacts != null && _repository.dirty)
{
@@ -150,9 +179,9 @@ namespace VCFEditor.Presenter
}
}
public void NewFileOpened(object sender, EventArg<string> e)
public void NewFileOpenedHandler(object sender, EventArg<string> e)
{
BeforeOpeningNewFile(sender, e);
BeforeOpeningNewFileHandler(sender, e);
string path = e.Data;
if (string.IsNullOrEmpty(path))
@@ -181,7 +210,7 @@ namespace VCFEditor.Presenter
}
public void ChangeContactSelected(object sender, EventArgs e)
public void ChangeContactSelectedHandler(object sender, EventArgs e)
{
if (_view.SelectedContactIndex > -1)
{

17
vCardEditor/Releases.txt Normal file
View File

@@ -0,0 +1,17 @@
0.5
A reworked control for adding/modifying or removing addresses.
0.4
Import images/export images.
refactoring and bugs fixed
0.3
Added address section.
refactoring and bugs fixed
0.2
Updated the vCard library to https://github.com/acastroy/Thought.vCards
Replaced Moq with nsubstitute (Test mocking library).
0.1
Intial release

View File

@@ -1,16 +1,14 @@
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using System.IO;
using System.ComponentModel;
using vCardEditor.Model;
using System.Runtime.Serialization;
namespace vCardEditor.Repository
{
[XmlRoot("Config")]
[Serializable]
public class ConfigRepository
public class ConfigRepository : IConfigRepository
{
private static string ConfigFileName
{
@@ -37,7 +35,10 @@ namespace vCardEditor.Repository
public int Maximum { get; set; }
[Browsable(false)]
public FixedList Paths { get; set;}
public FixedList Paths { get; set; }
[Browsable(false)]
public FormState FormState;
private ConfigRepository() { }
@@ -93,6 +94,6 @@ namespace vCardEditor.Repository
return configData;
}
}
}

View File

@@ -6,6 +6,7 @@ using Thought.vCards;
using VCFEditor.Model;
using System.ComponentModel;
using vCardEditor.Repository;
using vCardEditor.View;
namespace VCFEditor.Repository
{
@@ -21,14 +22,14 @@ namespace VCFEditor.Repository
/// <summary>
/// Keep a copy of contact list when filtering
/// </summary>
private BindingList<Contact> OriginalContactList = null;
private BindingList<Contact> _contacts;
public BindingList<Contact> Contacts
private SortableBindingList<Contact> OriginalContactList = null;
private SortableBindingList<Contact> _contacts;
public SortableBindingList<Contact> Contacts
{
get
{
if (_contacts == null)
_contacts = new BindingList<Contact>();
_contacts = new SortableBindingList<Contact>();
return _contacts;
}
set
@@ -37,16 +38,21 @@ namespace VCFEditor.Repository
}
}
private bool _dirty;
public bool dirty
{
get { return (_contacts != null && _contacts.Any(x => x.isDirty)) || _dirty; }
set { _dirty = true; }
}
public ContactRepository(IFileHandler fileHandler)
{
_fileHandler = fileHandler;
}
public BindingList<Contact> LoadContacts(string fileName)
public SortableBindingList<Contact> LoadContacts(string fileName)
{
Contacts.Clear();
//TODO: Clean end of line from spaces..
this.fileName = fileName;
string[] lines = _fileHandler.ReadAllLines(fileName);
@@ -134,9 +140,8 @@ namespace VCFEditor.Repository
{
if (_contacts[i].isSelected)
{
_contacts[i].isDeleted = true;
SetDirtyFlag(i);
_contacts.RemoveAt(i);
_dirty = true;
_contacts.RemoveAt(i);
}
}
@@ -167,20 +172,15 @@ namespace VCFEditor.Repository
return stream;
}
public BindingList<Contact> FilterContacts(string filter)
public SortableBindingList<Contact> FilterContacts(string filter)
{
var list = OriginalContactList.Where(i => (i.Name.IndexOf(filter, StringComparison.OrdinalIgnoreCase) >= 0) &&
!i.isDeleted);
Contacts = new BindingList<Contact>(list.ToList());
Contacts = new SortableBindingList<Contact>(list.ToList());
return Contacts;
}
/// <summary>
/// Save modified card info in the raw content.
/// </summary>
/// <param name="card"></param>
/// <param name="index"></param>
public void SetDirtyFlag(int index)
{
if (index > -1)
@@ -329,7 +329,7 @@ namespace VCFEditor.Repository
}
}
private string GenerateStringFromVCard(vCard card)
public string GenerateStringFromVCard(vCard card)
{
vCardStandardWriter writer = new vCardStandardWriter();
TextWriter tw = new StringWriter();
@@ -359,10 +359,12 @@ namespace VCFEditor.Repository
_fileHandler.WriteBytesToFile(imageFile, image.GetBytes());
}
public bool dirty
public string ChangeExtension(string path, string extension)
{
get { return _contacts != null && _contacts.Any(x => x.isDirty); }
return _fileHandler.ChangeExtension(path, extension);
}
}
}

View File

@@ -15,6 +15,11 @@ namespace vCardEditor.Repository
return Path.GetExtension(path);
}
public string ChangeExtension(string path, string extension)
{
return Path.ChangeExtension(path, extension);
}
public void MoveFile(string newFilename, string oldFilename)
{
File.Move(newFilename, oldFilename);

View File

@@ -0,0 +1,13 @@
using vCardEditor.Model;
namespace vCardEditor.Repository
{
public interface IConfigRepository
{
int Maximum { get; set; }
bool OverWrite { get; set; }
FixedList Paths { get; set; }
void SaveConfig();
}
}

View File

@@ -1,27 +1,31 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Thought.vCards;
using VCFEditor.Model;
using System.ComponentModel;
namespace VCFEditor.Repository
{
public interface IContactRepository
{
bool dirty { get; }
string fileName { get; set; }
BindingList<Contact> Contacts { get; set; }
BindingList<Contact> LoadContacts(string fileName);
BindingList<Contact> FilterContacts(string p);
void SaveContactsToFile(string fileName);
void DeleteContact();
void SetDirtyFlag(int index);
void SaveDirtyVCard(int index, vCard card);
void AddEmptyContact();
void ModifyImage(int index, vCardPhoto photo);
string GetExtension(string path);
void SaveImageToDisk(string imageFile, vCardPhoto image);
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Thought.vCards;
using VCFEditor.Model;
using System.ComponentModel;
using vCardEditor.View;
namespace VCFEditor.Repository
{
public interface IContactRepository
{
bool dirty { get; }
string fileName { get; set; }
SortableBindingList<Contact> Contacts { get; set; }
SortableBindingList<Contact> LoadContacts(string fileName);
SortableBindingList<Contact> FilterContacts(string p);
void SaveContactsToFile(string fileName);
void DeleteContact();
void SetDirtyFlag(int index);
void SaveDirtyVCard(int index, vCard card);
void AddEmptyContact();
void ModifyImage(int index, vCardPhoto photo);
string GetExtension(string path);
string ChangeExtension(string path, string extension);
void SaveImageToDisk(string imageFile, vCardPhoto image);
string GenerateStringFromVCard(vCard card);
}
}

View File

@@ -7,6 +7,7 @@
string[] ReadAllLines(string filename);
void WriteAllText(string fileName, string contents);
string GetExtension(string path);
string ChangeExtension(string path, string extension);
void WriteBytesToFile(string imageFile, byte[] image);
}
}

View File

@@ -54,7 +54,7 @@
this.tableLayoutPanel.Controls.Add(this.okButton, 1, 5);
this.tableLayoutPanel.Dock = System.Windows.Forms.DockStyle.Fill;
this.tableLayoutPanel.Location = new System.Drawing.Point(12, 11);
this.tableLayoutPanel.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.tableLayoutPanel.Margin = new System.Windows.Forms.Padding(4);
this.tableLayoutPanel.Name = "tableLayoutPanel";
this.tableLayoutPanel.RowCount = 6;
this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 10F));
@@ -73,7 +73,7 @@
//
this.logoPictureBox.Image = ((System.Drawing.Image)(resources.GetObject("logoPictureBox.Image")));
this.logoPictureBox.Location = new System.Drawing.Point(4, 4);
this.logoPictureBox.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.logoPictureBox.Margin = new System.Windows.Forms.Padding(4);
this.logoPictureBox.Name = "logoPictureBox";
this.tableLayoutPanel.SetRowSpan(this.logoPictureBox, 6);
this.logoPictureBox.Size = new System.Drawing.Size(145, 121);
@@ -148,7 +148,7 @@
this.okButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.okButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.okButton.Location = new System.Drawing.Point(452, 295);
this.okButton.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.okButton.Margin = new System.Windows.Forms.Padding(4);
this.okButton.Name = "okButton";
this.okButton.Size = new System.Drawing.Size(100, 27);
this.okButton.TabIndex = 24;
@@ -162,7 +162,7 @@
this.ClientSize = new System.Drawing.Size(580, 348);
this.Controls.Add(this.tableLayoutPanel);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.Margin = new System.Windows.Forms.Padding(4);
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "AboutDialog";

View File

@@ -35,33 +35,33 @@
//
// btnClose
//
this.btnClose.DialogResult = System.Windows.Forms.DialogResult.OK;
this.btnClose.Location = new System.Drawing.Point(337, 427);
this.btnClose.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.btnClose.Margin = new System.Windows.Forms.Padding(4);
this.btnClose.Name = "btnClose";
this.btnClose.Size = new System.Drawing.Size(100, 28);
this.btnClose.TabIndex = 0;
this.btnClose.Text = "Close";
this.btnClose.UseVisualStyleBackColor = true;
this.btnClose.Click += new System.EventHandler(this.btnClose_Click);
//
// pgConfig
//
this.pgConfig.Location = new System.Drawing.Point(16, 15);
this.pgConfig.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.pgConfig.Margin = new System.Windows.Forms.Padding(4);
this.pgConfig.Name = "pgConfig";
this.pgConfig.Size = new System.Drawing.Size(421, 405);
this.pgConfig.TabIndex = 1;
//
// btnCancel
//
this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.btnCancel.Location = new System.Drawing.Point(229, 427);
this.btnCancel.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.btnCancel.Margin = new System.Windows.Forms.Padding(4);
this.btnCancel.Name = "btnCancel";
this.btnCancel.Size = new System.Drawing.Size(100, 28);
this.btnCancel.TabIndex = 0;
this.btnCancel.Text = "Cancel";
this.btnCancel.UseVisualStyleBackColor = true;
this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
//
// ConfigDialog
//
@@ -71,7 +71,7 @@
this.Controls.Add(this.pgConfig);
this.Controls.Add(this.btnCancel);
this.Controls.Add(this.btnClose);
this.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.Margin = new System.Windows.Forms.Padding(4);
this.Name = "ConfigDialog";
this.Text = "Configuration Dialog";
this.ResumeLayout(false);

View File

@@ -10,19 +10,8 @@ namespace vCardEditor.View
public ConfigDialog()
{
InitializeComponent();
ConfigRepository conf = ConfigRepository.Instance;//.Clone();
ConfigRepository conf = ConfigRepository.Instance;//
pgConfig.SelectedObject = conf;
}
private void btnClose_Click(object sender, EventArgs e)
{
this.Close();
}
private void btnCancel_Click(object sender, EventArgs e)
{
this.Close();
}
}
}

View File

@@ -61,7 +61,6 @@ namespace vCardEditor.View.Customs
SelectedTab.Text = GetTabTitle(diag.Addresses);
SelectedTab.ToolTipText = string.Join(",", diag.Addresses.ConvertAll(f => f.ToString()));
//_card.DeliveryAddresses[i].AddressType = diag.Addresses;
ModifyTab?.Invoke(sender, new EventArg<List<vCardDeliveryAddressTypes>>(diag.Addresses));
}
break;
@@ -187,6 +186,7 @@ namespace vCardEditor.View.Customs
{
foreach (var item in card.DeliveryAddresses)
AddtabForAddress(item);
SelectedIndex = 0;
}
private void AddtabForAddress(vCardDeliveryAddress da)
@@ -221,10 +221,10 @@ namespace vCardEditor.View.Customs
private void ClearTabs()
{
//Remove every tab (except "+"). We don't call Clear() as it doesn't free memory.
while (TabCount > 1)
TabPages[TabCount - 1].Dispose();
TabPages[0].Dispose();
}
}
}

View File

@@ -0,0 +1,119 @@

namespace vCardEditor.View.Customs
{
partial class ColumnsDialog
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.cbFamilyName = new System.Windows.Forms.CheckBox();
this.cbCellular = new System.Windows.Forms.CheckBox();
this.cbName = new System.Windows.Forms.CheckBox();
this.btnCancel = new System.Windows.Forms.Button();
this.btnOK = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// cbFamilyName
//
this.cbFamilyName.AutoSize = true;
this.cbFamilyName.Location = new System.Drawing.Point(12, 39);
this.cbFamilyName.Name = "cbFamilyName";
this.cbFamilyName.Size = new System.Drawing.Size(107, 21);
this.cbFamilyName.TabIndex = 5;
this.cbFamilyName.Text = "FamilyName";
this.cbFamilyName.UseVisualStyleBackColor = true;
//
// cbCellular
//
this.cbCellular.AutoSize = true;
this.cbCellular.Location = new System.Drawing.Point(12, 66);
this.cbCellular.Name = "cbCellular";
this.cbCellular.Size = new System.Drawing.Size(77, 21);
this.cbCellular.TabIndex = 4;
this.cbCellular.Text = "Cellular";
this.cbCellular.UseVisualStyleBackColor = true;
//
// cbName
//
this.cbName.AutoSize = true;
this.cbName.Checked = true;
this.cbName.CheckState = System.Windows.Forms.CheckState.Checked;
this.cbName.Enabled = false;
this.cbName.Location = new System.Drawing.Point(12, 12);
this.cbName.Name = "cbName";
this.cbName.Size = new System.Drawing.Size(67, 21);
this.cbName.TabIndex = 3;
this.cbName.Text = "Name";
this.cbName.UseVisualStyleBackColor = true;
//
// btnCancel
//
this.btnCancel.CausesValidation = false;
this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.btnCancel.Location = new System.Drawing.Point(190, 119);
this.btnCancel.Name = "btnCancel";
this.btnCancel.Size = new System.Drawing.Size(75, 23);
this.btnCancel.TabIndex = 10;
this.btnCancel.Text = "Cancel";
this.btnCancel.UseVisualStyleBackColor = true;
//
// btnOK
//
this.btnOK.DialogResult = System.Windows.Forms.DialogResult.OK;
this.btnOK.Location = new System.Drawing.Point(109, 119);
this.btnOK.Name = "btnOK";
this.btnOK.Size = new System.Drawing.Size(75, 23);
this.btnOK.TabIndex = 9;
this.btnOK.Text = "OK";
this.btnOK.UseVisualStyleBackColor = true;
this.btnOK.Click += new System.EventHandler(this.btnOK_Click);
//
// ColumnsDialog
//
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(277, 149);
this.Controls.Add(this.btnCancel);
this.Controls.Add(this.btnOK);
this.Controls.Add(this.cbFamilyName);
this.Controls.Add(this.cbCellular);
this.Controls.Add(this.cbName);
this.Name = "ColumnsDialog";
this.Text = "Columns...";
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.CheckBox cbFamilyName;
private System.Windows.Forms.CheckBox cbCellular;
private System.Windows.Forms.CheckBox cbName;
private System.Windows.Forms.Button btnCancel;
private System.Windows.Forms.Button btnOK;
}
}

View File

@@ -0,0 +1,50 @@
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Windows.Forms;
using vCardEditor.Model;
namespace vCardEditor.View.Customs
{
public partial class ColumnsDialog : Form
{
private readonly List<CheckBox> _checkBoxes;
public List<Column> Columns { get; }
public ColumnsDialog(List<Column> columns)
{
InitializeComponent();
_checkBoxes = Controls.OfType<CheckBox>().ToList();
Columns = columns;
foreach (var item in columns)
{
switch (item)
{
case Model.Column.FamilyName:
cbFamilyName.Checked = true;
break;
case Model.Column.Cellular:
cbCellular.Checked = true;
break;
}
}
}
private void btnOK_Click(object sender, EventArgs e)
{
Columns.Clear();
var total = _checkBoxes
.Where(checkBox => checkBox.Checked);
foreach (var item in total)
{
var enumType = (Column)Enum.Parse(typeof(Column), item.Text, true);
Columns.Add(enumType);
}
}
}
}

View File

@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@@ -2,15 +2,14 @@
using System.Collections.Generic;
using Thought.vCards;
using VCFEditor.Model;
using System.ComponentModel;
using System.Windows.Forms;
using vCardEditor.Model;
using vCardEditor.View;
namespace VCFEditor.View
{
public interface IMainView
{
event EventHandler<EventArg<FormState>> LoadForm;
event EventHandler AddContact;
event EventHandler DeleteContact;
event EventHandler BeforeOpeningNewFile;
@@ -26,9 +25,10 @@ namespace VCFEditor.View
event EventHandler<EventArg<List<vCardDeliveryAddressTypes>>> AddressAdded;
event EventHandler<EventArg<List<vCardDeliveryAddressTypes>>> AddressModified;
event EventHandler<EventArg<int>> AddressRemoved;
event EventHandler CopyTextToClipboardEvent;
int SelectedContactIndex { get; }
void DisplayContacts(BindingList<Contact> contacts);
void DisplayContacts(SortableBindingList<Contact> contacts);
void DisplayContactDetail(vCard card, string FileName);
void ClearContactDetail();
bool AskMessage(string msg, string caption);
@@ -36,5 +36,9 @@ namespace VCFEditor.View
string DisplayOpenDialog(string filter);
string DisplaySaveDialog(string filename);
void UpdateMRUMenu(FixedList MRUList);
void SendTextToClipBoard(string text);
FormState GetFormState();
}
}

View File

@@ -32,7 +32,7 @@ namespace vCardEditor.View
{
this.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm));
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
this.menuStrip1 = new System.Windows.Forms.MenuStrip();
this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.miSave = new System.Windows.Forms.ToolStripMenuItem();
@@ -43,10 +43,13 @@ namespace vCardEditor.View
this.miQuit = new System.Windows.Forms.ToolStripMenuItem();
this.editToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.copyToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.helpToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.miAbout = new System.Windows.Forms.ToolStripMenuItem();
this.toolsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.imagesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.exportToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.clearToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.countToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.helpToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.miAbout = new System.Windows.Forms.ToolStripMenuItem();
this.statusStrip1 = new System.Windows.Forms.StatusStrip();
this.toolStrip1 = new System.Windows.Forms.ToolStrip();
this.tbsNew = new System.Windows.Forms.ToolStripButton();
@@ -64,40 +67,46 @@ namespace vCardEditor.View
this.btnExportImage = new System.Windows.Forms.Button();
this.btnRemoveImage = new System.Windows.Forms.Button();
this.groupBox4 = new System.Windows.Forms.GroupBox();
this.tbcAddress = new vCardEditor.View.Customs.AddressTabControl();
this.tabPage1 = new System.Windows.Forms.TabPage();
this.groupBox3 = new System.Windows.Forms.GroupBox();
this.FormattedTitleValue = new vCardEditor.View.StateTextBox();
this.FormattedTitleLabel = new System.Windows.Forms.Label();
this.lastNameValue = new vCardEditor.View.StateTextBox();
this.label3 = new System.Windows.Forms.Label();
this.middleNameValue = new vCardEditor.View.StateTextBox();
this.label2 = new System.Windows.Forms.Label();
this.firstNameValue = new vCardEditor.View.StateTextBox();
this.label1 = new System.Windows.Forms.Label();
this.FormattedNameValue = new vCardEditor.View.StateTextBox();
this.FormattedNameLabel = new System.Windows.Forms.Label();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.EmailAddressLabel = new System.Windows.Forms.Label();
this.PersonalWebSiteLabel = new System.Windows.Forms.Label();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.PhotoBox = new System.Windows.Forms.PictureBox();
this.bsContacts = new System.Windows.Forms.BindingSource(this.components);
this.gbNameList = new System.Windows.Forms.GroupBox();
this.btnClearFilter = new System.Windows.Forms.Button();
this.textBoxFilter = new System.Windows.Forms.TextBox();
this.dgContacts = new System.Windows.Forms.DataGridView();
this.Column1 = new System.Windows.Forms.DataGridViewCheckBoxColumn();
this.Column2 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.tbcAddress = new vCardEditor.View.Customs.AddressTabControl();
this.tabPage1 = new System.Windows.Forms.TabPage();
this.FormattedTitleValue = new vCardEditor.View.StateTextBox();
this.lastNameValue = new vCardEditor.View.StateTextBox();
this.middleNameValue = new vCardEditor.View.StateTextBox();
this.firstNameValue = new vCardEditor.View.StateTextBox();
this.FormattedNameValue = new vCardEditor.View.StateTextBox();
this.EmailAddressValue = new vCardEditor.View.StateTextBox();
this.PersonalWebSiteLabel = new System.Windows.Forms.Label();
this.PersonalWebSiteValue = new vCardEditor.View.StateTextBox();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.HomePhoneValue = new vCardEditor.View.StateTextBox();
this.WorkPhoneValue = new vCardEditor.View.StateTextBox();
this.CellularPhoneValue = new vCardEditor.View.StateTextBox();
this.PhotoBox = new System.Windows.Forms.PictureBox();
this.bsContacts = new System.Windows.Forms.BindingSource(this.components);
this.gbNameList = new System.Windows.Forms.GroupBox();
this.dgContacts = new System.Windows.Forms.DataGridView();
this.Column1 = new System.Windows.Forms.DataGridViewCheckBoxColumn();
this.FormattedName = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.FamilyName = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Cellular = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.btnClearFilter = new System.Windows.Forms.Button();
this.textBoxFilter = new System.Windows.Forms.TextBox();
this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components);
this.modifiyColumnsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.menuStrip1.SuspendLayout();
this.toolStrip1.SuspendLayout();
this.gbContactDetail.SuspendLayout();
this.groupBox4.SuspendLayout();
this.tbcAddress.SuspendLayout();
this.groupBox3.SuspendLayout();
this.groupBox2.SuspendLayout();
this.groupBox1.SuspendLayout();
@@ -105,7 +114,11 @@ namespace vCardEditor.View
((System.ComponentModel.ISupportInitialize)(this.bsContacts)).BeginInit();
this.gbNameList.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.dgContacts)).BeginInit();
this.tbcAddress.SuspendLayout();
this.contextMenuStrip1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout();
this.splitContainer1.SuspendLayout();
this.SuspendLayout();
//
// menuStrip1
@@ -114,11 +127,11 @@ namespace vCardEditor.View
this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.fileToolStripMenuItem,
this.editToolStripMenuItem,
this.helpToolStripMenuItem,
this.toolsToolStripMenuItem});
this.toolsToolStripMenuItem,
this.helpToolStripMenuItem});
this.menuStrip1.Location = new System.Drawing.Point(0, 0);
this.menuStrip1.Name = "menuStrip1";
this.menuStrip1.Size = new System.Drawing.Size(1145, 30);
this.menuStrip1.Size = new System.Drawing.Size(1197, 28);
this.menuStrip1.TabIndex = 0;
this.menuStrip1.Text = "menuStrip1";
//
@@ -132,7 +145,7 @@ namespace vCardEditor.View
this.recentFilesMenuItem,
this.miQuit});
this.fileToolStripMenuItem.Name = "fileToolStripMenuItem";
this.fileToolStripMenuItem.Size = new System.Drawing.Size(46, 26);
this.fileToolStripMenuItem.Size = new System.Drawing.Size(46, 24);
this.fileToolStripMenuItem.Text = "File";
//
// miSave
@@ -182,7 +195,7 @@ namespace vCardEditor.View
this.editToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.copyToolStripMenuItem});
this.editToolStripMenuItem.Name = "editToolStripMenuItem";
this.editToolStripMenuItem.Size = new System.Drawing.Size(49, 26);
this.editToolStripMenuItem.Size = new System.Drawing.Size(49, 24);
this.editToolStripMenuItem.Text = "Edit";
//
// copyToolStripMenuItem
@@ -190,13 +203,50 @@ namespace vCardEditor.View
this.copyToolStripMenuItem.Name = "copyToolStripMenuItem";
this.copyToolStripMenuItem.Size = new System.Drawing.Size(126, 26);
this.copyToolStripMenuItem.Text = "Copy";
this.copyToolStripMenuItem.Click += new System.EventHandler(this.copyToolStripMenuItem_Click);
//
// toolsToolStripMenuItem
//
this.toolsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.imagesToolStripMenuItem});
this.toolsToolStripMenuItem.Name = "toolsToolStripMenuItem";
this.toolsToolStripMenuItem.Size = new System.Drawing.Size(58, 24);
this.toolsToolStripMenuItem.Text = "Tools";
//
// imagesToolStripMenuItem
//
this.imagesToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.exportToolStripMenuItem,
this.clearToolStripMenuItem,
this.countToolStripMenuItem});
this.imagesToolStripMenuItem.Name = "imagesToolStripMenuItem";
this.imagesToolStripMenuItem.Size = new System.Drawing.Size(140, 26);
this.imagesToolStripMenuItem.Text = "Images";
//
// exportToolStripMenuItem
//
this.exportToolStripMenuItem.Name = "exportToolStripMenuItem";
this.exportToolStripMenuItem.Size = new System.Drawing.Size(135, 26);
this.exportToolStripMenuItem.Text = "Export";
//
// clearToolStripMenuItem
//
this.clearToolStripMenuItem.Name = "clearToolStripMenuItem";
this.clearToolStripMenuItem.Size = new System.Drawing.Size(135, 26);
this.clearToolStripMenuItem.Text = "Clear";
//
// countToolStripMenuItem
//
this.countToolStripMenuItem.Name = "countToolStripMenuItem";
this.countToolStripMenuItem.Size = new System.Drawing.Size(135, 26);
this.countToolStripMenuItem.Text = "Count";
//
// helpToolStripMenuItem
//
this.helpToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.miAbout});
this.helpToolStripMenuItem.Name = "helpToolStripMenuItem";
this.helpToolStripMenuItem.Size = new System.Drawing.Size(55, 26);
this.helpToolStripMenuItem.Size = new System.Drawing.Size(55, 24);
this.helpToolStripMenuItem.Text = "Help";
//
// miAbout
@@ -208,27 +258,13 @@ namespace vCardEditor.View
this.miAbout.Text = "&About";
this.miAbout.Click += new System.EventHandler(this.tbsAbout_Click);
//
// toolsToolStripMenuItem
//
this.toolsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.imagesToolStripMenuItem});
this.toolsToolStripMenuItem.Name = "toolsToolStripMenuItem";
this.toolsToolStripMenuItem.Size = new System.Drawing.Size(58, 26);
this.toolsToolStripMenuItem.Text = "Tools";
//
// imagesToolStripMenuItem
//
this.imagesToolStripMenuItem.Name = "imagesToolStripMenuItem";
this.imagesToolStripMenuItem.Size = new System.Drawing.Size(140, 26);
this.imagesToolStripMenuItem.Text = "Images";
//
// statusStrip1
//
this.statusStrip1.ImageScalingSize = new System.Drawing.Size(20, 20);
this.statusStrip1.Location = new System.Drawing.Point(0, 582);
this.statusStrip1.Location = new System.Drawing.Point(0, 624);
this.statusStrip1.Name = "statusStrip1";
this.statusStrip1.Padding = new System.Windows.Forms.Padding(1, 0, 19, 0);
this.statusStrip1.Size = new System.Drawing.Size(1145, 22);
this.statusStrip1.Size = new System.Drawing.Size(1197, 22);
this.statusStrip1.TabIndex = 1;
this.statusStrip1.Text = "statusStrip1";
//
@@ -243,9 +279,9 @@ namespace vCardEditor.View
this.toolStripSeparator1,
this.tbsAbout,
this.toolStripSeparator});
this.toolStrip1.Location = new System.Drawing.Point(0, 30);
this.toolStrip1.Location = new System.Drawing.Point(0, 28);
this.toolStrip1.Name = "toolStrip1";
this.toolStrip1.Size = new System.Drawing.Size(1145, 31);
this.toolStrip1.Size = new System.Drawing.Size(1197, 27);
this.toolStrip1.TabIndex = 1;
this.toolStrip1.Text = "toolStrip1";
//
@@ -255,7 +291,7 @@ namespace vCardEditor.View
this.tbsNew.Image = ((System.Drawing.Image)(resources.GetObject("tbsNew.Image")));
this.tbsNew.ImageTransparentColor = System.Drawing.Color.Magenta;
this.tbsNew.Name = "tbsNew";
this.tbsNew.Size = new System.Drawing.Size(29, 28);
this.tbsNew.Size = new System.Drawing.Size(29, 24);
this.tbsNew.Text = "&Nouveau";
this.tbsNew.Click += new System.EventHandler(this.tbsNew_Click);
//
@@ -265,7 +301,7 @@ namespace vCardEditor.View
this.tbsOpen.Image = ((System.Drawing.Image)(resources.GetObject("tbsOpen.Image")));
this.tbsOpen.ImageTransparentColor = System.Drawing.Color.Magenta;
this.tbsOpen.Name = "tbsOpen";
this.tbsOpen.Size = new System.Drawing.Size(29, 28);
this.tbsOpen.Size = new System.Drawing.Size(29, 24);
this.tbsOpen.Text = "&Open";
this.tbsOpen.Click += new System.EventHandler(this.tbsOpen_Click);
//
@@ -275,7 +311,7 @@ namespace vCardEditor.View
this.tbsSave.Image = ((System.Drawing.Image)(resources.GetObject("tbsSave.Image")));
this.tbsSave.ImageTransparentColor = System.Drawing.Color.Magenta;
this.tbsSave.Name = "tbsSave";
this.tbsSave.Size = new System.Drawing.Size(29, 28);
this.tbsSave.Size = new System.Drawing.Size(29, 24);
this.tbsSave.Text = "&Save";
this.tbsSave.Click += new System.EventHandler(this.tbsSave_Click);
//
@@ -285,14 +321,14 @@ namespace vCardEditor.View
this.tbsDelete.Image = ((System.Drawing.Image)(resources.GetObject("tbsDelete.Image")));
this.tbsDelete.ImageTransparentColor = System.Drawing.Color.Magenta;
this.tbsDelete.Name = "tbsDelete";
this.tbsDelete.Size = new System.Drawing.Size(29, 28);
this.tbsDelete.Size = new System.Drawing.Size(29, 24);
this.tbsDelete.Text = "Delete";
this.tbsDelete.Click += new System.EventHandler(this.tbsDelete_Click);
//
// toolStripSeparator1
//
this.toolStripSeparator1.Name = "toolStripSeparator1";
this.toolStripSeparator1.Size = new System.Drawing.Size(6, 31);
this.toolStripSeparator1.Size = new System.Drawing.Size(6, 27);
//
// tbsAbout
//
@@ -300,14 +336,14 @@ namespace vCardEditor.View
this.tbsAbout.Image = ((System.Drawing.Image)(resources.GetObject("tbsAbout.Image")));
this.tbsAbout.ImageTransparentColor = System.Drawing.Color.Magenta;
this.tbsAbout.Name = "tbsAbout";
this.tbsAbout.Size = new System.Drawing.Size(29, 28);
this.tbsAbout.Size = new System.Drawing.Size(29, 24);
this.tbsAbout.Text = "&?";
this.tbsAbout.Click += new System.EventHandler(this.tbsAbout_Click);
//
// toolStripSeparator
//
this.toolStripSeparator.Name = "toolStripSeparator";
this.toolStripSeparator.Size = new System.Drawing.Size(6, 31);
this.toolStripSeparator.Size = new System.Drawing.Size(6, 27);
//
// openFileDialog
//
@@ -330,12 +366,12 @@ namespace vCardEditor.View
this.CellularPhoneLabel.Name = "CellularPhoneLabel";
this.CellularPhoneLabel.Size = new System.Drawing.Size(60, 23);
this.CellularPhoneLabel.TabIndex = 2;
this.CellularPhoneLabel.Text = "Mobile:";
this.CellularPhoneLabel.Text = "Cellular:";
this.CellularPhoneLabel.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// WorkPhoneLabel
//
this.WorkPhoneLabel.Location = new System.Drawing.Point(16, 91);
this.WorkPhoneLabel.Location = new System.Drawing.Point(11, 86);
this.WorkPhoneLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.WorkPhoneLabel.Name = "WorkPhoneLabel";
this.WorkPhoneLabel.Size = new System.Drawing.Size(60, 23);
@@ -345,9 +381,6 @@ namespace vCardEditor.View
//
// gbContactDetail
//
this.gbContactDetail.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.gbContactDetail.Controls.Add(this.btnExportImage);
this.gbContactDetail.Controls.Add(this.btnRemoveImage);
this.gbContactDetail.Controls.Add(this.groupBox4);
@@ -355,18 +388,20 @@ namespace vCardEditor.View
this.gbContactDetail.Controls.Add(this.groupBox2);
this.gbContactDetail.Controls.Add(this.groupBox1);
this.gbContactDetail.Controls.Add(this.PhotoBox);
this.gbContactDetail.Dock = System.Windows.Forms.DockStyle.Fill;
this.gbContactDetail.Enabled = false;
this.gbContactDetail.Location = new System.Drawing.Point(333, 64);
this.gbContactDetail.Location = new System.Drawing.Point(0, 0);
this.gbContactDetail.Margin = new System.Windows.Forms.Padding(4);
this.gbContactDetail.Name = "gbContactDetail";
this.gbContactDetail.Padding = new System.Windows.Forms.Padding(4);
this.gbContactDetail.Size = new System.Drawing.Size(796, 510);
this.gbContactDetail.Size = new System.Drawing.Size(796, 569);
this.gbContactDetail.TabIndex = 3;
this.gbContactDetail.TabStop = false;
this.gbContactDetail.Text = "Contact Detail :";
//
// btnExportImage
//
this.btnExportImage.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.btnExportImage.BackColor = System.Drawing.SystemColors.Window;
this.btnExportImage.Image = ((System.Drawing.Image)(resources.GetObject("btnExportImage.Image")));
this.btnExportImage.Location = new System.Drawing.Point(744, 170);
@@ -378,6 +413,7 @@ namespace vCardEditor.View
//
// btnRemoveImage
//
this.btnRemoveImage.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.btnRemoveImage.BackColor = System.Drawing.SystemColors.Window;
this.btnRemoveImage.Image = ((System.Drawing.Image)(resources.GetObject("btnRemoveImage.Image")));
this.btnRemoveImage.Location = new System.Drawing.Point(768, 170);
@@ -393,15 +429,41 @@ namespace vCardEditor.View
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.groupBox4.Controls.Add(this.tbcAddress);
this.groupBox4.Location = new System.Drawing.Point(24, 190);
this.groupBox4.Location = new System.Drawing.Point(8, 190);
this.groupBox4.Margin = new System.Windows.Forms.Padding(4);
this.groupBox4.Name = "groupBox4";
this.groupBox4.Padding = new System.Windows.Forms.Padding(4);
this.groupBox4.Size = new System.Drawing.Size(764, 182);
this.groupBox4.Size = new System.Drawing.Size(780, 234);
this.groupBox4.TabIndex = 1;
this.groupBox4.TabStop = false;
this.groupBox4.Text = "Address:";
//
// tbcAddress
//
this.tbcAddress.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.tbcAddress.Controls.Add(this.tabPage1);
this.tbcAddress.DrawMode = System.Windows.Forms.TabDrawMode.OwnerDrawFixed;
this.tbcAddress.Location = new System.Drawing.Point(17, 23);
this.tbcAddress.Margin = new System.Windows.Forms.Padding(4);
this.tbcAddress.Name = "tbcAddress";
this.tbcAddress.Padding = new System.Drawing.Point(12, 4);
this.tbcAddress.SelectedIndex = 0;
this.tbcAddress.ShowToolTips = true;
this.tbcAddress.Size = new System.Drawing.Size(755, 196);
this.tbcAddress.TabIndex = 0;
//
// tabPage1
//
this.tabPage1.BackColor = System.Drawing.SystemColors.Control;
this.tabPage1.Location = new System.Drawing.Point(4, 27);
this.tabPage1.Name = "tabPage1";
this.tabPage1.Padding = new System.Windows.Forms.Padding(3);
this.tabPage1.Size = new System.Drawing.Size(747, 165);
this.tabPage1.TabIndex = 0;
this.tabPage1.Text = " ";
//
// groupBox3
//
this.groupBox3.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
@@ -416,241 +478,15 @@ namespace vCardEditor.View
this.groupBox3.Controls.Add(this.label1);
this.groupBox3.Controls.Add(this.FormattedNameValue);
this.groupBox3.Controls.Add(this.FormattedNameLabel);
this.groupBox3.Location = new System.Drawing.Point(24, 41);
this.groupBox3.Location = new System.Drawing.Point(8, 23);
this.groupBox3.Margin = new System.Windows.Forms.Padding(4);
this.groupBox3.Name = "groupBox3";
this.groupBox3.Padding = new System.Windows.Forms.Padding(4);
this.groupBox3.Size = new System.Drawing.Size(571, 142);
this.groupBox3.Size = new System.Drawing.Size(571, 159);
this.groupBox3.TabIndex = 0;
this.groupBox3.TabStop = false;
this.groupBox3.Text = "Name";
//
// FormattedTitleLabel
//
this.FormattedTitleLabel.Location = new System.Drawing.Point(-4, 20);
this.FormattedTitleLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.FormattedTitleLabel.Name = "FormattedTitleLabel";
this.FormattedTitleLabel.Size = new System.Drawing.Size(52, 23);
this.FormattedTitleLabel.TabIndex = 0;
this.FormattedTitleLabel.Text = "Title:";
this.FormattedTitleLabel.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// label3
//
this.label3.Location = new System.Drawing.Point(341, 53);
this.label3.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(47, 23);
this.label3.TabIndex = 8;
this.label3.Text = "Last:";
this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// label2
//
this.label2.Location = new System.Drawing.Point(151, 53);
this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(56, 23);
this.label2.TabIndex = 6;
this.label2.Text = "Middle:";
this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// label1
//
this.label1.Location = new System.Drawing.Point(4, 53);
this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(44, 23);
this.label1.TabIndex = 4;
this.label1.Text = "First:";
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// FormattedNameLabel
//
this.FormattedNameLabel.Location = new System.Drawing.Point(148, 21);
this.FormattedNameLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.FormattedNameLabel.Name = "FormattedNameLabel";
this.FormattedNameLabel.Size = new System.Drawing.Size(81, 23);
this.FormattedNameLabel.TabIndex = 2;
this.FormattedNameLabel.Text = "Full Name:";
this.FormattedNameLabel.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// groupBox2
//
this.groupBox2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.groupBox2.Controls.Add(this.EmailAddressLabel);
this.groupBox2.Controls.Add(this.EmailAddressValue);
this.groupBox2.Controls.Add(this.PersonalWebSiteLabel);
this.groupBox2.Controls.Add(this.PersonalWebSiteValue);
this.groupBox2.Location = new System.Drawing.Point(348, 373);
this.groupBox2.Margin = new System.Windows.Forms.Padding(4);
this.groupBox2.Name = "groupBox2";
this.groupBox2.Padding = new System.Windows.Forms.Padding(4);
this.groupBox2.Size = new System.Drawing.Size(440, 129);
this.groupBox2.TabIndex = 3;
this.groupBox2.TabStop = false;
this.groupBox2.Text = "Web : ";
//
// EmailAddressLabel
//
this.EmailAddressLabel.Location = new System.Drawing.Point(8, 27);
this.EmailAddressLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.EmailAddressLabel.Name = "EmailAddressLabel";
this.EmailAddressLabel.Size = new System.Drawing.Size(55, 23);
this.EmailAddressLabel.TabIndex = 0;
this.EmailAddressLabel.Text = "Email:";
this.EmailAddressLabel.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// PersonalWebSiteLabel
//
this.PersonalWebSiteLabel.Location = new System.Drawing.Point(13, 55);
this.PersonalWebSiteLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.PersonalWebSiteLabel.Name = "PersonalWebSiteLabel";
this.PersonalWebSiteLabel.Size = new System.Drawing.Size(49, 23);
this.PersonalWebSiteLabel.TabIndex = 2;
this.PersonalWebSiteLabel.Text = "Web:";
this.PersonalWebSiteLabel.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// groupBox1
//
this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.groupBox1.Controls.Add(this.WorkPhoneLabel);
this.groupBox1.Controls.Add(this.HomePhoneLabel);
this.groupBox1.Controls.Add(this.HomePhoneValue);
this.groupBox1.Controls.Add(this.WorkPhoneValue);
this.groupBox1.Controls.Add(this.CellularPhoneLabel);
this.groupBox1.Controls.Add(this.CellularPhoneValue);
this.groupBox1.Location = new System.Drawing.Point(29, 373);
this.groupBox1.Margin = new System.Windows.Forms.Padding(4);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Padding = new System.Windows.Forms.Padding(4);
this.groupBox1.Size = new System.Drawing.Size(377, 129);
this.groupBox1.TabIndex = 2;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "Phones : ";
//
// PhotoBox
//
this.PhotoBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.PhotoBox.Cursor = System.Windows.Forms.Cursors.Hand;
this.PhotoBox.Image = ((System.Drawing.Image)(resources.GetObject("PhotoBox.Image")));
this.PhotoBox.Location = new System.Drawing.Point(603, 23);
this.PhotoBox.Margin = new System.Windows.Forms.Padding(4);
this.PhotoBox.Name = "PhotoBox";
this.PhotoBox.Size = new System.Drawing.Size(185, 159);
this.PhotoBox.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
this.PhotoBox.TabIndex = 53;
this.PhotoBox.TabStop = false;
this.PhotoBox.Click += new System.EventHandler(this.PhotoBox_Click);
//
// gbNameList
//
this.gbNameList.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)));
this.gbNameList.Controls.Add(this.btnClearFilter);
this.gbNameList.Controls.Add(this.textBoxFilter);
this.gbNameList.Controls.Add(this.dgContacts);
this.gbNameList.Enabled = false;
this.gbNameList.Location = new System.Drawing.Point(17, 64);
this.gbNameList.Margin = new System.Windows.Forms.Padding(4);
this.gbNameList.Name = "gbNameList";
this.gbNameList.Padding = new System.Windows.Forms.Padding(4);
this.gbNameList.Size = new System.Drawing.Size(308, 510);
this.gbNameList.TabIndex = 2;
this.gbNameList.TabStop = false;
this.gbNameList.Text = "Name List :";
//
// btnClearFilter
//
this.btnClearFilter.Image = ((System.Drawing.Image)(resources.GetObject("btnClearFilter.Image")));
this.btnClearFilter.Location = new System.Drawing.Point(268, 17);
this.btnClearFilter.Margin = new System.Windows.Forms.Padding(4);
this.btnClearFilter.Name = "btnClearFilter";
this.btnClearFilter.Size = new System.Drawing.Size(37, 27);
this.btnClearFilter.TabIndex = 1;
this.btnClearFilter.UseVisualStyleBackColor = true;
this.btnClearFilter.Click += new System.EventHandler(this.btnClearFilter_Click);
//
// textBoxFilter
//
this.textBoxFilter.Location = new System.Drawing.Point(4, 18);
this.textBoxFilter.Margin = new System.Windows.Forms.Padding(4);
this.textBoxFilter.Name = "textBoxFilter";
this.textBoxFilter.Size = new System.Drawing.Size(256, 22);
this.textBoxFilter.TabIndex = 0;
this.textBoxFilter.TextChanged += new System.EventHandler(this.textBoxFilter_TextChanged);
//
// dgContacts
//
this.dgContacts.AllowUserToAddRows = false;
this.dgContacts.AllowUserToDeleteRows = false;
this.dgContacts.AllowUserToResizeRows = false;
dataGridViewCellStyle2.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
this.dgContacts.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle2;
this.dgContacts.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)));
this.dgContacts.AutoGenerateColumns = false;
this.dgContacts.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
this.dgContacts.CellBorderStyle = System.Windows.Forms.DataGridViewCellBorderStyle.None;
this.dgContacts.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dgContacts.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.Column1,
this.Column2});
this.dgContacts.DataSource = this.bsContacts;
this.dgContacts.Location = new System.Drawing.Point(4, 50);
this.dgContacts.Margin = new System.Windows.Forms.Padding(4);
this.dgContacts.MultiSelect = false;
this.dgContacts.Name = "dgContacts";
this.dgContacts.RowHeadersVisible = false;
this.dgContacts.RowHeadersWidth = 51;
this.dgContacts.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
this.dgContacts.Size = new System.Drawing.Size(300, 455);
this.dgContacts.TabIndex = 2;
this.dgContacts.RowLeave += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgContacts_RowLeave);
this.dgContacts.SelectionChanged += new System.EventHandler(this.dgContacts_SelectionChanged);
//
// Column1
//
this.Column1.DataPropertyName = "isSelected";
this.Column1.HeaderText = " ";
this.Column1.MinimumWidth = 6;
this.Column1.Name = "Column1";
this.Column1.Width = 50;
//
// Column2
//
this.Column2.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
this.Column2.DataPropertyName = "Name";
this.Column2.HeaderText = "Name";
this.Column2.MinimumWidth = 6;
this.Column2.Name = "Column2";
this.Column2.ReadOnly = true;
//
// tbcAddress
//
this.tbcAddress.Controls.Add(this.tabPage1);
this.tbcAddress.DrawMode = System.Windows.Forms.TabDrawMode.OwnerDrawFixed;
this.tbcAddress.Location = new System.Drawing.Point(17, 23);
this.tbcAddress.Margin = new System.Windows.Forms.Padding(4);
this.tbcAddress.Name = "tbcAddress";
this.tbcAddress.Padding = new System.Drawing.Point(12, 4);
this.tbcAddress.SelectedIndex = 0;
this.tbcAddress.ShowToolTips = true;
this.tbcAddress.Size = new System.Drawing.Size(739, 144);
this.tbcAddress.TabIndex = 0;
//
// tabPage1
//
this.tabPage1.BackColor = System.Drawing.SystemColors.Control;
this.tabPage1.Location = new System.Drawing.Point(4, 27);
this.tabPage1.Name = "tabPage1";
this.tabPage1.Padding = new System.Windows.Forms.Padding(3);
this.tabPage1.Size = new System.Drawing.Size(731, 113);
this.tabPage1.TabIndex = 0;
this.tabPage1.Text = " ";
//
// FormattedTitleValue
//
this.FormattedTitleValue.Location = new System.Drawing.Point(45, 21);
@@ -662,6 +498,16 @@ namespace vCardEditor.View
this.FormattedTitleValue.LostFocus += new System.EventHandler(this.Value_TextChanged);
this.FormattedTitleValue.Validated += new System.EventHandler(this.Value_TextChanged);
//
// FormattedTitleLabel
//
this.FormattedTitleLabel.Location = new System.Drawing.Point(-4, 20);
this.FormattedTitleLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.FormattedTitleLabel.Name = "FormattedTitleLabel";
this.FormattedTitleLabel.Size = new System.Drawing.Size(52, 23);
this.FormattedTitleLabel.TabIndex = 0;
this.FormattedTitleLabel.Text = "Title:";
this.FormattedTitleLabel.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// lastNameValue
//
this.lastNameValue.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
@@ -675,10 +521,18 @@ namespace vCardEditor.View
this.lastNameValue.LostFocus += new System.EventHandler(this.Value_TextChanged);
this.lastNameValue.Validated += new System.EventHandler(this.Value_TextChanged);
//
// label3
//
this.label3.Location = new System.Drawing.Point(341, 53);
this.label3.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(47, 23);
this.label3.TabIndex = 8;
this.label3.Text = "Last:";
this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// middleNameValue
//
this.middleNameValue.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.middleNameValue.Location = new System.Drawing.Point(237, 53);
this.middleNameValue.Margin = new System.Windows.Forms.Padding(4);
this.middleNameValue.Name = "middleNameValue";
@@ -688,6 +542,16 @@ namespace vCardEditor.View
this.middleNameValue.LostFocus += new System.EventHandler(this.Value_TextChanged);
this.middleNameValue.Validated += new System.EventHandler(this.Value_TextChanged);
//
// label2
//
this.label2.Location = new System.Drawing.Point(151, 53);
this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(56, 23);
this.label2.TabIndex = 6;
this.label2.Text = "Middle:";
this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// firstNameValue
//
this.firstNameValue.Location = new System.Drawing.Point(45, 53);
@@ -699,6 +563,16 @@ namespace vCardEditor.View
this.firstNameValue.LostFocus += new System.EventHandler(this.Value_TextChanged);
this.firstNameValue.Validated += new System.EventHandler(this.Value_TextChanged);
//
// label1
//
this.label1.Location = new System.Drawing.Point(4, 53);
this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(44, 23);
this.label1.TabIndex = 4;
this.label1.Text = "First:";
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// FormattedNameValue
//
this.FormattedNameValue.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
@@ -712,6 +586,42 @@ namespace vCardEditor.View
this.FormattedNameValue.LostFocus += new System.EventHandler(this.Value_TextChanged);
this.FormattedNameValue.Validated += new System.EventHandler(this.Value_TextChanged);
//
// FormattedNameLabel
//
this.FormattedNameLabel.Location = new System.Drawing.Point(148, 21);
this.FormattedNameLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.FormattedNameLabel.Name = "FormattedNameLabel";
this.FormattedNameLabel.Size = new System.Drawing.Size(81, 23);
this.FormattedNameLabel.TabIndex = 2;
this.FormattedNameLabel.Text = "Full Name:";
this.FormattedNameLabel.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// groupBox2
//
this.groupBox2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.groupBox2.Controls.Add(this.EmailAddressLabel);
this.groupBox2.Controls.Add(this.EmailAddressValue);
this.groupBox2.Controls.Add(this.PersonalWebSiteLabel);
this.groupBox2.Controls.Add(this.PersonalWebSiteValue);
this.groupBox2.Location = new System.Drawing.Point(360, 432);
this.groupBox2.Margin = new System.Windows.Forms.Padding(4);
this.groupBox2.Name = "groupBox2";
this.groupBox2.Padding = new System.Windows.Forms.Padding(4);
this.groupBox2.Size = new System.Drawing.Size(420, 129);
this.groupBox2.TabIndex = 3;
this.groupBox2.TabStop = false;
this.groupBox2.Text = "Web : ";
//
// EmailAddressLabel
//
this.EmailAddressLabel.Location = new System.Drawing.Point(8, 27);
this.EmailAddressLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.EmailAddressLabel.Name = "EmailAddressLabel";
this.EmailAddressLabel.Size = new System.Drawing.Size(55, 23);
this.EmailAddressLabel.TabIndex = 0;
this.EmailAddressLabel.Text = "Email:";
this.EmailAddressLabel.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// EmailAddressValue
//
this.EmailAddressValue.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
@@ -725,6 +635,16 @@ namespace vCardEditor.View
this.EmailAddressValue.LostFocus += new System.EventHandler(this.Value_TextChanged);
this.EmailAddressValue.Validated += new System.EventHandler(this.Value_TextChanged);
//
// PersonalWebSiteLabel
//
this.PersonalWebSiteLabel.Location = new System.Drawing.Point(13, 55);
this.PersonalWebSiteLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.PersonalWebSiteLabel.Name = "PersonalWebSiteLabel";
this.PersonalWebSiteLabel.Size = new System.Drawing.Size(49, 23);
this.PersonalWebSiteLabel.TabIndex = 2;
this.PersonalWebSiteLabel.Text = "Web:";
this.PersonalWebSiteLabel.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// PersonalWebSiteValue
//
this.PersonalWebSiteValue.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
@@ -738,6 +658,25 @@ namespace vCardEditor.View
this.PersonalWebSiteValue.LostFocus += new System.EventHandler(this.Value_TextChanged);
this.PersonalWebSiteValue.Validated += new System.EventHandler(this.Value_TextChanged);
//
// groupBox1
//
this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.groupBox1.Controls.Add(this.WorkPhoneLabel);
this.groupBox1.Controls.Add(this.HomePhoneLabel);
this.groupBox1.Controls.Add(this.HomePhoneValue);
this.groupBox1.Controls.Add(this.WorkPhoneValue);
this.groupBox1.Controls.Add(this.CellularPhoneLabel);
this.groupBox1.Controls.Add(this.CellularPhoneValue);
this.groupBox1.Location = new System.Drawing.Point(8, 432);
this.groupBox1.Margin = new System.Windows.Forms.Padding(4);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Padding = new System.Windows.Forms.Padding(4);
this.groupBox1.Size = new System.Drawing.Size(344, 129);
this.groupBox1.TabIndex = 2;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "Phones : ";
//
// HomePhoneValue
//
this.HomePhoneValue.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
@@ -777,14 +716,168 @@ namespace vCardEditor.View
this.CellularPhoneValue.LostFocus += new System.EventHandler(this.Value_TextChanged);
this.CellularPhoneValue.Validated += new System.EventHandler(this.Value_TextChanged);
//
// PhotoBox
//
this.PhotoBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.PhotoBox.Cursor = System.Windows.Forms.Cursors.Hand;
this.PhotoBox.Image = ((System.Drawing.Image)(resources.GetObject("PhotoBox.Image")));
this.PhotoBox.Location = new System.Drawing.Point(603, 23);
this.PhotoBox.Margin = new System.Windows.Forms.Padding(4);
this.PhotoBox.Name = "PhotoBox";
this.PhotoBox.Size = new System.Drawing.Size(185, 159);
this.PhotoBox.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
this.PhotoBox.TabIndex = 53;
this.PhotoBox.TabStop = false;
this.PhotoBox.Click += new System.EventHandler(this.PhotoBox_Click);
//
// gbNameList
//
this.gbNameList.Controls.Add(this.dgContacts);
this.gbNameList.Controls.Add(this.btnClearFilter);
this.gbNameList.Controls.Add(this.textBoxFilter);
this.gbNameList.Dock = System.Windows.Forms.DockStyle.Fill;
this.gbNameList.Enabled = false;
this.gbNameList.Location = new System.Drawing.Point(0, 0);
this.gbNameList.Margin = new System.Windows.Forms.Padding(4);
this.gbNameList.Name = "gbNameList";
this.gbNameList.Padding = new System.Windows.Forms.Padding(4);
this.gbNameList.Size = new System.Drawing.Size(397, 569);
this.gbNameList.TabIndex = 2;
this.gbNameList.TabStop = false;
this.gbNameList.Text = "Name List :";
//
// dgContacts
//
this.dgContacts.AllowUserToAddRows = false;
this.dgContacts.AllowUserToDeleteRows = false;
this.dgContacts.AllowUserToResizeRows = false;
dataGridViewCellStyle1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
this.dgContacts.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle1;
this.dgContacts.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.dgContacts.AutoGenerateColumns = false;
this.dgContacts.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
this.dgContacts.CellBorderStyle = System.Windows.Forms.DataGridViewCellBorderStyle.None;
this.dgContacts.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dgContacts.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.Column1,
this.FormattedName,
this.FamilyName,
this.Cellular});
this.dgContacts.DataSource = this.bsContacts;
this.dgContacts.Location = new System.Drawing.Point(8, 47);
this.dgContacts.Margin = new System.Windows.Forms.Padding(4);
this.dgContacts.MultiSelect = false;
this.dgContacts.Name = "dgContacts";
this.dgContacts.RowHeadersVisible = false;
this.dgContacts.RowHeadersWidth = 51;
this.dgContacts.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
this.dgContacts.Size = new System.Drawing.Size(389, 514);
this.dgContacts.TabIndex = 2;
this.dgContacts.CellContextMenuStripNeeded += new System.Windows.Forms.DataGridViewCellContextMenuStripNeededEventHandler(this.dgContacts_CellContextMenuStripNeeded);
this.dgContacts.RowLeave += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgContacts_RowLeave);
this.dgContacts.SelectionChanged += new System.EventHandler(this.dgContacts_SelectionChanged);
//
// Column1
//
this.Column1.DataPropertyName = "isSelected";
this.Column1.HeaderText = " ";
this.Column1.MinimumWidth = 6;
this.Column1.Name = "Column1";
this.Column1.Width = 50;
//
// FormattedName
//
this.FormattedName.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
this.FormattedName.DataPropertyName = "Name";
this.FormattedName.HeaderText = "Name";
this.FormattedName.MinimumWidth = 6;
this.FormattedName.Name = "FormattedName";
this.FormattedName.ReadOnly = true;
//
// FamilyName
//
this.FamilyName.DataPropertyName = "FamilyName";
this.FamilyName.HeaderText = "FamilyName";
this.FamilyName.MinimumWidth = 6;
this.FamilyName.Name = "FamilyName";
this.FamilyName.ReadOnly = true;
this.FamilyName.Visible = false;
this.FamilyName.Width = 125;
//
// Cellular
//
this.Cellular.DataPropertyName = "Cellular";
this.Cellular.HeaderText = "Cellular";
this.Cellular.MinimumWidth = 6;
this.Cellular.Name = "Cellular";
this.Cellular.ReadOnly = true;
this.Cellular.Visible = false;
this.Cellular.Width = 125;
//
// btnClearFilter
//
this.btnClearFilter.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.btnClearFilter.Image = ((System.Drawing.Image)(resources.GetObject("btnClearFilter.Image")));
this.btnClearFilter.Location = new System.Drawing.Point(357, 17);
this.btnClearFilter.Margin = new System.Windows.Forms.Padding(4);
this.btnClearFilter.Name = "btnClearFilter";
this.btnClearFilter.Size = new System.Drawing.Size(37, 27);
this.btnClearFilter.TabIndex = 1;
this.btnClearFilter.UseVisualStyleBackColor = true;
this.btnClearFilter.Click += new System.EventHandler(this.btnClearFilter_Click);
//
// textBoxFilter
//
this.textBoxFilter.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.textBoxFilter.Location = new System.Drawing.Point(8, 18);
this.textBoxFilter.Margin = new System.Windows.Forms.Padding(4);
this.textBoxFilter.Name = "textBoxFilter";
this.textBoxFilter.Size = new System.Drawing.Size(341, 22);
this.textBoxFilter.TabIndex = 0;
this.textBoxFilter.TextChanged += new System.EventHandler(this.textBoxFilter_TextChanged);
//
// contextMenuStrip1
//
this.contextMenuStrip1.ImageScalingSize = new System.Drawing.Size(20, 20);
this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.modifiyColumnsToolStripMenuItem});
this.contextMenuStrip1.Name = "contextMenuStrip1";
this.contextMenuStrip1.Size = new System.Drawing.Size(191, 28);
//
// modifiyColumnsToolStripMenuItem
//
this.modifiyColumnsToolStripMenuItem.Name = "modifiyColumnsToolStripMenuItem";
this.modifiyColumnsToolStripMenuItem.Size = new System.Drawing.Size(190, 24);
this.modifiyColumnsToolStripMenuItem.Text = "Modifiy Columns";
this.modifiyColumnsToolStripMenuItem.Click += new System.EventHandler(this.modifiyColumnsToolStripMenuItem_Click);
//
// splitContainer1
//
this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
this.splitContainer1.Location = new System.Drawing.Point(0, 55);
this.splitContainer1.Name = "splitContainer1";
//
// splitContainer1.Panel1
//
this.splitContainer1.Panel1.Controls.Add(this.gbNameList);
//
// splitContainer1.Panel2
//
this.splitContainer1.Panel2.Controls.Add(this.gbContactDetail);
this.splitContainer1.Size = new System.Drawing.Size(1197, 569);
this.splitContainer1.SplitterDistance = 397;
this.splitContainer1.TabIndex = 4;
//
// MainForm
//
this.AllowDrop = true;
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(1145, 604);
this.Controls.Add(this.gbNameList);
this.Controls.Add(this.gbContactDetail);
this.ClientSize = new System.Drawing.Size(1197, 646);
this.Controls.Add(this.splitContainer1);
this.Controls.Add(this.toolStrip1);
this.Controls.Add(this.statusStrip1);
this.Controls.Add(this.menuStrip1);
@@ -794,6 +887,7 @@ namespace vCardEditor.View
this.Name = "MainForm";
this.Text = "vCard Editor";
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.MainForm_FormClosing);
this.Load += new System.EventHandler(this.MainForm_Load);
this.DragDrop += new System.Windows.Forms.DragEventHandler(this.MainForm_DragDrop);
this.DragEnter += new System.Windows.Forms.DragEventHandler(this.MainForm_DragEnter);
this.menuStrip1.ResumeLayout(false);
@@ -802,6 +896,7 @@ namespace vCardEditor.View
this.toolStrip1.PerformLayout();
this.gbContactDetail.ResumeLayout(false);
this.groupBox4.ResumeLayout(false);
this.tbcAddress.ResumeLayout(false);
this.groupBox3.ResumeLayout(false);
this.groupBox3.PerformLayout();
this.groupBox2.ResumeLayout(false);
@@ -813,7 +908,11 @@ namespace vCardEditor.View
this.gbNameList.ResumeLayout(false);
this.gbNameList.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.dgContacts)).EndInit();
this.tbcAddress.ResumeLayout(false);
this.contextMenuStrip1.ResumeLayout(false);
this.splitContainer1.Panel1.ResumeLayout(false);
this.splitContainer1.Panel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit();
this.splitContainer1.ResumeLayout(false);
this.ResumeLayout(false);
this.PerformLayout();
@@ -847,8 +946,6 @@ namespace vCardEditor.View
private System.Windows.Forms.GroupBox gbNameList;
private System.Windows.Forms.TextBox textBoxFilter;
private System.Windows.Forms.DataGridView dgContacts;
private System.Windows.Forms.DataGridViewCheckBoxColumn Column1;
private System.Windows.Forms.DataGridViewTextBoxColumn Column2;
private System.Windows.Forms.Button btnClearFilter;
internal System.Windows.Forms.PictureBox PhotoBox;
private System.Windows.Forms.ToolStripMenuItem recentFilesMenuItem;
@@ -882,5 +979,15 @@ namespace vCardEditor.View
private System.Windows.Forms.ToolStripMenuItem imagesToolStripMenuItem;
private AddressTabControl tbcAddress;
private System.Windows.Forms.TabPage tabPage1;
private System.Windows.Forms.ToolStripMenuItem exportToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem clearToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem countToolStripMenuItem;
private System.Windows.Forms.ContextMenuStrip contextMenuStrip1;
private System.Windows.Forms.ToolStripMenuItem modifiyColumnsToolStripMenuItem;
private System.Windows.Forms.DataGridViewCheckBoxColumn Column1;
private System.Windows.Forms.DataGridViewTextBoxColumn FormattedName;
private System.Windows.Forms.DataGridViewTextBoxColumn FamilyName;
private System.Windows.Forms.DataGridViewTextBoxColumn Cellular;
private System.Windows.Forms.SplitContainer splitContainer1;
}
}

View File

@@ -9,11 +9,13 @@ using vCardEditor.Repository;
using vCardEditor.Model;
using System.Drawing;
using System.Collections.Generic;
using vCardEditor.View.Customs;
namespace vCardEditor.View
{
public partial class MainForm : Form, IMainView
{
public event EventHandler<EventArg<FormState>> LoadForm;
public event EventHandler AddContact;
public event EventHandler SaveContactsSelected;
public event EventHandler BeforeOpeningNewFile;
@@ -29,6 +31,7 @@ namespace vCardEditor.View
public event EventHandler<EventArg<List<vCardDeliveryAddressTypes>>> AddressModified;
public event EventHandler<EventArg<int>> AddressRemoved;
public event EventHandler ExportImage;
public event EventHandler CopyTextToClipboardEvent;
ComponentResourceManager resources;
@@ -61,7 +64,7 @@ namespace vCardEditor.View
NewFileOpened?.Invoke(sender, new EventArg<string>(string.Empty));
}
public void DisplayContacts(BindingList<Contact> contacts)
public void DisplayContacts(SortableBindingList<Contact> contacts)
{
if (contacts != null)
bsContacts.DataSource = contacts;
@@ -324,7 +327,6 @@ namespace vCardEditor.View
e.Cancel = evt.Data;
ConfigRepository.Instance.SaveConfig();
}
public bool AskMessage(string msg, string caption)
@@ -407,5 +409,113 @@ namespace vCardEditor.View
{
ExportImage?.Invoke(sender, e);
}
private void copyToolStripMenuItem_Click(object sender, EventArgs e)
{
CopyTextToClipboardEvent?.Invoke(sender, e);
}
public void SendTextToClipBoard(string text)
{
Clipboard.SetText(text);
}
private void dgContacts_CellContextMenuStripNeeded(object sender, DataGridViewCellContextMenuStripNeededEventArgs e)
{
if (e.RowIndex == -1)
{
e.ContextMenuStrip = contextMenuStrip1;
}
}
private void modifiyColumnsToolStripMenuItem_Click(object sender, EventArgs e)
{
List<Column> Columns = GetListColumnsForDataGrid();
var dialog = new ColumnsDialog(Columns);
if (dialog.ShowDialog() == DialogResult.OK)
{
ToggleAllColumnsToInvisible();
ToggleOnlySelected(dialog.Columns);
}
}
private List<Column> GetListColumnsForDataGrid()
{
List<Column> Columns = new List<Column>();
for (int i = 2; i < dgContacts.Columns.Count; i++)
{
if (dgContacts.Columns[i].Visible)
{
var name = dgContacts.Columns[i].Name;
var enumType = (Column)Enum.Parse(typeof(Column), name, true);
Columns.Add(enumType);
}
}
return Columns;
}
private void ToggleOnlySelected(List<Column> columns)
{
foreach (var item in columns)
{
switch (item)
{
case Column.FamilyName:
dgContacts.Columns["FamilyName"].Visible = true;
break;
case Column.Cellular:
dgContacts.Columns["Cellular"].Visible = true;
break;
}
}
}
private void ToggleAllColumnsToInvisible()
{
for (int i = 2; i < dgContacts.Columns.Count; i++)
{
dgContacts.Columns[i].Visible = false;
}
}
public FormState GetFormState()
{
return new FormState
{
Columns = GetListColumnsForDataGrid(),
X = Location.X,
Y = Location.Y,
Height = Size.Height,
Width = Size.Width,
splitterPosition = splitContainer1.SplitterDistance
};
}
private void MainForm_Load(object sender, EventArgs e)
{
var evt = new EventArg<FormState>(new FormState());
LoadForm?.Invoke(sender, evt);
//TODO: Better way to check if state was serialised!
var state = evt.Data;
if (state.Width != 0 && state.Height != 0)
{
Size = new Size(state.Width, state.Height);
Location = new Point(state.X , state.Y);
splitContainer1.SplitterDistance = state.splitterPosition;
if (state.Columns != null)
{
ToggleOnlySelected(state.Columns);
}
}
}
}
}

View File

@@ -304,6 +304,18 @@
<metadata name="bsContacts.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>486, 17</value>
</metadata>
<metadata name="Column1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="FormattedName.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="FamilyName.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Cellular.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<data name="btnClearFilter.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
@@ -321,11 +333,8 @@
TkSuQmCC
</value>
</data>
<metadata name="Column1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Column2.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
<metadata name="contextMenuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>618, 17</value>
</metadata>
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>

View File

@@ -0,0 +1,99 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using vCardEditor.Model;
namespace vCardEditor.View
{
public class SortableBindingList<T> : BindingList<T>
{
private readonly Dictionary<Type, PropertyComparer<T>> comparers;
private bool isSorted;
private ListSortDirection listSortDirection;
private PropertyDescriptor propertyDescriptor;
public SortableBindingList()
: base(new List<T>())
{
this.comparers = new Dictionary<Type, PropertyComparer<T>>();
}
public SortableBindingList(IEnumerable<T> enumeration)
: base(new List<T>(enumeration))
{
this.comparers = new Dictionary<Type, PropertyComparer<T>>();
}
protected override bool SupportsSortingCore
{
get { return true; }
}
protected override bool IsSortedCore
{
get { return this.isSorted; }
}
protected override PropertyDescriptor SortPropertyCore
{
get { return this.propertyDescriptor; }
}
protected override ListSortDirection SortDirectionCore
{
get { return this.listSortDirection; }
}
protected override bool SupportsSearchingCore
{
get { return true; }
}
protected override void ApplySortCore(PropertyDescriptor property, ListSortDirection direction)
{
List<T> itemsList = (List<T>)this.Items;
Type propertyType = property.PropertyType;
PropertyComparer<T> comparer;
if (!this.comparers.TryGetValue(propertyType, out comparer))
{
comparer = new PropertyComparer<T>(property, direction);
this.comparers.Add(propertyType, comparer);
}
comparer.SetPropertyAndDirection(property, direction);
itemsList.Sort(comparer);
this.propertyDescriptor = property;
this.listSortDirection = direction;
this.isSorted = true;
this.OnListChanged(new ListChangedEventArgs(ListChangedType.Reset, -1));
}
protected override void RemoveSortCore()
{
this.isSorted = false;
this.propertyDescriptor = base.SortPropertyCore;
this.listSortDirection = base.SortDirectionCore;
this.OnListChanged(new ListChangedEventArgs(ListChangedType.Reset, -1));
}
protected override int FindCore(PropertyDescriptor property, object key)
{
int count = this.Count;
for (int i = 0; i < count; ++i)
{
T element = this[i];
if (property.GetValue(element).Equals(key))
{
return i;
}
}
return -1;
}
}
}

View File

@@ -0,0 +1,118 @@
using System;
using System.Collections;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Windows.Forms;
namespace UIToolbox
{
/// <summary>
/// Summary description for CollapseBox.
/// </summary>
public class CollapseBox : OwnerDrawButton
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.Container components = null;
#region Internal variables
private bool m_bIsPlus;
#endregion Internal variables
public CollapseBox()
{
// This call is required by the Windows.Forms Form Designer.
InitializeComponent();
}
/// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if(components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Component Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
//
// CollapseBox
//
this.Click += new System.EventHandler(this.CollapseBox_Click);
this.Paint += new System.Windows.Forms.PaintEventHandler(this.CollapseBox_Paint);
this.DoubleClick += new System.EventHandler(this.CollapseBox_DoubleClick);
}
#endregion
#region Events
private void CollapseBox_Click(object sender, System.EventArgs e)
{
IsPlus = !IsPlus;
}
private void CollapseBox_DoubleClick(object sender, System.EventArgs e)
{
// fast clicking registers as double-clicking, so map a double-click
// event into a single click.
CollapseBox_Click(sender, e);
}
private void CollapseBox_Paint(object sender, System.Windows.Forms.PaintEventArgs e)
{
Graphics g = e.Graphics;
if(m_ButtonState == ButtonState.TrackingInside)
g.FillRectangle(Brushes.LightGray, ClientRectangle);
else
g.FillRectangle(Brushes.White, ClientRectangle);
Rectangle theRec = new Rectangle();
theRec = ClientRectangle;
theRec.Width--;
theRec.Height--;
g.DrawRectangle(Pens.Black, theRec);
g.DrawLine(Pens.Black, theRec.X + 2, theRec.Y + (this.Height/2),
theRec.X + this.Width - 3, theRec.Y + (this.Height/2));
if(m_bIsPlus)
{
g.DrawLine(Pens.Black, theRec.X + (this.Width/2), theRec.Y + 2,
theRec.X + (this.Width/2), theRec.Y + this.Height - 3);
}
}
#endregion Events
#region Accessors
[DefaultValue(false)]
public bool IsPlus
{
get
{
return m_bIsPlus;
}
set
{
if(m_bIsPlus != value)
{
m_bIsPlus = value;
Invalidate();
}
}
}
#endregion Accessors
}
}

View File

@@ -0,0 +1,109 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 1.3
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">1.3</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1">this is my long string</data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
[base64 mime encoded serialized .NET Framework object]
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
[base64 mime encoded string representing a byte array form of the .NET Framework object]
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used forserialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>1.3</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="$this.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="$this.TrayLargeIcon" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="$this.Name">
<value>CollapseBox</value>
</data>
</root>

Binary file not shown.

After

Width:  |  Height:  |  Size: 824 B

View File

@@ -0,0 +1,326 @@
using System;
using System.Collections;
using System.ComponentModel;
using System.Diagnostics;
using System.Drawing;
using System.Windows.Forms;
namespace UIToolbox
{
/// <summary>
/// Summary description for CollapsibleGroupBox.
/// </summary>
public class CollapsibleGroupBox : System.Windows.Forms.UserControl
{
public const int kCollapsedHeight = 20;
#region Members
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.Container components = null;
private CollapseBox m_CollapseBox;
private ImageButton m_TrashIcon;
public event CollapseBoxClickedEventHandler CollapseBoxClickedEvent;
public event TrashCanClickedEventHandler TrashCanClickedEvent;
private string m_Caption;
//private bool m_bContainsTrashCan;
//private System.Windows.Forms.GroupBox m_GroupBox;
private Size m_FullSize;
private bool m_bResizingFromCollapse = false;
#endregion Members
public CollapsibleGroupBox()
{
// This call is required by the Windows.Forms Form Designer.
InitializeComponent();
}
/// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if(components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Component Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(CollapsibleGroupBox));
this.m_CollapseBox = new UIToolbox.CollapseBox();
this.m_TrashIcon = new UIToolbox.ImageButton();
this.SuspendLayout();
//
// m_CollapseBox
//
this.m_CollapseBox.IsPlus = false;
this.m_CollapseBox.Location = new System.Drawing.Point(12, 1);
this.m_CollapseBox.Name = "m_CollapseBox";
this.m_CollapseBox.Size = new System.Drawing.Size(11, 11);
this.m_CollapseBox.TabIndex = 1;
this.m_CollapseBox.Click += new System.EventHandler(this.CollapseBox_Click);
this.m_CollapseBox.DoubleClick += new System.EventHandler(this.CollapseBox_DoubleClick);
//
// m_TrashIcon
//
this.m_TrashIcon.Location = new System.Drawing.Point(88, 0);
this.m_TrashIcon.Name = "m_TrashIcon";
this.m_TrashIcon.NormalImage = ((System.Drawing.Image)(resources.GetObject("m_TrashIcon.NormalImage")));
this.m_TrashIcon.PressedImage = ((System.Drawing.Image)(resources.GetObject("m_TrashIcon.PressedImage")));
this.m_TrashIcon.Size = new System.Drawing.Size(16, 16);
this.m_TrashIcon.TabIndex = 2;
this.m_TrashIcon.TabStop = false;
this.m_TrashIcon.Click += new System.EventHandler(this.TrashIcon_Click);
//
// CollapsibleGroupBox
//
this.Controls.Add(this.m_TrashIcon);
this.Controls.Add(this.m_CollapseBox);
this.Name = "CollapsibleGroupBox";
this.Resize += new System.EventHandler(this.CollapsibleGroupBox_Resize);
this.Load += new System.EventHandler(this.CollapsibleGroupBox_Load);
this.Paint += new System.Windows.Forms.PaintEventHandler(this.CollapsibleGroupBox_Paint);
this.ResumeLayout(false);
}
#endregion
#region Events
private void CollapsibleGroupBox_Load(object sender, System.EventArgs e)
{
SetGroupBoxCaption();
}
private void CollapsibleGroupBox_Resize(object sender, System.EventArgs e)
{
if(m_bResizingFromCollapse != true)
{
m_FullSize = this.Size;
}
Invalidate();
}
private void CollapsibleGroupBox_Paint(object sender, System.Windows.Forms.PaintEventArgs e)
{
// UG! I originall added a GroupBox control but ran into problems...
// Panes derived from CollapsibleGroupBox would "chew up" controls
// added to them, so I had to get rid of the GroupBox and draw a fake
// group box myself
Graphics g = e.Graphics;
Rectangle theRec = new Rectangle();
theRec = this.ClientRectangle;
//Color theEdgeGrayColor = Color.FromArgb(170, 170, 156);
//Pen thePen = new Pen(theEdgeGrayColor);
Pen thePen = SystemPens.ControlDark;
int theTextSize = (int)g.MeasureString(m_Caption, this.Font).Width;
if(theTextSize < 1)
theTextSize = 1;
int theCaptionPosition = (theRec.X + 8) + 2 + m_CollapseBox.Width + 2;
int theEndPosition = theCaptionPosition + theTextSize + 1;
if(m_TrashIcon.Visible)
theEndPosition += (m_TrashIcon.Width + 2);
g.DrawLine(thePen, theRec.X + 8, theRec.Y + 5,
theRec.X, theRec.Y + 5);
g.DrawLine(thePen, theRec.X, theRec.Y + 5,
theRec.X, theRec.Bottom - 2);
g.DrawLine(thePen, theRec.X, theRec.Bottom - 2,
theRec.Right - 1, theRec.Bottom - 2);
g.DrawLine(thePen, theRec.Right - 2, theRec.Bottom - 2,
theRec.Right - 2, theRec.Y + 5);
g.DrawLine(thePen, theRec.Right - 2, theRec.Y + 5,
theRec.X + theEndPosition, theRec.Y + 5);
g.DrawLine(Pens.White, theRec.X + 8, theRec.Y + 6,
theRec.X + 1, theRec.Y + 6);
g.DrawLine(Pens.White, theRec.X + 1, theRec.Y + 6,
theRec.X + 1, theRec.Bottom - 3);
g.DrawLine(Pens.White, theRec.X, theRec.Bottom - 1,
theRec.Right, theRec.Bottom - 1);
g.DrawLine(Pens.White, theRec.Right - 1, theRec.Bottom - 1,
theRec.Right - 1, theRec.Y + 5);
g.DrawLine(Pens.White, theRec.Right - 3, theRec.Y + 6,
theRec.X + theEndPosition, theRec.Y + 6);
StringFormat sf = new StringFormat();
SolidBrush drawBrush = new SolidBrush(Color.Black);
g.DrawString(m_Caption, this.Font, drawBrush, theCaptionPosition, 0);
}
public void CollapseBox_Click(object sender, System.EventArgs e)
{
// at this point the control's value has changed but hasn't been
// redrawn on the screen
this.IsCollapsed = m_CollapseBox.IsPlus;
if(CollapseBoxClickedEvent != null)
{
CollapseBoxClickedEvent(this);
}
}
private void CollapseBox_DoubleClick(object sender, System.EventArgs e)
{
// fast clicking registers as double-clicking, so map a double-click
// event into a single click.
CollapseBox_Click(sender, e);
}
private void TrashIcon_Click(object sender, System.EventArgs e)
{
if(TrashCanClickedEvent != null)
{
TrashCanClickedEvent(this);
}
}
#endregion events
#region Accessors
[DefaultValue("")]
public string Caption
{
get
{
return m_Caption;
}
set
{
m_Caption = value;
SetGroupBoxCaption();
Invalidate();
}
}
[DefaultValue(true)]
public bool ContainsTrashCan
{
get
{
return m_TrashIcon.Visible;
}
set
{
//m_bContainsTrashCan = value;
m_TrashIcon.Visible = value;
SetGroupBoxCaption();
Invalidate();
}
}
[Browsable(false)]
public int FullHeight
{
get
{
return m_FullSize.Height;
}
}
[DefaultValue(false), Browsable(false)]
public bool IsCollapsed
{
get
{
#if DEBUG
if(m_CollapseBox.IsPlus)
{
Debug.Assert(this.Height == kCollapsedHeight);
}
else
{
Debug.Assert(this.Height > kCollapsedHeight);
}
#endif
return m_CollapseBox.IsPlus;
}
set
{
if(m_CollapseBox.IsPlus != value)
{
m_CollapseBox.IsPlus = value;
}
if(m_CollapseBox.IsPlus != true)
{
//Expand();
this.Size = m_FullSize;
}
else
{
//Collapse();
m_bResizingFromCollapse = true;
Size smallSize = m_FullSize;
smallSize.Height = kCollapsedHeight;
this.Size = smallSize;
m_bResizingFromCollapse = false;
}
Invalidate();
}
}
#endregion accessors
#region Methods
private void SetGroupBoxCaption()
{
RepositionTrashCan();
}
private void RepositionTrashCan()
{
if(m_TrashIcon.Visible)
{
// Since the trash icon's location is a function of the caption's width,
// we also need to reposition the trash icon
// first, find the width of the string
Graphics g = CreateGraphics();
SizeF theTextSize = new SizeF();
theTextSize = g.MeasureString(m_Caption, this.Font);
// Hmm... MeasureString() doesn't seem to be returning the
// correct width. Close... but not exact
// 11 is the number of pixels from the beginning of the group box
// to the beginning of text of the group box's caption
//m_TrashIcon.Left = m_GroupBox.Location.X + 29 + (int)theTextSize.Width - 4;
m_TrashIcon.Left = this.Location.X + 29 + (int)theTextSize.Width - 4;
// -4 is a fudge factor. Hey, what can I say...
}
}
#endregion Methods
public delegate void CollapseBoxClickedEventHandler(object sender);
public delegate void TrashCanClickedEventHandler(object sender);
}
}

View File

@@ -0,0 +1,166 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 1.3
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">1.3</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1">this is my long string</data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
[base64 mime encoded serialized .NET Framework object]
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
[base64 mime encoded string representing a byte array form of the .NET Framework object]
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used forserialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>1.3</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="m_CollapseBox.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="m_CollapseBox.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="m_CollapseBox.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="m_TrashIcon.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="m_TrashIcon.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="m_TrashIcon.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="m_TrashIcon.NormalImage" type="System.Drawing.Bitmap, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAJdJREFUOE+VkgEK
wDAIA9ef92n9WYdlEbVR2aB0OM3O6Hj4s0l4JLkuLIV7rXUdiX8n1XFFpkDjlYj785xzyxES+25FGQYQ
uxaYP0ePoaqofBeaygdNgInAx90ZeQhCn/8IIIAbyPHO5ugmAU9IcWriZaTtvTMQVOqD3YEwgZ7A4ict
pOOkG2nw45Son+Uou3WOipXYyX0Bl4EdsYyOw8oAAAAASUVORK5CYII=
</value>
</data>
<data name="m_TrashIcon.PressedImage" type="System.Drawing.Bitmap, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAJhJREFUOE+VkgEK
wDAIA9dP9gn9/w86LIuojcoGpcNpdkbHw59NwiPJdWEp3Gut60j8O6mOKzIFGq9E3J/nnFuOkNh3K8ow
gNi1wPw5egxVReW70FQ+aAJMBD7uzshDEPr8RwAB3ECOdzZHNwl4QopTEy8jbe+dgaBSH+wOhAn0BBY/
aSEdJ91Igx+nRP0sR9mtc1SsxE7uC3D26NQxC7BSAAAAAElFTkSuQmCC
</value>
</data>
<data name="$this.TrayLargeIcon" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="$this.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="$this.SnapToGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</data>
<data name="$this.DrawGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</data>
<data name="$this.TrayHeight" type="System.Int32, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>80</value>
</data>
<data name="$this.Language" type="System.Globalization.CultureInfo, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>(Default)</value>
</data>
<data name="$this.Localizable" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="$this.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="$this.Name">
<value>CollapsibleGroupBox</value>
</data>
<data name="$this.GridSize" type="System.Drawing.Size, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>8, 8</value>
</data>
</root>

View File

@@ -0,0 +1,194 @@
using System;
using System.Collections;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Windows.Forms;
namespace UIToolbox
{
/// <summary>
/// Summary description for ExpandingPanel.
/// </summary>
public class ExpandingPanel : System.Windows.Forms.Panel
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.Container components = null;
ArrayList m_GroupArray = null;
public const int kGap = 6;
public ExpandingPanel()
{
// This call is required by the Windows.Forms Form Designer.
InitializeComponent();
m_GroupArray = new ArrayList();
}
/// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if(components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Component Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
//
// ExpandingPanel
//
this.Move += new System.EventHandler(this.ExpandingPanel_Move);
this.Resize += new System.EventHandler(this.ExpandingPanel_Resize);
this.SizeChanged += new System.EventHandler(this.ExpandingPanel_SizeChanged);
this.Layout += new System.Windows.Forms.LayoutEventHandler(this.ExpandingPanel_Layout);
}
#endregion
public void AddGroup(UIToolbox.CollapsibleGroupBox theGroupBox)
{
m_GroupArray.Add(theGroupBox);
this.SuspendLayout();
Size theSize = this.AutoScrollMinSize;
theGroupBox.Location = new System.Drawing.Point(4, theSize.Height + 4);
theSize.Height += (theGroupBox.Height + kGap);
this.AutoScrollMinSize = theSize;
theGroupBox.CollapseBoxClickedEvent += new CollapsibleGroupBox.CollapseBoxClickedEventHandler(this.CollapseBox_Click);
theGroupBox.TrashCanClickedEvent += new CollapsibleGroupBox.TrashCanClickedEventHandler(this.TrashCan_Click);
this.Controls.Add(theGroupBox);
this.ResumeLayout(false);
}
private void ExpandingPanel_Layout(object sender, System.Windows.Forms.LayoutEventArgs e)
{
}
private void ExpandingPanel_Move(object sender, System.EventArgs e)
{
}
private void ExpandingPanel_Resize(object sender, System.EventArgs e)
{
}
private void ExpandingPanel_SizeChanged(object sender, System.EventArgs e)
{
}
private void CollapseBox_Click(object sender)
{
int nIndex;
nIndex = m_GroupArray.IndexOf(sender);
CollapsibleGroupBox theGroupBox;
theGroupBox = (CollapsibleGroupBox)m_GroupArray[nIndex];
int nDelta;
if(theGroupBox.Height == CollapsibleGroupBox.kCollapsedHeight)
{
nDelta = -(theGroupBox.FullHeight - CollapsibleGroupBox.kCollapsedHeight);
}
else
{
nDelta = (theGroupBox.FullHeight - CollapsibleGroupBox.kCollapsedHeight);
}
for(int i=(nIndex + 1); i<m_GroupArray.Count; i++)
{
theGroupBox = (CollapsibleGroupBox)m_GroupArray[i];
theGroupBox.Top += nDelta;
}
Size theSize = this.AutoScrollMinSize;
theSize.Height += nDelta;
this.AutoScrollMinSize = theSize;
}
private void TrashCan_Click(object sender)
{
int nIndex;
nIndex = m_GroupArray.IndexOf(sender);
CollapsibleGroupBox theGroupBox;
theGroupBox = (CollapsibleGroupBox)m_GroupArray[nIndex];
int nDelta;
nDelta = theGroupBox.Height + kGap;
m_GroupArray.RemoveAt(nIndex);
theGroupBox.Dispose();
theGroupBox = null;
for(int i=nIndex; i<m_GroupArray.Count; i++)
{
theGroupBox = (CollapsibleGroupBox)m_GroupArray[i];
theGroupBox.Top -= nDelta;
}
Size theSize = this.AutoScrollMinSize;
theSize.Height -= nDelta;
this.AutoScrollMinSize = theSize;
}
}
}
#region NOT USED
class IndexerArray
{
protected ArrayList data = new ArrayList();
public object this[int idx]
{
get
{
if (idx > -1 && idx < data.Count)
{
return (data[idx]);
}
else
{
throw new InvalidOperationException("[IndexerArray.get_Item]Index out of range");
}
}
set
{
if (idx > -1 && idx < data.Count)
{
data[idx] = value;
}
else if (idx == data.Count)
{
data.Add(value);
}
else
{
throw new InvalidOperationException("[IndexerArray.set_Item]Index out of range");
}
}
}
}
#endregion NOT USED

View File

@@ -0,0 +1,109 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 1.3
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">1.3</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1">this is my long string</data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
[base64 mime encoded serialized .NET Framework object]
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
[base64 mime encoded string representing a byte array form of the .NET Framework object]
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used forserialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>1.3</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="$this.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="$this.TrayLargeIcon" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="$this.Name">
<value>ExpandingPanel</value>
</data>
</root>

View File

@@ -0,0 +1,110 @@
using System;
using System.Collections;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Windows.Forms;
namespace UIToolbox
{
/// <summary>
/// Summary description for ImageButton.
/// </summary>
public class ImageButton : OwnerDrawButton
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.Container components = null;
#region Internal variables
private Image m_NormalImage = null;
private Image m_PressedImage = null;
#endregion Internal variables
public ImageButton()
{
// This call is required by the Windows.Forms Form Designer.
InitializeComponent();
}
/// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if(components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Component Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
//
// ImageButton
//
this.Paint += new System.Windows.Forms.PaintEventHandler(this.ImageButton_Paint);
}
#endregion
#region Events
private void ImageButton_Paint(object sender, System.Windows.Forms.PaintEventArgs e)
{
Graphics g = e.Graphics;
if(m_ButtonState == ButtonState.TrackingInside)
{
if(m_PressedImage != null)
{
g.DrawImage(m_PressedImage, 0, 0, m_PressedImage.Width, m_PressedImage.Height);
}
}
else
{
if(m_NormalImage != null)
{
g.DrawImage(m_NormalImage, 0, 0, m_NormalImage.Width, m_NormalImage.Height);
}
}
}
#endregion Events
#region Accessors
public Image NormalImage
{
get
{
return m_NormalImage;
}
set
{
m_NormalImage = value;
Invalidate();
}
}
public Image PressedImage
{
get
{
return m_PressedImage;
}
set
{
m_PressedImage = value;
Invalidate();
}
}
#endregion Accessors
}
}

View File

@@ -0,0 +1,42 @@
<?xml version="1.0" encoding="utf-8" ?>
<root>
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="ResMimeType">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="Version">
<value>1.0.0.0</value>
</resheader>
<resheader name="Reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="Writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@@ -0,0 +1,136 @@
using System;
using System.Collections;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Windows.Forms;
namespace UIToolbox
{
/// <summary>
/// Summary description for OwnerDrawButton.
/// </summary>
public class OwnerDrawButton : System.Windows.Forms.Control
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.Container components = null;
#region Internal variables
public enum ButtonState
{
Normal,
TrackingInside,
TrackingOutside
}
protected ButtonState m_ButtonState = ButtonState.Normal;
#endregion Internal variables
public OwnerDrawButton()
{
// This call is required by the Windows.Forms Form Designer.
InitializeComponent();
}
/// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if(components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Component Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
//
// OwnerDrawButton
//
this.Resize += new System.EventHandler(this.OwnerDrawButton_Resize);
this.MouseUp += new System.Windows.Forms.MouseEventHandler(this.OwnerDrawButton_MouseUp);
this.Paint += new System.Windows.Forms.PaintEventHandler(this.OwnerDrawButton_Paint);
this.MouseEnter += new System.EventHandler(this.OwnerDrawButton_MouseEnter);
this.MouseMove += new System.Windows.Forms.MouseEventHandler(this.OwnerDrawButton_MouseMove);
this.MouseLeave += new System.EventHandler(this.OwnerDrawButton_MouseLeave);
this.MouseDown += new System.Windows.Forms.MouseEventHandler(this.OwnerDrawButton_MouseDown);
}
#endregion
#region Events
private void OwnerDrawButton_Paint(object sender, System.Windows.Forms.PaintEventArgs e)
{
// needs to be implemented by the derived class
}
private void OwnerDrawButton_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
{
m_ButtonState = ButtonState.TrackingInside;
Invalidate();
}
private void OwnerDrawButton_MouseEnter(object sender, System.EventArgs e)
{
if(m_ButtonState == ButtonState.TrackingOutside)
{
m_ButtonState = ButtonState.TrackingInside;
Invalidate();
}
}
private void OwnerDrawButton_MouseLeave(object sender, System.EventArgs e)
{
if(m_ButtonState == ButtonState.TrackingInside)
{
m_ButtonState = ButtonState.TrackingOutside;
Invalidate();
}
}
private void OwnerDrawButton_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e)
{
if(m_ButtonState == ButtonState.Normal)
return;
Rectangle bounds = new Rectangle(0, 0, this.Width, this.Height);
if(m_ButtonState == ButtonState.TrackingInside)
{
if( !bounds.Contains(e.X, e.Y) )
OwnerDrawButton_MouseLeave(sender, e);
}
else if(m_ButtonState == ButtonState.TrackingOutside)
{
if( bounds.Contains(e.X, e.Y) )
OwnerDrawButton_MouseEnter(sender, e);
}
}
private void OwnerDrawButton_MouseUp(object sender, System.Windows.Forms.MouseEventArgs e)
{
if(m_ButtonState != ButtonState.Normal)
{
m_ButtonState = ButtonState.Normal;
Invalidate();
}
}
private void OwnerDrawButton_Resize(object sender, System.EventArgs e)
{
Invalidate();
}
#endregion Events
}
}

View File

@@ -0,0 +1,109 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 1.3
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">1.3</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1">this is my long string</data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
[base64 mime encoded serialized .NET Framework object]
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
[base64 mime encoded string representing a byte array form of the .NET Framework object]
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used forserialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>1.3</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="$this.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="$this.TrayLargeIcon" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="$this.Name">
<value>OwnerDrawButton</value>
</data>
</root>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@@ -14,6 +14,7 @@
<TargetFrameworkProfile>
</TargetFrameworkProfile>
<FileAlignment>512</FileAlignment>
<IsWebBootstrapper>false</IsWebBootstrapper>
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
@@ -26,7 +27,6 @@
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup>
@@ -66,17 +66,21 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Model\Column.cs" />
<Compile Include="Model\FixedList.cs" />
<Compile Include="Model\ObjectCopier.cs" />
<Compile Include="Model\FormState.cs" />
<Compile Include="Model\PropertyComparer.cs" />
<Compile Include="Repository\ConfigRepository.cs" />
<Compile Include="Repository\ContactRepository.cs" />
<Compile Include="Repository\FileHandler.cs" />
<Compile Include="Repository\IContactRepository.cs" />
<Compile Include="Repository\Interfaces\IConfigRepository.cs" />
<Compile Include="Repository\Interfaces\IContactRepository.cs" />
<Compile Include="Model\Contact.cs" />
<Compile Include="Presenter\MainPresenter.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Repository\IFileHandler.cs" />
<Compile Include="Repository\Interfaces\IFileHandler.cs" />
<Compile Include="Thought.vCards\vCard.cs" />
<Compile Include="Thought.vCards\vCardAccessClassification.cs" />
<Compile Include="Thought.vCards\vCardCertificate.cs" />
@@ -148,6 +152,12 @@
<Compile Include="View\Customs\AddressTabControl.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="View\Customs\ColumnsDialog.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="View\Customs\ColumnsDialog.Designer.cs">
<DependentUpon>ColumnsDialog.cs</DependentUpon>
</Compile>
<Compile Include="View\EventArgs.cs" />
<Compile Include="View\IMainView.cs" />
<Compile Include="View\MainForm.cs">
@@ -156,9 +166,25 @@
<Compile Include="View\MainForm.Designer.cs">
<DependentUpon>MainForm.cs</DependentUpon>
</Compile>
<Compile Include="View\SortableBindingList.cs" />
<Compile Include="View\StateTextBox.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="View\UIToolbox\CollapseBox.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="View\UIToolbox\CollapsibleGroupBox.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="View\UIToolbox\ExpandingPanel.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="View\UIToolbox\ImageButton.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="View\UIToolbox\OwnerDrawButton.cs">
<SubType>Component</SubType>
</Compile>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
@@ -182,9 +208,27 @@
<EmbeddedResource Include="View\Customs\AddressBox.resx">
<DependentUpon>AddressBox.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="View\Customs\ColumnsDialog.resx">
<DependentUpon>ColumnsDialog.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="View\MainForm.resx">
<DependentUpon>MainForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="View\UIToolbox\CollapseBox.resx">
<DependentUpon>CollapseBox.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="View\UIToolbox\CollapsibleGroupBox.resx">
<DependentUpon>CollapsibleGroupBox.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="View\UIToolbox\ExpandingPanel.resx">
<DependentUpon>ExpandingPanel.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="View\UIToolbox\ImageButton.resx">
<DependentUpon>ImageButton.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="View\UIToolbox\OwnerDrawButton.resx">
<DependentUpon>OwnerDrawButton.cs</DependentUpon>
</EmbeddedResource>
<None Include="app.config" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
@@ -202,6 +246,7 @@
<Content Include="assests\Close.png" />
<Content Include="assests\icons8-close-16.png" />
<Content Include="assests\vCard.ico" />
<Content Include="Releases.txt" />
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
@@ -210,6 +255,7 @@
<Install>false</Install>
</BootstrapperPackage>
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.

View File

@@ -146,22 +146,12 @@
{
get
{
string s = @"BEGIN:VCARD
VERSION:4.0
N:Gump;Forrest;;;
FN:Forrest Gump
ORG:Bubba Gump Shrimp Co.
TITLE:Shrimp Man
PHOTO;MEDIATYPE=image/jpg:https://upload.wikimedia.org/wikipedia/commons/thumb/9/95/TomHanksForrestGump94.jpg/224px-TomHanksForrestGump94.jpg
TEL;TYPE=work,voice;VALUE=uri:tel:+1-111-555-1212
TEL;TYPE=home,voice;VALUE=uri:tel:+1-404-555-1212
ADR;TYPE=work;LABEL=""100 Waters Edge\nBaytown, LA 30314\nUnited States of America""
:;;100 Waters Edge; Baytown;LA;30314;United States of America
ADR;TYPE=home;LABEL=""42 Plantation St.\nBaytown, LA 30314\nUnited States of America""
:;;42 Plantation St.; Baytown;LA;30314;United States of America
EMAIL:forrestgump @example.com
REV:20080424T195243Z
END:VCARD";
string s = @"BEGIN:VCARD\n" +
"VERSION:4.0\n" +
"N:Gump;Forrest;;;\n" +
"FN:Forrest Gump\n" +
"PHOTO;MEDIATYPE=image/jpg:https://upload.wikimedia.org/wikipedia/commons/thumb/9/95/TomHanksForrestGump94.jpg/224px-TomHanksForrestGump94.jpg\n" +
"END:VCARD";
return s.Split('\n');
}
}
@@ -170,19 +160,34 @@
{
get
{
string s = @"BEGIN:VCARD
VERSION:3.0
N:Dupont;Jean;;;
FN:Jean Dupont1
ADR;TYPE=WORK;TYPE=PREF:;;6A Rue Th. Decuyper;;;;
EMAIL;TYPE=INTERNET:jean.dupont@example.com
PHOTO;ENCODING=b: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
TEL;TYPE=CELL:+1234 56789
END:VCARD";
string s = @"BEGIN:VCARD\n" +
"VERSION:3.0\n" +
"N:Dupont;Jean;;;\n" +
"FN:Jean Dupont1\n" +
"ADR;TYPE=WORK;TYPE=PREF:;;6A Rue Th. Decuyper;;;;\n" +
"EMAIL;TYPE=INTERNET:jean.dupont@example.com\n" +
"PHOTO;ENCODING=b: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\n" +
"TEL;TYPE=CELL:+1234 56789\n" +
"END:VCARD";
return s.Split('\n');
}
}
public static string[] vcfOneEntryWithTwoAddress
{
get
{
string s = @"BEGIN:VCARD\n" +
"VERSION:2.1\n" +
"FN:Jean Dupont1\n" +
"N:Dupont;Jean\n" +
"ADR;WORK;PREF;QUOTED-PRINTABLE:;Bruxelles 1200=Belgique;6A Rue Th. Decuyper\n" +
"ADR;Home;PREF;QUOTED-PRINTABLE:;Bruxelles 1200=Belgique;6A Rue Th. Decuyper\n" +
"END:VCARD";
return s.Split('\n');
}
}
}
}

View File

@@ -1,16 +1,15 @@
using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using VCFEditor;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using VCFEditor.View;
using VCFEditor.Presenter;
using VCFEditor.Model;
using System.ComponentModel;
using VCFEditor.Repository;
using vCardEditor.Repository;
using NSubstitute;
using vCardEditor.View;
using System;
using AutoFixture;
using Thought.vCards;
using System.Collections.Generic;
namespace vCardEditor_Test
{
@@ -25,9 +24,7 @@ namespace vCardEditor_Test
fileHandler.ReadAllLines(Arg.Any<string>()).Returns(Entries.vcfOneEntry);
var repo = Substitute.For<ContactRepository>(fileHandler);
var view = Substitute.For<IMainView>();
var presenter = new MainPresenter(view, repo);
_ = new MainPresenter(view, repo);
view.NewFileOpened += Raise.EventWith(new EventArg<string>("filename.aaa"));
view.Received().DisplayMessage(Arg.Any<string>(), Arg.Any<string>());
@@ -41,14 +38,15 @@ namespace vCardEditor_Test
var fileHandler = Substitute.For<IFileHandler>();
fileHandler.ReadAllLines(Arg.Any<string>()).Returns(Entries.vcfOneEntry);
var repo = Substitute.For<ContactRepository>(fileHandler);
repo.GetExtension(Arg.Any<string>()).Returns(".vcf");
var view = Substitute.For<IMainView>();
var presenter = new MainPresenter(view, repo);
view.NewFileOpened += Raise.EventWith(new EventArg<string>("filename.vcf"));
view.Received().DisplayContacts(Arg.Is<BindingList<Contact>>(x=>x.Count == 1));
view.Received().DisplayContacts(Arg.Is<BindingList<Contact>>(x => x[0].card.FormattedName == "Jean Dupont1"));
view.Received().DisplayContacts(Arg.Is<SortableBindingList<Contact>>(x=>x.Count == 1));
view.Received().DisplayContacts(Arg.Is<SortableBindingList<Contact>>(x => x[0].card.FormattedName == "Jean Dupont1"));
}
@@ -60,6 +58,7 @@ namespace vCardEditor_Test
var fileHandler = Substitute.For<IFileHandler>();
fileHandler.ReadAllLines(Arg.Any<string>()).Returns(Entries.vcfThreeEntry);
var repo = Substitute.For<ContactRepository>(fileHandler);
repo.GetExtension(Arg.Any<string>()).Returns(".vcf");
var view = Substitute.For<IMainView>();
view.AskMessage(Arg.Any<string>(), Arg.Any<string>()).Returns(true);
@@ -79,6 +78,7 @@ namespace vCardEditor_Test
var fileHandler = Substitute.For<IFileHandler>();
fileHandler.ReadAllLines(Arg.Any<string>()).Returns(Entries.vcfThreeEntry);
var repo = Substitute.For<ContactRepository>(fileHandler);
repo.GetExtension(Arg.Any<string>()).Returns(".vcf");
var view = Substitute.For<IMainView>();
@@ -91,16 +91,17 @@ namespace vCardEditor_Test
}
[TestMethod]
public void SaveFile_ExistAlready()
public void SaveFile_ExistAlready_Test()
{
var fileHandler = Substitute.For<IFileHandler>();
fileHandler.ReadAllLines(Arg.Any<string>()).Returns(Entries.vcfThreeEntry);
fileHandler.FileExist("aaa.vcf.old0").Returns(true);
var repo = Substitute.For<ContactRepository>(fileHandler);
repo.GetExtension(Arg.Any<string>()).Returns(".vcf");
var view = Substitute.For<IMainView>();
var presenter = new MainPresenter(view, repo);
_ = new MainPresenter(view, repo);
view.NewFileOpened += Raise.EventWith(new EventArg<string>("aaa.vcf"));
view.SaveContactsSelected += Raise.Event();
@@ -110,15 +111,15 @@ namespace vCardEditor_Test
[TestMethod]
public void DeleteTest()
public void DeleteContact_ShouldDelete_Test()
{
var fileHandler = Substitute.For<IFileHandler>();
fileHandler.ReadAllLines(Arg.Any<string>()).Returns(Entries.vcfThreeEntry);
var repo = Substitute.For<ContactRepository>(fileHandler);
repo.GetExtension(Arg.Any<string>()).Returns(".vcf");
var view = Substitute.For<IMainView>();
var presenter = new MainPresenter(view, repo);
_ = new MainPresenter(view, repo);
view.NewFileOpened += Raise.EventWith(new EventArg<string>("aaa.vcf"));
//Mouse click on second row.
@@ -132,9 +133,121 @@ namespace vCardEditor_Test
}
[TestMethod]
public void CopyTextToClipboardHandler_ShouldCopyvCard()
{
var fileHandler = Substitute.For<IFileHandler>();
fileHandler.ReadAllLines(Arg.Any<string>()).Returns(Entries.vcfOneEntry);
var repo = Substitute.For<ContactRepository>(fileHandler);
var view = Substitute.For<IMainView>();
view.SelectedContactIndex.Returns(0);
_ = new MainPresenter(view, repo);
repo.LoadContacts("aaa.vcf");
view.CopyTextToClipboardEvent += Raise.Event();
view.Received().SendTextToClipBoard(Arg.Any<string>());
view.Received().DisplayMessage("vCard copied to clipboard!", "Information");
}
[TestMethod]
public void AddressRemovedHandler_ShouldRemove_Test()
{
var fileHandler = Substitute.For<IFileHandler>();
fileHandler.ReadAllLines(Arg.Any<string>()).Returns(Entries.vcfOneEntryWithTwoAddress);
var repo = Substitute.For<ContactRepository>(fileHandler);
var view = Substitute.For<IMainView>();
view.SelectedContactIndex.Returns(0);
_ = new MainPresenter(view, repo);
var contact = repo.LoadContacts("aaa.vcf");
view.AddressRemoved += Raise.EventWith(new EventArg<int>(0));
Assert.AreEqual(1, contact[0].card.DeliveryAddresses.Count);
}
[TestMethod]
public void AddressAddedHandler_ShouldAddAddress_Test()
{
var fileHandler = Substitute.For<IFileHandler>();
fileHandler.ReadAllLines(Arg.Any<string>()).Returns(Entries.vcfOneEntryWithTwoAddress);
var repo = Substitute.For<ContactRepository>(fileHandler);
var view = Substitute.For<IMainView>();
view.SelectedContactIndex.Returns(0);
_ = new MainPresenter(view, repo);
var contact = repo.LoadContacts("aaa.vcf");
var fixture = new Fixture { RepeatCount = 2 };
var lstvCardDeliveryAddressTypes = fixture.Create <List<vCardDeliveryAddressTypes>>();
view.AddressAdded += Raise.EventWith(new EventArg<List<vCardDeliveryAddressTypes>>(lstvCardDeliveryAddressTypes));
Assert.AreEqual(2 + 1, contact[0].card.DeliveryAddresses.Count);
Assert.AreEqual(2, contact[0].card.DeliveryAddresses[2].AddressType.Count);
}
[TestMethod]
public void AddressModifiedHandler_ShouldModifyAddress_Test()
{
var fileHandler = Substitute.For<IFileHandler>();
fileHandler.ReadAllLines(Arg.Any<string>()).Returns(Entries.vcfOneEntryWithTwoAddress);
var repo = Substitute.For<ContactRepository>(fileHandler);
var view = Substitute.For<IMainView>();
view.SelectedContactIndex.Returns(0);
_ = new MainPresenter(view, repo);
var contact = repo.LoadContacts("aaa.vcf");
var fixture = new Fixture { RepeatCount = 2 };
var lstvCardDeliveryAddressTypes = fixture.Create<List<vCardDeliveryAddressTypes>>();
view.AddressModified += Raise.EventWith(new EventArg<List<vCardDeliveryAddressTypes>>(lstvCardDeliveryAddressTypes));
Assert.AreEqual(1, contact[0].card.DeliveryAddresses.Count);
Assert.AreEqual(2, contact[0].card.DeliveryAddresses[0].AddressType.Count);
}
[TestMethod]
public void ExportImage_ShouldExportArrayByte_Test()
{
var fileHandler = Substitute.For<IFileHandler>();
fileHandler.ReadAllLines(Arg.Any<string>()).Returns(Entries.vcfwithInternalPhoto);
var repo = Substitute.For<ContactRepository>(fileHandler);
var view = Substitute.For<IMainView>();
view.SelectedContactIndex.Returns(0);
_ = new MainPresenter(view, repo);
_ = repo.LoadContacts("aaa.vcf");
view.ExportImage += Raise.Event();
fileHandler.Received().WriteBytesToFile(Arg.Any<string>(), Arg.Any<Byte[]>());
}
[TestMethod]
public void ModifyImage_ShouldModify_Test()
{
var fileHandler = Substitute.For<IFileHandler>();
fileHandler.ReadAllLines(Arg.Any<string>()).Returns(Entries.vcfwithInternalPhoto);
var repo = Substitute.For<ContactRepository>(fileHandler);
var view = Substitute.For<IMainView>();
view.SelectedContactIndex.Returns(0);
_ = new MainPresenter(view, repo);
var contact = repo.LoadContacts("aaa.vcf");
view.ModifyImage += Raise.EventWith(new EventArg<string>(""));
Assert.AreEqual(0, contact[0].card.Photos.Count);
Assert.IsTrue(contact[0].isDirty);
}
}
}

View File

@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Threading.Tasks.Extensions" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.2.0.1" newVersion="4.2.0.1" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

View File

@@ -1,6 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="AutoFixture" version="4.18.0" targetFramework="net481" />
<package id="Castle.Core" version="5.1.1" targetFramework="net481" />
<package id="Fare" version="2.1.1" targetFramework="net481" />
<package id="NSubstitute" version="5.0.0" targetFramework="net481" />
<package id="System.Runtime.CompilerServices.Unsafe" version="6.0.0" targetFramework="net481" />
<package id="System.Threading.Tasks.Extensions" version="4.5.4" targetFramework="net481" />

View File

@@ -36,15 +36,22 @@
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="AutoFixture, Version=4.18.0.0, Culture=neutral, PublicKeyToken=b24654c590009d4f, processorArchitecture=MSIL">
<HintPath>..\packages\AutoFixture.4.18.0\lib\net452\AutoFixture.dll</HintPath>
</Reference>
<Reference Include="Castle.Core, Version=5.0.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL">
<HintPath>..\packages\Castle.Core.5.1.1\lib\net462\Castle.Core.dll</HintPath>
</Reference>
<Reference Include="Fare, Version=2.1.0.0, Culture=neutral, PublicKeyToken=ea68d375bf33a7c8, processorArchitecture=MSIL">
<HintPath>..\packages\Fare.2.1.1\lib\net35\Fare.dll</HintPath>
</Reference>
<Reference Include="Microsoft.CSharp" />
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
<Reference Include="NSubstitute, Version=5.0.0.0, Culture=neutral, PublicKeyToken=92dd2e9066daa5ca, processorArchitecture=MSIL">
<HintPath>..\packages\NSubstitute.5.0.0\lib\net462\NSubstitute.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.ComponentModel.DataAnnotations" />
<Reference Include="System.Configuration" />
<Reference Include="System.Core">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
@@ -82,6 +89,7 @@
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />