mirror of
https://github.com/abdelkader/vCardEditor
synced 2025-12-12 08:27:19 +07:00
Compare commits
82 Commits
Branch_Tho
...
v0.5.3
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
88efefef5e | ||
|
|
c244f09b92 | ||
|
|
1df41c4714 | ||
|
|
634f82b3bb | ||
|
|
016c23d4fc | ||
|
|
e3171db86d | ||
|
|
2bf9cd6064 | ||
|
|
81a63e8281 | ||
|
|
8cda766954 | ||
|
|
194ee7e56c | ||
|
|
a0a6c4900c | ||
|
|
449c22f576 | ||
|
|
0020c3e6c8 | ||
|
|
397279be43 | ||
|
|
d6f5e2f316 | ||
|
|
5a87bc104f | ||
|
|
47e5f0406f | ||
|
|
cbc4a24152 | ||
|
|
2c47765a5e | ||
|
|
f538d3a978 | ||
|
|
a589c642d3 | ||
|
|
687b2a248a | ||
|
|
834c1a7243 | ||
|
|
d9657f2318 | ||
|
|
3bbe7170c4 | ||
|
|
48631de425 | ||
|
|
71b5b7580a | ||
|
|
7a4c8e9d42 | ||
|
|
1233425972 | ||
|
|
2885f5f5cc | ||
|
|
89c06504ee | ||
|
|
adac378b13 | ||
|
|
74b5400a34 | ||
|
|
7ffb330559 | ||
|
|
3b1cfcd36b | ||
|
|
8cf9ce829c | ||
|
|
071c967e08 | ||
|
|
618e341e02 | ||
|
|
6427542051 | ||
|
|
dc9fa3143a | ||
|
|
f0742c560c | ||
|
|
e4e6a983e3 | ||
|
|
f4ede0585b | ||
|
|
83cda3c073 | ||
|
|
8d9070f483 | ||
|
|
4b33a2425d | ||
|
|
fa7f2c85d2 | ||
|
|
a40ffaca58 | ||
|
|
2325b5f986 | ||
|
|
1db99cf187 | ||
|
|
fe4c6381da | ||
|
|
437301d5bc | ||
|
|
ed4d988c1d | ||
|
|
b249d91439 | ||
|
|
7d9bfc4fe3 | ||
|
|
62deb9a13e | ||
|
|
4081142e2c | ||
|
|
dd62810160 | ||
|
|
314065c2dc | ||
|
|
a5e932b345 | ||
|
|
1e1c3cce81 | ||
|
|
dbc2615ed5 | ||
|
|
f9d016260f | ||
|
|
a03a4e8ee4 | ||
|
|
6843863778 | ||
|
|
ee95238e2d | ||
|
|
f14f5086d0 | ||
|
|
91fb7ca500 | ||
|
|
5c42100019 | ||
|
|
28fe4f116d | ||
|
|
79412f3484 | ||
|
|
126fc13afd | ||
|
|
cb013a36f6 | ||
|
|
a95dcafb29 | ||
|
|
a18a253696 | ||
|
|
ddde4b0d2c | ||
|
|
2d864d7c00 | ||
|
|
fe018dd2e7 | ||
|
|
ade032cdf2 | ||
|
|
0693da5bb4 | ||
|
|
b3cee3a9d2 | ||
|
|
3f66b15e0b |
2
.gitignore
vendored
2
.gitignore
vendored
@@ -215,3 +215,5 @@ FakesAssemblies/
|
||||
**/*.Server/GeneratedArtifacts
|
||||
**/*.Server/ModelManifest.xml
|
||||
_Pvt_Extensions
|
||||
/contacts
|
||||
/vCardEditor/assests/icons8-save-32.png
|
||||
|
||||
47
README.md
47
README.md
@@ -1,13 +1,38 @@
|
||||
# vCard Editor
|
||||
A Simple vcf file Editor.
|
||||

|
||||
|
||||
- You can export easily edit (modify, delete) entries of a vcf file with this simple tool.
|
||||
|
||||
Thanks for Thought.vCards for his wonderful library of parsing and generating vcf format.
|
||||
http://www.thoughtproject.com/Libraries/vCard/
|
||||
|
||||
Also, the MVP pattern from this example :
|
||||
https://github.com/lennykean/NoteCards
|
||||
|
||||
|
||||
[](https://ko-fi.com/B0B2KV8WP)
|
||||
|
||||
|
||||
<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>
|
||||
|
||||
|
||||
|
||||
|
||||
## 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
|
||||
|
||||
## 📚 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)
|
||||
- 🧰 [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 and help
|
||||
Contributions are always welcome! Check ths projet or ths issue page for ideas.
|
||||
- 📝 [**Report a bug**](https://github.com/abdelkader/vCardEditor/issues)
|
||||
- 🙋♀️ [**Request a feature**](https://github.com/abdelkader/vCardEditor/discussions)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
446
properties.md
Normal file
446
properties.md
Normal file
@@ -0,0 +1,446 @@
|
||||
Some properties are not supported by the library **Tought.vCards**.
|
||||
AGENT, ANNIVERSARY, CALADRURI, CALURI, CLIENTPIDMAP, FBURL, GENDER, KIND, LANG, LOGO, MEMBER, PROFILE, RELATED, SORT-STRING, SOUND.
|
||||
|
||||
<h3>Already implemented ✅ in version 5.0 </h3>
|
||||
<table>
|
||||
<tr>
|
||||
<td rowspan="2"><b>Name</b></td>
|
||||
<td colspan="3"><b>Property presence</b></td>
|
||||
<td rowspan="2"><b>Description</b></td>
|
||||
<td rowspan="2"><b>Example</b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><b>v. 2.1</b></td>
|
||||
<td><b>v. 3.0</b></td>
|
||||
<td><b>v. 4.0</b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>ADR</td>
|
||||
<td>Optional</td>
|
||||
<td>Optional</td>
|
||||
<td>Optional</td>
|
||||
<td>A structured representation of the physical delivery address for the vCard object.</td>
|
||||
<td>ADR;TYPE=home:;;123 Main St.;Springfield;IL;12345;USA</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>BEGIN</td>
|
||||
<td>Required</td>
|
||||
<td>Required</td>
|
||||
<td>Required</td>
|
||||
<td>All vCards must start with this property.</td>
|
||||
<td>BEGIN:VCARD</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>EMAIL</td>
|
||||
<td>Optional</td>
|
||||
<td>Optional</td>
|
||||
<td>Optional</td>
|
||||
<td>The address for electronic mail communication with the vCard object.</td>
|
||||
<td>EMAIL:johndoe@hotmail.com</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>END</td>
|
||||
<td>Required</td>
|
||||
<td>Required</td>
|
||||
<td>Required</td>
|
||||
<td>All vCards must end with this property.</td>
|
||||
<td>END:VCARD</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>FN</td>
|
||||
<td>Optional</td>
|
||||
<td>Required</td>
|
||||
<td>Required</td>
|
||||
<td>The formatted name string associated with the vCard object.</td>
|
||||
<td>FN:Dr. John Doe</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>N</td>
|
||||
<td>Required</td>
|
||||
<td>Required</td>
|
||||
<td>Optional</td>
|
||||
<td>A structured representation of the name of the person, place or thing associated with the vCard object. Structure recognizes, in order separated by semicolons: Family Name, Given Name, Additional/Middle Names, Honorific Prefixes, and Honorific Suffixes[3]</td>
|
||||
<td>N:Doe;John;;Dr;</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>NAME</td>
|
||||
<td>Undefined</td>
|
||||
<td>Optional</td>
|
||||
<td>Undefined</td>
|
||||
<td>Provides a textual representation of the SOURCE property.</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>NICKNAME</td>
|
||||
<td>Undefined</td>
|
||||
<td>Optional</td>
|
||||
<td>Optional</td>
|
||||
<td>One or more descriptive/familiar names for the object represented by this vCard.</td>
|
||||
<td>NICKNAME:Jon,Johnny</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td rowspan="6">PHOTO</td>
|
||||
<td rowspan="6">Optional</td>
|
||||
<td rowspan="6">Optional</td>
|
||||
<td rowspan="6">Optional</td>
|
||||
<td rowspan="6">An image or photograph of the individual associated with the vCard. It may point to an external URL or may be embedded in the vCard as a Base64 encoded block of text.</td>
|
||||
<td>2.1: PHOTO;JPEG:http://example.com/photo.jpg</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>2.1: PHOTO;JPEG;ENCODING=BASE64:[base64-data]</td>
|
||||
</tr>
|
||||
<tr><td>3.0: PHOTO;TYPE=JPEG;VALUE=URI:http://example.com/photo.jpg</td>
|
||||
</tr>
|
||||
<tr><td>3.0: PHOTO;TYPE=JPEG;ENCODING=b:[base64-data]</td>
|
||||
</tr>
|
||||
<tr><td>4.0: PHOTO;MEDIATYPE=image/jpeg:http://example.com/photo.jpg</td>
|
||||
</tr>
|
||||
<tr><td>4.0: PHOTO;ENCODING=BASE64;TYPE=JPEG:[base64-data]</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>TEL</td>
|
||||
<td>Optional</td>
|
||||
<td>Optional</td>
|
||||
<td>Optional</td>
|
||||
<td>The canonical number string for a telephone number for telephony communication with the vCard object.</td>
|
||||
<td>TEL;TYPE=cell:(123) 555-5832</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>TITLE</td>
|
||||
<td>Optional</td>
|
||||
<td>Optional</td>
|
||||
<td>Optional</td>
|
||||
<td>Specifies the job title, functional position or function of the individual associated with the vCard object within an organization.</td>
|
||||
<td>TITLE:V.P. Research and Development</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>VERSION</td>
|
||||
<td>Required</td>
|
||||
<td>Required</td>
|
||||
<td>Required</td>
|
||||
<td>The version of the vCard specification. In version 4.0, this must come right after the BEGIN property.</td>
|
||||
<td>VERSION:3.0</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<h3>Not implemented yet ❌ </h3>
|
||||
<table>
|
||||
<tr>
|
||||
<td rowspan="2"><b>Name</b></td>
|
||||
<td colspan="3"><b>Property presence</b></td>
|
||||
<td rowspan="2"><b>Description</b></td>
|
||||
<td rowspan="2"><b>Example</b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><b>v. 2.1</b></td>
|
||||
<td><b>v. 3.0</b></td>
|
||||
<td><b>v. 4.0</b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>AGENT</td>
|
||||
<td>Optional</td>
|
||||
<td>Optional</td>
|
||||
<td>Undefined</td>
|
||||
<td>Information about another person who will act on behalf of the vCard object. Typically this would be an area administrator, assistant, or secretary for the individual. Can be either a URL or an embedded vCard.</td>
|
||||
<td>AGENT:http://mi6.gov.uk/007</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>ANNIVERSARY</td>
|
||||
<td>Undefined</td>
|
||||
<td>Undefined</td>
|
||||
<td>Optional</td>
|
||||
<td>Defines the person's anniversary.</td>
|
||||
<td>ANNIVERSARY:19901021</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>BDAY</td>
|
||||
<td>Optional</td>
|
||||
<td>Optional</td>
|
||||
<td>Optional</td>
|
||||
<td>Date of birth of the individual associated with the vCard.</td>
|
||||
<td>BDAY:19700310</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>CALADRURI</td>
|
||||
<td>Undefined</td>
|
||||
<td>Undefined</td>
|
||||
<td>Optional</td>
|
||||
<td>A URL to use for sending a scheduling request to the person's calendar.</td>
|
||||
<td>CALADRURI:http://example.com/calendar/jdoe</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>CALURI</td>
|
||||
<td>Undefined</td>
|
||||
<td>Undefined</td>
|
||||
<td>Optional</td>
|
||||
<td>A URL to the person's calendar.</td>
|
||||
<td>CALURI:http://example.com/calendar/jdoe</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>CATEGORIES</td>
|
||||
<td>Optional</td>
|
||||
<td>Optional</td>
|
||||
<td>Optional</td>
|
||||
<td>A list of "tags" that can be used to describe the object represented by this vCard.</td>
|
||||
<td>CATEGORIES:swimmer,biker</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>CLASS</td>
|
||||
<td>Undefined</td>
|
||||
<td>Optional</td>
|
||||
<td>Undefined</td>
|
||||
<td>Describes the sensitivity of the information in the vCard.</td>
|
||||
<td>CLASS:public</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>CLIENTPIDMAP</td>
|
||||
<td>Undefined</td>
|
||||
<td>Undefined</td>
|
||||
<td>Optional</td>
|
||||
<td>Used for synchronizing different revisions of the same vCard.</td>
|
||||
<td>CLIENTPIDMAP:1;urn:uuid:3df403f4-5924-4bb7-b077-3c711d9eb34b</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>FBURL</td>
|
||||
<td>Undefined</td>
|
||||
<td>Undefined</td>
|
||||
<td>Optional</td>
|
||||
<td>Defines a URL that shows when the person is "free" or "busy" on their calendar.</td>
|
||||
<td>FBURL:http://example.com/fb/jdoe</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>GENDER</td>
|
||||
<td>Undefined</td>
|
||||
<td>Undefined</td>
|
||||
<td>Optional</td>
|
||||
<td>Defines the person's gender.</td>
|
||||
<td>GENDER:F</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>GEO</td>
|
||||
<td>Optional</td>
|
||||
<td>Optional</td>
|
||||
<td>Optional</td>
|
||||
<td>Specifies a latitude and longitude.</td>
|
||||
<td>2.1, 3.0: GEO:39.95;-75.1667 <br>4.0: GEO:geo:39.95,-75.1667</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>IMPP</td>
|
||||
<td>Undefined</td>
|
||||
<td>Maybe</td>
|
||||
<td>Optional</td>
|
||||
<td>"Defines an instant messenger handle. <br>This property was introduced in a separate RFC when the latest vCard version was 3.0. Therefore, 3.0 vCards might use this property without otherwise declaring it."</td>
|
||||
<td>IMPP:aim:johndoe@aol.com</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td rowspan="6">KEY</td>
|
||||
<td rowspan="6">Optional</td>
|
||||
<td rowspan="6">Optional</td>
|
||||
<td rowspan="6">Optional</td>
|
||||
<td rowspan="6">The public encryption key associated with the vCard object. It may point to an external URL, may be plain text, or may be embedded in the vCard as a Base64 encoded block of text.</td>
|
||||
<td>2.1: KEY;PGP:http://example.com/key.pgp</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>2.1: KEY;PGP;ENCODING=BASE64:[base64-data]</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>3.0: KEY;TYPE=PGP:http://example.com/key.pgp</td>
|
||||
</tr>
|
||||
<tr><td>3.0: KEY;TYPE=PGP;ENCODING=b:[base64-data]</td>
|
||||
</tr>
|
||||
<tr><td>4.0: KEY;MEDIATYPE=application/pgp-keys:http://example.com/key.pgp</td>
|
||||
</tr>
|
||||
<tr><td>4.0: KEY:data:application/pgp-keys;base64,[base64-data]</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>KIND</td>
|
||||
<td>Undefined</td>
|
||||
<td>Undefined</td>
|
||||
<td>Optional</td>
|
||||
<td>Defines the type of entity that this vCard represents: 'application', 'individual', 'group', 'location' or 'organization'; 'x-*' values may be used for experimental purposes.[1][2]</td>
|
||||
<td>KIND:individual</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>LABEL</td>
|
||||
<td>Optional</td>
|
||||
<td>Optional</td>
|
||||
<td>Incorporated without</td>
|
||||
<td>Represents the actual text that should be put on the mailing label when delivering a physical package to the person/object associated with the vCard (related to the ADR property).<br>Not supported in version 4.0. Instead, this information is stored in the LABEL parameter of the ADR property. Example: ADR;TYPE=home;LABEL="123 Main St\nNew York, NY 12345":;;123 Main St;New York;NY;12345;USA</td>
|
||||
<td>LABEL;TYPE=HOME:123 Main St.\nSpringfield, IL 12345\nUSA</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>LANG</td>
|
||||
<td>Undefined</td>
|
||||
<td>Undefined</td>
|
||||
<td>Optional</td>
|
||||
<td>Defines a language that the person speaks.</td>
|
||||
<td>LANG:fr-CA</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td rowspan="6">LOGO</td>
|
||||
<td rowspan="6">Optional</td>
|
||||
<td rowspan="6">Optional</td>
|
||||
<td rowspan="6">Optional</td>
|
||||
<td rowspan="6">An image or graphic of the logo of the organization that is associated with the individual to which the vCard belongs. It may point to an external URL or may be embedded in the vCard as a Base64 encoded block of text.</td>
|
||||
<td>2.1: LOGO;PNG:http://example.com/logo.png</td>
|
||||
</tr>
|
||||
<tr> <td>2.1: LOGO;PNG;ENCODING=BASE64:[base64-data]</td>
|
||||
</tr>
|
||||
<tr><td>3.0: LOGO;TYPE=PNG:http://example.com/logo.png</td>
|
||||
</tr>
|
||||
<tr><td>3.0: LOGO;TYPE=PNG;ENCODING=b:[base64-data]</td>
|
||||
</tr>
|
||||
<tr><td>4.0: LOGO;MEDIATYPE=image/png:http://example.com/logo.png</td>
|
||||
</tr>
|
||||
<tr><td>4.0: LOGO;ENCODING=BASE64;TYPE=PNG:[base64-data]</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>MAILER</td>
|
||||
<td>Optional</td>
|
||||
<td>Optional</td>
|
||||
<td>Undefined</td>
|
||||
<td>Type of email program used.</td>
|
||||
<td>MAILER:Thunderbird</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>MEMBER</td>
|
||||
<td>Undefined</td>
|
||||
<td>Undefined</td>
|
||||
<td>Optional</td>
|
||||
<td>Defines a member that is part of the group that this vCard represents. Acceptable values include:
|
||||
<ul><li>a "mailto:" URL containing an email address</li>
|
||||
<li>a UID which references the member's own vCard</li>
|
||||
</ul>
|
||||
The KIND property must be set to "group" in order to use this property.
|
||||
</td>
|
||||
<td>MEMBER:urn:uuid:03a0e51f-d1aa-4385-8a53-e29025acd8af</td>
|
||||
</tr><tr>
|
||||
<td>NOTE</td>
|
||||
<td>Optional</td>
|
||||
<td>Optional</td>
|
||||
<td>Optional</td>
|
||||
<td>Specifies supplemental information or a comment that is associated with the vCard.</td>
|
||||
<td>NOTE:I am proficient in Tiger-Crane Style,\nand I am more than proficient in the exquisite art of the Samurai sword.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>ORG</td>
|
||||
<td>Optional</td>
|
||||
<td>Optional</td>
|
||||
<td>Optional</td>
|
||||
<td>The name and optionally the unit(s) of the organization associated with the vCard object. This property is based on the X.520 Organization Name attribute and the X.520 Organization Unit attribute.</td>
|
||||
<td>ORG:Google;GMail Team;Spam Detection Squad</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>PRODID</td>
|
||||
<td>Undefined</td>
|
||||
<td>Optional</td>
|
||||
<td>Optional</td>
|
||||
<td>The identifier for the product that created the vCard object.</td>
|
||||
<td>PRODID:-//ONLINE DIRECTORY//NONSGML Version 1//EN</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>PROFILE</td>
|
||||
<td>Optional</td>
|
||||
<td>Optional</td>
|
||||
<td>Undefined</td>
|
||||
<td>States that the vCard is a vCard.</td>
|
||||
<td>PROFILE:VCARD</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>RELATED</td>
|
||||
<td>Undefined</td>
|
||||
<td>Undefined</td>
|
||||
<td>Optional</td>
|
||||
<td>Another entity that the person is related to. Acceptable values include:
|
||||
<ul>
|
||||
<li>a "mailto:" URL containing an email address</li>
|
||||
<li>a UID which references the person's own vCard</li>
|
||||
</ul>
|
||||
</td>
|
||||
<td>RELATED;TYPE=friend:urn:uuid:03a0e51f-d1aa-4385-8a53-e29025acd8af</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>REV</td>
|
||||
<td>Optional</td>
|
||||
<td>Optional</td>
|
||||
<td>Optional</td>
|
||||
<td>A timestamp for the last time the vCard was updated.</td>
|
||||
<td>REV:20121201T134211Z</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>ROLE</td>
|
||||
<td>Optional</td>
|
||||
<td>Optional</td>
|
||||
<td>Optional</td>
|
||||
<td>The role, occupation, or business category of the vCard object within an organization.</td>
|
||||
<td>ROLE:Executive</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>SORT-STRING</td>
|
||||
<td>Undefined</td>
|
||||
<td>Optional</td>
|
||||
<td>Incorporated without</td>
|
||||
<td>Defines a string that should be used when an application sorts this vCard in some way.<br/>Not supported in version 4.0. Instead, this information is stored in the SORT-AS parameter of the N and/or ORG properties.</td>
|
||||
<td>SORT-STRING:Doe</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td rowspan="6">SOUND</td>
|
||||
<td rowspan="6">Optional</td>
|
||||
<td rowspan="6">Optional</td>
|
||||
<td rowspan="6">Optional</td>
|
||||
<td rowspan="6">By default, if this property is not grouped with other properties it specifies the pronunciation of the FN property of the vCard object. It may point to an external URL or may be embedded in the vCard as a Base64 encoded block of text.</td>
|
||||
<td>2.1: SOUND;OGG:http://example.com/sound.ogg</td>
|
||||
</tr>
|
||||
<tr><td>2.1: SOUND;OGG;ENCODING=BASE64:[base64-data]</td>
|
||||
</tr>
|
||||
<tr><td>3.0: SOUND;TYPE=OGG:http://example.com/sound.ogg</td>
|
||||
</tr>
|
||||
<tr><td>3.0: SOUND;TYPE=OGG;ENCODING=b:[base64-data]</td>
|
||||
</tr>
|
||||
<tr><td>4.0: SOUND;MEDIATYPE=audio/ogg:http://example.com/sound.ogg</td>
|
||||
</tr>
|
||||
<tr><td>4.0: SOUND:data:audio/ogg;base64,[base64-data]</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>SOURCE</td>
|
||||
<td>Optional</td>
|
||||
<td>Optional</td>
|
||||
<td>Optional</td>
|
||||
<td>A URL that can be used to get the latest version of this vCard.</td>
|
||||
<td>SOURCE:http://johndoe.com/vcard.vcf</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>TZ</td>
|
||||
<td>Optional</td>
|
||||
<td>Optional</td>
|
||||
<td>Optional</td>
|
||||
<td>The time zone of the vCard object.</td>
|
||||
<td>2.1, 3.0: TZ:-0500 <br/>4.0: TZ:America/New_York</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>UID</td>
|
||||
<td>Optional</td>
|
||||
<td>Optional</td>
|
||||
<td>Optional</td>
|
||||
<td>Specifies a value that represents a persistent, globally unique identifier associated with the object.</td>
|
||||
<td>UID:urn:uuid:da418720-3754-4631-a169-db89a02b831b</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>URL</td>
|
||||
<td>Optional</td>
|
||||
<td>Optional</td>
|
||||
<td>Optional</td>
|
||||
<td>A URL pointing to a website that represents the person in some way.</td>
|
||||
<td>URL:http://www.johndoe.com</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>XML</td>
|
||||
<td>Undefined</td>
|
||||
<td>Undefined</td>
|
||||
<td>Optional</td>
|
||||
<td>Any XML data that is attached to the vCard. This is used if the vCard was encoded in XML (xCard standard) and the XML document contained elements which are not part of the xCard standard.</td>
|
||||
<td>XML:<b>Not an xCard XML element</b></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
78
vCardEditor/Libs/QRCoder/ASCIIQRCode.cs
Normal file
78
vCardEditor/Libs/QRCoder/ASCIIQRCode.cs
Normal file
@@ -0,0 +1,78 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using static QRCoder.QRCodeGenerator;
|
||||
|
||||
namespace QRCoder
|
||||
{
|
||||
public class AsciiQRCode : AbstractQRCode, IDisposable
|
||||
{
|
||||
/// <summary>
|
||||
/// Constructor without params to be used in COM Objects connections
|
||||
/// </summary>
|
||||
public AsciiQRCode() { }
|
||||
|
||||
public AsciiQRCode(QRCodeData data) : base(data) { }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Returns a strings that contains the resulting QR code as ASCII chars.
|
||||
/// </summary>
|
||||
/// <param name="repeatPerModule">Number of repeated darkColorString/whiteSpaceString per module.</param>
|
||||
/// <param name="darkColorString">String for use as dark color modules. In case of string make sure whiteSpaceString has the same length.</param>
|
||||
/// <param name="whiteSpaceString">String for use as white modules (whitespace). In case of string make sure darkColorString has the same length.</param>
|
||||
/// <param name="endOfLine">End of line separator. (Default: \n)</param>
|
||||
/// <returns></returns>
|
||||
public string GetGraphic(int repeatPerModule, string darkColorString = "██", string whiteSpaceString = " ", bool drawQuietZones = true, string endOfLine = "\n")
|
||||
{
|
||||
return string.Join(endOfLine, GetLineByLineGraphic(repeatPerModule, darkColorString, whiteSpaceString, drawQuietZones));
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Returns an array of strings that contains each line of the resulting QR code as ASCII chars.
|
||||
/// </summary>
|
||||
/// <param name="repeatPerModule">Number of repeated darkColorString/whiteSpaceString per module.</param>
|
||||
/// <param name="darkColorString">String for use as dark color modules. In case of string make sure whiteSpaceString has the same length.</param>
|
||||
/// <param name="whiteSpaceString">String for use as white modules (whitespace). In case of string make sure darkColorString has the same length.</param>
|
||||
/// <returns></returns>
|
||||
public string[] GetLineByLineGraphic(int repeatPerModule, string darkColorString = "██", string whiteSpaceString = " ", bool drawQuietZones = true)
|
||||
{
|
||||
var qrCode = new List<string>();
|
||||
//We need to adjust the repeatPerModule based on number of characters in darkColorString
|
||||
//(we assume whiteSpaceString has the same number of characters)
|
||||
//to keep the QR code as square as possible.
|
||||
var quietZonesModifier = (drawQuietZones ? 0 : 8);
|
||||
var quietZonesOffset = (int)(quietZonesModifier * 0.5);
|
||||
var adjustmentValueForNumberOfCharacters = darkColorString.Length / 2 != 1 ? darkColorString.Length / 2 : 0;
|
||||
var verticalNumberOfRepeats = repeatPerModule + adjustmentValueForNumberOfCharacters;
|
||||
var sideLength = (QrCodeData.ModuleMatrix.Count - quietZonesModifier) * verticalNumberOfRepeats;
|
||||
for (var y = 0; y < sideLength; y++)
|
||||
{
|
||||
var lineBuilder = new StringBuilder();
|
||||
for (var x = 0; x < QrCodeData.ModuleMatrix.Count - quietZonesModifier; x++)
|
||||
{
|
||||
var module = QrCodeData.ModuleMatrix[x + quietZonesOffset][((y + verticalNumberOfRepeats) / verticalNumberOfRepeats - 1)+quietZonesOffset];
|
||||
for (var i = 0; i < repeatPerModule; i++)
|
||||
{
|
||||
lineBuilder.Append(module ? darkColorString : whiteSpaceString);
|
||||
}
|
||||
}
|
||||
qrCode.Add(lineBuilder.ToString());
|
||||
}
|
||||
return qrCode.ToArray();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static class AsciiQRCodeHelper
|
||||
{
|
||||
public static string GetQRCode(string plainText, int pixelsPerModule, string darkColorString, string whiteSpaceString, ECCLevel eccLevel, bool forceUtf8 = false, bool utf8BOM = false, EciMode eciMode = EciMode.Default, int requestedVersion = -1, string endOfLine = "\n", bool drawQuietZones = true)
|
||||
{
|
||||
using (var qrGenerator = new QRCodeGenerator())
|
||||
using (var qrCodeData = qrGenerator.CreateQrCode(plainText, eccLevel, forceUtf8, utf8BOM, eciMode, requestedVersion))
|
||||
using (var qrCode = new AsciiQRCode(qrCodeData))
|
||||
return qrCode.GetGraphic(pixelsPerModule, darkColorString, whiteSpaceString, drawQuietZones, endOfLine);
|
||||
}
|
||||
}
|
||||
}
|
||||
28
vCardEditor/Libs/QRCoder/AbstractQRCode.cs
Normal file
28
vCardEditor/Libs/QRCoder/AbstractQRCode.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
namespace QRCoder
|
||||
{
|
||||
public abstract class AbstractQRCode
|
||||
{
|
||||
protected QRCodeData QrCodeData { get; set; }
|
||||
|
||||
protected AbstractQRCode() {
|
||||
}
|
||||
|
||||
protected AbstractQRCode(QRCodeData data) {
|
||||
this.QrCodeData = data;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Set a QRCodeData object that will be used to generate QR code. Used in COM Objects connections
|
||||
/// </summary>
|
||||
/// <param name="data">Need a QRCodeData object generated by QRCodeGenerator.CreateQrCode()</param>
|
||||
virtual public void SetQRCodeData(QRCodeData data) {
|
||||
this.QrCodeData = data;
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
this.QrCodeData?.Dispose();
|
||||
this.QrCodeData = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
298
vCardEditor/Libs/QRCoder/ArtQRCode.cs
Normal file
298
vCardEditor/Libs/QRCoder/ArtQRCode.cs
Normal file
@@ -0,0 +1,298 @@
|
||||
#if NETFRAMEWORK || NETSTANDARD2_0 || NET5_0 || NET6_0_WINDOWS
|
||||
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Drawing2D;
|
||||
using static QRCoder.ArtQRCode;
|
||||
using static QRCoder.QRCodeGenerator;
|
||||
|
||||
// pull request raised to extend library used.
|
||||
namespace QRCoder
|
||||
{
|
||||
#if NET6_0_WINDOWS
|
||||
[System.Runtime.Versioning.SupportedOSPlatform("windows")]
|
||||
#endif
|
||||
public class ArtQRCode : AbstractQRCode, IDisposable
|
||||
{
|
||||
/// <summary>
|
||||
/// Constructor without params to be used in COM Objects connections
|
||||
/// </summary>
|
||||
public ArtQRCode() { }
|
||||
|
||||
/// <summary>
|
||||
/// Creates new ArtQrCode object
|
||||
/// </summary>
|
||||
/// <param name="data">QRCodeData generated by the QRCodeGenerator</param>
|
||||
public ArtQRCode(QRCodeData data) : base(data) { }
|
||||
|
||||
/// <summary>
|
||||
/// Renders an art-style QR code with dots as modules. (With default settings: DarkColor=Black, LightColor=White, Background=Transparent, QuietZone=true)
|
||||
/// </summary>
|
||||
/// <param name="pixelsPerModule">Amount of px each dark/light module of the QR code shall take place in the final QR code image</param>
|
||||
/// <returns>QRCode graphic as bitmap</returns>
|
||||
public Bitmap GetGraphic(int pixelsPerModule)
|
||||
{
|
||||
return this.GetGraphic(pixelsPerModule, Color.Black, Color.White, Color.Transparent);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Renders an art-style QR code with dots as modules and a background image (With default settings: DarkColor=Black, LightColor=White, Background=Transparent, QuietZone=true)
|
||||
/// </summary>
|
||||
/// <param name="backgroundImage">A bitmap object that will be used as background picture</param>
|
||||
/// <returns>QRCode graphic as bitmap</returns>
|
||||
public Bitmap GetGraphic(Bitmap backgroundImage = null)
|
||||
{
|
||||
return this.GetGraphic(10, Color.Black, Color.White, Color.Transparent, backgroundImage: backgroundImage);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Renders an art-style QR code with dots as modules and various user settings
|
||||
/// </summary>
|
||||
/// <param name="pixelsPerModule">Amount of px each dark/light module of the QR code shall take place in the final QR code image</param>
|
||||
/// <param name="darkColor">Color of the dark modules</param>
|
||||
/// <param name="lightColor">Color of the light modules</param>
|
||||
/// <param name="backgroundColor">Color of the background</param>
|
||||
/// <param name="backgroundImage">A bitmap object that will be used as background picture</param>
|
||||
/// <param name="pixelSizeFactor">Value between 0.0 to 1.0 that defines how big the module dots are. The bigger the value, the less round the dots will be.</param>
|
||||
/// <param name="drawQuietZones">If true a white border is drawn around the whole QR Code</param>
|
||||
/// <param name="quietZoneRenderingStyle">Style of the quiet zones</param>
|
||||
/// <param name="backgroundImageStyle">Style of the background image (if set). Fill=spanning complete graphic; DataAreaOnly=Don't paint background into quietzone</param>
|
||||
/// <param name="finderPatternImage">Optional image that should be used instead of the default finder patterns</param>
|
||||
/// <returns>QRCode graphic as bitmap</returns>
|
||||
public Bitmap GetGraphic(int pixelsPerModule, Color darkColor, Color lightColor, Color backgroundColor, Bitmap backgroundImage = null, double pixelSizeFactor = 0.8,
|
||||
bool drawQuietZones = true, QuietZoneStyle quietZoneRenderingStyle = QuietZoneStyle.Dotted,
|
||||
BackgroundImageStyle backgroundImageStyle = BackgroundImageStyle.DataAreaOnly, Bitmap finderPatternImage = null)
|
||||
{
|
||||
if (pixelSizeFactor > 1)
|
||||
throw new Exception("The parameter pixelSize must be between 0 and 1. (0-100%)");
|
||||
int pixelSize = (int)Math.Min(pixelsPerModule, Math.Floor(pixelsPerModule / pixelSizeFactor));
|
||||
|
||||
var numModules = QrCodeData.ModuleMatrix.Count - (drawQuietZones ? 0 : 8);
|
||||
var offset = (drawQuietZones ? 0 : 4);
|
||||
var size = numModules * pixelsPerModule;
|
||||
|
||||
var bitmap = new Bitmap(size, size);
|
||||
|
||||
using (var graphics = Graphics.FromImage(bitmap))
|
||||
{
|
||||
using (var lightBrush = new SolidBrush(lightColor))
|
||||
{
|
||||
using (var darkBrush = new SolidBrush(darkColor))
|
||||
{
|
||||
// make background transparent
|
||||
using (var brush = new SolidBrush(backgroundColor))
|
||||
graphics.FillRectangle(brush, new Rectangle(0, 0, size, size));
|
||||
//Render background if set
|
||||
if (backgroundImage != null)
|
||||
{
|
||||
if (backgroundImageStyle == BackgroundImageStyle.Fill)
|
||||
graphics.DrawImage(Resize(backgroundImage, size), 0, 0);
|
||||
else if (backgroundImageStyle == BackgroundImageStyle.DataAreaOnly)
|
||||
{
|
||||
var bgOffset = 4 - offset;
|
||||
graphics.DrawImage(Resize(backgroundImage, size - (2 * bgOffset * pixelsPerModule)), 0 + (bgOffset * pixelsPerModule), (bgOffset * pixelsPerModule));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
var darkModulePixel = MakeDotPixel(pixelsPerModule, pixelSize, darkBrush);
|
||||
var lightModulePixel = MakeDotPixel(pixelsPerModule, pixelSize, lightBrush);
|
||||
|
||||
for (var x = 0; x < numModules; x += 1)
|
||||
{
|
||||
for (var y = 0; y < numModules; y += 1)
|
||||
{
|
||||
var rectangleF = new Rectangle(x * pixelsPerModule, y * pixelsPerModule, pixelsPerModule, pixelsPerModule);
|
||||
|
||||
var pixelIsDark = this.QrCodeData.ModuleMatrix[offset + y][offset + x];
|
||||
var solidBrush = pixelIsDark ? darkBrush : lightBrush;
|
||||
var pixelImage = pixelIsDark ? darkModulePixel : lightModulePixel;
|
||||
|
||||
if (!IsPartOfFinderPattern(x, y, numModules, offset))
|
||||
if (drawQuietZones && quietZoneRenderingStyle == QuietZoneStyle.Flat && IsPartOfQuietZone(x, y, numModules))
|
||||
graphics.FillRectangle(solidBrush, rectangleF);
|
||||
else
|
||||
graphics.DrawImage(pixelImage, rectangleF);
|
||||
else if (finderPatternImage == null)
|
||||
graphics.FillRectangle(solidBrush, rectangleF);
|
||||
}
|
||||
}
|
||||
if (finderPatternImage != null)
|
||||
{
|
||||
var finderPatternSize = 7 * pixelsPerModule;
|
||||
graphics.DrawImage(finderPatternImage, new Rectangle(0, 0, finderPatternSize, finderPatternSize));
|
||||
graphics.DrawImage(finderPatternImage, new Rectangle(size - finderPatternSize, 0, finderPatternSize, finderPatternSize));
|
||||
graphics.DrawImage(finderPatternImage, new Rectangle(0, size - finderPatternSize, finderPatternSize, finderPatternSize));
|
||||
}
|
||||
graphics.Save();
|
||||
}
|
||||
}
|
||||
}
|
||||
return bitmap;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// If the pixelSize is bigger than the pixelsPerModule or may end up filling the Module making a traditional QR code.
|
||||
/// </summary>
|
||||
/// <param name="pixelsPerModule">Pixels used per module rendered</param>
|
||||
/// <param name="pixelSize">Size of the dots</param>
|
||||
/// <param name="brush">Color of the pixels</param>
|
||||
/// <returns></returns>
|
||||
private Bitmap MakeDotPixel(int pixelsPerModule, int pixelSize, SolidBrush brush)
|
||||
{
|
||||
// draw a dot
|
||||
var bitmap = new Bitmap(pixelSize, pixelSize);
|
||||
using (var graphics = Graphics.FromImage(bitmap))
|
||||
{
|
||||
graphics.FillEllipse(brush, new Rectangle(0, 0, pixelSize, pixelSize));
|
||||
graphics.Save();
|
||||
}
|
||||
|
||||
var pixelWidth = Math.Min(pixelsPerModule, pixelSize);
|
||||
var margin = Math.Max((pixelsPerModule - pixelWidth) / 2, 0);
|
||||
|
||||
// center the dot in the module and crop to stay the right size.
|
||||
var cropped = new Bitmap(pixelsPerModule, pixelsPerModule);
|
||||
using (var graphics = Graphics.FromImage(cropped))
|
||||
{
|
||||
graphics.DrawImage(bitmap, new Rectangle(margin, margin, pixelWidth, pixelWidth),
|
||||
new RectangleF(((float)pixelSize - pixelWidth) / 2, ((float)pixelSize - pixelWidth) / 2, pixelWidth, pixelWidth),
|
||||
GraphicsUnit.Pixel);
|
||||
graphics.Save();
|
||||
}
|
||||
|
||||
return cropped;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Checks if a given module(-position) is part of the quietzone of a QR code
|
||||
/// </summary>
|
||||
/// <param name="x">X position</param>
|
||||
/// <param name="y">Y position</param>
|
||||
/// <param name="numModules">Total number of modules per row</param>
|
||||
/// <returns>true, if position is part of quiet zone</returns>
|
||||
private bool IsPartOfQuietZone(int x, int y, int numModules)
|
||||
{
|
||||
return
|
||||
x < 4 || //left
|
||||
y < 4 || //top
|
||||
x > numModules - 5 || //right
|
||||
y > numModules - 5; //bottom
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Checks if a given module(-position) is part of one of the three finder patterns of a QR code
|
||||
/// </summary>
|
||||
/// <param name="x">X position</param>
|
||||
/// <param name="y">Y position</param>
|
||||
/// <param name="numModules">Total number of modules per row</param>
|
||||
/// <param name="offset">Offset in modules (usually depending on drawQuietZones parameter)</param>
|
||||
/// <returns>true, if position is part of any finder pattern</returns>
|
||||
private bool IsPartOfFinderPattern(int x, int y, int numModules, int offset)
|
||||
{
|
||||
var cornerSize = 11 - offset;
|
||||
var outerLimitLow = (numModules - cornerSize - 1);
|
||||
var outerLimitHigh = outerLimitLow + 8;
|
||||
var invertedOffset = 4 - offset;
|
||||
return
|
||||
(x >= invertedOffset && x < cornerSize && y >= invertedOffset && y < cornerSize) || //Top-left finder pattern
|
||||
(x > outerLimitLow && x < outerLimitHigh && y >= invertedOffset && y < cornerSize) || //Top-right finder pattern
|
||||
(x >= invertedOffset && x < cornerSize && y > outerLimitLow && y < outerLimitHigh); //Bottom-left finder pattern
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Resize to a square bitmap, but maintain the aspect ratio by padding transparently.
|
||||
/// </summary>
|
||||
/// <param name="image"></param>
|
||||
/// <param name="newSize"></param>
|
||||
/// <returns>Resized image as bitmap</returns>
|
||||
private Bitmap Resize(Bitmap image, int newSize)
|
||||
{
|
||||
if (image == null) return null;
|
||||
|
||||
float scale = Math.Min((float)newSize / image.Width, (float)newSize / image.Height);
|
||||
var scaledWidth = (int)(image.Width * scale);
|
||||
var scaledHeight = (int)(image.Height * scale);
|
||||
var offsetX = (newSize - scaledWidth) / 2;
|
||||
var offsetY = (newSize - scaledHeight) / 2;
|
||||
|
||||
var scaledImage = new Bitmap(image, new Size(scaledWidth, scaledHeight));
|
||||
|
||||
var bm = new Bitmap(newSize, newSize);
|
||||
|
||||
using (Graphics graphics = Graphics.FromImage(bm))
|
||||
{
|
||||
using (var brush = new SolidBrush(Color.Transparent))
|
||||
{
|
||||
graphics.FillRectangle(brush, new Rectangle(0, 0, newSize, newSize));
|
||||
|
||||
graphics.InterpolationMode = InterpolationMode.High;
|
||||
graphics.CompositingQuality = CompositingQuality.HighQuality;
|
||||
graphics.SmoothingMode = SmoothingMode.AntiAlias;
|
||||
|
||||
graphics.DrawImage(scaledImage, new Rectangle(offsetX, offsetY, scaledWidth, scaledHeight));
|
||||
}
|
||||
}
|
||||
return bm;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Defines how the quiet zones shall be rendered.
|
||||
/// </summary>
|
||||
public enum QuietZoneStyle
|
||||
{
|
||||
Dotted,
|
||||
Flat
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Defines how the background image (if set) shall be rendered.
|
||||
/// </summary>
|
||||
public enum BackgroundImageStyle
|
||||
{
|
||||
Fill,
|
||||
DataAreaOnly
|
||||
}
|
||||
}
|
||||
|
||||
#if NET6_0_WINDOWS
|
||||
[System.Runtime.Versioning.SupportedOSPlatform("windows")]
|
||||
#endif
|
||||
public static class ArtQRCodeHelper
|
||||
{
|
||||
/// <summary>
|
||||
/// Helper function to create an ArtQRCode graphic with a single function call
|
||||
/// </summary>
|
||||
/// <param name="plainText">Text/payload to be encoded inside the QR code</param>
|
||||
/// <param name="pixelsPerModule">Amount of px each dark/light module of the QR code shall take place in the final QR code image</param>
|
||||
/// <param name="darkColor">Color of the dark modules</param>
|
||||
/// <param name="lightColor">Color of the light modules</param>
|
||||
/// <param name="backgroundColor">Color of the background</param>
|
||||
/// <param name="eccLevel">The level of error correction data</param>
|
||||
/// <param name="forceUtf8">Shall the generator be forced to work in UTF-8 mode?</param>
|
||||
/// <param name="utf8BOM">Should the byte-order-mark be used?</param>
|
||||
/// <param name="eciMode">Which ECI mode shall be used?</param>
|
||||
/// <param name="requestedVersion">Set fixed QR code target version.</param>
|
||||
/// <param name="backgroundImage">A bitmap object that will be used as background picture</param>
|
||||
/// <param name="pixelSizeFactor">Value between 0.0 to 1.0 that defines how big the module dots are. The bigger the value, the less round the dots will be.</param>
|
||||
/// <param name="drawQuietZones">If true a white border is drawn around the whole QR Code</param>
|
||||
/// <param name="quietZoneRenderingStyle">Style of the quiet zones</param>
|
||||
/// <param name="backgroundImageStyle">Style of the background image (if set). Fill=spanning complete graphic; DataAreaOnly=Don't paint background into quietzone</param>
|
||||
/// <param name="finderPatternImage">Optional image that should be used instead of the default finder patterns</param>
|
||||
/// <returns>QRCode graphic as bitmap</returns>
|
||||
public static Bitmap GetQRCode(string plainText, int pixelsPerModule, Color darkColor, Color lightColor, Color backgroundColor, ECCLevel eccLevel, bool forceUtf8 = false,
|
||||
bool utf8BOM = false, EciMode eciMode = EciMode.Default, int requestedVersion = -1, Bitmap backgroundImage = null, double pixelSizeFactor = 0.8,
|
||||
bool drawQuietZones = true, QuietZoneStyle quietZoneRenderingStyle = QuietZoneStyle.Flat,
|
||||
BackgroundImageStyle backgroundImageStyle = BackgroundImageStyle.DataAreaOnly, Bitmap finderPatternImage = null)
|
||||
{
|
||||
using (var qrGenerator = new QRCodeGenerator())
|
||||
using (var qrCodeData = qrGenerator.CreateQrCode(plainText, eccLevel, forceUtf8, utf8BOM, eciMode, requestedVersion))
|
||||
using (var qrCode = new ArtQRCode(qrCodeData))
|
||||
return qrCode.GetGraphic(pixelsPerModule, darkColor, lightColor, backgroundColor, backgroundImage, pixelSizeFactor, drawQuietZones, quietZoneRenderingStyle, backgroundImageStyle, finderPatternImage);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
BIN
vCardEditor/Libs/QRCoder/Assets/nuget-icon.png
Normal file
BIN
vCardEditor/Libs/QRCoder/Assets/nuget-icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 22 KiB |
59
vCardEditor/Libs/QRCoder/Assets/nuget-readme.md
Normal file
59
vCardEditor/Libs/QRCoder/Assets/nuget-readme.md
Normal file
@@ -0,0 +1,59 @@
|
||||
## About
|
||||
|
||||
QRCoder is a simple library, written in C#.NET, which enables you to create QR codes. It hasn't any dependencies to other libraries and is available as .NET Framework and .NET Core PCL version on NuGet.
|
||||
|
||||
***
|
||||
|
||||
## Documentation
|
||||
|
||||
👉 *Your first place to go should be our wiki. Here you can find a detailed documentation of the QRCoder and its functions.*
|
||||
* [**QRCode Wiki**](https://github.com/codebude/QRCoder/wiki)
|
||||
* [Creator's blog (english)](http://en.code-bude.net/2013/10/17/qrcoder-an-open-source-qr-code-generator-implementation-in-csharp/)
|
||||
* [Creator's blog (german)](http://code-bude.net/2013/10/17/qrcoder-eine-open-source-qr-code-implementierung-in-csharp/)
|
||||
|
||||
### Release Notes
|
||||
The release notes for the current and all past releases can be read here: [📄 Release Notes](https://github.com/codebude/QRCoder/wiki/Release-notes)
|
||||
|
||||
## Usage / Quick start
|
||||
|
||||
You only need four lines of code, to generate and view your first QR code.
|
||||
|
||||
```csharp
|
||||
using (QRCodeGenerator qrGenerator = new QRCodeGenerator())
|
||||
using (QRCodeData qrCodeData = qrGenerator.CreateQrCode("The text which should be encoded.", QRCodeGenerator.ECCLevel.Q))
|
||||
using (QRCode qrCode = new QRCode(qrCodeData))
|
||||
{
|
||||
Bitmap qrCodeImage = qrCode.GetGraphic(20);
|
||||
}
|
||||
```
|
||||
|
||||
### Optional parameters and overloads
|
||||
|
||||
The GetGraphics-method has some more overloads. The first two enable you to set the color of the QR code graphic. One uses Color-class-types, the other HTML hex color notation.
|
||||
|
||||
```csharp
|
||||
//Set color by using Color-class types
|
||||
Bitmap qrCodeImage = qrCode.GetGraphic(20, Color.DarkRed, Color.PaleGreen, true);
|
||||
|
||||
//Set color by using HTML hex color notation
|
||||
Bitmap qrCodeImage = qrCode.GetGraphic(20, "#000ff0", "#0ff000");
|
||||
```
|
||||
|
||||
The other overload enables you to render a logo/image in the center of the QR code.
|
||||
|
||||
```csharp
|
||||
Bitmap qrCodeImage = qrCode.GetGraphic(20, Color.Black, Color.White, (Bitmap)Bitmap.FromFile("C:\\myimage.png"));
|
||||
```
|
||||
|
||||
There are a plenty of other options. So feel free to read more on that in our wiki: [Wiki: How to use QRCoder](https://github.com/codebude/QRCoder/wiki/How-to-use-QRCoder)
|
||||
|
||||
## Help & Issues
|
||||
|
||||
If you think you have found a bug or have new ideas or feature requests, then feel free to open a new issue: https://github.com/codebude/QRCoder/issues
|
||||
|
||||
In case you have a question about using the library (and couldn't find an answer in our wiki), feel free to open a new question/discussion: https://github.com/codebude/QRCoder/discussions
|
||||
|
||||
|
||||
## Legal information and credits
|
||||
|
||||
QRCoder is a project by [Raffael Herrmann](https://raffaelherrmann.de) and was first released in 10/2013. It's licensed under the [MIT license](https://github.com/codebude/QRCoder/blob/master/LICENSE.txt).
|
||||
115
vCardEditor/Libs/QRCoder/Base64QRCode.cs
Normal file
115
vCardEditor/Libs/QRCoder/Base64QRCode.cs
Normal file
@@ -0,0 +1,115 @@
|
||||
#if NETFRAMEWORK || NETSTANDARD2_0 || NET5_0 || NET6_0_WINDOWS
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Imaging;
|
||||
using System.IO;
|
||||
using static QRCoder.Base64QRCode;
|
||||
using static QRCoder.QRCodeGenerator;
|
||||
|
||||
namespace QRCoder
|
||||
{
|
||||
#if NET6_0_WINDOWS
|
||||
[System.Runtime.Versioning.SupportedOSPlatform("windows")]
|
||||
#endif
|
||||
public class Base64QRCode : AbstractQRCode, IDisposable
|
||||
{
|
||||
private QRCode qr;
|
||||
|
||||
/// <summary>
|
||||
/// Constructor without params to be used in COM Objects connections
|
||||
/// </summary>
|
||||
public Base64QRCode() {
|
||||
qr = new QRCode();
|
||||
}
|
||||
|
||||
public Base64QRCode(QRCodeData data) : base(data) {
|
||||
qr = new QRCode(data);
|
||||
}
|
||||
|
||||
public override void SetQRCodeData(QRCodeData data) {
|
||||
this.qr.SetQRCodeData(data);
|
||||
}
|
||||
|
||||
public string GetGraphic(int pixelsPerModule)
|
||||
{
|
||||
return this.GetGraphic(pixelsPerModule, Color.Black, Color.White, true);
|
||||
}
|
||||
|
||||
|
||||
public string GetGraphic(int pixelsPerModule, string darkColorHtmlHex, string lightColorHtmlHex, bool drawQuietZones = true, ImageType imgType = ImageType.Png)
|
||||
{
|
||||
return this.GetGraphic(pixelsPerModule, ColorTranslator.FromHtml(darkColorHtmlHex), ColorTranslator.FromHtml(lightColorHtmlHex), drawQuietZones, imgType);
|
||||
}
|
||||
|
||||
public string GetGraphic(int pixelsPerModule, Color darkColor, Color lightColor, bool drawQuietZones = true, ImageType imgType = ImageType.Png)
|
||||
{
|
||||
var base64 = string.Empty;
|
||||
using (Bitmap bmp = qr.GetGraphic(pixelsPerModule, darkColor, lightColor, drawQuietZones))
|
||||
{
|
||||
base64 = BitmapToBase64(bmp, imgType);
|
||||
}
|
||||
return base64;
|
||||
}
|
||||
|
||||
public string GetGraphic(int pixelsPerModule, Color darkColor, Color lightColor, Bitmap icon, int iconSizePercent = 15, int iconBorderWidth = 6, bool drawQuietZones = true, ImageType imgType = ImageType.Png)
|
||||
{
|
||||
var base64 = string.Empty;
|
||||
using (Bitmap bmp = qr.GetGraphic(pixelsPerModule, darkColor, lightColor, icon, iconSizePercent, iconBorderWidth, drawQuietZones))
|
||||
{
|
||||
base64 = BitmapToBase64(bmp, imgType);
|
||||
}
|
||||
return base64;
|
||||
}
|
||||
|
||||
|
||||
private string BitmapToBase64(Bitmap bmp, ImageType imgType)
|
||||
{
|
||||
var base64 = string.Empty;
|
||||
ImageFormat iFormat;
|
||||
switch (imgType) {
|
||||
case ImageType.Png:
|
||||
iFormat = ImageFormat.Png;
|
||||
break;
|
||||
case ImageType.Jpeg:
|
||||
iFormat = ImageFormat.Jpeg;
|
||||
break;
|
||||
case ImageType.Gif:
|
||||
iFormat = ImageFormat.Gif;
|
||||
break;
|
||||
default:
|
||||
iFormat = ImageFormat.Png;
|
||||
break;
|
||||
}
|
||||
using (MemoryStream memoryStream = new MemoryStream())
|
||||
{
|
||||
bmp.Save(memoryStream, iFormat);
|
||||
base64 = Convert.ToBase64String(memoryStream.ToArray(), Base64FormattingOptions.None);
|
||||
}
|
||||
return base64;
|
||||
}
|
||||
|
||||
public enum ImageType
|
||||
{
|
||||
Gif,
|
||||
Jpeg,
|
||||
Png
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#if NET6_0_WINDOWS
|
||||
[System.Runtime.Versioning.SupportedOSPlatform("windows")]
|
||||
#endif
|
||||
public static class Base64QRCodeHelper
|
||||
{
|
||||
public static string GetQRCode(string plainText, int pixelsPerModule, string darkColorHtmlHex, string lightColorHtmlHex, ECCLevel eccLevel, bool forceUtf8 = false, bool utf8BOM = false, EciMode eciMode = EciMode.Default, int requestedVersion = -1, bool drawQuietZones = true, ImageType imgType = ImageType.Png)
|
||||
{
|
||||
using (var qrGenerator = new QRCodeGenerator())
|
||||
using (var qrCodeData = qrGenerator.CreateQrCode(plainText, eccLevel, forceUtf8, utf8BOM, eciMode, requestedVersion))
|
||||
using (var qrCode = new Base64QRCode(qrCodeData))
|
||||
return qrCode.GetGraphic(pixelsPerModule, darkColorHtmlHex, lightColorHtmlHex, drawQuietZones, imgType);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
125
vCardEditor/Libs/QRCoder/BitmapByteQRCode.cs
Normal file
125
vCardEditor/Libs/QRCoder/BitmapByteQRCode.cs
Normal file
@@ -0,0 +1,125 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using static QRCoder.QRCodeGenerator;
|
||||
|
||||
namespace QRCoder
|
||||
{
|
||||
|
||||
// ReSharper disable once InconsistentNaming
|
||||
public class BitmapByteQRCode : AbstractQRCode, IDisposable
|
||||
{
|
||||
/// <summary>
|
||||
/// Constructor without params to be used in COM Objects connections
|
||||
/// </summary>
|
||||
public BitmapByteQRCode() { }
|
||||
|
||||
public BitmapByteQRCode(QRCodeData data) : base(data) { }
|
||||
|
||||
public byte[] GetGraphic(int pixelsPerModule)
|
||||
{
|
||||
return GetGraphic(pixelsPerModule, new byte[] { 0x00, 0x00, 0x00 }, new byte[] { 0xFF, 0xFF, 0xFF });
|
||||
}
|
||||
|
||||
public byte[] GetGraphic(int pixelsPerModule, string darkColorHtmlHex, string lightColorHtmlHex)
|
||||
{
|
||||
return GetGraphic(pixelsPerModule, HexColorToByteArray(darkColorHtmlHex), HexColorToByteArray(lightColorHtmlHex));
|
||||
}
|
||||
|
||||
public byte[] GetGraphic(int pixelsPerModule, byte[] darkColorRgb, byte[] lightColorRgb)
|
||||
{
|
||||
var sideLength = this.QrCodeData.ModuleMatrix.Count * pixelsPerModule;
|
||||
|
||||
var moduleDark = darkColorRgb.Reverse();
|
||||
var moduleLight = lightColorRgb.Reverse();
|
||||
|
||||
List<byte> bmp = new List<byte>();
|
||||
|
||||
//header
|
||||
bmp.AddRange(new byte[] { 0x42, 0x4D, 0x4C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1A, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00 });
|
||||
|
||||
//width
|
||||
bmp.AddRange(IntTo4Byte(sideLength));
|
||||
//height
|
||||
bmp.AddRange(IntTo4Byte(sideLength));
|
||||
|
||||
//header end
|
||||
bmp.AddRange(new byte[] { 0x01, 0x00, 0x18, 0x00 });
|
||||
|
||||
//draw qr code
|
||||
for (var x = sideLength-1; x >= 0; x = x - pixelsPerModule)
|
||||
{
|
||||
for (int pm = 0; pm < pixelsPerModule; pm++)
|
||||
{
|
||||
for (var y = 0; y < sideLength; y = y + pixelsPerModule)
|
||||
{
|
||||
var module =
|
||||
this.QrCodeData.ModuleMatrix[(x + pixelsPerModule)/pixelsPerModule - 1][(y + pixelsPerModule)/pixelsPerModule - 1];
|
||||
for (int i = 0; i < pixelsPerModule; i++)
|
||||
{
|
||||
bmp.AddRange(module ? moduleDark : moduleLight);
|
||||
}
|
||||
}
|
||||
if (sideLength%4 != 0)
|
||||
{
|
||||
for (int i = 0; i < sideLength%4; i++)
|
||||
{
|
||||
bmp.Add(0x00);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//finalize with terminator
|
||||
bmp.AddRange(new byte[] { 0x00, 0x00 });
|
||||
|
||||
return bmp.ToArray();
|
||||
}
|
||||
|
||||
private byte[] HexColorToByteArray(string colorString)
|
||||
{
|
||||
if (colorString.StartsWith("#"))
|
||||
colorString = colorString.Substring(1);
|
||||
byte[] byteColor = new byte[colorString.Length / 2];
|
||||
for (int i = 0; i < byteColor.Length; i++)
|
||||
byteColor[i] = byte.Parse(colorString.Substring(i * 2, 2), System.Globalization.NumberStyles.HexNumber, System.Globalization.CultureInfo.InvariantCulture);
|
||||
return byteColor;
|
||||
}
|
||||
|
||||
private byte[] IntTo4Byte(int inp)
|
||||
{
|
||||
byte[] bytes = new byte[2];
|
||||
unchecked
|
||||
{
|
||||
bytes[1] = (byte)(inp >> 8);
|
||||
bytes[0] = (byte)(inp);
|
||||
}
|
||||
return bytes;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static class BitmapByteQRCodeHelper
|
||||
{
|
||||
public static byte[] GetQRCode(string plainText, int pixelsPerModule, string darkColorHtmlHex,
|
||||
string lightColorHtmlHex, ECCLevel eccLevel, bool forceUtf8 = false, bool utf8BOM = false,
|
||||
EciMode eciMode = EciMode.Default, int requestedVersion = -1)
|
||||
{
|
||||
using (var qrGenerator = new QRCodeGenerator())
|
||||
using (
|
||||
var qrCodeData = qrGenerator.CreateQrCode(plainText, eccLevel, forceUtf8, utf8BOM, eciMode,
|
||||
requestedVersion))
|
||||
using (var qrCode = new BitmapByteQRCode(qrCodeData))
|
||||
return qrCode.GetGraphic(pixelsPerModule, darkColorHtmlHex, lightColorHtmlHex);
|
||||
}
|
||||
|
||||
public static byte[] GetQRCode(string txt, QRCodeGenerator.ECCLevel eccLevel, int size)
|
||||
{
|
||||
using (var qrGen = new QRCodeGenerator())
|
||||
using (var qrCode = qrGen.CreateQrCode(txt, eccLevel))
|
||||
using (var qrBmp = new BitmapByteQRCode(qrCode))
|
||||
return qrBmp.GetGraphic(size);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
16
vCardEditor/Libs/QRCoder/Exceptions/DataTooLongException.cs
Normal file
16
vCardEditor/Libs/QRCoder/Exceptions/DataTooLongException.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
using System;
|
||||
|
||||
namespace QRCoder.Exceptions
|
||||
{
|
||||
public class DataTooLongException : Exception
|
||||
{
|
||||
public DataTooLongException(string eccLevel, string encodingMode, int maxSizeByte) : base(
|
||||
$"The given payload exceeds the maximum size of the QR code standard. The maximum size allowed for the choosen paramters (ECC level={eccLevel}, EncodingMode={encodingMode}) is {maxSizeByte} byte."
|
||||
){}
|
||||
|
||||
public DataTooLongException(string eccLevel, string encodingMode, int version, int maxSizeByte) : base(
|
||||
$"The given payload exceeds the maximum size of the QR code standard. The maximum size allowed for the choosen paramters (ECC level={eccLevel}, EncodingMode={encodingMode}, FixedVersion={version}) is {maxSizeByte} byte."
|
||||
)
|
||||
{ }
|
||||
}
|
||||
}
|
||||
52
vCardEditor/Libs/QRCoder/Extensions/StringValueAttribute.cs
Normal file
52
vCardEditor/Libs/QRCoder/Extensions/StringValueAttribute.cs
Normal file
@@ -0,0 +1,52 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
|
||||
namespace QRCoder.Extensions
|
||||
{
|
||||
/// <summary>
|
||||
/// Used to represent a string value for a value in an enum
|
||||
/// </summary>
|
||||
public class StringValueAttribute : Attribute
|
||||
{
|
||||
|
||||
#region Properties
|
||||
|
||||
/// <summary>
|
||||
/// Holds the alue in an enum
|
||||
/// </summary>
|
||||
public string StringValue { get; protected set; }
|
||||
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// Init a StringValue Attribute
|
||||
/// </summary>
|
||||
/// <param name="value"></param>
|
||||
public StringValueAttribute(string value)
|
||||
{
|
||||
this.StringValue = value;
|
||||
}
|
||||
}
|
||||
|
||||
public static class CustomExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// Will get the string value for a given enum's value
|
||||
/// </summary>
|
||||
/// <param name="value"></param>
|
||||
/// <returns></returns>
|
||||
public static string GetStringValue(this Enum value)
|
||||
{
|
||||
#if NETSTANDARD1_3
|
||||
var fieldInfo = value.GetType().GetRuntimeField(value.ToString());
|
||||
#else
|
||||
var fieldInfo = value.GetType().GetField(value.ToString());
|
||||
#endif
|
||||
var attr = fieldInfo.GetCustomAttributes(typeof(StringValueAttribute), false) as StringValueAttribute[];
|
||||
return attr.Length > 0 ? attr[0].StringValue : null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace QRCoder.Framework4._0Methods
|
||||
{
|
||||
class Stream4Methods
|
||||
{
|
||||
public static void CopyTo(System.IO.Stream input, System.IO.Stream output)
|
||||
{
|
||||
byte[] buffer = new byte[16 * 1024];
|
||||
int bytesRead;
|
||||
while ((bytesRead = input.Read(buffer, 0, buffer.Length)) > 0)
|
||||
{
|
||||
output.Write(buffer, 0, bytesRead);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
using System;
|
||||
|
||||
namespace QRCoder
|
||||
{
|
||||
internal static class String40Methods
|
||||
{
|
||||
/// <summary>
|
||||
/// The IsNullOrWhiteSpace method from Framework4.0
|
||||
/// </summary>
|
||||
/// <returns>
|
||||
/// <c>true</c> if the <paramref name="value"/> is null or white space; otherwise, <c>false</c>.
|
||||
/// </returns>
|
||||
public static bool IsNullOrWhiteSpace(String value)
|
||||
{
|
||||
if (value == null) return true;
|
||||
|
||||
for (int i = 0; i < value.Length; i++)
|
||||
{
|
||||
if (!Char.IsWhiteSpace(value[i])) return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public static string ReverseString(string str)
|
||||
{
|
||||
char[] chars = str.ToCharArray();
|
||||
char[] result = new char[chars.Length];
|
||||
for (int i = 0, j = str.Length - 1; i < str.Length; i++, j--)
|
||||
{
|
||||
result[i] = chars[j];
|
||||
}
|
||||
return new string(result);
|
||||
}
|
||||
|
||||
public static bool IsAllDigit(string str)
|
||||
{
|
||||
foreach (var c in str)
|
||||
{
|
||||
if (!char.IsDigit(c))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
3124
vCardEditor/Libs/QRCoder/PayloadGenerator.cs
Normal file
3124
vCardEditor/Libs/QRCoder/PayloadGenerator.cs
Normal file
File diff suppressed because it is too large
Load Diff
243
vCardEditor/Libs/QRCoder/PdfByteQRCode.cs
Normal file
243
vCardEditor/Libs/QRCoder/PdfByteQRCode.cs
Normal file
@@ -0,0 +1,243 @@
|
||||
#if NETFRAMEWORK || NETSTANDARD2_0 || NET5_0 || NET6_0_WINDOWS
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing.Imaging;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using static QRCoder.QRCodeGenerator;
|
||||
|
||||
/* This renderer is inspired by RemusVasii: https://github.com/codebude/QRCoder/issues/223 */
|
||||
namespace QRCoder
|
||||
{
|
||||
|
||||
#if NET6_0_WINDOWS
|
||||
[System.Runtime.Versioning.SupportedOSPlatform("windows")]
|
||||
#endif
|
||||
// ReSharper disable once InconsistentNaming
|
||||
public class PdfByteQRCode : AbstractQRCode, IDisposable
|
||||
{
|
||||
private readonly byte[] pdfBinaryComment = new byte[] { 0x25, 0xe2, 0xe3, 0xcf, 0xd3 };
|
||||
|
||||
/// <summary>
|
||||
/// Constructor without params to be used in COM Objects connections
|
||||
/// </summary>
|
||||
public PdfByteQRCode() { }
|
||||
|
||||
public PdfByteQRCode(QRCodeData data) : base(data) { }
|
||||
|
||||
/// <summary>
|
||||
/// Creates a PDF document with a black & white QR code
|
||||
/// </summary>
|
||||
/// <param name="pixelsPerModule"></param>
|
||||
/// <returns></returns>
|
||||
public byte[] GetGraphic(int pixelsPerModule)
|
||||
{
|
||||
return GetGraphic(pixelsPerModule, "#000000", "#ffffff");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Takes hexadecimal color string #000000 and returns byte[]{ 0, 0, 0 }
|
||||
/// </summary>
|
||||
/// <param name="colorString">Color in HEX format like #ffffff</param>
|
||||
/// <returns></returns>
|
||||
private byte[] HexColorToByteArray(string colorString)
|
||||
{
|
||||
if (colorString.StartsWith("#"))
|
||||
colorString = colorString.Substring(1);
|
||||
byte[] byteColor = new byte[colorString.Length / 2];
|
||||
for (int i = 0; i < byteColor.Length; i++)
|
||||
byteColor[i] = byte.Parse(colorString.Substring(i * 2, 2), NumberStyles.HexNumber, CultureInfo.InvariantCulture);
|
||||
return byteColor;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a PDF document with given colors DPI and quality
|
||||
/// </summary>
|
||||
/// <param name="pixelsPerModule"></param>
|
||||
/// <param name="darkColorHtmlHex"></param>
|
||||
/// <param name="lightColorHtmlHex"></param>
|
||||
/// <param name="dpi"></param>
|
||||
/// <param name="jpgQuality"></param>
|
||||
/// <returns></returns>
|
||||
public byte[] GetGraphic(int pixelsPerModule, string darkColorHtmlHex, string lightColorHtmlHex, int dpi = 150, long jpgQuality = 85)
|
||||
{
|
||||
byte[] jpgArray = null, pngArray = null;
|
||||
var imgSize = QrCodeData.ModuleMatrix.Count * pixelsPerModule;
|
||||
var pdfMediaSize = (imgSize * 72 / dpi).ToString(CultureInfo.InvariantCulture);
|
||||
|
||||
//Get QR code image
|
||||
using (var qrCode = new PngByteQRCode(QrCodeData))
|
||||
{
|
||||
pngArray = qrCode.GetGraphic(pixelsPerModule, HexColorToByteArray(darkColorHtmlHex), HexColorToByteArray(lightColorHtmlHex));
|
||||
}
|
||||
|
||||
//Create image and transofrm to JPG
|
||||
using (var msPng = new MemoryStream())
|
||||
{
|
||||
msPng.Write(pngArray, 0, pngArray.Length);
|
||||
var img = System.Drawing.Image.FromStream(msPng);
|
||||
using (var msJpeg = new MemoryStream())
|
||||
{
|
||||
// Create JPEG with specified quality
|
||||
var jpgImageCodecInfo = ImageCodecInfo.GetImageEncoders().First(x => x.MimeType == "image/jpeg");
|
||||
var jpgEncoderParameters = new EncoderParameters(1) {
|
||||
Param = new EncoderParameter[]{ new EncoderParameter(Encoder.Quality, jpgQuality) }
|
||||
};
|
||||
img.Save(msJpeg, jpgImageCodecInfo, jpgEncoderParameters);
|
||||
jpgArray = msJpeg.ToArray();
|
||||
}
|
||||
}
|
||||
|
||||
//Create PDF document
|
||||
using (var stream = new MemoryStream())
|
||||
{
|
||||
var writer = new StreamWriter(stream, System.Text.Encoding.GetEncoding("ASCII"));
|
||||
|
||||
var xrefs = new List<long>();
|
||||
|
||||
writer.Write("%PDF-1.5\r\n");
|
||||
writer.Flush();
|
||||
|
||||
stream.Write(pdfBinaryComment, 0, pdfBinaryComment.Length);
|
||||
writer.WriteLine();
|
||||
|
||||
writer.Flush();
|
||||
xrefs.Add(stream.Position);
|
||||
|
||||
writer.Write(
|
||||
xrefs.Count.ToString() + " 0 obj\r\n" +
|
||||
"<<\r\n" +
|
||||
"/Type /Catalog\r\n" +
|
||||
"/Pages 2 0 R\r\n" +
|
||||
">>\r\n" +
|
||||
"endobj\r\n"
|
||||
);
|
||||
|
||||
writer.Flush();
|
||||
xrefs.Add(stream.Position);
|
||||
|
||||
writer.Write(
|
||||
xrefs.Count.ToString() + " 0 obj\r\n" +
|
||||
"<<\r\n" +
|
||||
"/Count 1\r\n" +
|
||||
"/Kids [ <<\r\n" +
|
||||
"/Type /Page\r\n" +
|
||||
"/Parent 2 0 R\r\n" +
|
||||
"/MediaBox [0 0 " + pdfMediaSize + " " + pdfMediaSize + "]\r\n" +
|
||||
"/Resources << /ProcSet [ /PDF /ImageC ]\r\n" +
|
||||
"/XObject << /Im1 4 0 R >> >>\r\n" +
|
||||
"/Contents 3 0 R\r\n" +
|
||||
">> ]\r\n" +
|
||||
">>\r\n" +
|
||||
"endobj\r\n"
|
||||
);
|
||||
|
||||
var X = "q\r\n" +
|
||||
pdfMediaSize + " 0 0 " + pdfMediaSize + " 0 0 cm\r\n" +
|
||||
"/Im1 Do\r\n" +
|
||||
"Q";
|
||||
|
||||
writer.Flush();
|
||||
xrefs.Add(stream.Position);
|
||||
|
||||
writer.Write(
|
||||
xrefs.Count.ToString() + " 0 obj\r\n" +
|
||||
"<< /Length " + X.Length.ToString() + " >>\r\n" +
|
||||
"stream\r\n" +
|
||||
X + "endstream\r\n" +
|
||||
"endobj\r\n"
|
||||
);
|
||||
|
||||
writer.Flush();
|
||||
xrefs.Add(stream.Position);
|
||||
|
||||
writer.Write(
|
||||
xrefs.Count.ToString() + " 0 obj\r\n" +
|
||||
"<<\r\n" +
|
||||
"/Name /Im1\r\n" +
|
||||
"/Type /XObject\r\n" +
|
||||
"/Subtype /Image\r\n" +
|
||||
"/Width " + imgSize.ToString() + "/Height " + imgSize.ToString() + "/Length 5 0 R\r\n" +
|
||||
"/Filter /DCTDecode\r\n" +
|
||||
"/ColorSpace /DeviceRGB\r\n" +
|
||||
"/BitsPerComponent 8\r\n" +
|
||||
">>\r\n" +
|
||||
"stream\r\n"
|
||||
);
|
||||
writer.Flush();
|
||||
stream.Write(jpgArray, 0, jpgArray.Length);
|
||||
writer.Write(
|
||||
"\r\n" +
|
||||
"endstream\r\n" +
|
||||
"endobj\r\n"
|
||||
);
|
||||
|
||||
writer.Flush();
|
||||
xrefs.Add(stream.Position);
|
||||
|
||||
writer.Write(
|
||||
xrefs.Count.ToString() + " 0 obj\r\n" +
|
||||
jpgArray.Length.ToString() + " endobj\r\n"
|
||||
);
|
||||
|
||||
writer.Flush();
|
||||
var startxref = stream.Position;
|
||||
|
||||
writer.Write(
|
||||
"xref\r\n" +
|
||||
"0 " + (xrefs.Count + 1).ToString() + "\r\n" +
|
||||
"0000000000 65535 f\r\n"
|
||||
);
|
||||
|
||||
foreach (var refValue in xrefs)
|
||||
writer.Write(refValue.ToString("0000000000") + " 00000 n\r\n");
|
||||
|
||||
writer.Write(
|
||||
"trailer\r\n" +
|
||||
"<<\r\n" +
|
||||
"/Size " + (xrefs.Count + 1).ToString() + "\r\n" +
|
||||
"/Root 1 0 R\r\n" +
|
||||
">>\r\n" +
|
||||
"startxref\r\n" +
|
||||
startxref.ToString() + "\r\n" +
|
||||
"%%EOF"
|
||||
);
|
||||
|
||||
writer.Flush();
|
||||
|
||||
stream.Position = 0;
|
||||
|
||||
return stream.ToArray();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#if NET6_0_WINDOWS
|
||||
[System.Runtime.Versioning.SupportedOSPlatform("windows")]
|
||||
#endif
|
||||
public static class PdfByteQRCodeHelper
|
||||
{
|
||||
public static byte[] GetQRCode(string plainText, int pixelsPerModule, string darkColorHtmlHex,
|
||||
string lightColorHtmlHex, ECCLevel eccLevel, bool forceUtf8 = false, bool utf8BOM = false,
|
||||
EciMode eciMode = EciMode.Default, int requestedVersion = -1)
|
||||
{
|
||||
using (var qrGenerator = new QRCodeGenerator())
|
||||
using (
|
||||
var qrCodeData = qrGenerator.CreateQrCode(plainText, eccLevel, forceUtf8, utf8BOM, eciMode,
|
||||
requestedVersion))
|
||||
using (var qrCode = new PdfByteQRCode(qrCodeData))
|
||||
return qrCode.GetGraphic(pixelsPerModule, darkColorHtmlHex, lightColorHtmlHex);
|
||||
}
|
||||
|
||||
public static byte[] GetQRCode(string txt, ECCLevel eccLevel, int size)
|
||||
{
|
||||
using (var qrGen = new QRCodeGenerator())
|
||||
using (var qrCode = qrGen.CreateQrCode(txt, eccLevel))
|
||||
using (var qrBmp = new PdfByteQRCode(qrCode))
|
||||
return qrBmp.GetGraphic(size);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
341
vCardEditor/Libs/QRCoder/PngByteQRCode.cs
Normal file
341
vCardEditor/Libs/QRCoder/PngByteQRCode.cs
Normal file
@@ -0,0 +1,341 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.IO.Compression;
|
||||
using static QRCoder.QRCodeGenerator;
|
||||
|
||||
namespace QRCoder
|
||||
{
|
||||
public sealed class PngByteQRCode : AbstractQRCode, IDisposable
|
||||
{
|
||||
/// <summary>
|
||||
/// Constructor without params to be used in COM Objects connections
|
||||
/// </summary>
|
||||
public PngByteQRCode() { }
|
||||
|
||||
public PngByteQRCode(QRCodeData data) : base(data)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Creates a black & white PNG of the QR code, using 1-bit grayscale.
|
||||
/// </summary>
|
||||
public byte[] GetGraphic(int pixelsPerModule, bool drawQuietZones = true)
|
||||
{
|
||||
using (var png = new PngBuilder())
|
||||
{
|
||||
var size = (this.QrCodeData.ModuleMatrix.Count - (drawQuietZones ? 0 : 8)) * pixelsPerModule;
|
||||
png.WriteHeader(size, size, 1, PngBuilder.ColorType.Greyscale);
|
||||
png.WriteScanlines(this.DrawScanlines(pixelsPerModule, drawQuietZones));
|
||||
png.WriteEnd();
|
||||
return png.GetBytes();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates 2-color PNG of the QR code, using 1-bit indexed color. Accepts 3-byte RGB colors for normal images and 4-byte RGBA-colors for transparent images.
|
||||
/// </summary>
|
||||
public byte[] GetGraphic(int pixelsPerModule, byte[] darkColorRgba, byte[] lightColorRgba, bool drawQuietZones = true)
|
||||
{
|
||||
using (var png = new PngBuilder())
|
||||
{
|
||||
var size = (this.QrCodeData.ModuleMatrix.Count - (drawQuietZones ? 0 : 8)) * pixelsPerModule;
|
||||
png.WriteHeader(size, size, 1, PngBuilder.ColorType.Indexed);
|
||||
png.WritePalette(darkColorRgba, lightColorRgba);
|
||||
png.WriteScanlines(this.DrawScanlines(pixelsPerModule, drawQuietZones));
|
||||
png.WriteEnd();
|
||||
return png.GetBytes();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a bitmap where each pixel is represented by a single bit, dark = 0 and light = 1.
|
||||
/// </summary>
|
||||
private byte[] DrawScanlines(int pixelsPerModule, bool drawQuietZones)
|
||||
{
|
||||
var moduleMatrix = this.QrCodeData.ModuleMatrix;
|
||||
var matrixSize = moduleMatrix.Count - (drawQuietZones ? 0 : 8);
|
||||
var quietZoneOffset = (drawQuietZones ? 0 : 4);
|
||||
var bytesPerScanline = (matrixSize * pixelsPerModule + 7) / 8 + 1; // A monochrome scanline is one byte for filter type then one bit per pixel.
|
||||
var scanlines = new byte[bytesPerScanline * matrixSize * pixelsPerModule];
|
||||
|
||||
for (var y = 0; y < matrixSize; y++)
|
||||
{
|
||||
var modules = moduleMatrix[y+quietZoneOffset];
|
||||
var scanlineOffset = y * pixelsPerModule * bytesPerScanline;
|
||||
|
||||
// Draw a scanline with the modules from the QR code.
|
||||
for (var x = 0; x < matrixSize; x++)
|
||||
{
|
||||
if (modules[x + quietZoneOffset])
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
var pixelIndex = x * pixelsPerModule;
|
||||
var endIndex = pixelIndex + pixelsPerModule;
|
||||
for (; pixelIndex < endIndex; pixelIndex++)
|
||||
{
|
||||
scanlines[scanlineOffset + 1 + pixelIndex / 8] |= (byte)(0x80 >> (pixelIndex % 8));
|
||||
}
|
||||
}
|
||||
|
||||
// Copy the scanline required number of times.
|
||||
for (var copyCount = 1; copyCount < pixelsPerModule; copyCount++)
|
||||
{
|
||||
Array.Copy(scanlines, scanlineOffset, scanlines, scanlineOffset + copyCount * bytesPerScanline, bytesPerScanline);
|
||||
}
|
||||
}
|
||||
|
||||
return scanlines;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Writes the chunks that make up a PNG file.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// See https://www.w3.org/TR/2003/REC-PNG-20031110 and https://www.ietf.org/rfc/rfc1950.txt.
|
||||
/// </remarks>
|
||||
private sealed class PngBuilder : IDisposable
|
||||
{
|
||||
private static readonly byte[] PngSignature = { 0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A };
|
||||
|
||||
private static readonly uint[] CrcTable = {
|
||||
0x00000000, 0x77073096, 0xEE0E612C, 0x990951BA, 0x076DC419, 0x706AF48F, 0xE963A535, 0x9E6495A3, 0x0EDB8832, 0x79DCB8A4, 0xE0D5E91E, 0x97D2D988, 0x09B64C2B, 0x7EB17CBD, 0xE7B82D07, 0x90BF1D91, 0x1DB71064, 0x6AB020F2, 0xF3B97148, 0x84BE41DE, 0x1ADAD47D, 0x6DDDE4EB, 0xF4D4B551, 0x83D385C7, 0x136C9856, 0x646BA8C0, 0xFD62F97A, 0x8A65C9EC, 0x14015C4F, 0x63066CD9, 0xFA0F3D63, 0x8D080DF5, 0x3B6E20C8, 0x4C69105E, 0xD56041E4, 0xA2677172, 0x3C03E4D1, 0x4B04D447, 0xD20D85FD, 0xA50AB56B, 0x35B5A8FA, 0x42B2986C, 0xDBBBC9D6, 0xACBCF940, 0x32D86CE3, 0x45DF5C75, 0xDCD60DCF, 0xABD13D59, 0x26D930AC, 0x51DE003A, 0xC8D75180, 0xBFD06116, 0x21B4F4B5, 0x56B3C423, 0xCFBA9599, 0xB8BDA50F, 0x2802B89E, 0x5F058808, 0xC60CD9B2, 0xB10BE924, 0x2F6F7C87, 0x58684C11, 0xC1611DAB, 0xB6662D3D,
|
||||
0x76DC4190, 0x01DB7106, 0x98D220BC, 0xEFD5102A, 0x71B18589, 0x06B6B51F, 0x9FBFE4A5, 0xE8B8D433, 0x7807C9A2, 0x0F00F934, 0x9609A88E, 0xE10E9818, 0x7F6A0DBB, 0x086D3D2D, 0x91646C97, 0xE6635C01, 0x6B6B51F4, 0x1C6C6162, 0x856530D8, 0xF262004E, 0x6C0695ED, 0x1B01A57B, 0x8208F4C1, 0xF50FC457, 0x65B0D9C6, 0x12B7E950, 0x8BBEB8EA, 0xFCB9887C, 0x62DD1DDF, 0x15DA2D49, 0x8CD37CF3, 0xFBD44C65, 0x4DB26158, 0x3AB551CE, 0xA3BC0074, 0xD4BB30E2, 0x4ADFA541, 0x3DD895D7, 0xA4D1C46D, 0xD3D6F4FB, 0x4369E96A, 0x346ED9FC, 0xAD678846, 0xDA60B8D0, 0x44042D73, 0x33031DE5, 0xAA0A4C5F, 0xDD0D7CC9, 0x5005713C, 0x270241AA, 0xBE0B1010, 0xC90C2086, 0x5768B525, 0x206F85B3, 0xB966D409, 0xCE61E49F, 0x5EDEF90E, 0x29D9C998, 0xB0D09822, 0xC7D7A8B4, 0x59B33D17, 0x2EB40D81, 0xB7BD5C3B, 0xC0BA6CAD,
|
||||
0xEDB88320, 0x9ABFB3B6, 0x03B6E20C, 0x74B1D29A, 0xEAD54739, 0x9DD277AF, 0x04DB2615, 0x73DC1683, 0xE3630B12, 0x94643B84, 0x0D6D6A3E, 0x7A6A5AA8, 0xE40ECF0B, 0x9309FF9D, 0x0A00AE27, 0x7D079EB1, 0xF00F9344, 0x8708A3D2, 0x1E01F268, 0x6906C2FE, 0xF762575D, 0x806567CB, 0x196C3671, 0x6E6B06E7, 0xFED41B76, 0x89D32BE0, 0x10DA7A5A, 0x67DD4ACC, 0xF9B9DF6F, 0x8EBEEFF9, 0x17B7BE43, 0x60B08ED5, 0xD6D6A3E8, 0xA1D1937E, 0x38D8C2C4, 0x4FDFF252, 0xD1BB67F1, 0xA6BC5767, 0x3FB506DD, 0x48B2364B, 0xD80D2BDA, 0xAF0A1B4C, 0x36034AF6, 0x41047A60, 0xDF60EFC3, 0xA867DF55, 0x316E8EEF, 0x4669BE79, 0xCB61B38C, 0xBC66831A, 0x256FD2A0, 0x5268E236, 0xCC0C7795, 0xBB0B4703, 0x220216B9, 0x5505262F, 0xC5BA3BBE, 0xB2BD0B28, 0x2BB45A92, 0x5CB36A04, 0xC2D7FFA7, 0xB5D0CF31, 0x2CD99E8B, 0x5BDEAE1D,
|
||||
0x9B64C2B0, 0xEC63F226, 0x756AA39C, 0x026D930A, 0x9C0906A9, 0xEB0E363F, 0x72076785, 0x05005713, 0x95BF4A82, 0xE2B87A14, 0x7BB12BAE, 0x0CB61B38, 0x92D28E9B, 0xE5D5BE0D, 0x7CDCEFB7, 0x0BDBDF21, 0x86D3D2D4, 0xF1D4E242, 0x68DDB3F8, 0x1FDA836E, 0x81BE16CD, 0xF6B9265B, 0x6FB077E1, 0x18B74777, 0x88085AE6, 0xFF0F6A70, 0x66063BCA, 0x11010B5C, 0x8F659EFF, 0xF862AE69, 0x616BFFD3, 0x166CCF45, 0xA00AE278, 0xD70DD2EE, 0x4E048354, 0x3903B3C2, 0xA7672661, 0xD06016F7, 0x4969474D, 0x3E6E77DB, 0xAED16A4A, 0xD9D65ADC, 0x40DF0B66, 0x37D83BF0, 0xA9BCAE53, 0xDEBB9EC5, 0x47B2CF7F, 0x30B5FFE9, 0xBDBDF21C, 0xCABAC28A, 0x53B39330, 0x24B4A3A6, 0xBAD03605, 0xCDD70693, 0x54DE5729, 0x23D967BF, 0xB3667A2E, 0xC4614AB8, 0x5D681B02, 0x2A6F2B94, 0xB40BBE37, 0xC30C8EA1, 0x5A05DF1B, 0x2D02EF8D
|
||||
};
|
||||
|
||||
// ReSharper disable InconsistentNaming
|
||||
// Chunk types
|
||||
private static readonly byte[] IHDR = { 73, 72, 68, 82 };
|
||||
|
||||
private static readonly byte[] IDAT = { 73, 68, 65, 84 };
|
||||
|
||||
private static readonly byte[] IEND = { 73, 69, 78, 68 };
|
||||
|
||||
private static readonly byte[] PLTE = { 80, 76, 84, 69 };
|
||||
|
||||
private static readonly byte[] tRNS = { 116, 82, 78, 83 };
|
||||
// ReSharper enable InconsistentNaming
|
||||
|
||||
public enum ColorType : byte
|
||||
{
|
||||
Greyscale = 0,
|
||||
Indexed = 3
|
||||
}
|
||||
|
||||
private MemoryStream stream = new MemoryStream();
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
this.stream?.Dispose();
|
||||
this.stream = null;
|
||||
}
|
||||
|
||||
public byte[] GetBytes()
|
||||
{
|
||||
var bytes = this.stream.ToArray();
|
||||
|
||||
// Enumerate chunks in file and insert their CRC32 checksums.
|
||||
var chunkOffset = PngSignature.Length;
|
||||
while (chunkOffset < bytes.Length)
|
||||
{
|
||||
// Read length field.
|
||||
var dataLength = (bytes[chunkOffset] << 24) | (bytes[chunkOffset + 1] << 16) | (bytes[chunkOffset + 2] << 8) | bytes[chunkOffset + 3];
|
||||
|
||||
// CRC is computed from type and data fields.
|
||||
var crc = Crc32(bytes, chunkOffset + 4, dataLength + 4);
|
||||
|
||||
// Write CRC to end of chunk.
|
||||
var crcOffset = chunkOffset + 8 + dataLength;
|
||||
bytes[crcOffset + 0] = (byte)(crc >> 24);
|
||||
bytes[crcOffset + 1] = (byte)(crc >> 16);
|
||||
bytes[crcOffset + 2] = (byte)(crc >> 8);
|
||||
bytes[crcOffset + 3] = (byte)crc;
|
||||
|
||||
// Seek to next chunk.
|
||||
chunkOffset = crcOffset + 4;
|
||||
}
|
||||
|
||||
return bytes;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Writes the IHDR chunk. This must be the first chunk in the file.
|
||||
/// </summary>
|
||||
public void WriteHeader(int width, int height, byte bitDepth, ColorType colorType)
|
||||
{
|
||||
this.stream.Write(PngSignature, 0, PngSignature.Length);
|
||||
this.WriteChunkStart(IHDR, 13);
|
||||
|
||||
// Size.
|
||||
this.WriteIntBigEndian((uint)width);
|
||||
this.WriteIntBigEndian((uint)height);
|
||||
|
||||
// Color.
|
||||
this.stream.WriteByte(bitDepth);
|
||||
this.stream.WriteByte((byte)colorType);
|
||||
|
||||
// Constants.
|
||||
this.stream.WriteByte(0);
|
||||
this.stream.WriteByte(0);
|
||||
this.stream.WriteByte(0);
|
||||
|
||||
this.WriteChunkEnd();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Writes the PLTE chunk, and also the tRNS chunk if necessary. Must come before the IDAT chunk.
|
||||
/// </summary>
|
||||
public void WritePalette(params byte[][] rgbaColors)
|
||||
{
|
||||
const int Red = 0, Green = 1, Blue = 2, Alpha = 3;
|
||||
const byte Opaque = 255;
|
||||
var hasAlpha = false;
|
||||
|
||||
this.WriteChunkStart(PLTE, 3 * rgbaColors.Length);
|
||||
foreach (var color in rgbaColors)
|
||||
{
|
||||
hasAlpha |= color.Length > Alpha && color[Alpha] < Opaque;
|
||||
this.stream.WriteByte(color[Red]);
|
||||
this.stream.WriteByte(color[Green]);
|
||||
this.stream.WriteByte(color[Blue]);
|
||||
}
|
||||
this.WriteChunkEnd();
|
||||
|
||||
if (!hasAlpha)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
this.WriteChunkStart(tRNS, rgbaColors.Length);
|
||||
foreach (var color in rgbaColors)
|
||||
{
|
||||
this.stream.WriteByte(color.Length > Alpha ? color[Alpha] : Opaque);
|
||||
}
|
||||
this.WriteChunkEnd();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Writes the IDAT chunk with the actual picture.
|
||||
/// </summary>
|
||||
public void WriteScanlines(byte[] scanlines)
|
||||
{
|
||||
using (var idatStream = new MemoryStream())
|
||||
{
|
||||
Deflate(idatStream, scanlines);
|
||||
|
||||
this.WriteChunkStart(IDAT, (int)(idatStream.Length + 6));
|
||||
|
||||
// Deflate header.
|
||||
this.stream.WriteByte(0x78); // 8 Deflate algorithm, 7 max window size
|
||||
this.stream.WriteByte(0x9C); // Check bits.
|
||||
|
||||
// Compressed data.
|
||||
idatStream.Position = 0;
|
||||
#if NET35
|
||||
idatStream.WriteTo(this.stream);
|
||||
#else
|
||||
idatStream.CopyTo(this.stream);
|
||||
#endif
|
||||
// Deflate checksum.
|
||||
var adler = Adler32(scanlines, 0, scanlines.Length);
|
||||
this.WriteIntBigEndian(adler);
|
||||
|
||||
this.WriteChunkEnd();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Writes the IEND chunk. This must be the last chunk in the file.
|
||||
/// </summary>
|
||||
public void WriteEnd()
|
||||
{
|
||||
this.WriteChunkStart(IEND, 0);
|
||||
this.WriteChunkEnd();
|
||||
}
|
||||
|
||||
private void WriteChunkStart(byte[] type, int length)
|
||||
{
|
||||
this.WriteIntBigEndian((uint)length);
|
||||
this.stream.Write(type, 0, 4);
|
||||
}
|
||||
|
||||
private void WriteChunkEnd()
|
||||
{
|
||||
// Reserves 4 bytes space for crc32 so GetBytes can add it later.
|
||||
this.stream.SetLength(this.stream.Length + 4);
|
||||
this.stream.Position += 4;
|
||||
}
|
||||
|
||||
private void WriteIntBigEndian(uint value)
|
||||
{
|
||||
this.stream.WriteByte((byte)(value >> 24));
|
||||
this.stream.WriteByte((byte)(value >> 16));
|
||||
this.stream.WriteByte((byte)(value >> 8));
|
||||
this.stream.WriteByte((byte)value);
|
||||
}
|
||||
|
||||
private static void Deflate(Stream output, byte[] bytes)
|
||||
{
|
||||
using (var deflateStream = new DeflateStream(output, CompressionMode.Compress, leaveOpen: true))
|
||||
{
|
||||
deflateStream.Write(bytes, 0, bytes.Length);
|
||||
}
|
||||
}
|
||||
|
||||
// Reference implementation from RFC 1950. Not optimized.
|
||||
private static uint Adler32(byte[] data, int index, int length)
|
||||
{
|
||||
const uint Base = 65521;
|
||||
uint s1 = 1, s2 = 0;
|
||||
|
||||
var end = index + length;
|
||||
for (var n = index; n < end; n++)
|
||||
{
|
||||
s1 = (s1 + data[n]) % Base;
|
||||
s2 = (s2 + s1) % Base;
|
||||
}
|
||||
|
||||
return (s2 << 16) + s1;
|
||||
}
|
||||
|
||||
// Reference implementation from REC-PNG-20031110. Not optimized.
|
||||
private static uint Crc32(byte[] data, int index, int length)
|
||||
{
|
||||
var c = 0xffffffff;
|
||||
|
||||
var end = index + length;
|
||||
for (var n = index; n < end; n++)
|
||||
{
|
||||
c = CrcTable[(c ^ data[n]) & 0xff] ^ (c >> 8);
|
||||
}
|
||||
|
||||
return c ^ 0xffffffff;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static class PngByteQRCodeHelper
|
||||
{
|
||||
public static byte[] GetQRCode(string plainText, int pixelsPerModule, byte[] darkColorRgba, byte[] lightColorRgba, ECCLevel eccLevel, bool forceUtf8 = false, bool utf8BOM = false, EciMode eciMode = EciMode.Default, int requestedVersion = -1, bool drawQuietZones = true)
|
||||
{
|
||||
using (var qrGenerator = new QRCodeGenerator())
|
||||
using (var qrCodeData = qrGenerator.CreateQrCode(plainText, eccLevel, forceUtf8, utf8BOM, eciMode, requestedVersion))
|
||||
using (var qrCode = new PngByteQRCode(qrCodeData))
|
||||
return qrCode.GetGraphic(pixelsPerModule, darkColorRgba, lightColorRgba, drawQuietZones);
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static byte[] GetQRCode(string txt, QRCodeGenerator.ECCLevel eccLevel, int size, bool drawQuietZones = true)
|
||||
{
|
||||
using (var qrGen = new QRCodeGenerator())
|
||||
using (var qrCode = qrGen.CreateQrCode(txt, eccLevel))
|
||||
using (var qrPng = new PngByteQRCode(qrCode))
|
||||
return qrPng.GetGraphic(size, drawQuietZones);
|
||||
}
|
||||
}
|
||||
}
|
||||
161
vCardEditor/Libs/QRCoder/PostscriptQRCode.cs
Normal file
161
vCardEditor/Libs/QRCoder/PostscriptQRCode.cs
Normal file
@@ -0,0 +1,161 @@
|
||||
#if NETFRAMEWORK || NETSTANDARD2_0 || NET5_0 || NET6_0_WINDOWS
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using static QRCoder.QRCodeGenerator;
|
||||
|
||||
namespace QRCoder
|
||||
{
|
||||
|
||||
#if NET6_0_WINDOWS
|
||||
[System.Runtime.Versioning.SupportedOSPlatform("windows")]
|
||||
#endif
|
||||
public class PostscriptQRCode : AbstractQRCode, IDisposable
|
||||
{
|
||||
/// <summary>
|
||||
/// Constructor without params to be used in COM Objects connections
|
||||
/// </summary>
|
||||
public PostscriptQRCode() { }
|
||||
public PostscriptQRCode(QRCodeData data) : base(data) { }
|
||||
|
||||
public string GetGraphic(int pointsPerModule, bool epsFormat = false)
|
||||
{
|
||||
var viewBox = new Size(pointsPerModule * this.QrCodeData.ModuleMatrix.Count, pointsPerModule * this.QrCodeData.ModuleMatrix.Count);
|
||||
return this.GetGraphic(viewBox, Color.Black, Color.White, true, epsFormat);
|
||||
}
|
||||
public string GetGraphic(int pointsPerModule, Color darkColor, Color lightColor, bool drawQuietZones = true, bool epsFormat = false)
|
||||
{
|
||||
var viewBox = new Size(pointsPerModule * this.QrCodeData.ModuleMatrix.Count, pointsPerModule * this.QrCodeData.ModuleMatrix.Count);
|
||||
return this.GetGraphic(viewBox, darkColor, lightColor, drawQuietZones, epsFormat);
|
||||
}
|
||||
|
||||
public string GetGraphic(int pointsPerModule, string darkColorHex, string lightColorHex, bool drawQuietZones = true, bool epsFormat = false)
|
||||
{
|
||||
var viewBox = new Size(pointsPerModule * this.QrCodeData.ModuleMatrix.Count, pointsPerModule * this.QrCodeData.ModuleMatrix.Count);
|
||||
return this.GetGraphic(viewBox, darkColorHex, lightColorHex, drawQuietZones, epsFormat);
|
||||
}
|
||||
|
||||
public string GetGraphic(Size viewBox, bool drawQuietZones = true, bool epsFormat = false)
|
||||
{
|
||||
return this.GetGraphic(viewBox, Color.Black, Color.White, drawQuietZones, epsFormat);
|
||||
}
|
||||
|
||||
public string GetGraphic(Size viewBox, string darkColorHex, string lightColorHex, bool drawQuietZones = true, bool epsFormat = false)
|
||||
{
|
||||
return this.GetGraphic(viewBox, ColorTranslator.FromHtml(darkColorHex), ColorTranslator.FromHtml(lightColorHex), drawQuietZones, epsFormat);
|
||||
}
|
||||
|
||||
public string GetGraphic(Size viewBox, Color darkColor, Color lightColor, bool drawQuietZones = true, bool epsFormat = false)
|
||||
{
|
||||
var offset = drawQuietZones ? 0 : 4;
|
||||
var drawableModulesCount = this.QrCodeData.ModuleMatrix.Count - (drawQuietZones ? 0 : offset * 2);
|
||||
var pointsPerModule = (double)Math.Min(viewBox.Width, viewBox.Height) / (double)drawableModulesCount;
|
||||
|
||||
string psFile = string.Format(psHeader, new object[] {
|
||||
DateTime.Now.ToString("s"), CleanSvgVal(viewBox.Width), CleanSvgVal(pointsPerModule),
|
||||
epsFormat ? "EPSF-3.0" : string.Empty
|
||||
});
|
||||
psFile += string.Format(psFunctions, new object[] {
|
||||
CleanSvgVal(darkColor.R /255.0), CleanSvgVal(darkColor.G /255.0), CleanSvgVal(darkColor.B /255.0),
|
||||
CleanSvgVal(lightColor.R /255.0), CleanSvgVal(lightColor.G /255.0), CleanSvgVal(lightColor.B /255.0),
|
||||
drawableModulesCount
|
||||
});
|
||||
|
||||
for (int xi = offset; xi < offset + drawableModulesCount; xi++)
|
||||
{
|
||||
if (xi > offset)
|
||||
psFile += "nl\n";
|
||||
for (int yi = offset; yi < offset + drawableModulesCount; yi++)
|
||||
{
|
||||
psFile += (this.QrCodeData.ModuleMatrix[xi][yi] ? "f " : "b ");
|
||||
}
|
||||
psFile += "\n";
|
||||
}
|
||||
return psFile + psFooter;
|
||||
}
|
||||
|
||||
private string CleanSvgVal(double input)
|
||||
{
|
||||
//Clean double values for international use/formats
|
||||
return input.ToString(System.Globalization.CultureInfo.InvariantCulture);
|
||||
}
|
||||
|
||||
private const string psHeader = @"%!PS-Adobe-3.0 {3}
|
||||
%%Creator: QRCoder.NET
|
||||
%%Title: QRCode
|
||||
%%CreationDate: {0}
|
||||
%%DocumentData: Clean7Bit
|
||||
%%Origin: 0
|
||||
%%DocumentMedia: Default {1} {1} 0 () ()
|
||||
%%BoundingBox: 0 0 {1} {1}
|
||||
%%LanguageLevel: 2
|
||||
%%Pages: 1
|
||||
%%Page: 1 1
|
||||
%%EndComments
|
||||
%%BeginConstants
|
||||
/sz {1} def
|
||||
/sc {2} def
|
||||
%%EndConstants
|
||||
%%BeginFeature: *PageSize Default
|
||||
<< /PageSize [ sz sz ] /ImagingBBox null >> setpagedevice
|
||||
%%EndFeature
|
||||
";
|
||||
|
||||
private const string psFunctions = @"%%BeginFunctions
|
||||
/csquare {{
|
||||
newpath
|
||||
0 0 moveto
|
||||
0 1 rlineto
|
||||
1 0 rlineto
|
||||
0 -1 rlineto
|
||||
closepath
|
||||
setrgbcolor
|
||||
fill
|
||||
}} def
|
||||
/f {{
|
||||
{0} {1} {2} csquare
|
||||
1 0 translate
|
||||
}} def
|
||||
/b {{
|
||||
1 0 translate
|
||||
}} def
|
||||
/background {{
|
||||
{3} {4} {5} csquare
|
||||
}} def
|
||||
/nl {{
|
||||
-{6} -1 translate
|
||||
}} def
|
||||
%%EndFunctions
|
||||
%%BeginBody
|
||||
0 0 moveto
|
||||
gsave
|
||||
sz sz scale
|
||||
background
|
||||
grestore
|
||||
gsave
|
||||
sc sc scale
|
||||
0 {6} 1 sub translate
|
||||
";
|
||||
|
||||
private const string psFooter = @"%%EndBody
|
||||
grestore
|
||||
showpage
|
||||
%%EOF
|
||||
";
|
||||
}
|
||||
|
||||
#if NET6_0_WINDOWS
|
||||
[System.Runtime.Versioning.SupportedOSPlatform("windows")]
|
||||
#endif
|
||||
public static class PostscriptQRCodeHelper
|
||||
{
|
||||
public static string GetQRCode(string plainText, int pointsPerModule, string darkColorHex, string lightColorHex, ECCLevel eccLevel, bool forceUtf8 = false, bool utf8BOM = false, EciMode eciMode = EciMode.Default, int requestedVersion = -1, bool drawQuietZones = true, bool epsFormat = false)
|
||||
{
|
||||
using (var qrGenerator = new QRCodeGenerator())
|
||||
using (var qrCodeData = qrGenerator.CreateQrCode(plainText, eccLevel, forceUtf8, utf8BOM, eciMode, requestedVersion))
|
||||
using (var qrCode = new PostscriptQRCode(qrCodeData))
|
||||
return qrCode.GetGraphic(pointsPerModule, darkColorHex, lightColorHex, drawQuietZones, epsFormat);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
138
vCardEditor/Libs/QRCoder/QRCode.cs
Normal file
138
vCardEditor/Libs/QRCoder/QRCode.cs
Normal file
@@ -0,0 +1,138 @@
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Drawing2D;
|
||||
using static QRCoder.QRCodeGenerator;
|
||||
|
||||
namespace QRCoder
|
||||
{
|
||||
public class QRCode : AbstractQRCode, IDisposable
|
||||
{
|
||||
/// <summary>
|
||||
/// Constructor without params to be used in COM Objects connections
|
||||
/// </summary>
|
||||
public QRCode() { }
|
||||
|
||||
public QRCode(QRCodeData data) : base(data) {}
|
||||
|
||||
public Bitmap GetGraphic(int pixelsPerModule)
|
||||
{
|
||||
return this.GetGraphic(pixelsPerModule, Color.Black, Color.White, true);
|
||||
}
|
||||
|
||||
public Bitmap GetGraphic(int pixelsPerModule, string darkColorHtmlHex, string lightColorHtmlHex, bool drawQuietZones = true)
|
||||
{
|
||||
return this.GetGraphic(pixelsPerModule, ColorTranslator.FromHtml(darkColorHtmlHex), ColorTranslator.FromHtml(lightColorHtmlHex), drawQuietZones);
|
||||
}
|
||||
|
||||
public Bitmap GetGraphic(int pixelsPerModule, Color darkColor, Color lightColor, bool drawQuietZones = true)
|
||||
{
|
||||
var size = (this.QrCodeData.ModuleMatrix.Count - (drawQuietZones ? 0 : 8)) * pixelsPerModule;
|
||||
var offset = drawQuietZones ? 0 : 4 * pixelsPerModule;
|
||||
|
||||
var bmp = new Bitmap(size, size);
|
||||
using (var gfx = Graphics.FromImage(bmp))
|
||||
using (var lightBrush = new SolidBrush(lightColor))
|
||||
using (var darkBrush = new SolidBrush(darkColor))
|
||||
{
|
||||
for (var x = 0; x < size + offset; x = x + pixelsPerModule)
|
||||
{
|
||||
for (var y = 0; y < size + offset; y = y + pixelsPerModule)
|
||||
{
|
||||
var module = this.QrCodeData.ModuleMatrix[(y + pixelsPerModule) / pixelsPerModule - 1][(x + pixelsPerModule) / pixelsPerModule - 1];
|
||||
|
||||
if (module)
|
||||
{
|
||||
gfx.FillRectangle(darkBrush, new Rectangle(x - offset, y - offset, pixelsPerModule, pixelsPerModule));
|
||||
}
|
||||
else
|
||||
{
|
||||
gfx.FillRectangle(lightBrush, new Rectangle(x - offset, y - offset, pixelsPerModule, pixelsPerModule));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
gfx.Save();
|
||||
}
|
||||
|
||||
return bmp;
|
||||
}
|
||||
|
||||
public Bitmap GetGraphic(int pixelsPerModule, Color darkColor, Color lightColor, Bitmap icon=null, int iconSizePercent=15, int iconBorderWidth = 0, bool drawQuietZones = true, Color? iconBackgroundColor = null)
|
||||
{
|
||||
var size = (this.QrCodeData.ModuleMatrix.Count - (drawQuietZones ? 0 : 8)) * pixelsPerModule;
|
||||
var offset = drawQuietZones ? 0 : 4 * pixelsPerModule;
|
||||
|
||||
var bmp = new Bitmap(size, size, System.Drawing.Imaging.PixelFormat.Format32bppArgb);
|
||||
|
||||
using (var gfx = Graphics.FromImage(bmp))
|
||||
using (var lightBrush = new SolidBrush(lightColor))
|
||||
using (var darkBrush = new SolidBrush(darkColor))
|
||||
{
|
||||
gfx.InterpolationMode = InterpolationMode.HighQualityBicubic;
|
||||
gfx.CompositingQuality = CompositingQuality.HighQuality;
|
||||
gfx.Clear(lightColor);
|
||||
var drawIconFlag = icon != null && iconSizePercent > 0 && iconSizePercent <= 100;
|
||||
|
||||
for (var x = 0; x < size + offset; x = x + pixelsPerModule)
|
||||
{
|
||||
for (var y = 0; y < size + offset; y = y + pixelsPerModule)
|
||||
{
|
||||
var moduleBrush = this.QrCodeData.ModuleMatrix[(y + pixelsPerModule) / pixelsPerModule - 1][(x + pixelsPerModule) / pixelsPerModule - 1] ? darkBrush : lightBrush;
|
||||
gfx.FillRectangle(moduleBrush , new Rectangle(x - offset, y - offset, pixelsPerModule, pixelsPerModule));
|
||||
}
|
||||
}
|
||||
|
||||
if (drawIconFlag)
|
||||
{
|
||||
float iconDestWidth = iconSizePercent * bmp.Width / 100f;
|
||||
float iconDestHeight = drawIconFlag ? iconDestWidth * icon.Height / icon.Width : 0;
|
||||
float iconX = (bmp.Width - iconDestWidth) / 2;
|
||||
float iconY = (bmp.Height - iconDestHeight) / 2;
|
||||
var centerDest = new RectangleF(iconX - iconBorderWidth, iconY - iconBorderWidth, iconDestWidth + iconBorderWidth * 2, iconDestHeight + iconBorderWidth * 2);
|
||||
var iconDestRect = new RectangleF(iconX, iconY, iconDestWidth, iconDestHeight);
|
||||
var iconBgBrush = iconBackgroundColor != null ? new SolidBrush((Color)iconBackgroundColor) : lightBrush;
|
||||
//Only render icon/logo background, if iconBorderWith is set > 0
|
||||
if (iconBorderWidth > 0)
|
||||
{
|
||||
using (GraphicsPath iconPath = CreateRoundedRectanglePath(centerDest, iconBorderWidth * 2))
|
||||
{
|
||||
gfx.FillPath(iconBgBrush, iconPath);
|
||||
}
|
||||
}
|
||||
gfx.DrawImage(icon, iconDestRect, new RectangleF(0, 0, icon.Width, icon.Height), GraphicsUnit.Pixel);
|
||||
}
|
||||
|
||||
gfx.Save();
|
||||
}
|
||||
|
||||
return bmp;
|
||||
}
|
||||
|
||||
internal GraphicsPath CreateRoundedRectanglePath(RectangleF rect, int cornerRadius)
|
||||
{
|
||||
var roundedRect = new GraphicsPath();
|
||||
roundedRect.AddArc(rect.X, rect.Y, cornerRadius * 2, cornerRadius * 2, 180, 90);
|
||||
roundedRect.AddLine(rect.X + cornerRadius, rect.Y, rect.Right - cornerRadius * 2, rect.Y);
|
||||
roundedRect.AddArc(rect.X + rect.Width - cornerRadius * 2, rect.Y, cornerRadius * 2, cornerRadius * 2, 270, 90);
|
||||
roundedRect.AddLine(rect.Right, rect.Y + cornerRadius * 2, rect.Right, rect.Y + rect.Height - cornerRadius * 2);
|
||||
roundedRect.AddArc(rect.X + rect.Width - cornerRadius * 2, rect.Y + rect.Height - cornerRadius * 2, cornerRadius * 2, cornerRadius * 2, 0, 90);
|
||||
roundedRect.AddLine(rect.Right - cornerRadius * 2, rect.Bottom, rect.X + cornerRadius * 2, rect.Bottom);
|
||||
roundedRect.AddArc(rect.X, rect.Bottom - cornerRadius * 2, cornerRadius * 2, cornerRadius * 2, 90, 90);
|
||||
roundedRect.AddLine(rect.X, rect.Bottom - cornerRadius * 2, rect.X, rect.Y + cornerRadius * 2);
|
||||
roundedRect.CloseFigure();
|
||||
return roundedRect;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static class QRCodeHelper
|
||||
{
|
||||
public static Bitmap GetQRCode(string plainText, int pixelsPerModule, Color darkColor, Color lightColor, ECCLevel eccLevel, bool forceUtf8 = false, bool utf8BOM = false, EciMode eciMode = EciMode.Default, int requestedVersion = -1, Bitmap icon = null, int iconSizePercent = 15, int iconBorderWidth = 0, bool drawQuietZones = true)
|
||||
{
|
||||
using (var qrGenerator = new QRCodeGenerator())
|
||||
using (var qrCodeData = qrGenerator.CreateQrCode(plainText, eccLevel, forceUtf8, utf8BOM, eciMode, requestedVersion))
|
||||
using (var qrCode = new QRCode(qrCodeData))
|
||||
return qrCode.GetGraphic(pixelsPerModule, darkColor, lightColor, icon, iconSizePercent, iconBorderWidth, drawQuietZones);
|
||||
}
|
||||
}
|
||||
}
|
||||
185
vCardEditor/Libs/QRCoder/QRCodeData.cs
Normal file
185
vCardEditor/Libs/QRCoder/QRCodeData.cs
Normal file
@@ -0,0 +1,185 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace QRCoder
|
||||
{
|
||||
using QRCoder.Framework4._0Methods;
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.IO.Compression;
|
||||
|
||||
public class QRCodeData : IDisposable
|
||||
{
|
||||
public List<BitArray> ModuleMatrix { get; set; }
|
||||
|
||||
public QRCodeData(int version)
|
||||
{
|
||||
this.Version = version;
|
||||
var size = ModulesPerSideFromVersion(version);
|
||||
this.ModuleMatrix = new List<BitArray>();
|
||||
for (var i = 0; i < size; i++)
|
||||
this.ModuleMatrix.Add(new BitArray(size));
|
||||
}
|
||||
#if NETFRAMEWORK || NETSTANDARD2_0 || NET5_0
|
||||
public QRCodeData(string pathToRawData, Compression compressMode) : this(File.ReadAllBytes(pathToRawData), compressMode)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
public QRCodeData(byte[] rawData, Compression compressMode)
|
||||
{
|
||||
var bytes = new List<byte>(rawData);
|
||||
|
||||
//Decompress
|
||||
if (compressMode == Compression.Deflate)
|
||||
{
|
||||
using (var input = new MemoryStream(bytes.ToArray()))
|
||||
{
|
||||
using (var output = new MemoryStream())
|
||||
{
|
||||
using (var dstream = new DeflateStream(input, CompressionMode.Decompress))
|
||||
{
|
||||
Stream4Methods.CopyTo(dstream, output);
|
||||
}
|
||||
bytes = new List<byte>(output.ToArray());
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (compressMode == Compression.GZip)
|
||||
{
|
||||
using (var input = new MemoryStream(bytes.ToArray()))
|
||||
{
|
||||
using (var output = new MemoryStream())
|
||||
{
|
||||
using (var dstream = new GZipStream(input, CompressionMode.Decompress))
|
||||
{
|
||||
Stream4Methods.CopyTo(dstream, output);
|
||||
}
|
||||
bytes = new List<byte>(output.ToArray());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (bytes[0] != 0x51 || bytes[1] != 0x52 || bytes[2] != 0x52)
|
||||
throw new Exception("Invalid raw data file. Filetype doesn't match \"QRR\".");
|
||||
|
||||
//Set QR code version
|
||||
var sideLen = (int)bytes[4];
|
||||
bytes.RemoveRange(0, 5);
|
||||
this.Version = (sideLen - 21 - 8) / 4 + 1;
|
||||
|
||||
//Unpack
|
||||
var modules = new Queue<bool>(8 * bytes.Count);
|
||||
foreach (var b in bytes)
|
||||
{
|
||||
var bArr = new BitArray(new byte[] { b });
|
||||
for (int i = 7; i >= 0; i--)
|
||||
{
|
||||
modules.Enqueue((b & (1 << i)) != 0);
|
||||
}
|
||||
}
|
||||
|
||||
//Build module matrix
|
||||
this.ModuleMatrix = new List<BitArray>(sideLen);
|
||||
for (int y = 0; y < sideLen; y++)
|
||||
{
|
||||
this.ModuleMatrix.Add(new BitArray(sideLen));
|
||||
for (int x = 0; x < sideLen; x++)
|
||||
{
|
||||
this.ModuleMatrix[y][x] = modules.Dequeue();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public byte[] GetRawData(Compression compressMode)
|
||||
{
|
||||
var bytes = new List<byte>();
|
||||
|
||||
//Add header - signature ("QRR")
|
||||
bytes.AddRange(new byte[]{ 0x51, 0x52, 0x52, 0x00 });
|
||||
|
||||
//Add header - rowsize
|
||||
bytes.Add((byte)ModuleMatrix.Count);
|
||||
|
||||
//Build data queue
|
||||
var dataQueue = new Queue<int>();
|
||||
foreach (var row in ModuleMatrix)
|
||||
{
|
||||
foreach (var module in row)
|
||||
{
|
||||
dataQueue.Enqueue((bool)module ? 1 : 0);
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < 8 - (ModuleMatrix.Count * ModuleMatrix.Count) % 8; i++)
|
||||
{
|
||||
dataQueue.Enqueue(0);
|
||||
}
|
||||
|
||||
//Process queue
|
||||
while (dataQueue.Count > 0)
|
||||
{
|
||||
byte b = 0;
|
||||
for (int i = 7; i >= 0; i--)
|
||||
{
|
||||
b += (byte)(dataQueue.Dequeue() << i);
|
||||
}
|
||||
bytes.Add(b);
|
||||
}
|
||||
var rawData = bytes.ToArray();
|
||||
|
||||
//Compress stream (optional)
|
||||
if (compressMode == Compression.Deflate)
|
||||
{
|
||||
using (var output = new MemoryStream())
|
||||
{
|
||||
using (var dstream = new DeflateStream(output, CompressionMode.Compress))
|
||||
{
|
||||
dstream.Write(rawData, 0, rawData.Length);
|
||||
}
|
||||
rawData = output.ToArray();
|
||||
}
|
||||
}
|
||||
else if (compressMode == Compression.GZip)
|
||||
{
|
||||
using (var output = new MemoryStream())
|
||||
{
|
||||
using (GZipStream gzipStream = new GZipStream(output, CompressionMode.Compress, true))
|
||||
{
|
||||
gzipStream.Write(rawData, 0, rawData.Length);
|
||||
}
|
||||
rawData = output.ToArray();
|
||||
}
|
||||
}
|
||||
return rawData;
|
||||
}
|
||||
|
||||
#if NETFRAMEWORK || NETSTANDARD2_0 || NET5_0
|
||||
public void SaveRawData(string filePath, Compression compressMode)
|
||||
{
|
||||
File.WriteAllBytes(filePath, GetRawData(compressMode));
|
||||
}
|
||||
#endif
|
||||
|
||||
public int Version { get; private set; }
|
||||
|
||||
private static int ModulesPerSideFromVersion(int version)
|
||||
{
|
||||
return 21 + (version - 1) * 4;
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
this.ModuleMatrix = null;
|
||||
this.Version = 0;
|
||||
|
||||
}
|
||||
|
||||
public enum Compression
|
||||
{
|
||||
Uncompressed,
|
||||
Deflate,
|
||||
GZip
|
||||
}
|
||||
}
|
||||
}
|
||||
1596
vCardEditor/Libs/QRCoder/QRCodeGenerator.cs
Normal file
1596
vCardEditor/Libs/QRCoder/QRCodeGenerator.cs
Normal file
File diff suppressed because it is too large
Load Diff
397
vCardEditor/Libs/QRCoder/SvgQRCode.cs
Normal file
397
vCardEditor/Libs/QRCoder/SvgQRCode.cs
Normal file
@@ -0,0 +1,397 @@
|
||||
#if NETFRAMEWORK || NETSTANDARD2_0 || NET5_0 || NET6_0_WINDOWS
|
||||
using QRCoder.Extensions;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using static QRCoder.QRCodeGenerator;
|
||||
using static QRCoder.SvgQRCode;
|
||||
|
||||
namespace QRCoder
|
||||
{
|
||||
#if NET6_0_WINDOWS
|
||||
[System.Runtime.Versioning.SupportedOSPlatform("windows")]
|
||||
#endif
|
||||
public class SvgQRCode : AbstractQRCode, IDisposable
|
||||
{
|
||||
/// <summary>
|
||||
/// Constructor without params to be used in COM Objects connections
|
||||
/// </summary>
|
||||
public SvgQRCode() { }
|
||||
public SvgQRCode(QRCodeData data) : base(data) { }
|
||||
|
||||
/// <summary>
|
||||
/// Returns a QR code as SVG string
|
||||
/// </summary>
|
||||
/// <param name="pixelsPerModule">The pixel size each b/w module is drawn</param>
|
||||
/// <returns>SVG as string</returns>
|
||||
public string GetGraphic(int pixelsPerModule)
|
||||
{
|
||||
var viewBox = new Size(pixelsPerModule*this.QrCodeData.ModuleMatrix.Count, pixelsPerModule * this.QrCodeData.ModuleMatrix.Count);
|
||||
return this.GetGraphic(viewBox, Color.Black, Color.White);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a QR code as SVG string with custom colors, optional quietzone and logo
|
||||
/// </summary>
|
||||
/// <param name="pixelsPerModule">The pixel size each b/w module is drawn</param>
|
||||
/// <param name="darkColor">Color of the dark modules</param>
|
||||
/// <param name="lightColor">Color of the light modules</param>
|
||||
/// <param name="drawQuietZones">If true a white border is drawn around the whole QR Code</param>
|
||||
/// <param name="sizingMode">Defines if width/height or viewbox should be used for size definition</param>
|
||||
/// <param name="logo">A (optional) logo to be rendered on the code (either Bitmap or SVG)</param>
|
||||
/// <returns>SVG as string</returns>
|
||||
public string GetGraphic(int pixelsPerModule, Color darkColor, Color lightColor, bool drawQuietZones = true, SizingMode sizingMode = SizingMode.WidthHeightAttribute, SvgLogo logo = null)
|
||||
{
|
||||
var offset = drawQuietZones ? 0 : 4;
|
||||
var edgeSize = this.QrCodeData.ModuleMatrix.Count * pixelsPerModule - (offset * 2 * pixelsPerModule);
|
||||
var viewBox = new Size(edgeSize, edgeSize);
|
||||
return this.GetGraphic(viewBox, darkColor, lightColor, drawQuietZones, sizingMode, logo);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a QR code as SVG string with custom colors (in HEX syntax), optional quietzone and logo
|
||||
/// </summary>
|
||||
/// <param name="pixelsPerModule">The pixel size each b/w module is drawn</param>
|
||||
/// <param name="darkColorHex">The color of the dark/black modules in hex (e.g. #000000) representation</param>
|
||||
/// <param name="lightColorHex">The color of the light/white modules in hex (e.g. #ffffff) representation</param>
|
||||
/// <param name="drawQuietZones">If true a white border is drawn around the whole QR Code</param>
|
||||
/// <param name="sizingMode">Defines if width/height or viewbox should be used for size definition</param>
|
||||
/// <param name="logo">A (optional) logo to be rendered on the code (either Bitmap or SVG)</param>
|
||||
/// <returns>SVG as string</returns>
|
||||
public string GetGraphic(int pixelsPerModule, string darkColorHex, string lightColorHex, bool drawQuietZones = true, SizingMode sizingMode = SizingMode.WidthHeightAttribute, SvgLogo logo = null)
|
||||
{
|
||||
var offset = drawQuietZones ? 0 : 4;
|
||||
var edgeSize = this.QrCodeData.ModuleMatrix.Count * pixelsPerModule - (offset * 2 * pixelsPerModule);
|
||||
var viewBox = new Size(edgeSize, edgeSize);
|
||||
return this.GetGraphic(viewBox, darkColorHex, lightColorHex, drawQuietZones, sizingMode, logo);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a QR code as SVG string with optional quietzone and logo
|
||||
/// </summary>
|
||||
/// <param name="viewBox">The viewbox of the QR code graphic</param>
|
||||
/// <param name="drawQuietZones">If true a white border is drawn around the whole QR Code</param>
|
||||
/// <param name="sizingMode">Defines if width/height or viewbox should be used for size definition</param>
|
||||
/// <param name="logo">A (optional) logo to be rendered on the code (either Bitmap or SVG)</param>
|
||||
/// <returns>SVG as string</returns>
|
||||
public string GetGraphic(Size viewBox, bool drawQuietZones = true, SizingMode sizingMode = SizingMode.WidthHeightAttribute, SvgLogo logo = null)
|
||||
{
|
||||
return this.GetGraphic(viewBox, Color.Black, Color.White, drawQuietZones, sizingMode, logo);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a QR code as SVG string with custom colors and optional quietzone and logo
|
||||
/// </summary>
|
||||
/// <param name="viewBox">The viewbox of the QR code graphic</param>
|
||||
/// <param name="darkColor">Color of the dark modules</param>
|
||||
/// <param name="lightColor">Color of the light modules</param>
|
||||
/// <param name="drawQuietZones">If true a white border is drawn around the whole QR Code</param>
|
||||
/// <param name="sizingMode">Defines if width/height or viewbox should be used for size definition</param>
|
||||
/// <param name="logo">A (optional) logo to be rendered on the code (either Bitmap or SVG)</param>
|
||||
/// <returns>SVG as string</returns>
|
||||
public string GetGraphic(Size viewBox, Color darkColor, Color lightColor, bool drawQuietZones = true, SizingMode sizingMode = SizingMode.WidthHeightAttribute, SvgLogo logo = null)
|
||||
{
|
||||
return this.GetGraphic(viewBox, ColorTranslator.ToHtml(Color.FromArgb(darkColor.ToArgb())), ColorTranslator.ToHtml(Color.FromArgb(lightColor.ToArgb())), drawQuietZones, sizingMode, logo);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a QR code as SVG string with custom colors (in HEX syntax), optional quietzone and logo
|
||||
/// </summary>
|
||||
/// <param name="viewBox">The viewbox of the QR code graphic</param>
|
||||
/// <param name="darkColorHex">The color of the dark/black modules in hex (e.g. #000000) representation</param>
|
||||
/// <param name="lightColorHex">The color of the light/white modules in hex (e.g. #ffffff) representation</param>
|
||||
/// <param name="drawQuietZones">If true a white border is drawn around the whole QR Code</param>
|
||||
/// <param name="sizingMode">Defines if width/height or viewbox should be used for size definition</param>
|
||||
/// <param name="logo">A (optional) logo to be rendered on the code (either Bitmap or SVG)</param>
|
||||
/// <returns>SVG as string</returns>
|
||||
public string GetGraphic(Size viewBox, string darkColorHex, string lightColorHex, bool drawQuietZones = true, SizingMode sizingMode = SizingMode.WidthHeightAttribute, SvgLogo logo = null)
|
||||
{
|
||||
int offset = drawQuietZones ? 0 : 4;
|
||||
int drawableModulesCount = this.QrCodeData.ModuleMatrix.Count - (drawQuietZones ? 0 : offset * 2);
|
||||
double pixelsPerModule = Math.Min(viewBox.Width, viewBox.Height) / (double)drawableModulesCount;
|
||||
double qrSize = drawableModulesCount * pixelsPerModule;
|
||||
string svgSizeAttributes = (sizingMode == SizingMode.WidthHeightAttribute) ? $@"width=""{viewBox.Width}"" height=""{viewBox.Height}""" : $@"viewBox=""0 0 {viewBox.Width} {viewBox.Height}""";
|
||||
ImageAttributes? logoAttr = null;
|
||||
if (logo != null)
|
||||
logoAttr = GetLogoAttributes(logo, viewBox);
|
||||
|
||||
// Merge horizontal rectangles
|
||||
int[,] matrix = new int[drawableModulesCount, drawableModulesCount];
|
||||
for (int yi = 0; yi < drawableModulesCount; yi += 1)
|
||||
{
|
||||
BitArray bitArray = this.QrCodeData.ModuleMatrix[yi+offset];
|
||||
|
||||
int x0 = -1;
|
||||
int xL = 0;
|
||||
for (int xi = 0; xi < drawableModulesCount; xi += 1)
|
||||
{
|
||||
matrix[yi, xi] = 0;
|
||||
if (bitArray[xi+offset] && (logo == null || !logo.FillLogoBackground() || !IsBlockedByLogo((xi+offset)*pixelsPerModule, (yi+offset) * pixelsPerModule, logoAttr, pixelsPerModule)))
|
||||
{
|
||||
if(x0 == -1)
|
||||
{
|
||||
x0 = xi;
|
||||
}
|
||||
xL += 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(xL > 0)
|
||||
{
|
||||
matrix[yi, x0] = xL;
|
||||
x0 = -1;
|
||||
xL = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (xL > 0)
|
||||
{
|
||||
matrix[yi, x0] = xL;
|
||||
}
|
||||
}
|
||||
|
||||
StringBuilder svgFile = new StringBuilder($@"<svg version=""1.1"" baseProfile=""full"" shape-rendering=""crispEdges"" {svgSizeAttributes} xmlns=""http://www.w3.org/2000/svg"" xmlns:xlink=""http://www.w3.org/1999/xlink"">");
|
||||
svgFile.AppendLine($@"<rect x=""0"" y=""0"" width=""{CleanSvgVal(qrSize)}"" height=""{CleanSvgVal(qrSize)}"" fill=""{lightColorHex}"" />");
|
||||
for (int yi = 0; yi < drawableModulesCount; yi += 1)
|
||||
{
|
||||
double y = yi * pixelsPerModule;
|
||||
for (int xi = 0; xi < drawableModulesCount; xi += 1)
|
||||
{
|
||||
int xL = matrix[yi, xi];
|
||||
if(xL > 0)
|
||||
{
|
||||
// Merge vertical rectangles
|
||||
int yL = 1;
|
||||
for (int y2 = yi + 1; y2 < drawableModulesCount; y2 += 1)
|
||||
{
|
||||
if(matrix[y2, xi] == xL)
|
||||
{
|
||||
matrix[y2, xi] = 0;
|
||||
yL += 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Output SVG rectangles
|
||||
double x = xi * pixelsPerModule;
|
||||
if (logo == null || !logo.FillLogoBackground() || !IsBlockedByLogo(x, y, logoAttr, pixelsPerModule))
|
||||
svgFile.AppendLine($@"<rect x=""{CleanSvgVal(x)}"" y=""{CleanSvgVal(y)}"" width=""{CleanSvgVal(xL * pixelsPerModule)}"" height=""{CleanSvgVal(yL * pixelsPerModule)}"" fill=""{darkColorHex}"" />");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Render logo, if set
|
||||
if (logo != null)
|
||||
{
|
||||
if (!logo.IsEmbedded())
|
||||
{
|
||||
svgFile.AppendLine($@"<svg width=""100%"" height=""100%"" version=""1.1"" xmlns = ""http://www.w3.org/2000/svg"">");
|
||||
svgFile.AppendLine($@"<image x=""{CleanSvgVal(logoAttr.Value.X)}"" y=""{CleanSvgVal(logoAttr.Value.Y)}"" width=""{CleanSvgVal(logoAttr.Value.Width)}"" height=""{CleanSvgVal(logoAttr.Value.Height)}"" xlink:href=""{logo.GetDataUri()}"" />");
|
||||
svgFile.AppendLine(@"</svg>");
|
||||
}
|
||||
else
|
||||
{
|
||||
var rawLogo = (string)logo.GetRawLogo();
|
||||
var svg = System.Xml.Linq.XDocument.Parse(rawLogo);
|
||||
svg.Root.SetAttributeValue("x", CleanSvgVal(logoAttr.Value.X));
|
||||
svg.Root.SetAttributeValue("y", CleanSvgVal(logoAttr.Value.Y));
|
||||
svg.Root.SetAttributeValue("width", CleanSvgVal(logoAttr.Value.Width));
|
||||
svg.Root.SetAttributeValue("height", CleanSvgVal(logoAttr.Value.Height));
|
||||
svg.Root.SetAttributeValue("shape-rendering", "geometricPrecision");
|
||||
svgFile.AppendLine(svg.ToString(System.Xml.Linq.SaveOptions.DisableFormatting).Replace("svg:", ""));
|
||||
}
|
||||
}
|
||||
|
||||
svgFile.Append(@"</svg>");
|
||||
return svgFile.ToString();
|
||||
}
|
||||
|
||||
private bool IsBlockedByLogo(double x, double y, ImageAttributes? attr, double pixelPerModule)
|
||||
{
|
||||
return x + pixelPerModule >= attr.Value.X && x <= attr.Value.X + attr.Value.Width && y + pixelPerModule >= attr.Value.Y && y <= attr.Value.Y + attr.Value.Height;
|
||||
}
|
||||
|
||||
private ImageAttributes GetLogoAttributes(SvgLogo logo, Size viewBox)
|
||||
{
|
||||
var imgWidth = logo.GetIconSizePercent() / 100d * viewBox.Width;
|
||||
var imgHeight = logo.GetIconSizePercent() / 100d * viewBox.Height;
|
||||
var imgPosX = viewBox.Width / 2d - imgWidth / 2d;
|
||||
var imgPosY = viewBox.Height / 2d - imgHeight / 2d;
|
||||
return new ImageAttributes()
|
||||
{
|
||||
Width = imgWidth,
|
||||
Height = imgHeight,
|
||||
X = imgPosX,
|
||||
Y = imgPosY
|
||||
};
|
||||
}
|
||||
|
||||
private struct ImageAttributes
|
||||
{
|
||||
public double Width;
|
||||
public double Height;
|
||||
public double X;
|
||||
public double Y;
|
||||
}
|
||||
|
||||
private string CleanSvgVal(double input)
|
||||
{
|
||||
//Clean double values for international use/formats
|
||||
//We use explicitly "G15" to avoid differences between .NET full and Core platforms
|
||||
//https://stackoverflow.com/questions/64898117/tostring-has-a-different-behavior-between-net-462-and-net-core-3-1
|
||||
return input.ToString("G15", System.Globalization.CultureInfo.InvariantCulture);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Mode of sizing attribution on svg root node
|
||||
/// </summary>
|
||||
public enum SizingMode
|
||||
{
|
||||
WidthHeightAttribute,
|
||||
ViewBoxAttribute
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Represents a logo graphic that can be rendered on a SvgQRCode
|
||||
/// </summary>
|
||||
public class SvgLogo
|
||||
{
|
||||
private string _logoData;
|
||||
private MediaType _mediaType;
|
||||
private int _iconSizePercent;
|
||||
private bool _fillLogoBackground;
|
||||
private object _logoRaw;
|
||||
private bool _isEmbedded;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Create a logo object to be used in SvgQRCode renderer
|
||||
/// </summary>
|
||||
/// <param name="iconRasterized">Logo to be rendered as Bitmap/rasterized graphic</param>
|
||||
/// <param name="iconSizePercent">Degree of percentage coverage of the QR code by the logo</param>
|
||||
/// <param name="fillLogoBackground">If true, the background behind the logo will be cleaned</param>
|
||||
public SvgLogo(Bitmap iconRasterized, int iconSizePercent = 15, bool fillLogoBackground = true)
|
||||
{
|
||||
_iconSizePercent = iconSizePercent;
|
||||
using (var ms = new System.IO.MemoryStream())
|
||||
{
|
||||
using (var bitmap = new Bitmap(iconRasterized))
|
||||
{
|
||||
bitmap.Save(ms, System.Drawing.Imaging.ImageFormat.Png);
|
||||
_logoData = Convert.ToBase64String(ms.GetBuffer(), Base64FormattingOptions.None);
|
||||
}
|
||||
}
|
||||
_mediaType = MediaType.PNG;
|
||||
_fillLogoBackground = fillLogoBackground;
|
||||
_logoRaw = iconRasterized;
|
||||
_isEmbedded = false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create a logo object to be used in SvgQRCode renderer
|
||||
/// </summary>
|
||||
/// <param name="iconVectorized">Logo to be rendered as SVG/vectorized graphic/string</param>
|
||||
/// <param name="iconSizePercent">Degree of percentage coverage of the QR code by the logo</param>
|
||||
/// <param name="fillLogoBackground">If true, the background behind the logo will be cleaned</param>
|
||||
/// <param name="iconEmbedded">If true, the logo will embedded as native svg instead of embedding it as image-tag</param>
|
||||
public SvgLogo(string iconVectorized, int iconSizePercent = 15, bool fillLogoBackground = true, bool iconEmbedded = true)
|
||||
{
|
||||
_iconSizePercent = iconSizePercent;
|
||||
_logoData = Convert.ToBase64String(Encoding.UTF8.GetBytes(iconVectorized), Base64FormattingOptions.None);
|
||||
_mediaType = MediaType.SVG;
|
||||
_fillLogoBackground = fillLogoBackground;
|
||||
_logoRaw = iconVectorized;
|
||||
_isEmbedded = iconEmbedded;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the raw logo's data
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public object GetRawLogo()
|
||||
{
|
||||
return _logoRaw;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Defines, if the logo shall be natively embedded.
|
||||
/// true=native svg embedding, false=embedding via image-tag
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public bool IsEmbedded()
|
||||
{
|
||||
return _isEmbedded;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the media type of the logo
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public MediaType GetMediaType()
|
||||
{
|
||||
return _mediaType;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the logo as data-uri
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public string GetDataUri()
|
||||
{
|
||||
return $"data:{_mediaType.GetStringValue()};base64,{_logoData}";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns how much of the QR code should be covered by the logo (in percent)
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public int GetIconSizePercent()
|
||||
{
|
||||
return _iconSizePercent;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns if the background of the logo should be cleaned (no QR modules will be rendered behind the logo)
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public bool FillLogoBackground()
|
||||
{
|
||||
return _fillLogoBackground;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Media types for SvgLogos
|
||||
/// </summary>
|
||||
public enum MediaType : int
|
||||
{
|
||||
[StringValue("image/png")]
|
||||
PNG = 0,
|
||||
[StringValue("image/svg+xml")]
|
||||
SVG = 1
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#if NET6_0_WINDOWS
|
||||
[System.Runtime.Versioning.SupportedOSPlatform("windows")]
|
||||
#endif
|
||||
public static class SvgQRCodeHelper
|
||||
{
|
||||
public static string GetQRCode(string plainText, int pixelsPerModule, string darkColorHex, string lightColorHex, ECCLevel eccLevel, bool forceUtf8 = false, bool utf8BOM = false, EciMode eciMode = EciMode.Default, int requestedVersion = -1, bool drawQuietZones = true, SizingMode sizingMode = SizingMode.WidthHeightAttribute, SvgLogo logo = null)
|
||||
{
|
||||
using (var qrGenerator = new QRCodeGenerator())
|
||||
using (var qrCodeData = qrGenerator.CreateQrCode(plainText, eccLevel, forceUtf8, utf8BOM, eciMode, requestedVersion))
|
||||
using (var qrCode = new SvgQRCode(qrCodeData))
|
||||
return qrCode.GetGraphic(pixelsPerModule, darkColorHex, lightColorHex, drawQuietZones, sizingMode, logo);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
9
vCardEditor/Model/Column.cs
Normal file
9
vCardEditor/Model/Column.cs
Normal file
@@ -0,0 +1,9 @@
|
||||
namespace vCardEditor.Model
|
||||
{
|
||||
public enum Column
|
||||
{
|
||||
Name = 0,
|
||||
FamilyName,
|
||||
Cellular,
|
||||
}
|
||||
}
|
||||
@@ -1,54 +1,63 @@
|
||||
using System.ComponentModel;
|
||||
using Thought.vCards;
|
||||
|
||||
namespace VCFEditor.Model
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public class Contact : INotifyPropertyChanged
|
||||
{
|
||||
[DisplayName(" ")]
|
||||
public bool isSelected { get; set; }
|
||||
|
||||
|
||||
[DisplayName("Name")]
|
||||
public string Name
|
||||
{
|
||||
get { return card.FormattedName; }
|
||||
set
|
||||
{
|
||||
card.FormattedName = value;
|
||||
this.NotifyPropertyChanged("Name");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
[Browsable(false)]
|
||||
public vCard card { get; set; }
|
||||
|
||||
[Browsable(false)]
|
||||
public bool isDirty { get; set; }
|
||||
using System.ComponentModel;
|
||||
using Thought.vCards;
|
||||
|
||||
namespace VCFEditor.Model
|
||||
{
|
||||
public class Contact : INotifyPropertyChanged
|
||||
{
|
||||
[DisplayName("Name")]
|
||||
public string Name
|
||||
{
|
||||
get => card.FormattedName;
|
||||
set
|
||||
{
|
||||
card.FormattedName = value;
|
||||
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)]
|
||||
public bool isDeleted { get; set; }
|
||||
|
||||
|
||||
public Contact()
|
||||
{
|
||||
card = new vCard();
|
||||
isSelected = false;
|
||||
isDirty = false;
|
||||
}
|
||||
|
||||
#region property change event
|
||||
private void NotifyPropertyChanged(string name)
|
||||
{
|
||||
if (PropertyChanged != null)
|
||||
PropertyChanged(this, new PropertyChangedEventArgs(name));
|
||||
}
|
||||
|
||||
public event PropertyChangedEventHandler PropertyChanged;
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
public vCard card { get; set; }
|
||||
|
||||
[Browsable(false)]
|
||||
public bool isDirty { get; set; }
|
||||
|
||||
[DisplayName(" ")]
|
||||
public bool isSelected { get; set; }
|
||||
|
||||
[Browsable(false)]
|
||||
public bool isDeleted { get; set; }
|
||||
|
||||
|
||||
public Contact()
|
||||
{
|
||||
card = new vCard();
|
||||
isSelected = false;
|
||||
isDirty = false;
|
||||
}
|
||||
|
||||
private void NotifyPropertyChanged(string name)
|
||||
{
|
||||
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(name));
|
||||
}
|
||||
|
||||
public event PropertyChangedEventHandler PropertyChanged;
|
||||
}
|
||||
}
|
||||
|
||||
19
vCardEditor/Model/FormState.cs
Normal file
19
vCardEditor/Model/FormState.cs
Normal 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; }
|
||||
|
||||
}
|
||||
}
|
||||
48
vCardEditor/Model/PropertyComparer.cs
Normal file
48
vCardEditor/Model/PropertyComparer.cs
Normal 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
51
vCardEditor/Model/vCardPropeties.cs
Normal file
51
vCardEditor/Model/vCardPropeties.cs
Normal file
@@ -0,0 +1,51 @@
|
||||
namespace vCardEditor.Model
|
||||
{
|
||||
public enum vCardPropeties
|
||||
{
|
||||
ADR = 0,
|
||||
AGENT,
|
||||
ANNIVERSARY,
|
||||
BDAY,
|
||||
BEGIN,
|
||||
CALADRURI,
|
||||
CALURI,
|
||||
CATEGORIES,
|
||||
CLASS,
|
||||
CLIENTPIDMAP,
|
||||
EMAIL,
|
||||
END,
|
||||
FBURL,
|
||||
FN,
|
||||
GENDER,
|
||||
GEO,
|
||||
IMPP,
|
||||
KEY,
|
||||
KIND,
|
||||
LABEL,
|
||||
LANG,
|
||||
LOGO,
|
||||
MAILER,
|
||||
MEMBER,
|
||||
N,
|
||||
NAME,
|
||||
NICKNAME,
|
||||
NOTE,
|
||||
ORG,
|
||||
PHOTO,
|
||||
PRODID,
|
||||
PROFILE,
|
||||
RELATED,
|
||||
REV,
|
||||
ROLE,
|
||||
SORTSTRING,
|
||||
SOUND,
|
||||
SOURCE,
|
||||
TEL,
|
||||
TITLE,
|
||||
TZ,
|
||||
UID,
|
||||
URL,
|
||||
VERSION,
|
||||
XML
|
||||
}
|
||||
}
|
||||
@@ -1,14 +1,13 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Thought.vCards;
|
||||
using VCFEditor.View;
|
||||
using vCardEditor.View;
|
||||
using VCFEditor.Repository;
|
||||
using System.Windows.Forms;
|
||||
using vCardEditor.Repository;
|
||||
using vCardEditor.Model;
|
||||
|
||||
using System.Linq;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace VCFEditor.Presenter
|
||||
{
|
||||
@@ -22,95 +21,232 @@ namespace VCFEditor.Presenter
|
||||
_view = view;
|
||||
_repository = repository;
|
||||
|
||||
//hook event from the view to event handler present in this presenter.
|
||||
_view.NewFileOpened += NewFileOpened;
|
||||
_view.SaveContactsSelected += SaveContacts;
|
||||
_view.ChangeContactsSelected += ChangeContactSelected;
|
||||
_view.DeleteContact += DeleteContact;
|
||||
_view.FilterTextChanged += FilterTextChanged;
|
||||
_view.TextBoxValueChanged += TextBoxValueChanged;
|
||||
_view.BeforeLeavingContact += BeforeLeavingContact;
|
||||
_view.CloseForm += CloseForm;
|
||||
_view.LoadForm += LoadFormHandler;
|
||||
_view.AddContact += AddContactHandler;
|
||||
_view.NewFileOpened += NewFileOpenedHandler;
|
||||
_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.ExportQR += ExportQRHandler;
|
||||
_view.AddressAdded += AddressAddedHandler;
|
||||
_view.AddressModified += AddressModifiedHandler;
|
||||
_view.AddressRemoved += AddressRemovedHandler;
|
||||
_view.CopyTextToClipboardEvent += CopyTextToClipboardHandler;
|
||||
_view.AddExtraField += _view_AddExtraField;
|
||||
|
||||
}
|
||||
|
||||
void CloseForm(object sender, FormClosingEventArgs e)
|
||||
private void _view_AddExtraField(object sender, EventArg<vCardPropeties> e)
|
||||
{
|
||||
if (_repository.dirty && _view.AskMessage("Exit before saving", "Exit"))
|
||||
e.Cancel = true;
|
||||
_view.AddExtraTextGroup(e.Data, string.Empty);
|
||||
}
|
||||
public void BeforeLeavingContact(object sender, EventArg<vCard> 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)
|
||||
{
|
||||
_view.LoadIntialState(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);
|
||||
|
||||
contact.card.DeliveryAddresses.RemoveAt(e.Data);
|
||||
}
|
||||
|
||||
private void AddressAddedHandler(object sender, EventArg<List<vCardDeliveryAddressTypes>> e)
|
||||
{
|
||||
var contact = _repository.Contacts[_view.SelectedContactIndex];
|
||||
_repository.SetDirtyFlag(_view.SelectedContactIndex);
|
||||
|
||||
contact.card.DeliveryAddresses.Add(new vCardDeliveryAddress( e.Data));
|
||||
}
|
||||
|
||||
private void AddressModifiedHandler(object sender, EventArg<List<vCardDeliveryAddressTypes>> e)
|
||||
{
|
||||
var contact = _repository.Contacts[_view.SelectedContactIndex];
|
||||
_repository.SetDirtyFlag(_view.SelectedContactIndex);
|
||||
|
||||
contact.card.DeliveryAddresses.Clear();
|
||||
contact.card.DeliveryAddresses.Add(new vCardDeliveryAddress(e.Data));
|
||||
}
|
||||
private void ExportImageHandler(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
if (_view.SelectedContactIndex > -1)
|
||||
{
|
||||
if (_repository.dirty)
|
||||
_repository.SaveDirtyVCard(_view.SelectedContactIndex, e.Data);
|
||||
//TODO: image can be url, or file location.
|
||||
var card = _repository.Contacts[_view.SelectedContactIndex].card;
|
||||
var image = card.Photos.FirstOrDefault();
|
||||
|
||||
if (image != null)
|
||||
{
|
||||
|
||||
var newPath = _repository.ChangeExtension(_repository.fileName, image.Extension);
|
||||
|
||||
string imageFile = _view.DisplaySaveDialog(newPath);
|
||||
_repository.SaveImageToDisk(imageFile, image);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void TextBoxValueChanged(object sender, EventArgs e)
|
||||
private void ExportQRHandler(object sender, EventArgs e)
|
||||
{
|
||||
StateTextBox tb = sender as StateTextBox;
|
||||
if (tb != null && tb.oldText != tb.Text)
|
||||
_repository.SaveDirtyFlag(_view.SelectedContactIndex);
|
||||
|
||||
if (_view.SelectedContactIndex > -1)
|
||||
{
|
||||
var card = _repository.Contacts[_view.SelectedContactIndex].card;
|
||||
string content = _repository.GenerateStringFromVCard(card);
|
||||
|
||||
_view.DisplayQRCode(content);
|
||||
}
|
||||
}
|
||||
|
||||
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
|
||||
_repository.ModifyImage(_view.SelectedContactIndex, null);
|
||||
|
||||
}
|
||||
|
||||
public void FilterTextChanged(object sender, EventArg<string> e)
|
||||
void CloseFormHandler(object sender, EventArg<bool> e)
|
||||
{
|
||||
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 BeforeLeavingContactHandler(object sender, EventArg<vCard> e)
|
||||
{
|
||||
_repository.SaveDirtyVCard(_view.SelectedContactIndex, e.Data);
|
||||
}
|
||||
|
||||
public void TextBoxValueChangedHandler(object sender, EventArgs e)
|
||||
{
|
||||
var tb = sender as StateTextBox;
|
||||
if (tb != null && tb.oldText != tb.Text)
|
||||
_repository.SetDirtyFlag(_view.SelectedContactIndex);
|
||||
|
||||
}
|
||||
|
||||
public void FilterTextChangedHandler(object sender, EventArg<string> e)
|
||||
{
|
||||
var FilteredContacts = _repository.FilterContacts(e.Data);
|
||||
_view.DisplayContacts(FilteredContacts);
|
||||
}
|
||||
|
||||
private void DeleteContact(object sender, EventArgs e)
|
||||
private void AddContactHandler(object sender, EventArgs e)
|
||||
{
|
||||
_repository.AddEmptyContact();
|
||||
}
|
||||
|
||||
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.SaveContacts(_repository.fileName);
|
||||
_repository.SaveContactsToFile(_repository.fileName);
|
||||
|
||||
}
|
||||
|
||||
public void NewFileOpened(object sender, EventArg<string> e)
|
||||
private void BeforeOpeningNewFileHandler()
|
||||
{
|
||||
if (_repository.Contacts != null && _repository.dirty)
|
||||
{
|
||||
if (!_view.AskMessage("Save current file before?", "Load"))
|
||||
_repository.SaveContactsToFile(_repository.fileName);
|
||||
}
|
||||
|
||||
}
|
||||
public void NewFileOpenedHandler(object sender, EventArg<string> e)
|
||||
{
|
||||
BeforeOpeningNewFileHandler();
|
||||
|
||||
string path = e.Data;
|
||||
if (string.IsNullOrEmpty(path))
|
||||
path = _view.DisplayOpenDialog("vCard Files|*.vcf");
|
||||
|
||||
if (!string.IsNullOrEmpty(path))
|
||||
{
|
||||
FixedList MRUList = ConfigRepository.Instance.Paths;
|
||||
|
||||
if (!MRUList.Contains(path))
|
||||
string ext = _repository.GetExtension(path);
|
||||
if (!string.Equals(ext, ".vcf", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
MRUList.Enqueue(path);
|
||||
// ConfigRepository.Instance.Paths.Clear();
|
||||
_view.UpdateMRUMenu(MRUList);
|
||||
_view.DisplayMessage("Only vcf extension accepted!", "Error");
|
||||
return;
|
||||
}
|
||||
|
||||
_repository.LoadContacts(path);
|
||||
_view.DisplayContacts(_repository.Contacts);
|
||||
|
||||
FixedList MostRecentUsedFiles = ConfigRepository.Instance.Paths;
|
||||
if (!MostRecentUsedFiles.Contains(path))
|
||||
{
|
||||
MostRecentUsedFiles.Enqueue(path);
|
||||
_view.UpdateMRUMenu(MostRecentUsedFiles);
|
||||
}
|
||||
|
||||
if (!_repository.LoadContacts(path))
|
||||
_view.DisplayMessage("File seems missing or corrupted!", "Error");
|
||||
else
|
||||
_view.DisplayContacts(_repository.Contacts);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void ChangeContactSelected(object sender, EventArgs e)
|
||||
public void ChangeContactSelectedHandler(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
if (_view.SelectedContactIndex > -1)
|
||||
{
|
||||
int index = _view.SelectedContactIndex;
|
||||
vCard card = _repository.Contacts[index].card;
|
||||
vCard card = _repository.Contacts[_view.SelectedContactIndex].card;
|
||||
|
||||
if (card != null)
|
||||
{
|
||||
_repository.Contacts[index].isDirty = false;
|
||||
_view.DisplayContactDetail(card, _repository.fileName);
|
||||
}
|
||||
else
|
||||
_view.ClearContactDetail();
|
||||
}
|
||||
else
|
||||
_view.ClearContactDetail();
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ namespace vCardEditor
|
||||
|
||||
var fileHandler = new FileHandler();
|
||||
var mainForm = new MainForm();
|
||||
var presenter = new MainPresenter(mainForm, new ContactRepository(fileHandler));
|
||||
new MainPresenter(mainForm, new ContactRepository(fileHandler));
|
||||
|
||||
Application.Run(mainForm);
|
||||
}
|
||||
|
||||
@@ -32,5 +32,4 @@ using System.Runtime.InteropServices;
|
||||
// Vous pouvez spécifier toutes les valeurs ou indiquer les numéros de build et de révision par défaut
|
||||
// en utilisant '*', comme indiqué ci-dessous :
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("0.12.*")]
|
||||
//[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
[assembly: AssemblyVersion("0.5.3")]
|
||||
|
||||
34
vCardEditor/Properties/Resources.Designer.cs
generated
34
vCardEditor/Properties/Resources.Designer.cs
generated
@@ -1,7 +1,7 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// Ce code a été généré par un outil.
|
||||
// Version du runtime :4.0.30319.34209
|
||||
// Version du runtime :4.0.30319.42000
|
||||
//
|
||||
// Les modifications apportées à ce fichier peuvent provoquer un comportement incorrect et seront perdues si
|
||||
// le code est régénéré.
|
||||
@@ -19,7 +19,7 @@ namespace vCardEditor.Properties {
|
||||
// à l'aide d'un outil, tel que ResGen ou Visual Studio.
|
||||
// Pour ajouter ou supprimer un membre, modifiez votre fichier .ResX, puis réexécutez ResGen
|
||||
// avec l'option /str ou régénérez votre projet VS.
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
internal class Resources {
|
||||
@@ -59,5 +59,35 @@ namespace vCardEditor.Properties {
|
||||
resourceCulture = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Recherche une ressource localisée de type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap Add {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("Add", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Recherche une ressource localisée de type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap Close {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("Close", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Recherche une ressource localisée de type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap nuget_icon {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("nuget-icon", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -117,4 +117,14 @@
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
<data name="Add" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\assests\Add.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="Close" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\assests\Close.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="nuget-icon" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Libs\QRCoder\Assets\nuget-icon.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
</root>
|
||||
4
vCardEditor/Properties/Settings.Designer.cs
generated
4
vCardEditor/Properties/Settings.Designer.cs
generated
@@ -1,7 +1,7 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// Ce code a été généré par un outil.
|
||||
// Version du runtime :4.0.30319.34209
|
||||
// Version du runtime :4.0.30319.42000
|
||||
//
|
||||
// Les modifications apportées à ce fichier peuvent provoquer un comportement incorrect et seront perdues si
|
||||
// le code est régénéré.
|
||||
@@ -12,7 +12,7 @@ namespace vCardEditor.Properties {
|
||||
|
||||
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "12.0.0.0")]
|
||||
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
|
||||
|
||||
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
||||
|
||||
26
vCardEditor/Releases.txt
Normal file
26
vCardEditor/Releases.txt
Normal file
@@ -0,0 +1,26 @@
|
||||
0.5.3
|
||||
Support of QR Code.
|
||||
|
||||
0.5.2
|
||||
added an option to Right-click on a ".vcf"" file –> Open With —> vCardEditor
|
||||
|
||||
0.5.1
|
||||
Fixed clearing fields when changing contact
|
||||
|
||||
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
|
||||
@@ -1,22 +1,21 @@
|
||||
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
|
||||
{
|
||||
get { return Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "config.xml"); }
|
||||
}
|
||||
|
||||
private const int MAX_RECENT_FILES = 5;
|
||||
private static ConfigRepository instance = null;
|
||||
[XmlIgnore]
|
||||
public static ConfigRepository Instance
|
||||
@@ -36,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() { }
|
||||
|
||||
@@ -64,7 +66,7 @@ namespace vCardEditor.Repository
|
||||
/// <returns></returns>
|
||||
private static ConfigRepository LoadConfig()
|
||||
{
|
||||
ConfigRepository obj;
|
||||
ConfigRepository configData = null;
|
||||
|
||||
try
|
||||
{
|
||||
@@ -74,21 +76,24 @@ namespace vCardEditor.Repository
|
||||
XmlSerializer deserializer = new XmlSerializer(typeof(ConfigRepository));
|
||||
using (TextReader reader = new StreamReader(ConfigFileName))
|
||||
{
|
||||
obj = (ConfigRepository)deserializer.Deserialize(reader);
|
||||
obj.Paths.Size = obj.Maximum;
|
||||
configData = (ConfigRepository)deserializer.Deserialize(reader);
|
||||
configData.Paths.Size = configData.Maximum;
|
||||
}
|
||||
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
obj = new ConfigRepository();
|
||||
obj.Paths = new FixedList(5);
|
||||
configData = new ConfigRepository
|
||||
{
|
||||
Maximum = MAX_RECENT_FILES,
|
||||
Paths = new FixedList(MAX_RECENT_FILES)
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
return obj;
|
||||
return configData;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ using Thought.vCards;
|
||||
using VCFEditor.Model;
|
||||
using System.ComponentModel;
|
||||
using vCardEditor.Repository;
|
||||
using vCardEditor.View;
|
||||
|
||||
namespace VCFEditor.Repository
|
||||
{
|
||||
@@ -13,7 +14,6 @@ namespace VCFEditor.Repository
|
||||
{
|
||||
public string fileName { get; set; }
|
||||
private IFileHandler _fileHandler;
|
||||
#region Contact Info
|
||||
/// <summary>
|
||||
/// Formatted name.
|
||||
/// </summary>
|
||||
@@ -22,17 +22,14 @@ namespace VCFEditor.Repository
|
||||
/// <summary>
|
||||
/// Keep a copy of contact list when filtering
|
||||
/// </summary>
|
||||
private BindingList<Contact> OriginalContactList = null;
|
||||
/// <summary>
|
||||
/// Contact List
|
||||
/// </summary>
|
||||
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
|
||||
@@ -40,33 +37,39 @@ namespace VCFEditor.Repository
|
||||
_contacts = value;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
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;
|
||||
}
|
||||
/// <summary>
|
||||
/// Load the contacts from filename.
|
||||
/// 1- Parse the file
|
||||
/// 2-
|
||||
/// </summary>
|
||||
/// <param name="path"></param>
|
||||
public BindingList<Contact> LoadContacts(string fileName)
|
||||
|
||||
public bool LoadContacts(string fileName)
|
||||
{
|
||||
Contacts.Clear();
|
||||
|
||||
this.fileName = fileName;
|
||||
|
||||
if (!_fileHandler.FileExist(fileName))
|
||||
{
|
||||
OriginalContactList = null;
|
||||
return false;
|
||||
}
|
||||
|
||||
string[] lines = _fileHandler.ReadAllLines(fileName);
|
||||
|
||||
StringBuilder RawContent = new StringBuilder();
|
||||
Contact contact = new Contact();
|
||||
string[] lines = _fileHandler.ReadAllLines(fileName);
|
||||
|
||||
//Prevent from adding contacts to existings ones.
|
||||
Contacts.Clear();
|
||||
|
||||
for (int i = 0; i < lines.Length; i++)
|
||||
{
|
||||
RawContent.AppendLine(lines[i]);
|
||||
if (lines[i] == "END:VCARD")
|
||||
if (string.Equals(lines[i].TrimEnd(), "END:VCARD", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
contact.card = ParseRawContent(RawContent);
|
||||
Contacts.Add(contact);
|
||||
@@ -75,41 +78,66 @@ namespace VCFEditor.Repository
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
OriginalContactList = Contacts;
|
||||
return Contacts;
|
||||
return true;
|
||||
}
|
||||
|
||||
public void AddEmptyContact()
|
||||
{
|
||||
if (_contacts != null && _contacts.Count > 0)
|
||||
{
|
||||
Contact contact = new Contact();
|
||||
Contacts.Add(contact);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Save the contact to the file.
|
||||
/// </summary>
|
||||
/// <param name="path">Path to the new file, else if null, we overwrite the same file</param>
|
||||
public void SaveContacts(string fileName)
|
||||
public void SaveContactsToFile(string fileName)
|
||||
{
|
||||
//overwrite the same file, else save as another file.
|
||||
if (string.IsNullOrEmpty(fileName))
|
||||
fileName = this.fileName;
|
||||
|
||||
//Take a copy...
|
||||
//Take a copy if specified in the config file
|
||||
if (!ConfigRepository.Instance.OverWrite)
|
||||
File.Move(fileName, fileName + ".old");
|
||||
{
|
||||
string backupName = GetBackupName();
|
||||
_fileHandler.MoveFile(fileName, backupName);
|
||||
}
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
//Do not save the deleted ones...
|
||||
|
||||
foreach (var entry in Contacts)
|
||||
{
|
||||
//Do not save the deleted ones!
|
||||
if (!entry.isDeleted)
|
||||
sb.Append(generateRawContent(entry.card));
|
||||
{
|
||||
string SerializedCard = GenerateStringFromVCard(entry.card);
|
||||
sb.Append(SerializedCard);
|
||||
}
|
||||
|
||||
//Clean the flag for every contact, even the deleted ones.
|
||||
entry.isDirty = false;
|
||||
}
|
||||
|
||||
|
||||
_fileHandler.WriteAllText(fileName, sb.ToString());
|
||||
}
|
||||
|
||||
private string GetBackupName()
|
||||
{
|
||||
int count = 0;
|
||||
string backupName = fileName + ".old" + count.ToString();
|
||||
|
||||
/// <summary>
|
||||
/// Delete contacted that are selected.
|
||||
/// </summary>
|
||||
while (_fileHandler.FileExist(backupName))
|
||||
{
|
||||
count++;
|
||||
backupName = fileName + ".old" + count.ToString();
|
||||
}
|
||||
|
||||
return backupName;
|
||||
}
|
||||
|
||||
public void DeleteContact()
|
||||
{
|
||||
if (_contacts != null && _contacts.Count > 0)
|
||||
@@ -119,22 +147,15 @@ namespace VCFEditor.Repository
|
||||
{
|
||||
if (_contacts[i].isSelected)
|
||||
{
|
||||
_contacts[i].isDeleted = true;
|
||||
_dirty = true;
|
||||
_contacts.RemoveAt(i);
|
||||
dirty = true;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Use the lib to parse a vcard chunk.
|
||||
/// </summary>
|
||||
/// <param name="rawContent"></param>
|
||||
/// <returns></returns>
|
||||
|
||||
private vCard ParseRawContent(StringBuilder rawContent)
|
||||
{
|
||||
vCard card = null;
|
||||
@@ -147,12 +168,7 @@ namespace VCFEditor.Repository
|
||||
|
||||
return card;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="s"></param>
|
||||
/// <returns></returns>
|
||||
|
||||
private MemoryStream GenerateStreamFromString(string s)
|
||||
{
|
||||
MemoryStream stream = new MemoryStream();
|
||||
@@ -163,21 +179,16 @@ 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 SaveDirtyFlag(int index)
|
||||
public void SetDirtyFlag(int index)
|
||||
{
|
||||
if (index > -1)
|
||||
_contacts[index].isDirty = true;
|
||||
@@ -185,50 +196,166 @@ namespace VCFEditor.Repository
|
||||
|
||||
public void SaveDirtyVCard(int index, vCard NewCard)
|
||||
{
|
||||
if (index > -1 && _contacts[index].isDirty)
|
||||
if (index > -1 && index <= _contacts.Count-1 && _contacts[index].isDirty)
|
||||
{
|
||||
vCard card = _contacts[index].card;
|
||||
card.Title = NewCard.Title;
|
||||
card.FormattedName = NewCard.FormattedName;
|
||||
card.GivenName = NewCard.GivenName;
|
||||
card.FamilyName = NewCard.FamilyName;
|
||||
card.AdditionalNames = NewCard.AdditionalNames;
|
||||
card.FamilyName = NewCard.FamilyName;
|
||||
|
||||
|
||||
//HomePhone
|
||||
if (card.Phones.GetFirstChoice(vCardPhoneTypes.Home) != null)
|
||||
card.Phones.GetFirstChoice(vCardPhoneTypes.Home).FullNumber = NewCard.Phones.GetFirstChoice(vCardPhoneTypes.Home).FullNumber;
|
||||
else
|
||||
{
|
||||
if (NewCard.Phones.GetFirstChoice(vCardPhoneTypes.Home) != null
|
||||
&& !string.IsNullOrEmpty(NewCard.Phones.GetFirstChoice(vCardPhoneTypes.Home).FullNumber))
|
||||
card.Phones.Add(new vCardPhone(NewCard.Phones.GetFirstChoice(vCardPhoneTypes.Home).FullNumber, vCardPhoneTypes.Home));
|
||||
}
|
||||
|
||||
|
||||
//Cellular
|
||||
if (card.Phones.GetFirstChoice(vCardPhoneTypes.Cellular) != null)
|
||||
card.Phones.GetFirstChoice(vCardPhoneTypes.Cellular).FullNumber = NewCard.Phones.GetFirstChoice(vCardPhoneTypes.Cellular).FullNumber;
|
||||
else
|
||||
{
|
||||
if (NewCard.Phones.GetFirstChoice(vCardPhoneTypes.Cellular) != null
|
||||
&& !string.IsNullOrEmpty(NewCard.Phones.GetFirstChoice(vCardPhoneTypes.Cellular).FullNumber))
|
||||
card.Phones.Add(new vCardPhone(NewCard.Phones.GetFirstChoice(vCardPhoneTypes.Cellular).FullNumber, vCardPhoneTypes.Cellular));
|
||||
}
|
||||
|
||||
if (card.EmailAddresses.GetFirstChoice(vCardEmailAddressType.Internet) != null)
|
||||
card.EmailAddresses.GetFirstChoice(vCardEmailAddressType.Internet).Address = NewCard.EmailAddresses.GetFirstChoice(vCardEmailAddressType.Internet).Address;
|
||||
if (card.Websites.GetFirstChoice(vCardWebsiteTypes.Personal) != null)
|
||||
card.Websites.GetFirstChoice(vCardWebsiteTypes.Personal).Url = NewCard.Websites.GetFirstChoice(vCardWebsiteTypes.Personal).Url;
|
||||
|
||||
|
||||
_contacts[index].isDirty = false;
|
||||
_dirty = false;
|
||||
SavePhone(NewCard, card);
|
||||
SaveEmail(NewCard, card);
|
||||
SaveWebUrl(NewCard, card);
|
||||
SaveAddresses(NewCard, card);
|
||||
SaveExtraField(NewCard, card);
|
||||
SaveExtraPhones(NewCard, card);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Generate a VCard class from a string.
|
||||
/// </summary>
|
||||
/// <param name="card"></param>
|
||||
/// <returns></returns>
|
||||
private string generateRawContent(vCard card)
|
||||
private void SaveExtraPhones(vCard newCard, vCard card)
|
||||
{
|
||||
card.Phones.Clear();
|
||||
foreach (var item in newCard.Phones)
|
||||
card.Phones.Add(new vCardPhone(item.FullNumber, item.PhoneType));
|
||||
|
||||
}
|
||||
|
||||
private void SaveExtraField(vCard newCard, vCard card)
|
||||
{
|
||||
card.Notes.Clear();
|
||||
foreach (var item in newCard.Notes)
|
||||
card.Notes.Add(new vCardNote(item.Text));
|
||||
|
||||
card.Organization = newCard.Organization;
|
||||
}
|
||||
|
||||
private void SaveAddresses(vCard NewCard, vCard card)
|
||||
{
|
||||
foreach (var item in NewCard.DeliveryAddresses)
|
||||
{
|
||||
var adr = card.DeliveryAddresses.Where(x => x.AddressType.FirstOrDefault() == item.AddressType.FirstOrDefault()).FirstOrDefault();
|
||||
if (adr != null)
|
||||
{
|
||||
adr.City = item.City;
|
||||
adr.Country = item.Country;
|
||||
adr.PostalCode = item.PostalCode;
|
||||
adr.Region = item.Region;
|
||||
adr.Street = item.Street;
|
||||
}
|
||||
else
|
||||
card.DeliveryAddresses.Add(new vCardDeliveryAddress(item.Street, item.City, item.Region, item.Country,
|
||||
item.PostalCode, item.AddressType.FirstOrDefault()));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private void SavePhone(vCard NewCard, vCard card)
|
||||
{
|
||||
//HomePhone
|
||||
if (NewCard.Phones.GetFirstChoice(vCardPhoneTypes.Home) != null)
|
||||
{
|
||||
if (card.Phones.GetFirstChoice(vCardPhoneTypes.Home) != null)
|
||||
card.Phones.GetFirstChoice(vCardPhoneTypes.Home).FullNumber = NewCard.Phones.GetFirstChoice(vCardPhoneTypes.Home).FullNumber;
|
||||
else
|
||||
card.Phones.Add(new vCardPhone(NewCard.Phones.GetFirstChoice(vCardPhoneTypes.Home).FullNumber, vCardPhoneTypes.Home));
|
||||
}
|
||||
else
|
||||
{
|
||||
if (card.Phones.GetFirstChoice(vCardPhoneTypes.Home) != null)
|
||||
card.Phones.GetFirstChoice(vCardPhoneTypes.Home).FullNumber = string.Empty;
|
||||
|
||||
}
|
||||
|
||||
|
||||
//Cellular
|
||||
if (NewCard.Phones.GetFirstChoice(vCardPhoneTypes.Cellular) != null)
|
||||
{
|
||||
if (card.Phones.GetFirstChoice(vCardPhoneTypes.Cellular) != null)
|
||||
card.Phones.GetFirstChoice(vCardPhoneTypes.Cellular).FullNumber = NewCard.Phones.GetFirstChoice(vCardPhoneTypes.Cellular).FullNumber;
|
||||
else
|
||||
card.Phones.Add(new vCardPhone(NewCard.Phones.GetFirstChoice(vCardPhoneTypes.Cellular).FullNumber, vCardPhoneTypes.Cellular));
|
||||
}
|
||||
else
|
||||
{
|
||||
if (card.Phones.GetFirstChoice(vCardPhoneTypes.Cellular) != null)
|
||||
card.Phones.GetFirstChoice(vCardPhoneTypes.Cellular).FullNumber = string.Empty;
|
||||
|
||||
}
|
||||
|
||||
//Work
|
||||
if (NewCard.Phones.GetFirstChoice(vCardPhoneTypes.Work) != null)
|
||||
{
|
||||
if (card.Phones.GetFirstChoice(vCardPhoneTypes.Work) != null)
|
||||
card.Phones.GetFirstChoice(vCardPhoneTypes.Work).FullNumber = NewCard.Phones.GetFirstChoice(vCardPhoneTypes.Work).FullNumber;
|
||||
else
|
||||
card.Phones.Add(new vCardPhone(NewCard.Phones.GetFirstChoice(vCardPhoneTypes.Work).FullNumber, vCardPhoneTypes.Work));
|
||||
}
|
||||
else
|
||||
{
|
||||
if (card.Phones.GetFirstChoice(vCardPhoneTypes.Work) != null)
|
||||
card.Phones.GetFirstChoice(vCardPhoneTypes.Work).FullNumber = string.Empty;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private void SaveEmail(vCard NewCard, vCard card)
|
||||
{
|
||||
//Inernet
|
||||
if (NewCard.EmailAddresses.GetFirstChoice(vCardEmailAddressType.Internet) != null)
|
||||
{
|
||||
if (card.EmailAddresses.GetFirstChoice(vCardEmailAddressType.Internet) != null)
|
||||
card.EmailAddresses.GetFirstChoice(vCardEmailAddressType.Internet).Address
|
||||
= NewCard.EmailAddresses.GetFirstChoice(vCardEmailAddressType.Internet).Address;
|
||||
else
|
||||
card.EmailAddresses.Add(new vCardEmailAddress(NewCard.EmailAddresses.GetFirstChoice(vCardEmailAddressType.Internet).Address,
|
||||
vCardEmailAddressType.Internet));
|
||||
}
|
||||
else
|
||||
{
|
||||
if (card.EmailAddresses.GetFirstChoice(vCardEmailAddressType.Internet) != null)
|
||||
card.EmailAddresses.GetFirstChoice(vCardEmailAddressType.Internet).Address = string.Empty;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void SaveWebUrl(vCard NewCard, vCard card)
|
||||
{
|
||||
|
||||
if (NewCard.Websites.GetFirstChoice(vCardWebsiteTypes.Personal) != null)
|
||||
{
|
||||
if (card.Websites.GetFirstChoice(vCardWebsiteTypes.Personal) != null)
|
||||
card.Websites.GetFirstChoice(vCardWebsiteTypes.Personal).Url = NewCard.Websites.GetFirstChoice(vCardWebsiteTypes.Personal).Url;
|
||||
else
|
||||
card.Websites.Add(new vCardWebsite(NewCard.Websites.GetFirstChoice(vCardWebsiteTypes.Personal).Url, vCardWebsiteTypes.Personal));
|
||||
}
|
||||
else
|
||||
{
|
||||
if (card.Websites.GetFirstChoice(vCardWebsiteTypes.Personal) != null)
|
||||
card.Websites.GetFirstChoice(vCardWebsiteTypes.Personal).Url = string.Empty;
|
||||
|
||||
}
|
||||
|
||||
|
||||
if (NewCard.Websites.GetFirstChoice(vCardWebsiteTypes.Work) != null)
|
||||
{
|
||||
if (card.Websites.GetFirstChoice(vCardWebsiteTypes.Work) != null)
|
||||
card.Websites.GetFirstChoice(vCardWebsiteTypes.Work).Url = NewCard.Websites.GetFirstChoice(vCardWebsiteTypes.Work).Url;
|
||||
else
|
||||
card.Websites.Add(new vCardWebsite(NewCard.Websites.GetFirstChoice(vCardWebsiteTypes.Work).Url, vCardWebsiteTypes.Work));
|
||||
}
|
||||
else
|
||||
{
|
||||
if (card.Websites.GetFirstChoice(vCardWebsiteTypes.Work) != null)
|
||||
card.Websites.GetFirstChoice(vCardWebsiteTypes.Work).Url = string.Empty;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public string GenerateStringFromVCard(vCard card)
|
||||
{
|
||||
vCardStandardWriter writer = new vCardStandardWriter();
|
||||
TextWriter tw = new StringWriter();
|
||||
@@ -237,16 +364,33 @@ namespace VCFEditor.Repository
|
||||
return tw.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Check if some iem in the contact list is modified
|
||||
/// </summary>
|
||||
/// <returns>true for dirty</returns>
|
||||
private bool _dirty;
|
||||
public bool dirty
|
||||
public void ModifyImage(int index, vCardPhoto photo)
|
||||
{
|
||||
get { return _dirty || (_contacts != null && _contacts.Any(x => x.isDirty)); }
|
||||
set { _dirty = value; }
|
||||
if (index > -1)
|
||||
{
|
||||
SetDirtyFlag(index);
|
||||
_contacts[index].card.Photos.Clear();
|
||||
if (photo != null)
|
||||
_contacts[index].card.Photos.Add(photo);
|
||||
}
|
||||
}
|
||||
|
||||
public string GetExtension(string path)
|
||||
{
|
||||
return _fileHandler.GetExtension(path);
|
||||
}
|
||||
|
||||
public void SaveImageToDisk(string imageFile, vCardPhoto image)
|
||||
{
|
||||
_fileHandler.WriteBytesToFile(imageFile, image.GetBytes());
|
||||
}
|
||||
|
||||
public string ChangeExtension(string path, string extension)
|
||||
{
|
||||
return _fileHandler.ChangeExtension(path, extension);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,13 +1,30 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.IO;
|
||||
|
||||
|
||||
namespace vCardEditor.Repository
|
||||
{
|
||||
public class FileHandler : IFileHandler
|
||||
{
|
||||
public bool FileExist(string filename)
|
||||
{
|
||||
return File.Exists(filename);
|
||||
}
|
||||
|
||||
public string GetExtension(string path)
|
||||
{
|
||||
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);
|
||||
}
|
||||
|
||||
public string[] ReadAllLines(string filename)
|
||||
{
|
||||
return File.ReadAllLines(filename);
|
||||
@@ -17,5 +34,14 @@ namespace vCardEditor.Repository
|
||||
{
|
||||
File.WriteAllText(filename, contents);
|
||||
}
|
||||
|
||||
public void WriteBytesToFile(string imageFile, byte[] image)
|
||||
{
|
||||
using (var ms = new MemoryStream(image))
|
||||
{
|
||||
using (var fs = new FileStream(imageFile, FileMode.Create))
|
||||
ms.WriteTo(fs);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
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
|
||||
{
|
||||
string fileName { get; set; }
|
||||
BindingList<Contact> Contacts { get; set; }
|
||||
bool dirty { get; set; }
|
||||
|
||||
BindingList<Contact> LoadContacts(string fileName);
|
||||
void SaveContacts(string fileName);
|
||||
void DeleteContact();
|
||||
BindingList<Contact> FilterContacts(string p);
|
||||
void SaveDirtyFlag(int index);
|
||||
void SaveDirtyVCard(int index, vCard card);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace vCardEditor.Repository
|
||||
{
|
||||
public interface IFileHandler
|
||||
{
|
||||
string[] ReadAllLines(string filename);
|
||||
void WriteAllText(string fileName, string contents);
|
||||
}
|
||||
}
|
||||
13
vCardEditor/Repository/Interfaces/IConfigRepository.cs
Normal file
13
vCardEditor/Repository/Interfaces/IConfigRepository.cs
Normal 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();
|
||||
}
|
||||
}
|
||||
31
vCardEditor/Repository/Interfaces/IContactRepository.cs
Normal file
31
vCardEditor/Repository/Interfaces/IContactRepository.cs
Normal file
@@ -0,0 +1,31 @@
|
||||
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; }
|
||||
bool 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);
|
||||
}
|
||||
}
|
||||
13
vCardEditor/Repository/Interfaces/IFileHandler.cs
Normal file
13
vCardEditor/Repository/Interfaces/IFileHandler.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
namespace vCardEditor.Repository
|
||||
{
|
||||
public interface IFileHandler
|
||||
{
|
||||
void MoveFile(string newFilename, string oldFilename);
|
||||
bool FileExist(string filename);
|
||||
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);
|
||||
}
|
||||
}
|
||||
@@ -25,6 +25,8 @@ namespace Thought.vCards
|
||||
private string postalCode;
|
||||
private string region;
|
||||
private string street;
|
||||
private string postOfficeBox;
|
||||
private string extendedAddress;
|
||||
|
||||
|
||||
/// <summary>
|
||||
@@ -37,14 +39,42 @@ namespace Thought.vCards
|
||||
this.postalCode = string.Empty;
|
||||
this.region = string.Empty;
|
||||
this.street = string.Empty;
|
||||
this.postOfficeBox = string.Empty;
|
||||
this.extendedAddress = string.Empty;
|
||||
this.addressType = new List<vCardDeliveryAddressTypes>();
|
||||
}
|
||||
|
||||
public vCardDeliveryAddress(string street, string city, string region, string country, string postalCode, vCardDeliveryAddressTypes addressType)
|
||||
{
|
||||
AddressType = new List<vCardDeliveryAddressTypes>() { addressType };
|
||||
City = city;
|
||||
Country = country;
|
||||
PostalCode = postalCode;
|
||||
Region = region;
|
||||
Street = street;
|
||||
}
|
||||
|
||||
public vCardDeliveryAddress(string street, string city, string region, string country, string postalCode, string extendedAddress, string postOfficeBox, vCardDeliveryAddressTypes addressType)
|
||||
{
|
||||
AddressType = new List<vCardDeliveryAddressTypes>() { addressType };
|
||||
City = city;
|
||||
Country = country;
|
||||
PostalCode = postalCode;
|
||||
Region = region;
|
||||
Street = street;
|
||||
ExtendedAddress = extendedAddress;
|
||||
PostOfficeBox= postOfficeBox;
|
||||
}
|
||||
|
||||
public vCardDeliveryAddress(List<vCardDeliveryAddressTypes> addressType)
|
||||
{
|
||||
AddressType = addressType ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The type of postal address.
|
||||
/// </summary>
|
||||
public List<vCardDeliveryAddressTypes> AddressType
|
||||
public List<vCardDeliveryAddressTypes> AddressType
|
||||
{
|
||||
get
|
||||
{
|
||||
@@ -219,6 +249,28 @@ namespace Thought.vCards
|
||||
}
|
||||
}
|
||||
|
||||
public string ExtendedAddress
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.extendedAddress ?? string.Empty;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.extendedAddress = value;
|
||||
}
|
||||
}
|
||||
public string PostOfficeBox
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.postOfficeBox ?? string.Empty;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.postOfficeBox = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -21,7 +21,7 @@ namespace Thought.vCards
|
||||
/// </remarks>
|
||||
/// <seealso cref="vCardEmailAddressCollection"/>
|
||||
/// <seealso cref="vCardEmailAddressType"/>
|
||||
public class vCardEmailAddress
|
||||
public class vCardEmailAddress : vCardRoot
|
||||
{
|
||||
|
||||
private string address;
|
||||
|
||||
@@ -16,7 +16,7 @@ namespace Thought.vCards
|
||||
/// <seealso cref="vCardPhoneCollection"/>
|
||||
/// <seealso cref="vCardPhoneTypes"/>
|
||||
[Serializable]
|
||||
public class vCardPhone
|
||||
public class vCardPhone : vCardRoot
|
||||
{
|
||||
|
||||
private string fullNumber;
|
||||
|
||||
@@ -48,7 +48,7 @@ namespace Thought.vCards
|
||||
/// </summary>
|
||||
private Uri url;
|
||||
|
||||
|
||||
public string Extension { get; }
|
||||
|
||||
private string encodedData;
|
||||
|
||||
@@ -60,12 +60,13 @@ namespace Thought.vCards
|
||||
/// An array of bytes containing the raw data from
|
||||
/// any of the supported image formats.
|
||||
/// </param>
|
||||
public vCardPhoto(byte[] buffer)
|
||||
public vCardPhoto(byte[] buffer, string imageType)
|
||||
{
|
||||
if (buffer == null)
|
||||
throw new ArgumentNullException("buffer");
|
||||
|
||||
this.data = (byte[])buffer.Clone();
|
||||
this.Extension = imageType;
|
||||
}
|
||||
|
||||
|
||||
@@ -75,13 +76,14 @@ namespace Thought.vCards
|
||||
/// <param name="url">
|
||||
/// A URL pointing to an image.
|
||||
/// </param>
|
||||
public vCardPhoto(Uri url)
|
||||
public vCardPhoto(Uri url, string imageType)
|
||||
{
|
||||
|
||||
if (url == null)
|
||||
throw new ArgumentNullException("url");
|
||||
|
||||
this.url = url;
|
||||
this.Extension = imageType;
|
||||
}
|
||||
|
||||
|
||||
@@ -110,7 +112,7 @@ namespace Thought.vCards
|
||||
/// <param name="isEncoded">
|
||||
/// Boolean true if is encoded.
|
||||
/// </param>
|
||||
public vCardPhoto(string data, bool isEncoded)
|
||||
public vCardPhoto(string data, bool isEncoded, string imageType)
|
||||
{
|
||||
|
||||
if (string.IsNullOrEmpty(data))
|
||||
@@ -119,7 +121,7 @@ namespace Thought.vCards
|
||||
}
|
||||
|
||||
this.encodedData = data;
|
||||
|
||||
this.Extension = imageType;
|
||||
}
|
||||
|
||||
|
||||
@@ -291,6 +293,7 @@ namespace Thought.vCards
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// The URL of the image.
|
||||
|
||||
6
vCardEditor/Thought.vCards/vCardRoot.cs
Normal file
6
vCardEditor/Thought.vCards/vCardRoot.cs
Normal file
@@ -0,0 +1,6 @@
|
||||
namespace Thought.vCards
|
||||
{
|
||||
public class vCardRoot
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -1225,6 +1225,12 @@ namespace Thought.vCards
|
||||
if (addressParts.Length >= 3)
|
||||
deliveryAddress.Street = addressParts[2].Trim();
|
||||
|
||||
if (addressParts.Length >= 1)
|
||||
deliveryAddress.ExtendedAddress = addressParts[1].Trim();
|
||||
|
||||
if (addressParts.Length >= 0)
|
||||
deliveryAddress.PostOfficeBox = addressParts[0].Trim();
|
||||
|
||||
if (
|
||||
(string.IsNullOrEmpty(deliveryAddress.City)) &&
|
||||
(string.IsNullOrEmpty(deliveryAddress.Country)) &&
|
||||
@@ -1661,6 +1667,7 @@ namespace Thought.vCards
|
||||
// often consist of binary data.
|
||||
|
||||
vCardCertificate certificate = new vCardCertificate();
|
||||
|
||||
certificate.Data = (byte[])property.Value;
|
||||
|
||||
// TODO: Support other key types.
|
||||
@@ -1900,6 +1907,8 @@ namespace Thought.vCards
|
||||
private void ReadInto_PHOTO(vCard card, vCardProperty property)
|
||||
{
|
||||
|
||||
string imageType = property.Subproperties.GetValue("TYPE");
|
||||
|
||||
// The PHOTO property contains an embedded (encoded) image
|
||||
// or a link to an image. A URL (linked) image is supposed
|
||||
// to be indicated with the VALUE=URI subproperty.
|
||||
@@ -1914,7 +1923,7 @@ namespace Thought.vCards
|
||||
// rather than being encoded directly in the vCard.
|
||||
|
||||
card.Photos.Add(
|
||||
new vCardPhoto(new Uri(property.ToString())));
|
||||
new vCardPhoto(new Uri(property.ToString()), imageType));
|
||||
|
||||
|
||||
}
|
||||
@@ -1922,13 +1931,15 @@ namespace Thought.vCards
|
||||
{
|
||||
if (property.Value.GetType() == typeof(string))
|
||||
{
|
||||
card.Photos.Add(new vCardPhoto((string)property.Value, true));
|
||||
card.Photos.Add(new vCardPhoto((string)property.Value, true, imageType));
|
||||
}
|
||||
else
|
||||
{
|
||||
card.Photos.Add(new vCardPhoto((byte[])property.Value));
|
||||
card.Photos.Add(new vCardPhoto((byte[])property.Value, imageType));
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1020,8 +1020,10 @@ namespace Thought.vCards
|
||||
|
||||
if (doEmbedded)
|
||||
{
|
||||
properties.Add(
|
||||
new vCardProperty("PHOTO", photo.GetBytes()));
|
||||
|
||||
var EmbeddedProperty = new vCardProperty("PHOTO", photo.GetBytes());
|
||||
EmbeddedProperty.Subproperties.Add("TYPE", "JPG");
|
||||
properties.Add(EmbeddedProperty);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -15,7 +15,7 @@ namespace Thought.vCards
|
||||
/// </summary>
|
||||
/// <seealso cref="vCardWebsiteCollection"/>
|
||||
/// <seealso cref="vCardWebsiteTypes"/>
|
||||
public class vCardWebsite
|
||||
public class vCardWebsite : vCardRoot
|
||||
{
|
||||
|
||||
private string url;
|
||||
|
||||
66
vCardEditor/View/AboutDialog.Designer.cs
generated
66
vCardEditor/View/AboutDialog.Designer.cs
generated
@@ -53,7 +53,8 @@
|
||||
this.tableLayoutPanel.Controls.Add(this.textBoxDescription, 1, 4);
|
||||
this.tableLayoutPanel.Controls.Add(this.okButton, 1, 5);
|
||||
this.tableLayoutPanel.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.tableLayoutPanel.Location = new System.Drawing.Point(9, 9);
|
||||
this.tableLayoutPanel.Location = new System.Drawing.Point(12, 11);
|
||||
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));
|
||||
@@ -62,19 +63,20 @@
|
||||
this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 10F));
|
||||
this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
|
||||
this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 10F));
|
||||
this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
|
||||
this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
|
||||
this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
|
||||
this.tableLayoutPanel.Size = new System.Drawing.Size(417, 265);
|
||||
this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25F));
|
||||
this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25F));
|
||||
this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25F));
|
||||
this.tableLayoutPanel.Size = new System.Drawing.Size(556, 326);
|
||||
this.tableLayoutPanel.TabIndex = 0;
|
||||
//
|
||||
// logoPictureBox
|
||||
//
|
||||
this.logoPictureBox.Image = ((System.Drawing.Image)(resources.GetObject("logoPictureBox.Image")));
|
||||
this.logoPictureBox.Location = new System.Drawing.Point(3, 3);
|
||||
this.logoPictureBox.Location = new System.Drawing.Point(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(109, 98);
|
||||
this.logoPictureBox.Size = new System.Drawing.Size(145, 121);
|
||||
this.logoPictureBox.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
|
||||
this.logoPictureBox.TabIndex = 12;
|
||||
this.logoPictureBox.TabStop = false;
|
||||
@@ -82,11 +84,11 @@
|
||||
// labelProductName
|
||||
//
|
||||
this.labelProductName.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.labelProductName.Location = new System.Drawing.Point(121, 0);
|
||||
this.labelProductName.Margin = new System.Windows.Forms.Padding(6, 0, 3, 0);
|
||||
this.labelProductName.MaximumSize = new System.Drawing.Size(0, 17);
|
||||
this.labelProductName.Location = new System.Drawing.Point(162, 0);
|
||||
this.labelProductName.Margin = new System.Windows.Forms.Padding(8, 0, 4, 0);
|
||||
this.labelProductName.MaximumSize = new System.Drawing.Size(0, 21);
|
||||
this.labelProductName.Name = "labelProductName";
|
||||
this.labelProductName.Size = new System.Drawing.Size(293, 17);
|
||||
this.labelProductName.Size = new System.Drawing.Size(390, 21);
|
||||
this.labelProductName.TabIndex = 19;
|
||||
this.labelProductName.Text = "Nom du produit";
|
||||
this.labelProductName.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
@@ -94,11 +96,11 @@
|
||||
// labelVersion
|
||||
//
|
||||
this.labelVersion.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.labelVersion.Location = new System.Drawing.Point(121, 26);
|
||||
this.labelVersion.Margin = new System.Windows.Forms.Padding(6, 0, 3, 0);
|
||||
this.labelVersion.MaximumSize = new System.Drawing.Size(0, 17);
|
||||
this.labelVersion.Location = new System.Drawing.Point(162, 32);
|
||||
this.labelVersion.Margin = new System.Windows.Forms.Padding(8, 0, 4, 0);
|
||||
this.labelVersion.MaximumSize = new System.Drawing.Size(0, 21);
|
||||
this.labelVersion.Name = "labelVersion";
|
||||
this.labelVersion.Size = new System.Drawing.Size(293, 17);
|
||||
this.labelVersion.Size = new System.Drawing.Size(390, 21);
|
||||
this.labelVersion.TabIndex = 0;
|
||||
this.labelVersion.Text = "Version";
|
||||
this.labelVersion.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
@@ -106,11 +108,11 @@
|
||||
// labelCopyright
|
||||
//
|
||||
this.labelCopyright.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.labelCopyright.Location = new System.Drawing.Point(121, 52);
|
||||
this.labelCopyright.Margin = new System.Windows.Forms.Padding(6, 0, 3, 0);
|
||||
this.labelCopyright.MaximumSize = new System.Drawing.Size(0, 17);
|
||||
this.labelCopyright.Location = new System.Drawing.Point(162, 64);
|
||||
this.labelCopyright.Margin = new System.Windows.Forms.Padding(8, 0, 4, 0);
|
||||
this.labelCopyright.MaximumSize = new System.Drawing.Size(0, 21);
|
||||
this.labelCopyright.Name = "labelCopyright";
|
||||
this.labelCopyright.Size = new System.Drawing.Size(293, 17);
|
||||
this.labelCopyright.Size = new System.Drawing.Size(390, 21);
|
||||
this.labelCopyright.TabIndex = 21;
|
||||
this.labelCopyright.Text = "Copyright";
|
||||
this.labelCopyright.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
@@ -118,11 +120,11 @@
|
||||
// labelCompanyName
|
||||
//
|
||||
this.labelCompanyName.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.labelCompanyName.Location = new System.Drawing.Point(121, 78);
|
||||
this.labelCompanyName.Margin = new System.Windows.Forms.Padding(6, 0, 3, 0);
|
||||
this.labelCompanyName.MaximumSize = new System.Drawing.Size(0, 17);
|
||||
this.labelCompanyName.Location = new System.Drawing.Point(162, 96);
|
||||
this.labelCompanyName.Margin = new System.Windows.Forms.Padding(8, 0, 4, 0);
|
||||
this.labelCompanyName.MaximumSize = new System.Drawing.Size(0, 21);
|
||||
this.labelCompanyName.Name = "labelCompanyName";
|
||||
this.labelCompanyName.Size = new System.Drawing.Size(293, 17);
|
||||
this.labelCompanyName.Size = new System.Drawing.Size(390, 21);
|
||||
this.labelCompanyName.TabIndex = 22;
|
||||
this.labelCompanyName.Text = "Nom de la société";
|
||||
this.labelCompanyName.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
@@ -130,13 +132,13 @@
|
||||
// textBoxDescription
|
||||
//
|
||||
this.textBoxDescription.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.textBoxDescription.Location = new System.Drawing.Point(121, 107);
|
||||
this.textBoxDescription.Margin = new System.Windows.Forms.Padding(6, 3, 3, 3);
|
||||
this.textBoxDescription.Location = new System.Drawing.Point(162, 132);
|
||||
this.textBoxDescription.Margin = new System.Windows.Forms.Padding(8, 4, 4, 4);
|
||||
this.textBoxDescription.Multiline = true;
|
||||
this.textBoxDescription.Name = "textBoxDescription";
|
||||
this.textBoxDescription.ReadOnly = true;
|
||||
this.textBoxDescription.ScrollBars = System.Windows.Forms.ScrollBars.Both;
|
||||
this.textBoxDescription.Size = new System.Drawing.Size(293, 126);
|
||||
this.textBoxDescription.Size = new System.Drawing.Size(390, 155);
|
||||
this.textBoxDescription.TabIndex = 23;
|
||||
this.textBoxDescription.TabStop = false;
|
||||
this.textBoxDescription.Text = "Description";
|
||||
@@ -145,24 +147,26 @@
|
||||
//
|
||||
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(339, 239);
|
||||
this.okButton.Location = new System.Drawing.Point(452, 295);
|
||||
this.okButton.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.okButton.Name = "okButton";
|
||||
this.okButton.Size = new System.Drawing.Size(75, 23);
|
||||
this.okButton.Size = new System.Drawing.Size(100, 27);
|
||||
this.okButton.TabIndex = 24;
|
||||
this.okButton.Text = "&OK";
|
||||
//
|
||||
// AboutDialog
|
||||
//
|
||||
this.AcceptButton = this.okButton;
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(435, 283);
|
||||
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);
|
||||
this.MaximizeBox = false;
|
||||
this.MinimizeBox = false;
|
||||
this.Name = "AboutDialog";
|
||||
this.Padding = new System.Windows.Forms.Padding(9);
|
||||
this.Padding = new System.Windows.Forms.Padding(12, 11, 12, 11);
|
||||
this.ShowIcon = false;
|
||||
this.ShowInTaskbar = false;
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
|
||||
|
||||
@@ -120,288 +120,288 @@
|
||||
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<data name="logoPictureBox.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAYAAABccqhmAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
|
||||
YQUAAEGqSURBVHhe7Z0HvBzVleZnd3Z3djYxOxt/G4wDyYxtbDxmxmMb2ePAZJzT2IAZG5ucg00QJpic
|
||||
TEYSAoRQlkBISCCQQLAGIQkhEAIBkhCgSBBpc6g93333lk6d+qq7uru6qt/TPb/f/8fjha57z/m+r6ur
|
||||
6z39VqxYsWLFihUrVqxYsWLFihUrVqxYsWLFihUrVqxYsWLFihUrVqxYsWLFihUrVqxYsWLFihUrVqxY
|
||||
sWLFihUrVqxYsWLFihUrVqxYsWLFihUrVqxYsWLFihUrVqxYsWLFihUrVqxYsWLFihUrVqxYsWLFihUr
|
||||
VqxYsWLFihUrVqxYsWLFihUrVqxYsWLFihUrVqxYsWLFihUrVqxYsWLFihUrVqxYsWLFihUrVqxYsWLF
|
||||
ihUrVqxYsWLFihUrVqxYsWLFihUrVqxYsWLFihUrVqxYsWLFihUrVqxYsVRt3bp1H2H0tq1bF23btm2F
|
||||
kGheC7z2Wo7XweuvU94Ab7xBeRO8+WYh28H27YW8Bd56qyVvg7ffbss74J13SvMuePfdrnnvvfcqhR2j
|
||||
I8z+WmJ61wo2kwxmpjmMJnIYTWUwWszgdZvTs9e51b9j61aH+CSwQli0dcuW0cI+3krDq2QDBwvr/YaG
|
||||
Nkk23zYAAGl0qwAArUJgJAcAYEbuBvbYHWH21hbTu0LMLChmpjmMJnIYPWUwWszgNZvTs9c58wAJgCG2
|
||||
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FixYsWKFStWrFixYsWKFStWrFixYsWKFStWrFixYsWKFStWrFixYsWK
|
||||
FStWrFixYsXaOeq3fuv/A1DE2dBR9aYSAAAAAElFTkSuQmCC
|
||||
FStWrFixYsWKFStWrFixYsWKFStWrFixYsWKFStWrFixYsWKFStWrFixYsWKFStWrFixYsWKFStWrFix
|
||||
YsWKFStWrFixYsWKFStWrFixYsWKFStWrFixYsWKFStWrFixYsWKFStWrFixYsWKFStWrFixYsWKFStW
|
||||
rFixYsWKFStWrFixYsWKFStWrFixYsWKFStWrFixVG3dunUfYfS2rVsXbdu2bYWQaF4LvPZajtfB669T
|
||||
3gBvvEF5E7z5ZiHbwfbthbwF3nqrJW+Dt99uyzvgnXdK8y54992uee+99yqFHaMjzP5aYnrXCjaTDGam
|
||||
OYwmchhNZTBazOB1m9Oz17nVv2PrVof4JLBCWLR1y5bRwj7eSsOrZAMHC+v9hoY2STbfNgAAaXSrAACt
|
||||
QmAkBwBgRu4G9tgdYfbWFtO7QswsKGamOYwmchg9ZTBazOA1m9Oz1znzAAmAIbZscWzZsmW9cLC31mCX
|
||||
LHiULD41fiBs0m5+EAMAtAuBsgEAOgmBKgIAMEN3AnvMjjF7a4vpWyFmFhQzzxxGEzmMnjIYLWZQ+s3g
|
||||
dW717/DesJ5RARBAEIzyVhu8ksXilCW/ESEGABF8AVWFAGDmbgV7jK4we2qL6VlLzCxymFlSjCYyGC3l
|
||||
MFpM8XplWm4XAMwzJACG2Lz5WG+5wSlZ2PiwYLaZogBwRgak0c7EgA2pBe0M3s7coBODt6PJAAgws1vY
|
||||
z3WN2VMpTN+6xsySYjSRw2iqFF6vTMtB5yw4ugiAZPPmzeO99ZovWdTosLhWAYDNorkYNhNgJLIzg/CC
|
||||
P3DG4Hzj/ZQaH4j5fQCA0d6CzZUsapReYFi0Nj+MH00fiZQHfsHLiTYBAJq7JiAL2kXAhYnCAECqsQ1G
|
||||
IpH24OWK9hcJgPXejvWXLCQ99Q+EAMBpDF4L2g2F05z09c+24X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+mCcsQhMW2C4oNN2ERhFVhUkVDFIg1U2VZquKbkxbRKdm1rQyNmC+ynjPW3Jw
|
||||
yi7QwDakN6wpGxpFVBkmVTBIgVQnVZqtKnoxbRHtzKxhPmB+cXhrjaxiGy2ANYs1tRW9hkkVDFog1UU/
|
||||
zFYVnZi2CKZPpuMc3gqxyhZrYoewYbGh9ptBCKS6qcJsVcF0wPRSGi/RWMOl2BAbgAmRCXY4w/bIelE7
|
||||
XgqxYjVfTKAjCb/NWLFixYoVK1asWLFixYoVK1asWLFixYoVK1asWLFixYoVK1asWLFixYoVK1asWLFi
|
||||
xYoVK1asWLFixYoVK1asWLFixYoVK1asWLFixYoVK1asWLFixYoVK1asWLFixYoVK1asWLFixdo56rd+
|
||||
6/8DUMTZ0FH1phIAAAAASUVORK5CYII=
|
||||
</value>
|
||||
</data>
|
||||
</root>
|
||||
26
vCardEditor/View/ConfigDialog.Designer.cs
generated
26
vCardEditor/View/ConfigDialog.Designer.cs
generated
@@ -35,41 +35,45 @@
|
||||
//
|
||||
// btnClose
|
||||
//
|
||||
this.btnClose.Location = new System.Drawing.Point(253, 347);
|
||||
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);
|
||||
this.btnClose.Name = "btnClose";
|
||||
this.btnClose.Size = new System.Drawing.Size(75, 23);
|
||||
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(12, 12);
|
||||
this.pgConfig.Location = new System.Drawing.Point(16, 15);
|
||||
this.pgConfig.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.pgConfig.Name = "pgConfig";
|
||||
this.pgConfig.Size = new System.Drawing.Size(316, 329);
|
||||
this.pgConfig.Size = new System.Drawing.Size(421, 405);
|
||||
this.pgConfig.TabIndex = 1;
|
||||
//
|
||||
// btnCancel
|
||||
//
|
||||
this.btnCancel.Location = new System.Drawing.Point(172, 347);
|
||||
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);
|
||||
this.btnCancel.Name = "btnCancel";
|
||||
this.btnCancel.Size = new System.Drawing.Size(75, 23);
|
||||
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
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(337, 382);
|
||||
this.ClientSize = new System.Drawing.Size(449, 470);
|
||||
this.Controls.Add(this.pgConfig);
|
||||
this.Controls.Add(this.btnCancel);
|
||||
this.Controls.Add(this.btnClose);
|
||||
this.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.Name = "ConfigDialog";
|
||||
this.Text = "ConfigDialog";
|
||||
this.Text = "Configuration Dialog";
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -112,9 +112,9 @@
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
<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=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
165
vCardEditor/View/Customs/AddAddressDialog.Designer.cs
generated
Normal file
165
vCardEditor/View/Customs/AddAddressDialog.Designer.cs
generated
Normal file
@@ -0,0 +1,165 @@
|
||||
|
||||
namespace vCardEditor.View.Customs
|
||||
{
|
||||
partial class AddAddressDialog
|
||||
{
|
||||
/// <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.cbHome = new System.Windows.Forms.CheckBox();
|
||||
this.cbWork = new System.Windows.Forms.CheckBox();
|
||||
this.cbPostal = new System.Windows.Forms.CheckBox();
|
||||
this.cbDomestic = new System.Windows.Forms.CheckBox();
|
||||
this.btnOK = new System.Windows.Forms.Button();
|
||||
this.btnCancel = new System.Windows.Forms.Button();
|
||||
this.cbInternational = new System.Windows.Forms.CheckBox();
|
||||
this.cbCustom = new System.Windows.Forms.CheckBox();
|
||||
this.textBox1 = new System.Windows.Forms.TextBox();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// cbHome
|
||||
//
|
||||
this.cbHome.AutoSize = true;
|
||||
this.cbHome.Location = new System.Drawing.Point(12, 12);
|
||||
this.cbHome.Name = "cbHome";
|
||||
this.cbHome.Size = new System.Drawing.Size(67, 21);
|
||||
this.cbHome.TabIndex = 0;
|
||||
this.cbHome.Text = "Home";
|
||||
this.cbHome.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// cbWork
|
||||
//
|
||||
this.cbWork.AutoSize = true;
|
||||
this.cbWork.Location = new System.Drawing.Point(12, 40);
|
||||
this.cbWork.Name = "cbWork";
|
||||
this.cbWork.Size = new System.Drawing.Size(63, 21);
|
||||
this.cbWork.TabIndex = 1;
|
||||
this.cbWork.Text = "Work";
|
||||
this.cbWork.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// cbPostal
|
||||
//
|
||||
this.cbPostal.AutoSize = true;
|
||||
this.cbPostal.Location = new System.Drawing.Point(12, 67);
|
||||
this.cbPostal.Name = "cbPostal";
|
||||
this.cbPostal.Size = new System.Drawing.Size(69, 21);
|
||||
this.cbPostal.TabIndex = 2;
|
||||
this.cbPostal.Text = "Postal";
|
||||
this.cbPostal.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// cbDomestic
|
||||
//
|
||||
this.cbDomestic.AutoSize = true;
|
||||
this.cbDomestic.Location = new System.Drawing.Point(12, 94);
|
||||
this.cbDomestic.Name = "cbDomestic";
|
||||
this.cbDomestic.Size = new System.Drawing.Size(88, 21);
|
||||
this.cbDomestic.TabIndex = 3;
|
||||
this.cbDomestic.Text = "Domestic";
|
||||
this.cbDomestic.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// btnOK
|
||||
//
|
||||
this.btnOK.DialogResult = System.Windows.Forms.DialogResult.OK;
|
||||
this.btnOK.Location = new System.Drawing.Point(95, 187);
|
||||
this.btnOK.Name = "btnOK";
|
||||
this.btnOK.Size = new System.Drawing.Size(75, 23);
|
||||
this.btnOK.TabIndex = 7;
|
||||
this.btnOK.Text = "OK";
|
||||
this.btnOK.UseVisualStyleBackColor = true;
|
||||
this.btnOK.Click += new System.EventHandler(this.btnOK_Click);
|
||||
//
|
||||
// btnCancel
|
||||
//
|
||||
this.btnCancel.CausesValidation = false;
|
||||
this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
|
||||
this.btnCancel.Location = new System.Drawing.Point(176, 187);
|
||||
this.btnCancel.Name = "btnCancel";
|
||||
this.btnCancel.Size = new System.Drawing.Size(75, 23);
|
||||
this.btnCancel.TabIndex = 8;
|
||||
this.btnCancel.Text = "Cancel";
|
||||
this.btnCancel.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// cbInternational
|
||||
//
|
||||
this.cbInternational.AutoSize = true;
|
||||
this.cbInternational.Location = new System.Drawing.Point(12, 121);
|
||||
this.cbInternational.Name = "cbInternational";
|
||||
this.cbInternational.Size = new System.Drawing.Size(108, 21);
|
||||
this.cbInternational.TabIndex = 9;
|
||||
this.cbInternational.Text = "International";
|
||||
this.cbInternational.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// cbCustom
|
||||
//
|
||||
this.cbCustom.AutoSize = true;
|
||||
this.cbCustom.Location = new System.Drawing.Point(12, 148);
|
||||
this.cbCustom.Name = "cbCustom";
|
||||
this.cbCustom.Size = new System.Drawing.Size(81, 21);
|
||||
this.cbCustom.TabIndex = 10;
|
||||
this.cbCustom.Text = "Custom:";
|
||||
this.cbCustom.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// textBox1
|
||||
//
|
||||
this.textBox1.Location = new System.Drawing.Point(90, 149);
|
||||
this.textBox1.Name = "textBox1";
|
||||
this.textBox1.Size = new System.Drawing.Size(161, 22);
|
||||
this.textBox1.TabIndex = 11;
|
||||
//
|
||||
// AddAddress
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(263, 223);
|
||||
this.Controls.Add(this.textBox1);
|
||||
this.Controls.Add(this.cbCustom);
|
||||
this.Controls.Add(this.cbInternational);
|
||||
this.Controls.Add(this.btnCancel);
|
||||
this.Controls.Add(this.btnOK);
|
||||
this.Controls.Add(this.cbDomestic);
|
||||
this.Controls.Add(this.cbPostal);
|
||||
this.Controls.Add(this.cbWork);
|
||||
this.Controls.Add(this.cbHome);
|
||||
this.Name = "AddAddress";
|
||||
this.Text = "Address Type";
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.CheckBox cbHome;
|
||||
private System.Windows.Forms.CheckBox cbWork;
|
||||
private System.Windows.Forms.CheckBox cbPostal;
|
||||
private System.Windows.Forms.CheckBox cbDomestic;
|
||||
private System.Windows.Forms.Button btnOK;
|
||||
private System.Windows.Forms.Button btnCancel;
|
||||
private System.Windows.Forms.CheckBox cbInternational;
|
||||
private System.Windows.Forms.CheckBox cbCustom;
|
||||
private System.Windows.Forms.TextBox textBox1;
|
||||
}
|
||||
}
|
||||
86
vCardEditor/View/Customs/AddAddressDialog.cs
Normal file
86
vCardEditor/View/Customs/AddAddressDialog.cs
Normal file
@@ -0,0 +1,86 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using Thought.vCards;
|
||||
|
||||
namespace vCardEditor.View.Customs
|
||||
{
|
||||
public partial class AddAddressDialog : Form
|
||||
{
|
||||
public List<vCardDeliveryAddressTypes> Addresses { get;}
|
||||
private readonly List<CheckBox> _checkBoxes;
|
||||
|
||||
public AddAddressDialog()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
_checkBoxes = Controls.OfType<CheckBox>().ToList();
|
||||
Addresses = new List<vCardDeliveryAddressTypes>();
|
||||
}
|
||||
|
||||
public AddAddressDialog(List<vCardDeliveryAddressTypes> addressCollection)
|
||||
{
|
||||
InitializeComponent();
|
||||
Addresses = addressCollection;
|
||||
_checkBoxes = Controls.OfType<CheckBox>().ToList();
|
||||
|
||||
foreach (var item in addressCollection)
|
||||
{
|
||||
switch (item.ToString())
|
||||
{
|
||||
case "Home":
|
||||
cbHome.Checked = true;
|
||||
break;
|
||||
|
||||
case "Work":
|
||||
cbWork.Checked = true;
|
||||
break;
|
||||
|
||||
case "Postal":
|
||||
cbPostal.Checked = true;
|
||||
break;
|
||||
|
||||
case "Domestic":
|
||||
cbDomestic.Checked = true;
|
||||
break;
|
||||
|
||||
case "International":
|
||||
cbInternational.Checked = true;
|
||||
break;
|
||||
case "Default":
|
||||
cbCustom.Checked = true;
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void btnOK_Click(object sender, EventArgs e)
|
||||
{
|
||||
var total = _checkBoxes
|
||||
.Where(checkBox => checkBox.Checked);
|
||||
|
||||
if (total.Count() == 0)
|
||||
{
|
||||
MessageBox.Show("One item must be checked!");
|
||||
DialogResult = DialogResult.None;
|
||||
return;
|
||||
}
|
||||
|
||||
foreach (var item in total)
|
||||
{
|
||||
var enumType = (vCardDeliveryAddressTypes)Enum.Parse(typeof(vCardDeliveryAddressTypes), item.Text, true);
|
||||
Addresses.Add(enumType);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
120
vCardEditor/View/Customs/AddAddressDialog.resx
Normal file
120
vCardEditor/View/Customs/AddAddressDialog.resx
Normal 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>
|
||||
252
vCardEditor/View/Customs/AddressBox.Designer.cs
generated
Normal file
252
vCardEditor/View/Customs/AddressBox.Designer.cs
generated
Normal file
@@ -0,0 +1,252 @@
|
||||
|
||||
namespace vCardEditor.View.Customs
|
||||
{
|
||||
partial class AddressBox
|
||||
{
|
||||
/// <summary>
|
||||
/// Variable nécessaire au concepteur.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Nettoyage des ressources utilisées.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true si les ressources managées doivent être supprimées ; sinon, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Code généré par le Concepteur de composants
|
||||
|
||||
/// <summary>
|
||||
/// Méthode requise pour la prise en charge du concepteur - ne modifiez pas
|
||||
/// le contenu de cette méthode avec l'éditeur de code.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.ExtAddrValue = new vCardEditor.View.StateTextBox();
|
||||
this.ExtAdressLabel = new System.Windows.Forms.Label();
|
||||
this.StreetLabel = new System.Windows.Forms.Label();
|
||||
this.StreetValue = new vCardEditor.View.StateTextBox();
|
||||
this.POBoxLabel = new System.Windows.Forms.Label();
|
||||
this.CountryValue = new vCardEditor.View.StateTextBox();
|
||||
this.Country = new System.Windows.Forms.Label();
|
||||
this.POBoxValue = new vCardEditor.View.StateTextBox();
|
||||
this.CityLabel = new System.Windows.Forms.Label();
|
||||
this.RegionValue = new vCardEditor.View.StateTextBox();
|
||||
this.CityValue = new vCardEditor.View.StateTextBox();
|
||||
this.StateLabel = new System.Windows.Forms.Label();
|
||||
this.ZipLabel = new System.Windows.Forms.Label();
|
||||
this.ZipValue = new vCardEditor.View.StateTextBox();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// ExtAddrValue
|
||||
//
|
||||
this.ExtAddrValue.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.ExtAddrValue.Location = new System.Drawing.Point(90, 45);
|
||||
this.ExtAddrValue.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.ExtAddrValue.Name = "ExtAddrValue";
|
||||
this.ExtAddrValue.oldText = null;
|
||||
this.ExtAddrValue.Size = new System.Drawing.Size(237, 22);
|
||||
this.ExtAddrValue.TabIndex = 27;
|
||||
this.ExtAddrValue.LostFocus += new System.EventHandler(this.Value_TextChanged);
|
||||
this.ExtAddrValue.Validated += new System.EventHandler(this.Value_TextChanged);
|
||||
//
|
||||
// ExtAdressLabel
|
||||
//
|
||||
this.ExtAdressLabel.Location = new System.Drawing.Point(1, 42);
|
||||
this.ExtAdressLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
this.ExtAdressLabel.Name = "ExtAdressLabel";
|
||||
this.ExtAdressLabel.Size = new System.Drawing.Size(87, 23);
|
||||
this.ExtAdressLabel.TabIndex = 26;
|
||||
this.ExtAdressLabel.Text = "Ext Address:";
|
||||
this.ExtAdressLabel.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
//
|
||||
// StreetLabel
|
||||
//
|
||||
this.StreetLabel.Location = new System.Drawing.Point(2, 14);
|
||||
this.StreetLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
this.StreetLabel.Name = "StreetLabel";
|
||||
this.StreetLabel.Size = new System.Drawing.Size(65, 23);
|
||||
this.StreetLabel.TabIndex = 14;
|
||||
this.StreetLabel.Text = "Address:";
|
||||
this.StreetLabel.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
|
||||
//
|
||||
// StreetValue
|
||||
//
|
||||
this.StreetValue.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.StreetValue.Location = new System.Drawing.Point(90, 14);
|
||||
this.StreetValue.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.StreetValue.Name = "StreetValue";
|
||||
this.StreetValue.oldText = "";
|
||||
this.StreetValue.Size = new System.Drawing.Size(613, 22);
|
||||
this.StreetValue.TabIndex = 15;
|
||||
this.StreetValue.LostFocus += new System.EventHandler(this.Value_TextChanged);
|
||||
this.StreetValue.Validated += new System.EventHandler(this.Value_TextChanged);
|
||||
//
|
||||
// POBoxLabel
|
||||
//
|
||||
this.POBoxLabel.Location = new System.Drawing.Point(334, 75);
|
||||
this.POBoxLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
this.POBoxLabel.Name = "POBoxLabel";
|
||||
this.POBoxLabel.Size = new System.Drawing.Size(59, 23);
|
||||
this.POBoxLabel.TabIndex = 16;
|
||||
this.POBoxLabel.Text = "PO Box:";
|
||||
this.POBoxLabel.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
|
||||
|
||||
//
|
||||
// CountryValue
|
||||
//
|
||||
this.CountryValue.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.CountryValue.Location = new System.Drawing.Point(579, 76);
|
||||
this.CountryValue.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.CountryValue.Name = "CountryValue";
|
||||
this.CountryValue.oldText = null;
|
||||
this.CountryValue.Size = new System.Drawing.Size(125, 22);
|
||||
this.CountryValue.TabIndex = 25;
|
||||
this.CountryValue.LostFocus += new System.EventHandler(this.Value_TextChanged);
|
||||
this.CountryValue.Validated += new System.EventHandler(this.Value_TextChanged);
|
||||
//
|
||||
// Country
|
||||
//
|
||||
this.Country.Location = new System.Drawing.Point(505, 76);
|
||||
this.Country.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
this.Country.Name = "Country";
|
||||
this.Country.Size = new System.Drawing.Size(65, 23);
|
||||
this.Country.TabIndex = 24;
|
||||
this.Country.Text = "Country:";
|
||||
this.Country.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
|
||||
//
|
||||
// POBoxValue
|
||||
//
|
||||
this.POBoxValue.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.POBoxValue.Location = new System.Drawing.Point(397, 75);
|
||||
this.POBoxValue.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.POBoxValue.Name = "POBoxValue";
|
||||
this.POBoxValue.oldText = null;
|
||||
this.POBoxValue.Size = new System.Drawing.Size(100, 22);
|
||||
this.POBoxValue.TabIndex = 17;
|
||||
this.POBoxValue.LostFocus += new System.EventHandler(this.Value_TextChanged);
|
||||
this.POBoxValue.Validated += new System.EventHandler(this.Value_TextChanged);
|
||||
//
|
||||
// CityLabel
|
||||
//
|
||||
this.CityLabel.Location = new System.Drawing.Point(338, 45);
|
||||
this.CityLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
this.CityLabel.Name = "CityLabel";
|
||||
this.CityLabel.Size = new System.Drawing.Size(32, 23);
|
||||
this.CityLabel.TabIndex = 18;
|
||||
this.CityLabel.Text = "City:";
|
||||
this.CityLabel.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
|
||||
//
|
||||
// RegionValue
|
||||
//
|
||||
this.RegionValue.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.RegionValue.Location = new System.Drawing.Point(90, 75);
|
||||
this.RegionValue.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.RegionValue.Name = "RegionValue";
|
||||
this.RegionValue.oldText = null;
|
||||
this.RegionValue.Size = new System.Drawing.Size(236, 22);
|
||||
this.RegionValue.TabIndex = 23;
|
||||
this.RegionValue.LostFocus += new System.EventHandler(this.Value_TextChanged);
|
||||
this.RegionValue.Validated += new System.EventHandler(this.Value_TextChanged);
|
||||
//
|
||||
// CityValue
|
||||
//
|
||||
this.CityValue.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.CityValue.Location = new System.Drawing.Point(397, 45);
|
||||
this.CityValue.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.CityValue.Name = "CityValue";
|
||||
this.CityValue.oldText = null;
|
||||
this.CityValue.Size = new System.Drawing.Size(127, 22);
|
||||
this.CityValue.TabIndex = 19;
|
||||
this.CityValue.LostFocus += new System.EventHandler(this.Value_TextChanged);
|
||||
this.CityValue.Validated += new System.EventHandler(this.Value_TextChanged);
|
||||
//
|
||||
// StateLabel
|
||||
//
|
||||
this.StateLabel.Location = new System.Drawing.Point(17, 74);
|
||||
this.StateLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
this.StateLabel.Name = "StateLabel";
|
||||
this.StateLabel.Size = new System.Drawing.Size(61, 23);
|
||||
this.StateLabel.TabIndex = 22;
|
||||
this.StateLabel.Text = "Region:";
|
||||
this.StateLabel.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
|
||||
//
|
||||
// ZipLabel
|
||||
//
|
||||
this.ZipLabel.Location = new System.Drawing.Point(533, 45);
|
||||
this.ZipLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
this.ZipLabel.Name = "ZipLabel";
|
||||
this.ZipLabel.Size = new System.Drawing.Size(37, 23);
|
||||
this.ZipLabel.TabIndex = 20;
|
||||
this.ZipLabel.Text = "Zip:";
|
||||
this.ZipLabel.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
|
||||
//
|
||||
// ZipValue
|
||||
//
|
||||
this.ZipValue.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.ZipValue.Location = new System.Drawing.Point(579, 46);
|
||||
this.ZipValue.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.ZipValue.Name = "ZipValue";
|
||||
this.ZipValue.oldText = null;
|
||||
this.ZipValue.Size = new System.Drawing.Size(124, 22);
|
||||
this.ZipValue.TabIndex = 21;
|
||||
this.ZipValue.LostFocus += new System.EventHandler(this.Value_TextChanged);
|
||||
this.ZipValue.Validated += new System.EventHandler(this.Value_TextChanged);
|
||||
//
|
||||
// AddressBox
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.Controls.Add(this.ExtAddrValue);
|
||||
this.Controls.Add(this.ExtAdressLabel);
|
||||
this.Controls.Add(this.StreetLabel);
|
||||
this.Controls.Add(this.StreetValue);
|
||||
this.Controls.Add(this.POBoxLabel);
|
||||
this.Controls.Add(this.CountryValue);
|
||||
this.Controls.Add(this.Country);
|
||||
this.Controls.Add(this.POBoxValue);
|
||||
this.Controls.Add(this.CityLabel);
|
||||
this.Controls.Add(this.RegionValue);
|
||||
this.Controls.Add(this.CityValue);
|
||||
this.Controls.Add(this.StateLabel);
|
||||
this.Controls.Add(this.ZipLabel);
|
||||
this.Controls.Add(this.ZipValue);
|
||||
this.Name = "AddressBox";
|
||||
this.Size = new System.Drawing.Size(706, 104);
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
internal StateTextBox ExtAddrValue;
|
||||
internal System.Windows.Forms.Label ExtAdressLabel;
|
||||
internal System.Windows.Forms.Label StreetLabel;
|
||||
internal StateTextBox StreetValue;
|
||||
internal System.Windows.Forms.Label POBoxLabel;
|
||||
internal StateTextBox CountryValue;
|
||||
internal System.Windows.Forms.Label Country;
|
||||
internal StateTextBox POBoxValue;
|
||||
internal System.Windows.Forms.Label CityLabel;
|
||||
internal StateTextBox RegionValue;
|
||||
internal StateTextBox CityValue;
|
||||
internal System.Windows.Forms.Label StateLabel;
|
||||
internal System.Windows.Forms.Label ZipLabel;
|
||||
internal StateTextBox ZipValue;
|
||||
}
|
||||
}
|
||||
65
vCardEditor/View/Customs/AddressBox.cs
Normal file
65
vCardEditor/View/Customs/AddressBox.cs
Normal file
@@ -0,0 +1,65 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Windows.Forms;
|
||||
using Thought.vCards;
|
||||
|
||||
namespace vCardEditor.View.Customs
|
||||
{
|
||||
public partial class AddressBox : UserControl
|
||||
{
|
||||
public event EventHandler TextChangedEvent;
|
||||
public List<vCardDeliveryAddressTypes> AddressType { get; set; }
|
||||
|
||||
|
||||
public AddressBox(string street, string city, string region, string country, string postalCode,
|
||||
string extendedAddress, string postOfficeBox, List<vCardDeliveryAddressTypes> addressType)
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
this.AddressType = addressType;
|
||||
CityValue.Text = city;
|
||||
CityValue.oldText = city;
|
||||
|
||||
CountryValue.Text = country;
|
||||
CountryValue.oldText = country;
|
||||
|
||||
ZipValue.Text = postalCode;
|
||||
ZipValue.oldText = postalCode;
|
||||
|
||||
RegionValue.Text = region;
|
||||
RegionValue.oldText = region;
|
||||
|
||||
StreetValue.Text = street;
|
||||
StreetValue.oldText = street;
|
||||
|
||||
ExtAddrValue.Text = extendedAddress;
|
||||
ExtAddrValue.oldText = extendedAddress;
|
||||
|
||||
POBoxValue.Text = postOfficeBox;
|
||||
POBoxValue.oldText = postOfficeBox;
|
||||
}
|
||||
|
||||
private void Value_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
TextChangedEvent?.Invoke(sender, e);
|
||||
}
|
||||
|
||||
public vCardDeliveryAddress getDeliveryAddress()
|
||||
{
|
||||
var deliveryAddress = new vCardDeliveryAddress
|
||||
{
|
||||
City = CityValue.Text,
|
||||
Country = CountryValue.Text,
|
||||
PostalCode = ZipValue.Text,
|
||||
Region = RegionValue.Text,
|
||||
Street = StreetValue.Text,
|
||||
ExtendedAddress = ExtAddrValue.Text,
|
||||
PostOfficeBox = POBoxValue.Text,
|
||||
AddressType = AddressType
|
||||
};
|
||||
|
||||
return deliveryAddress;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
120
vCardEditor/View/Customs/AddressBox.resx
Normal file
120
vCardEditor/View/Customs/AddressBox.resx
Normal 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>
|
||||
230
vCardEditor/View/Customs/AddressTabControl.cs
Normal file
230
vCardEditor/View/Customs/AddressTabControl.cs
Normal file
@@ -0,0 +1,230 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Windows.Forms;
|
||||
using Thought.vCards;
|
||||
using VCFEditor.View;
|
||||
|
||||
namespace vCardEditor.View.Customs
|
||||
{
|
||||
class AddressTabControl : TabControl
|
||||
{
|
||||
public event EventHandler TextChangedEvent;
|
||||
public event EventHandler<EventArg<List<vCardDeliveryAddressTypes>>> AddTab;
|
||||
public event EventHandler<EventArg<int>> RemoveTab;
|
||||
public event EventHandler<EventArg<List<vCardDeliveryAddressTypes>>> ModifyTab;
|
||||
|
||||
public AddressTabControl()
|
||||
{
|
||||
Padding = new Point(20, 20);
|
||||
ShowToolTips = true;
|
||||
DrawMode = TabDrawMode.OwnerDrawFixed;
|
||||
|
||||
DrawItem += tbcAddress_DrawItem;
|
||||
MouseDown += tbcAddress_MouseDown;
|
||||
Selecting += tbcAddress_Selecting;
|
||||
HandleCreated += tbcAddress_HandleCreated;
|
||||
MouseDoubleClick += AddressTabControl_MouseDoubleClick;
|
||||
|
||||
}
|
||||
|
||||
public void getDeliveryAddress(vCard card)
|
||||
{
|
||||
if (TabCount < 2)
|
||||
return;
|
||||
|
||||
card.DeliveryAddresses.Clear();
|
||||
|
||||
for (int i = 0; i < TabCount - 1; i++)
|
||||
{
|
||||
if (TabPages[i].Controls.Count == 0) continue;
|
||||
AddressBox adr = TabPages[i].Controls[0] as AddressBox;
|
||||
card.DeliveryAddresses.Add(adr.getDeliveryAddress());
|
||||
}
|
||||
}
|
||||
|
||||
private void AddressTabControl_MouseDoubleClick(object sender, MouseEventArgs e)
|
||||
{
|
||||
TabPage SlectedTab;
|
||||
for (int i = 0; i < TabPages.Count - 1; ++i)
|
||||
{
|
||||
if (GetTabRect(i).Contains(e.Location))
|
||||
{
|
||||
var AddressBox = TabPages[i].Controls[0] as AddressBox;
|
||||
|
||||
var diag = new AddAddressDialog(AddressBox.AddressType);
|
||||
|
||||
if (diag.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
SlectedTab = TabPages[i];
|
||||
SelectedTab.Text = GetTabTitle(diag.Addresses);
|
||||
SelectedTab.ToolTipText = string.Join(",", diag.Addresses.ConvertAll(f => f.ToString()));
|
||||
|
||||
ModifyTab?.Invoke(sender, new EventArg<List<vCardDeliveryAddressTypes>>(diag.Addresses));
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
[DllImport("user32.dll")]
|
||||
private static extern IntPtr SendMessage(IntPtr hWnd, int msg, IntPtr wp, IntPtr lp);
|
||||
private const int TCM_SETMINTABWIDTH = 0x1300 + 49;
|
||||
private void tbcAddress_HandleCreated(object sender, EventArgs e)
|
||||
{
|
||||
SendMessage(Handle, TCM_SETMINTABWIDTH, IntPtr.Zero, (IntPtr)16);
|
||||
}
|
||||
|
||||
|
||||
private void tbcAddress_Selecting(object sender, TabControlCancelEventArgs e)
|
||||
{
|
||||
if (e.TabPageIndex == TabCount - 1)
|
||||
e.Cancel = true;
|
||||
}
|
||||
|
||||
|
||||
private void tbcAddress_MouseDown(object sender, MouseEventArgs e)
|
||||
{
|
||||
var lastIndex = TabCount - 1;
|
||||
if (GetTabRect(lastIndex).Contains(e.Location))
|
||||
{
|
||||
var diag = new AddAddressDialog();
|
||||
if (diag.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
vCardDeliveryAddress da = new vCardDeliveryAddress();
|
||||
da.AddressType = diag.Addresses;
|
||||
AddtabForAddress(da);
|
||||
AddTab?.Invoke(sender, new EventArg<List<vCardDeliveryAddressTypes>>(diag.Addresses));
|
||||
SelectedIndex = TabCount - 1;
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
for (var i = 0; i < TabPages.Count; i++)
|
||||
{
|
||||
var tabRect = GetTabRect(i);
|
||||
tabRect.Inflate(-2, -2);
|
||||
var closeImage = Properties.Resources.Close;
|
||||
var imageRect = new Rectangle(
|
||||
(tabRect.Right - closeImage.Width),
|
||||
tabRect.Top + (tabRect.Height - closeImage.Height) / 2,
|
||||
closeImage.Width, closeImage.Height);
|
||||
|
||||
if (imageRect.Contains(e.Location))
|
||||
{
|
||||
if (MessageBox.Show("Remove tab?", "Asking", MessageBoxButtons.YesNo) == DialogResult.Yes)
|
||||
{
|
||||
TabPages.RemoveAt(i);
|
||||
SelectedIndex = 0;
|
||||
RemoveTab?.Invoke(sender, new EventArg<int>(i));
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private void tbcAddress_DrawItem(object sender, DrawItemEventArgs e)
|
||||
{
|
||||
if (e.Index > TabCount - 1)
|
||||
return;
|
||||
|
||||
var tabRect = GetTabRect(e.Index);
|
||||
tabRect.Inflate(-2, -2);
|
||||
|
||||
if (e.Index == TabCount - 1)
|
||||
{
|
||||
var addImage = Properties.Resources.Add;
|
||||
e.Graphics.DrawImage(addImage,
|
||||
tabRect.Left + (tabRect.Width - addImage.Width) / 2,
|
||||
tabRect.Top + (tabRect.Height - addImage.Height) / 2);
|
||||
}
|
||||
else
|
||||
{
|
||||
var closeImage = Properties.Resources.Close;
|
||||
e.Graphics.DrawImage(closeImage,
|
||||
(tabRect.Right - closeImage.Width),
|
||||
tabRect.Top + (tabRect.Height - closeImage.Height) / 2);
|
||||
|
||||
TabPage SelectedTab = TabPages[e.Index];
|
||||
Rectangle HeaderRect = GetTabRect(e.Index);
|
||||
SolidBrush TextBrush = new SolidBrush(Color.Black);
|
||||
StringFormat sf = new StringFormat
|
||||
{
|
||||
LineAlignment = StringAlignment.Center
|
||||
};
|
||||
|
||||
if (e.State == DrawItemState.Selected)
|
||||
{
|
||||
Font BoldFont = new Font(Font.Name, Font.Size, FontStyle.Bold);
|
||||
|
||||
e.Graphics.DrawString(SelectedTab.Text, BoldFont, TextBrush, HeaderRect, sf);
|
||||
}
|
||||
else
|
||||
e.Graphics.DrawString(SelectedTab.Text , e.Font, TextBrush, HeaderRect, sf);
|
||||
|
||||
TextBrush.Dispose();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void SetAddresses(vCard card)
|
||||
{
|
||||
ClearTabs();
|
||||
AddTabForEveryAddress(card);
|
||||
}
|
||||
|
||||
private void AddTabForEveryAddress(vCard card)
|
||||
{
|
||||
foreach (var item in card.DeliveryAddresses)
|
||||
AddtabForAddress(item);
|
||||
SelectedIndex = 0;
|
||||
}
|
||||
|
||||
private void AddtabForAddress(vCardDeliveryAddress da)
|
||||
{
|
||||
string title = GetTabTitle(da.AddressType);
|
||||
|
||||
var page = new TabPage($" {title} ");
|
||||
TabPages.Insert(TabCount - 1, page);
|
||||
|
||||
var ab = new AddressBox(da.Street, da.City, da.Region, da.Country,
|
||||
da.PostalCode, da.ExtendedAddress, da.PostOfficeBox, da.AddressType);
|
||||
|
||||
ab.TextChangedEvent += (s, e) => TextChangedEvent?.Invoke(s, e);
|
||||
page.Controls.Add(ab);
|
||||
page.ToolTipText = string.Join(",", da.AddressType.ConvertAll(f => f.ToString()));
|
||||
|
||||
|
||||
}
|
||||
|
||||
private string GetTabTitle(List<vCardDeliveryAddressTypes> addressTypes)
|
||||
{
|
||||
var title = string.Empty;
|
||||
if (addressTypes.Count > 0)
|
||||
{
|
||||
title = addressTypes[0].ToString();
|
||||
if (addressTypes.Count > 1)
|
||||
title += "...";
|
||||
}
|
||||
|
||||
return title;
|
||||
}
|
||||
|
||||
private void ClearTabs()
|
||||
{
|
||||
|
||||
//Remove every tab (except "+"). We don't call Clear() as it doesn't free memory.
|
||||
while (TabCount > 1)
|
||||
TabPages[0].Dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
119
vCardEditor/View/Customs/ColumnsDialog.Designer.cs
generated
Normal file
119
vCardEditor/View/Customs/ColumnsDialog.Designer.cs
generated
Normal 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;
|
||||
}
|
||||
}
|
||||
50
vCardEditor/View/Customs/ColumnsDialog.cs
Normal file
50
vCardEditor/View/Customs/ColumnsDialog.cs
Normal 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
120
vCardEditor/View/Customs/ColumnsDialog.resx
Normal file
120
vCardEditor/View/Customs/ColumnsDialog.resx
Normal 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>
|
||||
98
vCardEditor/View/Customs/CustumInputDialog.Designer.cs
generated
Normal file
98
vCardEditor/View/Customs/CustumInputDialog.Designer.cs
generated
Normal file
@@ -0,0 +1,98 @@
|
||||
|
||||
namespace vCardEditor.View.Customs
|
||||
{
|
||||
partial class CustumInputDialog
|
||||
{
|
||||
/// <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.btnOK = new System.Windows.Forms.Button();
|
||||
this.button2 = new System.Windows.Forms.Button();
|
||||
this.tbInput = new System.Windows.Forms.TextBox();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// btnOK
|
||||
//
|
||||
this.btnOK.DialogResult = System.Windows.Forms.DialogResult.OK;
|
||||
this.btnOK.Location = new System.Drawing.Point(252, 67);
|
||||
this.btnOK.Name = "btnOK";
|
||||
this.btnOK.Size = new System.Drawing.Size(75, 23);
|
||||
this.btnOK.TabIndex = 0;
|
||||
this.btnOK.Text = "OK";
|
||||
this.btnOK.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// button2
|
||||
//
|
||||
this.button2.DialogResult = System.Windows.Forms.DialogResult.Cancel;
|
||||
this.button2.Location = new System.Drawing.Point(171, 67);
|
||||
this.button2.Name = "button2";
|
||||
this.button2.Size = new System.Drawing.Size(75, 23);
|
||||
this.button2.TabIndex = 1;
|
||||
this.button2.Text = "Cancel";
|
||||
this.button2.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// tbInput
|
||||
//
|
||||
this.tbInput.Location = new System.Drawing.Point(80, 26);
|
||||
this.tbInput.Name = "tbInput";
|
||||
this.tbInput.Size = new System.Drawing.Size(247, 22);
|
||||
this.tbInput.TabIndex = 0;
|
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Location = new System.Drawing.Point(13, 30);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(51, 17);
|
||||
this.label1.TabIndex = 3;
|
||||
this.label1.Text = "Label :";
|
||||
//
|
||||
// CustumInputDialog
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(344, 102);
|
||||
this.Controls.Add(this.label1);
|
||||
this.Controls.Add(this.tbInput);
|
||||
this.Controls.Add(this.button2);
|
||||
this.Controls.Add(this.btnOK);
|
||||
this.Name = "CustumInputDialog";
|
||||
this.Text = "Label Dialog";
|
||||
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.CustumInputDialog_FormClosing);
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.Button btnOK;
|
||||
private System.Windows.Forms.Button button2;
|
||||
private System.Windows.Forms.TextBox tbInput;
|
||||
private System.Windows.Forms.Label label1;
|
||||
}
|
||||
}
|
||||
21
vCardEditor/View/Customs/CustumInputDialog.cs
Normal file
21
vCardEditor/View/Customs/CustumInputDialog.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace vCardEditor.View.Customs
|
||||
{
|
||||
public partial class CustumInputDialog : Form
|
||||
{
|
||||
public CustumInputDialog()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
public string input { get; set; }
|
||||
|
||||
private void CustumInputDialog_FormClosing(object sender, FormClosingEventArgs e)
|
||||
{
|
||||
input = tbInput.Text;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
120
vCardEditor/View/Customs/CustumInputDialog.resx
Normal file
120
vCardEditor/View/Customs/CustumInputDialog.resx
Normal 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>
|
||||
158
vCardEditor/View/Customs/ExtendedPanel.Designer.cs
generated
Normal file
158
vCardEditor/View/Customs/ExtendedPanel.Designer.cs
generated
Normal file
@@ -0,0 +1,158 @@
|
||||
|
||||
namespace vCardEditor.View.Customs
|
||||
{
|
||||
partial class ExtendedPanel
|
||||
{
|
||||
/// <summary>
|
||||
/// Variable nécessaire au concepteur.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Nettoyage des ressources utilisées.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true si les ressources managées doivent être supprimées ; sinon, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Code généré par le Concepteur de composants
|
||||
|
||||
/// <summary>
|
||||
/// Méthode requise pour la prise en charge du concepteur - ne modifiez pas
|
||||
/// le contenu de cette méthode avec l'éditeur de code.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.components = new System.ComponentModel.Container();
|
||||
this.gbExtended = new System.Windows.Forms.GroupBox();
|
||||
this.btnAddExtraText = new System.Windows.Forms.Button();
|
||||
this.PanelContent = new System.Windows.Forms.Panel();
|
||||
this.menuPhone = new System.Windows.Forms.ContextMenuStrip(this.components);
|
||||
this.miCell = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.miHome = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.miWork = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.menuWeb = new System.Windows.Forms.ContextMenuStrip(this.components);
|
||||
this.miEmail = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.miWeb = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.gbExtended.SuspendLayout();
|
||||
this.menuPhone.SuspendLayout();
|
||||
this.menuWeb.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// gbExtended
|
||||
//
|
||||
this.gbExtended.Controls.Add(this.btnAddExtraText);
|
||||
this.gbExtended.Controls.Add(this.PanelContent);
|
||||
this.gbExtended.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.gbExtended.Location = new System.Drawing.Point(0, 0);
|
||||
this.gbExtended.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.gbExtended.Name = "gbExtended";
|
||||
this.gbExtended.Padding = new System.Windows.Forms.Padding(4);
|
||||
this.gbExtended.Size = new System.Drawing.Size(367, 155);
|
||||
this.gbExtended.TabIndex = 3;
|
||||
this.gbExtended.TabStop = false;
|
||||
//
|
||||
// btnAddExtraText
|
||||
//
|
||||
this.btnAddExtraText.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.btnAddExtraText.BackColor = System.Drawing.SystemColors.Window;
|
||||
this.btnAddExtraText.Image = global::vCardEditor.Properties.Resources.Add;
|
||||
this.btnAddExtraText.Location = new System.Drawing.Point(316, -3);
|
||||
this.btnAddExtraText.Name = "btnAddExtraText";
|
||||
this.btnAddExtraText.Size = new System.Drawing.Size(39, 23);
|
||||
this.btnAddExtraText.TabIndex = 58;
|
||||
this.btnAddExtraText.UseVisualStyleBackColor = true;
|
||||
this.btnAddExtraText.Click += new System.EventHandler(this.btnAddExtraText_Click);
|
||||
//
|
||||
// PanelContent
|
||||
//
|
||||
this.PanelContent.AutoScroll = true;
|
||||
this.PanelContent.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.PanelContent.Location = new System.Drawing.Point(4, 19);
|
||||
this.PanelContent.Name = "PanelContent";
|
||||
this.PanelContent.Size = new System.Drawing.Size(359, 132);
|
||||
this.PanelContent.TabIndex = 0;
|
||||
//
|
||||
// menuPhone
|
||||
//
|
||||
this.menuPhone.ImageScalingSize = new System.Drawing.Size(20, 20);
|
||||
this.menuPhone.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.miCell,
|
||||
this.miHome,
|
||||
this.miWork});
|
||||
this.menuPhone.Name = "contextMenuStrip1";
|
||||
this.menuPhone.Size = new System.Drawing.Size(120, 76);
|
||||
//
|
||||
// miCell
|
||||
//
|
||||
this.miCell.Name = "miCell";
|
||||
this.miCell.Size = new System.Drawing.Size(119, 24);
|
||||
this.miCell.Text = "Cell";
|
||||
//
|
||||
// miHome
|
||||
//
|
||||
this.miHome.Name = "miHome";
|
||||
this.miHome.Size = new System.Drawing.Size(119, 24);
|
||||
this.miHome.Text = "Home";
|
||||
//
|
||||
// miWork
|
||||
//
|
||||
this.miWork.Name = "miWork";
|
||||
this.miWork.Size = new System.Drawing.Size(119, 24);
|
||||
this.miWork.Text = "Work";
|
||||
//
|
||||
// menuWeb
|
||||
//
|
||||
this.menuWeb.ImageScalingSize = new System.Drawing.Size(20, 20);
|
||||
this.menuWeb.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.miEmail,
|
||||
this.miWeb});
|
||||
this.menuWeb.Name = "contextMenuStrip1";
|
||||
this.menuWeb.Size = new System.Drawing.Size(211, 80);
|
||||
//
|
||||
// miEmail
|
||||
//
|
||||
this.miEmail.Name = "miEmail";
|
||||
this.miEmail.Size = new System.Drawing.Size(210, 24);
|
||||
this.miEmail.Text = "Email";
|
||||
//
|
||||
// miWeb
|
||||
//
|
||||
this.miWeb.Name = "miWeb";
|
||||
this.miWeb.Size = new System.Drawing.Size(210, 24);
|
||||
this.miWeb.Text = "Web";
|
||||
//
|
||||
// ExtendedPanel
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.Controls.Add(this.gbExtended);
|
||||
this.Name = "ExtendedPanel";
|
||||
this.Size = new System.Drawing.Size(367, 155);
|
||||
this.gbExtended.ResumeLayout(false);
|
||||
this.menuPhone.ResumeLayout(false);
|
||||
this.menuWeb.ResumeLayout(false);
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.GroupBox gbExtended;
|
||||
private System.Windows.Forms.Button btnAddExtraText;
|
||||
private System.Windows.Forms.Panel PanelContent;
|
||||
private System.Windows.Forms.ContextMenuStrip menuPhone;
|
||||
private System.Windows.Forms.ToolStripMenuItem miCell;
|
||||
private System.Windows.Forms.ToolStripMenuItem miHome;
|
||||
private System.Windows.Forms.ToolStripMenuItem miWork;
|
||||
private System.Windows.Forms.ContextMenuStrip menuWeb;
|
||||
private System.Windows.Forms.ToolStripMenuItem miEmail;
|
||||
private System.Windows.Forms.ToolStripMenuItem miWeb;
|
||||
}
|
||||
}
|
||||
154
vCardEditor/View/Customs/ExtendedPanel.cs
Normal file
154
vCardEditor/View/Customs/ExtendedPanel.cs
Normal file
@@ -0,0 +1,154 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Windows.Forms;
|
||||
using Thought.vCards;
|
||||
|
||||
namespace vCardEditor.View.Customs
|
||||
{
|
||||
|
||||
public partial class ExtendedPanel : UserControl
|
||||
{
|
||||
public event EventHandler ContentTextChanged;
|
||||
|
||||
public string Caption
|
||||
{
|
||||
get { return PanelContent.Text; }
|
||||
set { PanelContent.Text = value; }
|
||||
}
|
||||
|
||||
public PanelType panelType { get; set; }
|
||||
|
||||
public ExtendedPanel(PanelType _panel)
|
||||
{
|
||||
InitializeComponent();
|
||||
panelType = _panel;
|
||||
miCell.Click += MenuItemClickHandlers;
|
||||
miCell.Tag = new vCardPhone(string.Empty, vCardPhoneTypes.Cellular);
|
||||
|
||||
miHome.Tag = new vCardPhone(string.Empty, vCardPhoneTypes.Home);
|
||||
miHome.Click += MenuItemClickHandlers;
|
||||
|
||||
miWork.Tag = new vCardPhone(string.Empty, vCardPhoneTypes.Home);
|
||||
miWork.Click += MenuItemClickHandlers;
|
||||
|
||||
miEmail.Tag = new vCardEmailAddress(string.Empty, vCardEmailAddressType.Internet);
|
||||
miEmail.Click += MenuItemClickHandlers;
|
||||
|
||||
miWeb.Tag = new vCardWebsite(string.Empty, vCardWebsiteTypes.Personal);
|
||||
miWeb.Click += MenuItemClickHandlers;
|
||||
|
||||
//TODO : For Custom types
|
||||
//CustumInputDialog custom = new CustumInputDialog();
|
||||
//var res = custom.ShowDialog();
|
||||
//if (res == DialogResult.OK)
|
||||
//{
|
||||
// AddControl(custom.input, string.Empty);
|
||||
//}
|
||||
|
||||
}
|
||||
|
||||
private void MenuItemClickHandlers(object sender, EventArgs e)
|
||||
{
|
||||
var tag = (sender as ToolStripMenuItem).Tag;
|
||||
if (tag != null && tag is vCardRoot)
|
||||
AddControl(tag as vCardRoot);
|
||||
}
|
||||
|
||||
|
||||
private void btnAddExtraText_Click(object sender, EventArgs e)
|
||||
{
|
||||
Button btnSender = (Button)sender;
|
||||
Point ptLowerLeft = new Point(0, btnSender.Height);
|
||||
ptLowerLeft = btnSender.PointToScreen(ptLowerLeft);
|
||||
|
||||
switch (panelType)
|
||||
{
|
||||
case PanelType.Phone:
|
||||
menuPhone.Show(ptLowerLeft);
|
||||
break;
|
||||
case PanelType.Web:
|
||||
menuWeb.Show(ptLowerLeft);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void AddControl(vCardRoot card)
|
||||
{
|
||||
Point pt = GetCoordinatesForNewControl();
|
||||
|
||||
RemovableTextBox ctl = new RemovableTextBox(card);
|
||||
|
||||
ctl.Anchor = AnchorStyles.Top | AnchorStyles.Right | AnchorStyles.Left;
|
||||
ctl.Location = pt;
|
||||
ctl.Width = PanelContent.Width - 20; //TODO : Calculte the right size of the scrollbar!
|
||||
|
||||
|
||||
ctl.BoutonRemoveClicked += RemoveControl;
|
||||
ctl.ContentTextChanged += (s, e) => ContentTextChanged?.Invoke(s, e);
|
||||
PanelContent.Controls.Add(ctl);
|
||||
}
|
||||
public List<vCardRoot> GetExtraFields()
|
||||
{
|
||||
List<vCardRoot> result = new List<vCardRoot>();
|
||||
|
||||
foreach (var item in PanelContent.Controls)
|
||||
{
|
||||
var ctl = item as RemovableTextBox;
|
||||
result.Add(ctl.Tag as vCardRoot);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public void ClearFields()
|
||||
{
|
||||
if (PanelContent.Controls.Count > 0)
|
||||
PanelContent.Controls.Clear();
|
||||
}
|
||||
|
||||
private void RemoveControl(object sender, EventArgs e)
|
||||
{
|
||||
var par = (sender as Control).Parent;
|
||||
PanelContent.Controls.Remove(par);
|
||||
|
||||
ReplaceControls();
|
||||
}
|
||||
|
||||
private void ReplaceControls()
|
||||
{
|
||||
for (int i = 0; i < PanelContent.Controls.Count; i++)
|
||||
{
|
||||
var ctl = PanelContent.Controls[i];
|
||||
ctl.Location = new Point(5, (i * 30) + 10);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
private Point GetCoordinatesForNewControl()
|
||||
{
|
||||
Point pt;
|
||||
if (PanelContent.Controls.Count > 0)
|
||||
{
|
||||
var LastControl = PanelContent.Controls[PanelContent.Controls.Count - 1];
|
||||
pt = LastControl.Location;
|
||||
pt.Y += 30;
|
||||
}
|
||||
else
|
||||
pt = new Point(5, 10);
|
||||
|
||||
return pt;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
126
vCardEditor/View/Customs/ExtendedPanel.resx
Normal file
126
vCardEditor/View/Customs/ExtendedPanel.resx
Normal file
@@ -0,0 +1,126 @@
|
||||
<?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>
|
||||
<metadata name="menuPhone.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
<metadata name="menuWeb.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>203, 17</value>
|
||||
</metadata>
|
||||
</root>
|
||||
82
vCardEditor/View/Customs/ExtraTextGroup.Designer.cs
generated
Normal file
82
vCardEditor/View/Customs/ExtraTextGroup.Designer.cs
generated
Normal file
@@ -0,0 +1,82 @@
|
||||
|
||||
namespace vCardEditor.View.UIToolbox
|
||||
{
|
||||
partial class ExtraTextGroup
|
||||
{
|
||||
/// <summary>
|
||||
/// Variable nécessaire au concepteur.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Nettoyage des ressources utilisées.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true si les ressources managées doivent être supprimées ; sinon, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Code généré par le Concepteur de composants
|
||||
|
||||
/// <summary>
|
||||
/// Méthode requise pour la prise en charge du concepteur - ne modifiez pas
|
||||
/// le contenu de cette méthode avec l'éditeur de code.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.btnClose = new System.Windows.Forms.Button();
|
||||
this.txtContent = new vCardEditor.View.StateTextBox();
|
||||
this.label2 = new System.Windows.Forms.Label();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// btnClose
|
||||
//
|
||||
this.btnClose.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.btnClose.BackgroundImage = global::vCardEditor.Properties.Resources.Close;
|
||||
this.btnClose.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
|
||||
this.btnClose.Location = new System.Drawing.Point(594, 18);
|
||||
this.btnClose.Name = "btnClose";
|
||||
this.btnClose.Size = new System.Drawing.Size(23, 23);
|
||||
this.btnClose.TabIndex = 1;
|
||||
this.btnClose.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// txtContent
|
||||
//
|
||||
this.txtContent.Location = new System.Drawing.Point(56, 4);
|
||||
this.txtContent.Multiline = true;
|
||||
this.txtContent.Name = "txtContent";
|
||||
this.txtContent.oldText = null;
|
||||
this.txtContent.Size = new System.Drawing.Size(532, 53);
|
||||
this.txtContent.TabIndex = 2;
|
||||
//
|
||||
// label2
|
||||
//
|
||||
this.label2.AutoSize = true;
|
||||
this.label2.Location = new System.Drawing.Point(3, 7);
|
||||
this.label2.Name = "label2";
|
||||
this.label2.Size = new System.Drawing.Size(0, 17);
|
||||
this.label2.TabIndex = 3;
|
||||
//
|
||||
// ExtraTextGroup
|
||||
//
|
||||
this.Controls.Add(this.label2);
|
||||
this.Controls.Add(this.txtContent);
|
||||
this.Controls.Add(this.btnClose);
|
||||
this.Name = "ExtraTextGroup";
|
||||
this.Size = new System.Drawing.Size(620, 67);
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
private System.Windows.Forms.Button btnClose;
|
||||
private StateTextBox txtContent;
|
||||
private System.Windows.Forms.Label label2;
|
||||
}
|
||||
}
|
||||
34
vCardEditor/View/Customs/ExtraTextGroup.cs
Normal file
34
vCardEditor/View/Customs/ExtraTextGroup.cs
Normal file
@@ -0,0 +1,34 @@
|
||||
using System;
|
||||
using System.Windows.Forms;
|
||||
using vCardEditor.Model;
|
||||
|
||||
namespace vCardEditor.View.UIToolbox
|
||||
{
|
||||
public partial class ExtraTextGroup : UserControl
|
||||
{
|
||||
public event EventHandler ControlDeleted;
|
||||
public event EventHandler TextChangedEvent;
|
||||
|
||||
public ExtraTextGroup()
|
||||
{
|
||||
InitializeComponent();
|
||||
txtContent.TextChanged += (s, e) => TextChangedEvent?.Invoke(s, e);
|
||||
btnClose.Click += (s, e) => ControlDeleted?.Invoke(s, e);
|
||||
|
||||
}
|
||||
|
||||
public vCardPropeties CardProp { get; set; }
|
||||
|
||||
public string Caption
|
||||
{
|
||||
get { return label2.Text; }
|
||||
set { label2.Text = value; }
|
||||
}
|
||||
|
||||
public string Content
|
||||
{
|
||||
get { return txtContent.Text; }
|
||||
set { txtContent.Text = value; }
|
||||
}
|
||||
}
|
||||
}
|
||||
120
vCardEditor/View/Customs/ExtraTextGroup.resx
Normal file
120
vCardEditor/View/Customs/ExtraTextGroup.resx
Normal 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>
|
||||
8
vCardEditor/View/Customs/PanelType.cs
Normal file
8
vCardEditor/View/Customs/PanelType.cs
Normal file
@@ -0,0 +1,8 @@
|
||||
namespace vCardEditor.View.Customs
|
||||
{
|
||||
public enum PanelType
|
||||
{
|
||||
Phone,
|
||||
Web
|
||||
}
|
||||
}
|
||||
91
vCardEditor/View/Customs/RemovableTextBox.Designer.cs
generated
Normal file
91
vCardEditor/View/Customs/RemovableTextBox.Designer.cs
generated
Normal file
@@ -0,0 +1,91 @@
|
||||
|
||||
namespace vCardEditor.View.Customs
|
||||
{
|
||||
partial class RemovableTextBox
|
||||
{
|
||||
/// <summary>
|
||||
/// Variable nécessaire au concepteur.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Nettoyage des ressources utilisées.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true si les ressources managées doivent être supprimées ; sinon, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Code généré par le Concepteur de composants
|
||||
|
||||
/// <summary>
|
||||
/// Méthode requise pour la prise en charge du concepteur - ne modifiez pas
|
||||
/// le contenu de cette méthode avec l'éditeur de code.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.btnRemove = new System.Windows.Forms.Button();
|
||||
this.TitleLabel = new System.Windows.Forms.Label();
|
||||
this.ContentTextBox = new vCardEditor.View.StateTextBox();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// btnRemove
|
||||
//
|
||||
this.btnRemove.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.btnRemove.BackgroundImage = global::vCardEditor.Properties.Resources.Close;
|
||||
this.btnRemove.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
|
||||
this.btnRemove.FlatAppearance.BorderSize = 0;
|
||||
this.btnRemove.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
|
||||
this.btnRemove.Location = new System.Drawing.Point(315, 4);
|
||||
this.btnRemove.Name = "btnRemove";
|
||||
this.btnRemove.Size = new System.Drawing.Size(18, 24);
|
||||
this.btnRemove.TabIndex = 13;
|
||||
this.btnRemove.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// TitleLabel
|
||||
//
|
||||
this.TitleLabel.Location = new System.Drawing.Point(-1, 6);
|
||||
this.TitleLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
this.TitleLabel.Name = "TitleLabel";
|
||||
this.TitleLabel.Size = new System.Drawing.Size(61, 23);
|
||||
this.TitleLabel.TabIndex = 11;
|
||||
this.TitleLabel.Text = "Home :";
|
||||
this.TitleLabel.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
|
||||
//
|
||||
// ContentTextBox
|
||||
//
|
||||
this.ContentTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.ContentTextBox.Location = new System.Drawing.Point(67, 6);
|
||||
this.ContentTextBox.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.ContentTextBox.Name = "ContentTextBox";
|
||||
this.ContentTextBox.oldText = null;
|
||||
this.ContentTextBox.Size = new System.Drawing.Size(241, 22);
|
||||
this.ContentTextBox.TabIndex = 12;
|
||||
//
|
||||
// RemovableTextBox
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.Controls.Add(this.btnRemove);
|
||||
this.Controls.Add(this.TitleLabel);
|
||||
this.Controls.Add(this.ContentTextBox);
|
||||
this.Name = "RemovableTextBox";
|
||||
this.Size = new System.Drawing.Size(332, 35);
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.Button btnRemove;
|
||||
internal System.Windows.Forms.Label TitleLabel;
|
||||
internal StateTextBox ContentTextBox;
|
||||
}
|
||||
}
|
||||
63
vCardEditor/View/Customs/RemovableTextBox.cs
Normal file
63
vCardEditor/View/Customs/RemovableTextBox.cs
Normal file
@@ -0,0 +1,63 @@
|
||||
using System;
|
||||
using System.Windows.Forms;
|
||||
using Thought.vCards;
|
||||
|
||||
namespace vCardEditor.View.Customs
|
||||
{
|
||||
public partial class RemovableTextBox : UserControl
|
||||
{
|
||||
public event EventHandler BoutonRemoveClicked;
|
||||
public event EventHandler ContentTextChanged;
|
||||
public RemovableTextBox()
|
||||
{
|
||||
InitializeComponent();
|
||||
btnRemove.Click += (s, e) => BoutonRemoveClicked?.Invoke(s, e);
|
||||
|
||||
ContentTextBox.LostFocus += (s, e) => ContentTextChanged?.Invoke(s, e);
|
||||
ContentTextBox.Validated += (s, e) => ContentTextChanged?.Invoke(s, e);
|
||||
|
||||
|
||||
}
|
||||
|
||||
public RemovableTextBox(vCardRoot cardType) : this()
|
||||
{
|
||||
//CardType = cardType;
|
||||
this.Tag = cardType;
|
||||
switch (cardType)
|
||||
{
|
||||
case vCardPhone phone:
|
||||
Title = phone.PhoneType.ToString();
|
||||
Content = phone.FullNumber;
|
||||
break;
|
||||
|
||||
case vCardEmailAddress email:
|
||||
Title = email.EmailType.ToString();
|
||||
Content = email.Address;
|
||||
break;
|
||||
|
||||
case vCardWebsite website:
|
||||
Title = website.WebsiteType.ToString();
|
||||
Content = website.Url;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
public string Title
|
||||
{
|
||||
get { return TitleLabel.Text; }
|
||||
set { TitleLabel.Text = value; }
|
||||
}
|
||||
|
||||
public string Content
|
||||
{
|
||||
get { return ContentTextBox.Text; }
|
||||
set { ContentTextBox.Text = value; }
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
120
vCardEditor/View/Customs/RemovableTextBox.resx
Normal file
120
vCardEditor/View/Customs/RemovableTextBox.resx
Normal 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>
|
||||
@@ -1,33 +1,16 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace VCFEditor.View
|
||||
{
|
||||
|
||||
//public class ArgumentEventArgs : EventArgs
|
||||
//{
|
||||
// public object argument { get; set; }
|
||||
//}
|
||||
|
||||
//http://stackoverflow.com/questions/3312134/does-net-have-a-built-in-eventargst
|
||||
|
||||
public class EventArg<T> : EventArgs
|
||||
{
|
||||
// Property variable
|
||||
private readonly T p_EventData;
|
||||
|
||||
// Constructor
|
||||
public EventArg(T data)
|
||||
{
|
||||
p_EventData = data;
|
||||
Data = data;
|
||||
}
|
||||
|
||||
// Property for EventArgs argument
|
||||
public T Data
|
||||
{
|
||||
get { return p_EventData; }
|
||||
}
|
||||
public T Data { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,15 +2,15 @@
|
||||
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
|
||||
{
|
||||
#region All events
|
||||
event EventHandler<EventArg<FormState>> LoadForm;
|
||||
event EventHandler AddContact;
|
||||
event EventHandler DeleteContact;
|
||||
event EventHandler SaveContactsSelected;
|
||||
event EventHandler<EventArg<string>> NewFileOpened;
|
||||
@@ -18,13 +18,30 @@ namespace VCFEditor.View
|
||||
event EventHandler<EventArg<vCard>> BeforeLeavingContact;
|
||||
event EventHandler<EventArg<string>> FilterTextChanged;
|
||||
event EventHandler TextBoxValueChanged;
|
||||
event EventHandler<FormClosingEventArgs> CloseForm;
|
||||
#endregion
|
||||
|
||||
event EventHandler<EventArg<bool>> CloseForm;
|
||||
event EventHandler<EventArg<string>> ModifyImage;
|
||||
event EventHandler ExportImage;
|
||||
event EventHandler ExportQR;
|
||||
event EventHandler<EventArg<List<vCardDeliveryAddressTypes>>> AddressAdded;
|
||||
event EventHandler<EventArg<List<vCardDeliveryAddressTypes>>> AddressModified;
|
||||
event EventHandler<EventArg<int>> AddressRemoved;
|
||||
event EventHandler CopyTextToClipboardEvent;
|
||||
event EventHandler<EventArg<vCardPropeties>> AddExtraField;
|
||||
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);
|
||||
void DisplayMessage(string msg, string caption);
|
||||
string DisplayOpenDialog(string filter);
|
||||
string DisplaySaveDialog(string filename);
|
||||
void UpdateMRUMenu(FixedList MRUList);
|
||||
|
||||
void SendTextToClipBoard(string text);
|
||||
|
||||
FormState GetFormState();
|
||||
void LoadIntialState(FormState state);
|
||||
void AddExtraTextGroup(vCardPropeties type, string content);
|
||||
void DisplayQRCode(string content);
|
||||
}
|
||||
}
|
||||
|
||||
912
vCardEditor/View/MainForm.Designer.cs
generated
912
vCardEditor/View/MainForm.Designer.cs
generated
File diff suppressed because it is too large
Load Diff
@@ -1,5 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Windows.Forms;
|
||||
@@ -8,23 +7,37 @@ using VCFEditor.Model;
|
||||
using Thought.vCards;
|
||||
using vCardEditor.Repository;
|
||||
using vCardEditor.Model;
|
||||
using System.Drawing;
|
||||
using System.Collections.Generic;
|
||||
using vCardEditor.View.Customs;
|
||||
using vCardEditor.View.UIToolbox;
|
||||
|
||||
namespace vCardEditor.View
|
||||
{
|
||||
public partial class MainForm : Form, IMainView
|
||||
{
|
||||
#region event list
|
||||
public event EventHandler<EventArg<FormState>> LoadForm;
|
||||
public event EventHandler<EventArg<vCard>> BeforeLeavingContact;
|
||||
public event EventHandler<EventArg<List<vCardDeliveryAddressTypes>>> AddressModified;
|
||||
public event EventHandler<EventArg<List<vCardDeliveryAddressTypes>>> AddressAdded;
|
||||
public event EventHandler<EventArg<string>> NewFileOpened;
|
||||
public event EventHandler<EventArg<string>> FilterTextChanged;
|
||||
public event EventHandler<EventArg<string>> ModifyImage;
|
||||
public event EventHandler<EventArg<bool>> CloseForm;
|
||||
public event EventHandler<EventArg<int>> AddressRemoved;
|
||||
public event EventHandler<EventArg<vCardPropeties>> AddExtraField;
|
||||
public event EventHandler SaveContactsSelected;
|
||||
public event EventHandler DeleteContact;
|
||||
public event EventHandler<EventArg<string>> NewFileOpened;
|
||||
public event EventHandler AddContact;
|
||||
public event EventHandler ChangeContactsSelected;
|
||||
public event EventHandler<EventArg<vCard>> BeforeLeavingContact;
|
||||
public event EventHandler<EventArg<string>> FilterTextChanged;
|
||||
public event EventHandler TextBoxValueChanged;
|
||||
public event EventHandler<FormClosingEventArgs> CloseForm;
|
||||
#endregion
|
||||
public event EventHandler ExportImage;
|
||||
public event EventHandler ExportQR;
|
||||
public event EventHandler CopyTextToClipboardEvent;
|
||||
|
||||
ComponentResourceManager resources;
|
||||
|
||||
|
||||
public int SelectedContactIndex
|
||||
{
|
||||
get
|
||||
@@ -40,27 +53,28 @@ namespace vCardEditor.View
|
||||
public MainForm()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
resources = new ComponentResourceManager(typeof(MainForm));
|
||||
|
||||
tbcAddress.AddTab += (sender, e) => AddressAdded?.Invoke(sender, e);
|
||||
tbcAddress.RemoveTab += (sender, e) => AddressRemoved?.Invoke(sender, e);
|
||||
tbcAddress.ModifyTab += (sender, e) => AddressModified?.Invoke(sender, e);
|
||||
tbcAddress.TextChangedEvent += (sender, e) => TextBoxValueChanged?.Invoke(sender, e);
|
||||
btnClearFilter.Click += (sender, e) => textBoxFilter.Clear();
|
||||
extendedPanelPhones.ContentTextChanged += (sender, e) => TextBoxValueChanged?.Invoke(sender, e);
|
||||
extendedPanelWeb.ContentTextChanged += (sender, e) => TextBoxValueChanged?.Invoke(sender, e);
|
||||
BuildMRUMenu();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private void tbsOpen_Click(object sender, EventArgs e)
|
||||
{
|
||||
DialogResult result = openFileDialog.ShowDialog();
|
||||
if (result == DialogResult.OK)
|
||||
OpenNewFile(sender, openFileDialog.FileName);
|
||||
|
||||
NewFileOpened?.Invoke(sender, new EventArg<string>(string.Empty));
|
||||
}
|
||||
|
||||
public void DisplayContacts(BindingList<Contact> contacts)
|
||||
public void DisplayContacts(SortableBindingList<Contact> contacts)
|
||||
{
|
||||
if (contacts != null)
|
||||
this.bsContacts.DataSource = contacts;
|
||||
bsContacts.DataSource = contacts;
|
||||
|
||||
}
|
||||
|
||||
@@ -69,77 +83,132 @@ namespace vCardEditor.View
|
||||
if (SaveContactsSelected != null)
|
||||
{
|
||||
//make sure the last changes in the textboxes is saved.
|
||||
this.Validate();
|
||||
Validate();
|
||||
SaveContactsSelected(sender, e);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void tbsNew_Click(object sender, EventArgs e)
|
||||
{
|
||||
AddContact?.Invoke(sender, e);
|
||||
}
|
||||
|
||||
private void dgContacts_SelectionChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (ChangeContactsSelected != null && dgContacts.CurrentCell != null)
|
||||
ChangeContactsSelected(sender, new EventArg<vCard>(getvCard()));
|
||||
|
||||
{
|
||||
vCard data = GetvCardFromWindow();
|
||||
ChangeContactsSelected(sender, new EventArg<vCard>(data));
|
||||
}
|
||||
else
|
||||
ChangeContactsSelected(sender, new EventArg<vCard>(null));
|
||||
}
|
||||
|
||||
private void Value_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (TextBoxValueChanged != null)
|
||||
TextBoxValueChanged(sender, e);
|
||||
TextBoxValueChanged?.Invoke(sender, e);
|
||||
}
|
||||
|
||||
public void DisplayContactDetail(vCard card, string FileName)
|
||||
{
|
||||
|
||||
if (card == null)
|
||||
throw new ArgumentException("card");
|
||||
throw new ArgumentException("vCard must be valid!");
|
||||
|
||||
//set the title with the filename.
|
||||
this.Text = string.Format("{0} - vCard Editor", FileName);
|
||||
|
||||
|
||||
gbContactDetail.Enabled = true;
|
||||
ClearContactDetail();
|
||||
|
||||
Text = string.Format("{0} - vCard Editor", FileName);
|
||||
//gbContactDetail.Enabled = true;
|
||||
tcMainTab.Enabled = true;
|
||||
gbNameList.Enabled = true;
|
||||
|
||||
//Formatted Name
|
||||
SetSummaryValue(FormattedTitleValue, card.Title);
|
||||
SetSummaryValue(firstNameValue, card.GivenName);
|
||||
SetSummaryValue(lastNameValue, card.FamilyName);
|
||||
SetSummaryValue(middleNameValue, card.AdditionalNames);
|
||||
SetSummaryValue(FormattedNameValue, card.FormattedName);
|
||||
|
||||
SetAddressesValues(card);
|
||||
SetPhotoValue(card.Photos);
|
||||
|
||||
//Home Phone
|
||||
SetSummaryValue(HomePhoneValue, card.Phones.GetFirstChoice(vCardPhoneTypes.Home));
|
||||
|
||||
//Cellular Phone
|
||||
SetSummaryValue(CellularPhoneValue, card.Phones.GetFirstChoice(vCardPhoneTypes.Cellular));
|
||||
|
||||
//Email Address
|
||||
SetSummaryValue(EmailAddressValue, card.EmailAddresses.GetFirstChoice(vCardEmailAddressType.Internet));
|
||||
|
||||
// Personal Home Page
|
||||
SetSummaryValue(PersonalWebSiteValue, card.Websites.GetFirstChoice(vCardWebsiteTypes.Personal));
|
||||
|
||||
|
||||
if (card.Photos.Count > 0)
|
||||
{
|
||||
var photo = card.Photos[0];
|
||||
try
|
||||
{
|
||||
// Get the bytes of the photo if it has
|
||||
// not already been loaded.
|
||||
if (!photo.IsLoaded)
|
||||
photo.Fetch();
|
||||
|
||||
PhotoBox.Image = photo.GetBitmap();
|
||||
}
|
||||
catch
|
||||
{
|
||||
//Empty image icon instead.
|
||||
PhotoBox.Image = ((System.Drawing.Image)(resources.GetObject("PhotoBox.Image")));
|
||||
}
|
||||
}
|
||||
else
|
||||
PhotoBox.Image = ((System.Drawing.Image)(resources.GetObject("PhotoBox.Image")));
|
||||
SetExtraInfos(card);
|
||||
|
||||
SetExtraTabFields(card);
|
||||
|
||||
}
|
||||
|
||||
#region helper methods to populate textboxes.
|
||||
private void SetExtraInfos(vCard card)
|
||||
{
|
||||
foreach (var item in card.EmailAddresses)
|
||||
{
|
||||
extendedPanelWeb.AddControl(item);
|
||||
}
|
||||
|
||||
foreach (var item in card.Websites)
|
||||
{
|
||||
extendedPanelWeb.AddControl(item);
|
||||
}
|
||||
|
||||
foreach (var item in card.Phones)
|
||||
{
|
||||
extendedPanelPhones.AddControl(item);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void SetExtraTabFields(vCard card)
|
||||
{
|
||||
if (card.Notes.Count > 0)
|
||||
{
|
||||
foreach (var note in card.Notes)
|
||||
AddExtraTextGroup(vCardPropeties.NOTE, note.Text);
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(card.Organization))
|
||||
{
|
||||
AddExtraTextGroup(vCardPropeties.ORG, card.Organization);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void AddExtraTextGroup(vCardPropeties type, string content)
|
||||
{
|
||||
ExtraTextGroup etg = new ExtraTextGroup();
|
||||
etg.Content = content;
|
||||
etg.Caption = type.ToString() + " :";
|
||||
etg.CardProp = type;
|
||||
etg.TextChangedEvent += (sender, e) => TextBoxValueChanged?.Invoke(sender, e);
|
||||
etg.ControlDeleted += (sender, e) =>
|
||||
{
|
||||
var send = sender as Control;
|
||||
flowLayoutPanel1.Controls.Remove(send.Parent);
|
||||
};
|
||||
|
||||
flowLayoutPanel1.Controls.Add(etg);
|
||||
}
|
||||
|
||||
public void ClearContactDetail()
|
||||
{
|
||||
//gbContactDetail.Enabled = false;
|
||||
tcMainTab.Enabled = false;
|
||||
gbNameList.Enabled = false;
|
||||
|
||||
SetSummaryValue(firstNameValue, string.Empty);
|
||||
SetSummaryValue(lastNameValue, string.Empty);
|
||||
SetSummaryValue(middleNameValue, string.Empty);
|
||||
SetSummaryValue(FormattedTitleValue, string.Empty);
|
||||
SetSummaryValue(FormattedNameValue, string.Empty);
|
||||
|
||||
SetAddressesValues(new vCard());
|
||||
SetPhotoValue(new vCardPhotoCollection());
|
||||
flowLayoutPanel1.Controls.Clear();
|
||||
extendedPanelPhones.ClearFields();
|
||||
extendedPanelWeb.ClearFields();
|
||||
}
|
||||
|
||||
private void SetSummaryValue(StateTextBox valueLabel, string value)
|
||||
{
|
||||
if (valueLabel == null)
|
||||
@@ -150,28 +219,33 @@ namespace vCardEditor.View
|
||||
valueLabel.oldText = value;
|
||||
}
|
||||
|
||||
private void SetSummaryValue(StateTextBox valueLabel, vCardEmailAddress email)
|
||||
void SetPhotoValue(vCardPhotoCollection photos)
|
||||
{
|
||||
valueLabel.Text = string.Empty;
|
||||
if (email != null)
|
||||
SetSummaryValue(valueLabel, email.Address);
|
||||
}
|
||||
if (photos.Any())
|
||||
{
|
||||
var photo = photos[0];
|
||||
try
|
||||
{
|
||||
// Get the bytes of the photo if it has not already been loaded.
|
||||
if (!photo.IsLoaded)
|
||||
photo.Fetch();
|
||||
|
||||
private void SetSummaryValue(StateTextBox valueLabel, vCardPhone phone)
|
||||
{
|
||||
valueLabel.Text = string.Empty;
|
||||
if (phone != null)
|
||||
SetSummaryValue(valueLabel, phone.FullNumber);
|
||||
PhotoBox.Image = photo.GetBitmap();
|
||||
}
|
||||
catch
|
||||
{
|
||||
//Empty image icon instead.
|
||||
PhotoBox.Image = (Image)resources.GetObject("PhotoBox.Image");
|
||||
}
|
||||
}
|
||||
else
|
||||
PhotoBox.Image = (Image)resources.GetObject("PhotoBox.Image");
|
||||
|
||||
}
|
||||
|
||||
private void SetSummaryValue(StateTextBox valueLabel, vCardWebsite webSite)
|
||||
private void SetAddressesValues(vCard card)
|
||||
{
|
||||
valueLabel.Text = string.Empty;
|
||||
if (webSite != null)
|
||||
SetSummaryValue(valueLabel, webSite.Url.ToString());
|
||||
tbcAddress.SetAddresses(card);
|
||||
}
|
||||
#endregion
|
||||
|
||||
private void tbsDelete_Click(object sender, EventArgs e)
|
||||
{
|
||||
@@ -186,73 +260,110 @@ namespace vCardEditor.View
|
||||
|
||||
private void tbsAbout_Click(object sender, EventArgs e)
|
||||
{
|
||||
AboutDialog dialog = new AboutDialog();
|
||||
dialog.ShowDialog();
|
||||
new AboutDialog().ShowDialog();
|
||||
}
|
||||
|
||||
private void textBoxFilter_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
//Save before leaving contact.
|
||||
if (BeforeLeavingContact != null)
|
||||
BeforeLeavingContact(sender, new EventArg<vCard>(getvCard()));
|
||||
BeforeLeavingContact?.Invoke(sender, new EventArg<vCard>(GetvCardFromWindow()));
|
||||
|
||||
//filter.
|
||||
if (FilterTextChanged != null)
|
||||
FilterTextChanged(sender, new EventArg<string>(textBoxFilter.Text));
|
||||
FilterTextChanged?.Invoke(sender, new EventArg<string>(textBoxFilter.Text));
|
||||
}
|
||||
|
||||
private void btnClearFilter_Click(object sender, EventArgs e)
|
||||
|
||||
|
||||
private vCard GetvCardFromWindow()
|
||||
{
|
||||
textBoxFilter.Text = string.Empty;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Generate a vcard from differents fields
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private vCard getvCard()
|
||||
{
|
||||
vCard card = new vCard();
|
||||
card.FormattedName = this.FormattedNameValue.Text;
|
||||
|
||||
if (!string.IsNullOrEmpty(HomePhoneValue.Text))
|
||||
vCard card = new vCard
|
||||
{
|
||||
card.Phones.Add(
|
||||
new vCardPhone(HomePhoneValue.Text, vCardPhoneTypes.Home));
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(CellularPhoneValue.Text))
|
||||
{
|
||||
card.Phones.Add(
|
||||
new vCardPhone(CellularPhoneValue.Text, vCardPhoneTypes.Cellular));
|
||||
}
|
||||
Title = FormattedTitleValue.Text,
|
||||
FormattedName = FormattedNameValue.Text,
|
||||
GivenName = firstNameValue.Text,
|
||||
AdditionalNames = middleNameValue.Text,
|
||||
FamilyName = lastNameValue.Text,
|
||||
|
||||
if (!string.IsNullOrEmpty(this.EmailAddressValue.Text))
|
||||
{
|
||||
card.EmailAddresses.Add(
|
||||
new vCardEmailAddress(this.EmailAddressValue.Text));
|
||||
}
|
||||
};
|
||||
|
||||
tbcAddress.getDeliveryAddress(card);
|
||||
getExtraPhones(card);
|
||||
getExtraWeb(card);
|
||||
getExtraData(card);
|
||||
return card;
|
||||
}
|
||||
|
||||
private void getExtraPhones(vCard card)
|
||||
{
|
||||
card.Phones.Clear();
|
||||
foreach (var item in extendedPanelPhones.GetExtraFields())
|
||||
{
|
||||
if (item is vCardPhone)
|
||||
{
|
||||
vCardPhone phone = item as vCardPhone;
|
||||
card.Phones.Add(phone);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
private void getExtraWeb(vCard card)
|
||||
{
|
||||
card.Websites.Clear();
|
||||
card.EmailAddresses.Clear();
|
||||
|
||||
foreach (var item in extendedPanelWeb.GetExtraFields())
|
||||
{
|
||||
switch (item)
|
||||
{
|
||||
case vCardEmailAddress email:
|
||||
card.EmailAddresses.Add(email);
|
||||
break;
|
||||
|
||||
case vCardWebsite website:
|
||||
card.Websites.Add(website);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void getExtraData(vCard card)
|
||||
{
|
||||
foreach (var item in flowLayoutPanel1.Controls)
|
||||
{
|
||||
var tbc = item as ExtraTextGroup;
|
||||
switch (tbc.CardProp)
|
||||
{
|
||||
case vCardPropeties.NOTE:
|
||||
card.Notes.Add(tbc.Content);
|
||||
break;
|
||||
case vCardPropeties.ORG:
|
||||
card.Organization = tbc.Content;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void dgContacts_RowLeave(object sender, DataGridViewCellEventArgs e)
|
||||
{
|
||||
if (BeforeLeavingContact != null)
|
||||
BeforeLeavingContact(sender, new EventArg<vCard>(getvCard()));
|
||||
vCard data = GetvCardFromWindow();
|
||||
BeforeLeavingContact?.Invoke(sender, new EventArg<vCard>(data));
|
||||
}
|
||||
|
||||
private void miQuit_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.Close();
|
||||
Close();
|
||||
}
|
||||
|
||||
#region drag&drop
|
||||
/// <summary>
|
||||
/// Make our form accept drag&drop
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
|
||||
private void MainForm_DragEnter(object sender, DragEventArgs e)
|
||||
{
|
||||
if (e.Data.GetDataPresent(DataFormats.FileDrop))
|
||||
@@ -267,65 +378,42 @@ namespace vCardEditor.View
|
||||
return;
|
||||
}
|
||||
|
||||
OpenNewFile(sender, FileList[0]);
|
||||
NewFileOpened(sender, new EventArg<string>(FileList[0]));
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// Open vcf file.
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="file"></param>
|
||||
private void OpenNewFile(object sender, string file)
|
||||
{
|
||||
string ext = System.IO.Path.GetExtension(file);
|
||||
//TODO: Should parse invalid content file...
|
||||
if (ext != ".vcf")
|
||||
{
|
||||
MessageBox.Show("Only vcf extension accepted!");
|
||||
return;
|
||||
}
|
||||
|
||||
if (NewFileOpened != null)
|
||||
NewFileOpened(sender, new EventArg<string>(file));
|
||||
}
|
||||
|
||||
private void BuildMRUMenu()
|
||||
{
|
||||
recentFilesMenuItem.DropDownItemClicked += (s, e) => OpenNewFile(s, e.ClickedItem.Text);
|
||||
|
||||
//Update the MRU Menu entries..
|
||||
recentFilesMenuItem.DropDownItemClicked += (s, e) =>
|
||||
{
|
||||
var evt = new EventArg<string>(e.ClickedItem.Text);
|
||||
NewFileOpened(s, evt);
|
||||
};
|
||||
|
||||
UpdateMRUMenu(ConfigRepository.Instance.Paths);
|
||||
|
||||
}
|
||||
|
||||
public void UpdateMRUMenu(FixedList MRUList)
|
||||
public void UpdateMRUMenu(FixedList MostRecentFilesList)
|
||||
{
|
||||
//No need to go further if no menu entry to load!
|
||||
if (MRUList == null || MRUList.IsEmpty())
|
||||
if (MostRecentFilesList == null || MostRecentFilesList.IsEmpty())
|
||||
return;
|
||||
|
||||
recentFilesMenuItem.DropDownItems.Clear();
|
||||
for (int i = 0; i < MRUList._innerList.Count; i++)
|
||||
recentFilesMenuItem.DropDownItems.Add(MRUList[i]);
|
||||
|
||||
for (int i = 0; i < MostRecentFilesList._innerList.Count; i++)
|
||||
recentFilesMenuItem.DropDownItems.Add(MostRecentFilesList[i]);
|
||||
|
||||
}
|
||||
|
||||
private void MainForm_FormClosing(object sender, FormClosingEventArgs e)
|
||||
{
|
||||
if (CloseForm != null)
|
||||
CloseForm(sender, e);
|
||||
var evt = new EventArg<bool>(false);
|
||||
CloseForm?.Invoke(sender, evt);
|
||||
|
||||
e.Cancel = evt.Data;
|
||||
|
||||
ConfigRepository.Instance.SaveConfig();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Ask user a question
|
||||
/// </summary>
|
||||
/// <param name="msg">question</param>
|
||||
/// <param name="caption">caption</param>
|
||||
/// <returns>true for yes, false for no</returns>
|
||||
public bool AskMessage(string msg, string caption)
|
||||
{
|
||||
bool result = true; // true == yes
|
||||
@@ -340,10 +428,204 @@ namespace vCardEditor.View
|
||||
|
||||
private void miConfig_Click(object sender, EventArgs e)
|
||||
{
|
||||
ConfigDialog dialog = new ConfigDialog();
|
||||
dialog.ShowDialog();
|
||||
new ConfigDialog().ShowDialog();
|
||||
}
|
||||
|
||||
public void DisplayMessage(string msg, string caption)
|
||||
{
|
||||
MessageBox.Show(msg, caption);
|
||||
}
|
||||
public string DisplayOpenDialog(string filter = "")
|
||||
{
|
||||
string filename = string.Empty;
|
||||
openFileDialog.Filter = filter;
|
||||
|
||||
DialogResult result = openFileDialog.ShowDialog();
|
||||
if (result == DialogResult.OK)
|
||||
filename = openFileDialog.FileName;
|
||||
|
||||
return filename;
|
||||
}
|
||||
|
||||
public string DisplaySaveDialog(string filename)
|
||||
{
|
||||
|
||||
var saveFileDialog = new SaveFileDialog
|
||||
{
|
||||
FileName = filename
|
||||
};
|
||||
|
||||
DialogResult result = saveFileDialog.ShowDialog();
|
||||
if (result == DialogResult.OK)
|
||||
filename = saveFileDialog.FileName;
|
||||
|
||||
return filename;
|
||||
}
|
||||
private void PhotoBox_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (ModifyImage != null)
|
||||
{
|
||||
var fileName = DisplayOpenDialog();
|
||||
if (!string.IsNullOrEmpty(fileName))
|
||||
{
|
||||
try
|
||||
{
|
||||
PhotoBox.Image = new Bitmap(fileName);
|
||||
var evt = new EventArg<string>(fileName);
|
||||
ModifyImage(sender, evt);
|
||||
}
|
||||
catch (ArgumentException)
|
||||
{
|
||||
MessageBox.Show($"Invalid file! : {fileName}");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void btnRemoveImage_Click(object sender, EventArgs e)
|
||||
{
|
||||
PhotoBox.Image = (Image)resources.GetObject("PhotoBox.Image");
|
||||
//Remove image from vcf
|
||||
ModifyImage(sender, new EventArg<string>(""));
|
||||
}
|
||||
|
||||
private void btnExportImage_Click(object sender, EventArgs e)
|
||||
{
|
||||
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);
|
||||
|
||||
}
|
||||
|
||||
public void LoadIntialState(FormState state)
|
||||
{
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void addNotesToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
var evt = new EventArg<vCardPropeties>(vCardPropeties.NOTE);
|
||||
AddExtraField?.Invoke(sender, evt);
|
||||
}
|
||||
|
||||
private void addOrgToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
var evt = new EventArg<vCardPropeties>(vCardPropeties.ORG);
|
||||
AddExtraField?.Invoke(sender, evt);
|
||||
}
|
||||
|
||||
private void tbsQR_Click(object sender, EventArgs e)
|
||||
{
|
||||
ExportQR?.Invoke(sender, e);
|
||||
}
|
||||
|
||||
public void DisplayQRCode(string content)
|
||||
{
|
||||
QRDialog qr = new QRDialog(content);
|
||||
qr.ShowDialog();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -112,19 +112,19 @@
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
<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=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<metadata name="menuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<metadata name="menuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
<assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<data name="miOpen.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
|
||||
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAJJSURBVDhPvZJdSNNRGMZ30UVXFllRCAWWF94MgiKqi5Ai
|
||||
YQUAAAAJcEhZcwAAEnQAABJ0Ad5mH3gAAAJJSURBVDhPvZJdSNNRGMZ30UVXFllRCAWWF94MgiKqi5Ai
|
||||
CkWxzIIkTaj5QYWxMKeuTU03NzenrnRZ23RNnVaaUVgxqBSJ0FJHialpYF+KmaGSX7/+bTFbXwRBLzwc
|
||||
eM95fuc5H6L/VkqDnTNqK3lGB99af19xUqOPKUuAfR1jpSWefp1Nz49yT/yhopILiEgsxG3u6bQwNVbr
|
||||
1udROzPDZhzWgt9C9iXpiEgwECYpRlRboWNytMrHPPe2lBlXClWX1VSW5WIuycJUKOeCVkaxKtUXXG3R
|
||||
@@ -139,22 +139,22 @@
|
||||
</data>
|
||||
<data name="miQuit.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
|
||||
YQUAAAH9SURBVDhPpZLdS1NhHMcfCMFuvOj9wrQ5S5a62TKdKSZpu5CVowbzjc1srZh6nDp3EF8YQ8XI
|
||||
G0EEQWqCaHgT1kCJ5aYDmQt1IAYhSN11lX/Ct9+ziXrmEQS/8DkP/J7n++FwnsPOnR+iFmfloCIN39ga
|
||||
NSDkfbKXcoHpOTTWEWoim7hBXDxVEHXfQ8h1H3+/iAh/6AieJjCMXgKbZCcl7912LDs1+DXyCP+C7zDR
|
||||
rAnSWCoYZzPxspwg4ipAQFDjp1eHP76XeFN0hR86Egyydl4cjg0mBMmsdWrwrTUf255i/PbZpIJeJvJD
|
||||
3i0PXNEOOCOt6NsQ4Y0NQFh/C9ZFgrAzH4uOXMT6C7E72SgVUNmzOQD90mOU+otQtVQOQ0AP84oRQtSe
|
||||
EKy05cFvV2GjR4udMZPsGzSEzKgJVMMSroV9zRov98e6E4Jlx118fpWDiEuDCXc9ROsz2W/gXG9JFJIZ
|
||||
6bJh3pKN1fY8zAkVaK4ukQqO3wIVKPxxCFu03cZsnQLfHSqsiqV4/eDySQH9B1VDafKCr01K+EwZ4KKA
|
||||
oIVDl3SNBwJ+jlZJOS7g+fg8fXvBooDfpkJbyVU+5WUVoSQyCC5JIeQFU8b0rE+1mfsLViU6y67xaSVR
|
||||
Tjwk7hCpRDyyAp7pFzeN83W30FNxnU/NxFNCwfeORyoA+w+MrWMTrGDAJwAAAABJRU5ErkJggg==
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAf1JREFUOE+l
|
||||
kt1LU2Ecxx8IwW686P3CtDlLlrrZMp0pJmm7kJWjBvONzWytmHqcOncQXxhDxcgbQQRBaoJoeBPWQInl
|
||||
pgOZC3UgBiFI3XWVf8K337OJeuYRBL/wOQ/8nuf74XCew86dH6IWZ+WgIg3f2Bo1IOR9spdygek5NNYR
|
||||
aiKbuEFcPFUQdd9DyHUff7+ICH/oCJ4mMIxeAptkJyXv3XYsOzX4NfII/4LvMNGsCdJYKhhnM/GynCDi
|
||||
KkBAUOOnV4c/vpd4U3SFHzoSDLJ2XhyODSYEyax1avCtNR/bnmL89tmkgl4m8kPeLQ9c0Q44I63o2xDh
|
||||
jQ1AWH8L1kWCsDMfi45cxPoLsTvZKBVQ2bM5AP3SY5T6i1C1VA5DQA/zihFC1J4QrLTlwW9XYaNHi50x
|
||||
k+wbNITMqAlUwxKuhX3NGi/3x7oTgmXHXXx+lYOIS4MJdz1E6zPZb+Bcb0kUkhnpsmHeko3V9jzMCRVo
|
||||
ri6RCo7fAhUo/HEIW7TdxmydAt8dKqyKpXj94PJJAf0HVUNp8oKvTUr4TBngooCghUOXdI0HAn6OVkk5
|
||||
LuD5+Dx9e8GigN+mQlvJVT7lZRWhJDIILkkh5AVTxvSsT7WZ+wtWJTrLrvFpJVFOPCTuEKlEPLICnukX
|
||||
N43zdbfQU3GdT83EU0LB945HKgD7D4ytYxOsYMAnAAAAAElFTkSuQmCC
|
||||
</value>
|
||||
</data>
|
||||
<data name="miAbout.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
|
||||
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIVSURBVDhPtVJNaxNRFM1PyE+Yn1AUXLjK0uWgDWQZwUUX
|
||||
YQUAAAAJcEhZcwAAEnQAABJ0Ad5mH3gAAAIVSURBVDhPtVJNaxNRFM1PyE+Yn1AUXLjK0uWgDWQZwUUX
|
||||
KsGFBEEcCkIwqBEpGiydsSo2kupsasdo7Yi2toh0sFZjG5JpiZo20/TpVOmH5njvm8BYahEXHji8+968
|
||||
c+55l4n8F0zM+rhVWkHmdg29A/PoK1Yw8uIjOp/3xpvqBgrjLeilZbjNLXxZ34bwt6jexMVCGRndQenl
|
||||
0p+NWHzPXoP3rQ3bAbQhQM0E5Np2BKprbZzrm8TIs8puE+68+r0NwwZiacCwALEBCVcAqet8JlAjk1PZ
|
||||
@@ -166,16 +166,27 @@
|
||||
E9ew//AVxE8OItv/9O/Cf0ck8gud2vKswuxNZgAAAABJRU5ErkJggg==
|
||||
</value>
|
||||
</data>
|
||||
<metadata name="statusStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<metadata name="statusStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>132, 17</value>
|
||||
</metadata>
|
||||
<metadata name="toolStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<metadata name="toolStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>248, 17</value>
|
||||
</metadata>
|
||||
<data name="tbsNew.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
|
||||
YQUAAAAJcEhZcwAAEnQAABJ0Ad5mH3gAAAERSURBVDhPrZDbSgJRGIXnpewd6jXsjSQvIrwoI0RQMChU
|
||||
0iiDPCGiE3ZCRkvR8VzTeBhnyR5/ccaZNnPhB4t9sdf6Ln5hb8QeathNJFVFKF5C8DqL4ksDVHWGDf7j
|
||||
LHyPg6NjviSaFqlu5yQYR+KpupaIkrMknCxT3Y7v/NYYb0ITK1c3BarbWWhLQ7IR0cTKReyZ6lZ0XYei
|
||||
ztHpK4bAc+h1FgQijzSxMptrGIxVSO0xX3AaStFki7bUMVFmaMm/eJMGfIH/MkGzLep0AXn4h/r3CJV3
|
||||
mS9gn2bY4UY/UzQ7E9TqfeTFtnuB+XAfzSHKr11kSl/uBebDiZ89ZCst3OUkdwL28sIVsE83ock+EIQV
|
||||
2Mz2wxeg6/UAAAAASUVORK5CYII=
|
||||
</value>
|
||||
</data>
|
||||
<data name="tbsOpen.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
|
||||
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAJHSURBVDhPxZBdSNNhFMb/F110ZZEVhVBgeeHNICiiuggp
|
||||
YQUAAAAJcEhZcwAAEnQAABJ0Ad5mH3gAAAJHSURBVDhPxZBdSNNhFMb/F110ZZEVhVBgeeHNICiiuggp
|
||||
olAUyyxI0oSaH1QYC3N+tKnp5ubm1JUua5uuqdNKMwr7kApFItTUkWZqVhSVYmao5Nevvy7UoYR3HXh4
|
||||
4XCe33nOKyy3lAY7l9RWMo0O/raWXxEyo5spVYTNvOGyfIRPfW+ptOkXqaPl6T83hcRmExSdgzAz3NVm
|
||||
YWyoYla/B+1M9JtxWLPpaH22JORIjI6gKAMB0jyEimIdo4OlbuaprwVMOOMovammpDADc34qppwUrmnl
|
||||
@@ -191,7 +202,7 @@
|
||||
<data name="tbsSave.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
|
||||
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIySURBVDhPrZLfS5NRGMfff6H7boIuuq2pMZyL1eAt11CW
|
||||
YQUAAAAJcEhZcwAAEnQAABJ0Ad5mH3gAAAIySURBVDhPrZLfS5NRGMfff6H7boIuuq2pMZyL1eAt11CW
|
||||
DcOKsB9vpFmaLtNExco0av6CbIVLJ61Wk3BSkT/AFCkRZSpZmrmiJQ41xSaCwdfznL15XEUX0Reem5f3
|
||||
8znnec4j/Zc8fxYGla91CS3eRTx0z6OpMYS7jmnU1X6B/VYA18snUVoyjsKCt8jLHcH5c36ouCQR2NUJ
|
||||
1Nas4G9ZXlmFKbULh1Kf8lJxSfI+WeCCyopv6q+/h+DQ/DJ2WV5Ao1FgPegRAveDOS4oLfmq/h6dn/DH
|
||||
@@ -207,7 +218,7 @@
|
||||
<data name="tbsDelete.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
|
||||
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAL4SURBVDhPjZFrSJNRHMaPpptu653ZErUsl1JmSVgZ6afU
|
||||
YQUAAAAJcEhZcwAAEnQAABJ0Ad5mH3gAAAL4SURBVDhPjZFrSJNRHMaPpptu653ZErUsl1JmSVgZ6afU
|
||||
eU0plCwRMrEL1Eya6bygJHPeG5aadLFppSUaOkwtL2VmdlHsYiDZly5fJIvYdG454uk927oYfeiBP+ec
|
||||
5zy/5+XlkH/peUXozvFyyYXxEsk787B76lmvSRMhW68TIr9GCGO1fmu0LOTQlDoAM/1rMCFzgGaVLcaO
|
||||
LAP16F0zIcqedV54vj8ObFGxFbOIDQRPXQnA3FMRpk7b42lkCLQ3LmLA3w8v0vgYSvBAj7cYhvZGGJpq
|
||||
@@ -226,7 +237,7 @@
|
||||
<data name="tbsAbout.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
|
||||
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIVSURBVDhPtVJNaxNRFM1PyE+Yn1AUXLjK0uWgDWQZwUUX
|
||||
YQUAAAAJcEhZcwAAEnQAABJ0Ad5mH3gAAAIVSURBVDhPtVJNaxNRFM1PyE+Yn1AUXLjK0uWgDWQZwUUX
|
||||
KsGFBEEcCkIwqBEpGiydsSo2kupsasdo7Yi2toh0sFZjG5JpiZo20/TpVOmH5njvm8BYahEXHji8+968
|
||||
c+55l4n8F0zM+rhVWkHmdg29A/PoK1Yw8uIjOp/3xpvqBgrjLeilZbjNLXxZ34bwt6jexMVCGRndQenl
|
||||
0p+NWHzPXoP3rQ3bAbQhQM0E5Np2BKprbZzrm8TIs8puE+68+r0NwwZiacCwALEBCVcAqet8JlAjk1PZ
|
||||
@@ -238,62 +249,93 @@
|
||||
E9ew//AVxE8OItv/9O/Cf0ck8gud2vKswuxNZgAAAABJRU5ErkJggg==
|
||||
</value>
|
||||
</data>
|
||||
<metadata name="openFileDialog.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<metadata name="openFileDialog.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>353, 17</value>
|
||||
</metadata>
|
||||
<data name="PhotoBox.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAAGYAAABmCAMAAAAOARRQAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
|
||||
YQUAAACHUExURf///y4uLi8vLykpKUBAQEVFRUtLS0REREpKSj09PUFBQd/f3ygoKDk5OU5OTiAgIAAA
|
||||
ADQ0NBwcHBkZGff39+zs7BMTE9nZ2QkJCWlpaebm5qenp/Pz88LCws/Pz4eHh3h4eFhYWJKSkp+fn8XF
|
||||
xWdnZ6+vr3BwcH5+frm5uY2NjV5eXqGhob8kg48AAARnSURBVGhD7ZiLkqI6EEAHoqNAmPAGdXzg23H/
|
||||
//u2u9OiIM4Okq3aW9dTNVVj0vQh5EHI24sXL178T/nMZ8dyOCyP+zzhIvOk85WrIkKNjttPLjbMaSdj
|
||||
JYQFCKFi67DlCpMkK6VQYRPwj1RyyXXm8MpCkCIkyCSC85SrDeGVMUq0Q4Oi7JBygBGSHVgwt19BJis+
|
||||
cIQRVgW1xPedChLZVrHmEAPMC5JA8oHLDNCEnmDBQb1JS6lbMnBHoyExGqEIW6TOpibqXtloAQkIxgSa
|
||||
QAQeW5w4rCfpRJFFS94JEmmPWplZDrbxxUKOD4BM7LGFmd5ZgwaemG4KShDdIPSE2S8O7EUyFrpfbiQI
|
||||
ekYujANZmhgEXgGNubdUHugdE0vBqeBHdqfR3eP7RqbOV0T9f9sxGuqeEfRONuPQPhykw8+sVQO9o44c
|
||||
2ofSujyzOw0ParHj0D6Mw+ucaQIaeGpWyaF9GJDmMv1r4NQBjf3BoX1wQ+waXMs4+ZWLxkRrPvihtaI1
|
||||
Zw7tw9n+XuM61oRD+3AQ9NBaPfg+GDhGdjhrxW+aVvCtE+85tA/z7I8aE4uNR6154MGXtW+ZWDo/h+Hg
|
||||
YXPAMrDN7AaWEjWtHtp5qA0H9mMrHPK0AY3xQzMv6ekZJqjb6sH9mj0xtMHdwBpd7QPrDEBj4m2DLFx4
|
||||
sbWJoNDxxx6H9eZLwI6zFXinmRkASOqH7R7HCUcGP0L38QONrwxtbQn4IsTPgQZQpJZGv6jTiXXngQJh
|
||||
aP9ckZ9hGDSRE2Oj7IL3gc+thjL9hYtMDzGMtythfDT6fVtxKi2LPg1h32xZ5zkXGyedHcaWBOz31f4v
|
||||
naUQn/l8ttnMtvnflLz45/C+nYXbWf+lIJnOV34w4F9tJHYQhMtFr5m6WLpZpmTwzWr/KxBSZXE5e3rh
|
||||
Sb9CcEgplPMwx8KSApBRvHtyg5NOMkoBxIcH0zE9RxwiI/s5zzG4WIQs2l9f6argCCDKnhkL86sFPa3H
|
||||
c8fiJkZkz3y1jRVdq8+D0XP33JIlWjCAQsDTfcu2j/FCnYM82a7xTPJzXFkAiFFl1+GWTKBvOQGC9yo3
|
||||
06qHkuk6whvhagRvpWtzFo6+Uzx6xsNtutlsuJ7naZKk+Xw9omF4iaCYb0bkI2YZ3eg1B3rwyP59cjjs
|
||||
xgKP8Wsa8kiR8/U/IznGtxp9r4CUSkWRUjzAbiIwRoii2+7QG6haispzSz2CYjoefy9i2UgCPxsiLOFK
|
||||
An8rq9Mu9FRAFr5cg0luPfT7LkQEnYb0umjm0J5KpH9xFYPV3U4KYUVsZqG8CCsArrmARUGnmePgCHig
|
||||
ucI1DBVlXU4KE9UcAQjluYGLK7As7nJMlAaoqSeiggZcReiSqMsq7QW6AziDhkpqcAVDReqdU/yEPOBp
|
||||
QZd2Qbmc4icsuDWdgW0Dp/gJT2ss9d1mq8k2wM8L2NPAmqv/HnCpwkgi6vLQtsHNJLyi6nBpDdXlsDjJ
|
||||
vTbyOlxa5+ld4YsXL178Z3h7+w1PM1gbWuVRlwAAAABJRU5ErkJggg==
|
||||
</value>
|
||||
</data>
|
||||
<metadata name="bsContacts.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<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>
|
||||
<metadata name="bsContacts.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>486, 17</value>
|
||||
</metadata>
|
||||
<data name="btnClearFilter.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
|
||||
YQUAAAAJcEhZcwAADrwAAA68AZW8ckkAAAJ4SURBVDhPbZNfSFNxFMdPrdYf18TKNEEo//XUTEqb9kcC
|
||||
NXqTRASH5Z9AVvjQpkv7Y2qUZOq0qHSrUFrDxiJS6GEg6EPP5SDouYcC96DTuT8O+XbO3TWSduDDOfd7
|
||||
zvdw7+/eS//GGNFpB9GEZFX6G6yfYEZeER1Tpa0xTtQ6oUvBj24bJMu12hJz/4f8HPgtN/7rKbFpXhwf
|
||||
xsb8DALOEbgzD0GMgjf3CCIzbmzMTSPgsG9dophT9mLxWT/iHifWXw8h/t6BsOcNvHk5CuEpJ+Lul1h3
|
||||
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oTp57
|
||||
4belFbHhHsTsvYgNdiM2dJ8XjWLt7ZiC1KIpPZnh+qf5qtzFPI0StXkz0rHSbka024pory1B3y1EH3Ql
|
||||
kFq0ng6esSiz4rETXZGn2DVI9NybfgAr5kZErNcRsbUlx2rGL1MNZFY87NXKgm3MnidEL9z7dAjU1yJs
|
||||
bklKwFSLCa0WfURd4lG97CQy8jrXbFEhwjYLQo0NCDXUb4W1cGc7Zg3HwfP8clSzfDR8GJPf62oRuXcH
|
||||
a9dasFpdnRTpRe7exuypk3KAk8oHJ4XfWIpQUxNWL9dgpfJigooqplKFa1UP1Zt4thn+sjPKEjkJ10Ju
|
||||
AYLGcwiWnkewrJzhbDyLhdw8BakVTXoyw9dzh7PwlKiDHhKVDxF9/JKRhWVDMZYLSziX4Fv2UTwi+ixI
|
||||
LVqiVwxf2kGwx1VBlCrHoDHxDzJANOXTp2Ep34Cvmdl4TDRtJbokSC3aUoEBPv1+8KybfXpmuyyQ0DCp
|
||||
0ni3Yyf4lX7qJKpSdY3Uonm0u5OaN0OElGaiIs4yIObNkFp/k+gCZx2jmon+AEJJs9KsJOQkAAAAAElF
|
||||
TkSuQmCC
|
||||
</value>
|
||||
</data>
|
||||
<metadata name="Column1.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="Column2.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.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="btnExportImage.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAL
|
||||
EwAACxMBAJqcGAAAAZFJREFUOE/NkMtKAlEAhn2Ctq26qmPavTdp3b4Iih6gnqMyoqCw0hIru5hJmFlI
|
||||
FBE0pNXo2IzO1YNZGK3+xtOIC81t/fBvDnzf+c+x/J+MREi690BHx5qA4ts7bYEUIas6VmMsEiyHpctn
|
||||
OHeVqO1IbzGxWoZPCVzBH4GmE6hGK7CYV9A654c7cofFiyf07KpgAnLUxGoZChM49zUqyEkKrZCTwb/m
|
||||
qGAhfIv5WBKOgALGr8DEahk8KcBVEayLuHwUkM6K4DICnjiewmc3D5gNPVKY2ZHrBQOhAvqPdDrR4c+D
|
||||
8YmwV+oVYNsSYDXK+IxzA7ZvNxD0H+voOzR6oKE3qNE1zj31R2jOrsI2n1QvqMJj8SJmrouYThBMXRUw
|
||||
GVcxca5gPCpjNCRR2OptJDBv/vj8QrlcRqlUAiEEmqZBkiSIooiXDE/h7q18vaA6+zeY53lwHEfhro0G
|
||||
guqbm8GpVIrCnZ5cvaDy28xmtinMsizaVjJoX+YaCDx81u5J4174HQ7fsBRucyezJvbnsVi+AVtEwzA2
|
||||
nUJSAAAAAElFTkSuQmCC
|
||||
</value>
|
||||
</data>
|
||||
<data name="btnRemoveImage.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAL
|
||||
EwAACxMBAJqcGAAAAJdJREFUOE9jGFzgv7Ex6397exYoFwOA5EBqoFxU8D80lPmLs+lyIF6NTRFY3sls
|
||||
CRCvxWoIXIGz2X90QzDkcLkSmyFEa4YBFA1OpmuAeBnRmmEAashSiEaIQURrBgGIAebkGYDqBTOgF2Au
|
||||
IdX/UA3YxKDKUQE+hUQZAlbkDApx7ArghuBKSCAAjndcTgQCkBxOzQMEGBgA54+vl3zobyEAAAAASUVO
|
||||
RK5CYII=
|
||||
</value>
|
||||
</data>
|
||||
<data name="PhotoBox.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAAGYAAABmCAMAAAAOARRQAAAABGdBTUEAALGPC/xhBQAAAIdQTFRF////
|
||||
Li4uLy8vKSkpQEBARUVFS0tLRERESkpKPT09QUFB39/fKCgoOTk5Tk5OICAgAAAANDQ0HBwcGRkZ9/f3
|
||||
7OzsExMT2dnZCQkJaWlp5ubmp6en8/PzwsLCz8/Ph4eHeHh4WFhYkpKSn5+fxcXFZ2dnr6+vcHBwfn5+
|
||||
ubm5jY2NXl5eoaGhvySDjwAABGdJREFUaEPtmIuSojoQQAeio0CY8AZ1fODbcf//+7a706Igzg6Srdpb
|
||||
11M1VWPS9CHkQcjbixcvXvxP+cxnx3I4LI/7POEi86TzlasiQo2O208uNsxpJ2MlhAUIoWLrsOUKkyQr
|
||||
pVBhE/CPVHLJdebwykKQIiTIJILzlKsN4ZUxSrRDg6LskHKAEZIdWDC3X0EmKz5whBFWBbXE950KEtlW
|
||||
seYQA8wLkkDygcsM0ISeYMFBvUlLqVsycEejITEaoQhbpM6mJupe2WgBCQjGBJpABB5bnDisJ+lEkUVL
|
||||
3gkSaY9amVkOtvHFQo4PgEzssYWZ3lmDBp6YbgpKEN0g9ITZLw7sRTIWul9uJAh6Ri6MA1maGAReAY25
|
||||
t1Qe6B0TS8Gp4Ed2p9Hd4/tGps5XRP1/2zEa6p4R9E4249A+HKTDz6xVA72jjhzah9K6PLM7DQ9qsePQ
|
||||
PozD65xpAhp4albJoX0YkOYy/Wvg1AGN/cGhfXBD7Bpcyzj5lYvGRGs++KG1ojVnDu3D2f5e4zrWhEP7
|
||||
cBD00Fo9+D4YOEZ2OGvFb5pW8K0T7zm0D/PsjxoTi41HrXngwZe1b5lYOj+H4eBhc8AysM3sBpYSNa0e
|
||||
2nmoDQf2Yysc8rQBjfFDMy/p6RkmqNvqwf2aPTG0wd3AGl3tA+sMQGPibYMsXHixtYmg0PHHHof15kvA
|
||||
jrMVeKeZGQBI6oftHscJRwY/QvfxA42vDG1tCfgixM+BBlCklka/qNOJdeeBAmFo/1yRn2EYNJETY6Ps
|
||||
gveBz62GMv2Fi0wPMYy3K2F8NPp9W3EqLYs+DWHfbFnnORcbJ50dxpYE7PfV/i+dpRCf+Xy22cy2+d+U
|
||||
vPjn8L6dhdtZ/6Ugmc5XfjDgX20kdhCEy0WvmbpYulmmZPDNav8rEFJlcTl7euFJv0JwSCmU8zDHwpIC
|
||||
kFG8e3KDk04ySgHEhwfTMT1HHCIj+znPMbhYhCzaX1/pquAIIMqeGQvzqwU9rcdzx+ImRmTPfLWNFV2r
|
||||
z4PRc/fckiVaMIBCwNN9y7aP8UKdgzzZrvFM8nNcWQCIUWXX4ZZMoG85AYL3KjfTqoeS6TrCG+FqBG+l
|
||||
a3MWjr5TPHrGw2262Wy4nudpkqT5fD2iYXiJoJhvRuQjZhnd6DUHevDI/n1yOOzGAo/xaxrySJHz9T8j
|
||||
Oca3Gn2vgJRKRZFSPMBuIjBGiKLb7tAbqFqKynNLPYJiOh5/L2LZSAI/GyIs4UoCfyur0y70VEAWvlyD
|
||||
SW499PsuRASdhvS6aObQnkqkf3EVg9XdTgphRWxmobwIKwCuuYBFQaeZ4+AIeKC5wjUMFWVdTgoT1RwB
|
||||
COW5gYsrsCzuckyUBqipJ6KCBlxF6JKoyyrtBboDOIOGSmpwBUNF6p1T/IQ84GlBl3ZBuZziJyy4NZ2B
|
||||
bQOn+AlPayz13WaryTbAzwvY08Caq/8ecKnCSCLq8tC2wc0kvKLqcGkN1eWwOMm9NvI6XFrn6V3hixcv
|
||||
XvxneHv7DU8zWBta5VGXAAAAAElFTkSuQmCC
|
||||
</value>
|
||||
</data>
|
||||
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
AAABAAkAAAAAAAEAIAAHLwAAlgAAAICAAAABACAAKAgBAJ0vAABgYAAAAQAgAKiUAADFNwEASEgAAAEA
|
||||
|
||||
96
vCardEditor/View/QRDialog.Designer.cs
generated
Normal file
96
vCardEditor/View/QRDialog.Designer.cs
generated
Normal file
@@ -0,0 +1,96 @@
|
||||
|
||||
namespace vCardEditor.View
|
||||
{
|
||||
partial class QRDialog
|
||||
{
|
||||
/// <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.btnExport = new System.Windows.Forms.Button();
|
||||
this.btnClose = new System.Windows.Forms.Button();
|
||||
this.pictureBoxQRCode = new System.Windows.Forms.PictureBox();
|
||||
this.saveFileDialog1 = new System.Windows.Forms.SaveFileDialog();
|
||||
((System.ComponentModel.ISupportInitialize)(this.pictureBoxQRCode)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// btnExport
|
||||
//
|
||||
this.btnExport.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.btnExport.Location = new System.Drawing.Point(464, 385);
|
||||
this.btnExport.Name = "btnExport";
|
||||
this.btnExport.Size = new System.Drawing.Size(75, 28);
|
||||
this.btnExport.TabIndex = 5;
|
||||
this.btnExport.Text = "Export..";
|
||||
this.btnExport.UseVisualStyleBackColor = true;
|
||||
this.btnExport.Click += new System.EventHandler(this.btnExport_Click);
|
||||
//
|
||||
// btnClose
|
||||
//
|
||||
this.btnClose.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.btnClose.Location = new System.Drawing.Point(550, 386);
|
||||
this.btnClose.Name = "btnClose";
|
||||
this.btnClose.Size = new System.Drawing.Size(75, 28);
|
||||
this.btnClose.TabIndex = 4;
|
||||
this.btnClose.Text = "Close";
|
||||
this.btnClose.UseVisualStyleBackColor = true;
|
||||
this.btnClose.Click += new System.EventHandler(this.btnClose_Click);
|
||||
//
|
||||
// pictureBoxQRCode
|
||||
//
|
||||
this.pictureBoxQRCode.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.pictureBoxQRCode.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom;
|
||||
this.pictureBoxQRCode.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
|
||||
this.pictureBoxQRCode.Location = new System.Drawing.Point(12, 12);
|
||||
this.pictureBoxQRCode.Name = "pictureBoxQRCode";
|
||||
this.pictureBoxQRCode.Size = new System.Drawing.Size(613, 367);
|
||||
this.pictureBoxQRCode.TabIndex = 3;
|
||||
this.pictureBoxQRCode.TabStop = false;
|
||||
//
|
||||
// QRDialog
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(640, 422);
|
||||
this.Controls.Add(this.btnExport);
|
||||
this.Controls.Add(this.btnClose);
|
||||
this.Controls.Add(this.pictureBoxQRCode);
|
||||
this.Name = "QRDialog";
|
||||
this.Text = "QR Generator";
|
||||
((System.ComponentModel.ISupportInitialize)(this.pictureBoxQRCode)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.Button btnExport;
|
||||
private System.Windows.Forms.Button btnClose;
|
||||
private System.Windows.Forms.PictureBox pictureBoxQRCode;
|
||||
private System.Windows.Forms.SaveFileDialog saveFileDialog1;
|
||||
}
|
||||
}
|
||||
74
vCardEditor/View/QRDialog.cs
Normal file
74
vCardEditor/View/QRDialog.cs
Normal file
@@ -0,0 +1,74 @@
|
||||
using QRCoder;
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Imaging;
|
||||
using System.IO;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace vCardEditor.View
|
||||
{
|
||||
public partial class QRDialog : Form
|
||||
{
|
||||
public QRDialog(string content)
|
||||
{
|
||||
InitializeComponent();
|
||||
RenderQrCode(content);
|
||||
}
|
||||
|
||||
public void RenderQrCode(string code)
|
||||
{
|
||||
//TODO Change ECCLevel
|
||||
QRCodeGenerator.ECCLevel eccLevel = 0;
|
||||
|
||||
using (QRCodeGenerator qrGenerator = new QRCodeGenerator())
|
||||
using (QRCodeData qrCodeData = qrGenerator.CreateQrCode(code, eccLevel))
|
||||
using (QRCode qrCode = new QRCode(qrCodeData))
|
||||
{
|
||||
pictureBoxQRCode.BackgroundImage = qrCode.GetGraphic(20, Color.Black, Color.White, null, 1);
|
||||
pictureBoxQRCode.Size = new System.Drawing.Size(pictureBoxQRCode.Width, pictureBoxQRCode.Height);
|
||||
pictureBoxQRCode.SizeMode = PictureBoxSizeMode.StretchImage;
|
||||
}
|
||||
}
|
||||
|
||||
private void btnClose_Click(object sender, EventArgs e)
|
||||
{
|
||||
Close();
|
||||
}
|
||||
|
||||
private void btnExport_Click(object sender, EventArgs e)
|
||||
{
|
||||
// Displays a SaveFileDialog so the user can save the Image
|
||||
SaveFileDialog saveFileDialog1 = new SaveFileDialog();
|
||||
saveFileDialog1.Filter = "Bitmap Image|*.bmp|PNG Image|*.png|JPeg Image|*.jpg|Gif Image|*.gif";
|
||||
saveFileDialog1.Title = "Save an Image File";
|
||||
saveFileDialog1.ShowDialog();
|
||||
|
||||
if (saveFileDialog1.FileName != "")
|
||||
{
|
||||
using (FileStream fs = (System.IO.FileStream)saveFileDialog1.OpenFile())
|
||||
{
|
||||
ImageFormat imageFormat = null;
|
||||
switch (saveFileDialog1.FilterIndex)
|
||||
{
|
||||
case 1:
|
||||
imageFormat = ImageFormat.Bmp;
|
||||
break;
|
||||
case 2:
|
||||
imageFormat = ImageFormat.Png;
|
||||
break;
|
||||
case 3:
|
||||
imageFormat = ImageFormat.Jpeg;
|
||||
break;
|
||||
case 4:
|
||||
imageFormat = ImageFormat.Gif;
|
||||
break;
|
||||
default:
|
||||
throw new NotSupportedException("File extension is not supported");
|
||||
}
|
||||
|
||||
pictureBoxQRCode.BackgroundImage.Save(fs, imageFormat);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
123
vCardEditor/View/QRDialog.resx
Normal file
123
vCardEditor/View/QRDialog.resx
Normal file
@@ -0,0 +1,123 @@
|
||||
<?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>
|
||||
<metadata name="saveFileDialog1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
</root>
|
||||
99
vCardEditor/View/SortableBindingList.cs
Normal file
99
vCardEditor/View/SortableBindingList.cs
Normal 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
3
vCardEditor/app.config
Normal file
3
vCardEditor/app.config
Normal file
@@ -0,0 +1,3 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8.1"/></startup></configuration>
|
||||
BIN
vCardEditor/assests/Add.png
Normal file
BIN
vCardEditor/assests/Add.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 437 B |
BIN
vCardEditor/assests/Close.png
Normal file
BIN
vCardEditor/assests/Close.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 605 B |
BIN
vCardEditor/assests/icons8-close-16.png
Normal file
BIN
vCardEditor/assests/icons8-close-16.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 217 B |
BIN
vCardEditor/assests/icons8-save-16.png
Normal file
BIN
vCardEditor/assests/icons8-save-16.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 475 B |
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
|
||||
@@ -10,10 +10,25 @@
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>vCardEditor</RootNamespace>
|
||||
<AssemblyName>vCardEditor</AssemblyName>
|
||||
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
|
||||
<TargetFrameworkVersion>v4.8.1</TargetFrameworkVersion>
|
||||
<TargetFrameworkProfile>
|
||||
</TargetFrameworkProfile>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<IsWebBootstrapper>false</IsWebBootstrapper>
|
||||
<PublishUrl>publish\</PublishUrl>
|
||||
<Install>true</Install>
|
||||
<InstallFrom>Disk</InstallFrom>
|
||||
<UpdateEnabled>false</UpdateEnabled>
|
||||
<UpdateMode>Foreground</UpdateMode>
|
||||
<UpdateInterval>7</UpdateInterval>
|
||||
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
|
||||
<UpdatePeriodically>false</UpdatePeriodically>
|
||||
<UpdateRequired>false</UpdateRequired>
|
||||
<MapFileExtensions>true</MapFileExtensions>
|
||||
<ApplicationRevision>0</ApplicationRevision>
|
||||
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
|
||||
<UseApplicationTrust>false</UseApplicationTrust>
|
||||
<BootstrapperEnabled>true</BootstrapperEnabled>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
@@ -24,6 +39,7 @@
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
@@ -33,6 +49,7 @@
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<ApplicationIcon>assests\vCard.ico</ApplicationIcon>
|
||||
@@ -49,17 +66,39 @@
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Libs\QRCoder\AbstractQRCode.cs" />
|
||||
<Compile Include="Libs\QRCoder\ArtQRCode.cs" />
|
||||
<Compile Include="Libs\QRCoder\ASCIIQRCode.cs" />
|
||||
<Compile Include="Libs\QRCoder\Base64QRCode.cs" />
|
||||
<Compile Include="Libs\QRCoder\BitmapByteQRCode.cs" />
|
||||
<Compile Include="Libs\QRCoder\Exceptions\DataTooLongException.cs" />
|
||||
<Compile Include="Libs\QRCoder\Extensions\StringValueAttribute.cs" />
|
||||
<Compile Include="Libs\QRCoder\Framework4.0Methods\Stream4Methods.cs" />
|
||||
<Compile Include="Libs\QRCoder\Framework4.0Methods\String4Methods.cs" />
|
||||
<Compile Include="Libs\QRCoder\PayloadGenerator.cs" />
|
||||
<Compile Include="Libs\QRCoder\PdfByteQRCode.cs" />
|
||||
<Compile Include="Libs\QRCoder\PngByteQRCode.cs" />
|
||||
<Compile Include="Libs\QRCoder\PostscriptQRCode.cs" />
|
||||
<Compile Include="Libs\QRCoder\QRCode.cs" />
|
||||
<Compile Include="Libs\QRCoder\QRCodeData.cs" />
|
||||
<Compile Include="Libs\QRCoder\QRCodeGenerator.cs" />
|
||||
<Compile Include="Libs\QRCoder\SvgQRCode.cs" />
|
||||
<Compile Include="Model\vCardPropeties.cs" />
|
||||
<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" />
|
||||
@@ -89,6 +128,7 @@
|
||||
<Compile Include="Thought.vCards\vCardProperty.cs" />
|
||||
<Compile Include="Thought.vCards\vCardPropertyCollection.cs" />
|
||||
<Compile Include="Thought.vCards\vCardReader.cs" />
|
||||
<Compile Include="Thought.vCards\vCardRoot.cs" />
|
||||
<Compile Include="Thought.vCards\vCardSocialProfile.cs" />
|
||||
<Compile Include="Thought.vCards\vCardSocialProfileCollection.cs" />
|
||||
<Compile Include="Thought.vCards\vCardSource.cs" />
|
||||
@@ -116,6 +156,46 @@
|
||||
<Compile Include="View\ConfigDialog.Designer.cs">
|
||||
<DependentUpon>ConfigDialog.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="View\Customs\AddAddressDialog.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="View\Customs\AddAddressDialog.Designer.cs">
|
||||
<DependentUpon>AddAddressDialog.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="View\Customs\AddressBox.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
<Compile Include="View\Customs\AddressBox.Designer.cs">
|
||||
<DependentUpon>AddressBox.cs</DependentUpon>
|
||||
</Compile>
|
||||
<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\Customs\CustumInputDialog.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="View\Customs\CustumInputDialog.Designer.cs">
|
||||
<DependentUpon>CustumInputDialog.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="View\Customs\ExtendedPanel.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
<Compile Include="View\Customs\ExtendedPanel.Designer.cs">
|
||||
<DependentUpon>ExtendedPanel.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="View\Customs\PanelType.cs" />
|
||||
<Compile Include="View\Customs\RemovableTextBox.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
<Compile Include="View\Customs\RemovableTextBox.Designer.cs">
|
||||
<DependentUpon>RemovableTextBox.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="View\EventArgs.cs" />
|
||||
<Compile Include="View\IMainView.cs" />
|
||||
<Compile Include="View\MainForm.cs">
|
||||
@@ -124,9 +204,22 @@
|
||||
<Compile Include="View\MainForm.Designer.cs">
|
||||
<DependentUpon>MainForm.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="View\QRDialog.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="View\QRDialog.Designer.cs">
|
||||
<DependentUpon>QRDialog.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="View\SortableBindingList.cs" />
|
||||
<Compile Include="View\StateTextBox.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="View\Customs\ExtraTextGroup.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
<Compile Include="View\Customs\ExtraTextGroup.Designer.cs">
|
||||
<DependentUpon>ExtraTextGroup.cs</DependentUpon>
|
||||
</Compile>
|
||||
<EmbeddedResource Include="Properties\Resources.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||
@@ -144,9 +237,35 @@
|
||||
<EmbeddedResource Include="View\ConfigDialog.resx">
|
||||
<DependentUpon>ConfigDialog.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="View\Customs\AddAddressDialog.resx">
|
||||
<DependentUpon>AddAddressDialog.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<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\Customs\CustumInputDialog.resx">
|
||||
<DependentUpon>CustumInputDialog.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="View\Customs\ExtendedPanel.resx">
|
||||
<DependentUpon>ExtendedPanel.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="View\Customs\RemovableTextBox.resx">
|
||||
<DependentUpon>RemovableTextBox.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="View\MainForm.resx">
|
||||
<DependentUpon>MainForm.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="View\Customs\ExtraTextGroup.resx">
|
||||
<DependentUpon>ExtraTextGroup.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="View\QRDialog.resx">
|
||||
<DependentUpon>QRDialog.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<None Include="app.config" />
|
||||
<None Include="Libs\QRCoder\Assets\nuget-readme.md" />
|
||||
<None Include="Properties\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||
@@ -159,8 +278,21 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="assests\About.ico" />
|
||||
<Content Include="assests\Add.png" />
|
||||
<Content Include="assests\Close.png" />
|
||||
<Content Include="assests\icons8-close-16.png" />
|
||||
<Content Include="assests\vCard.ico" />
|
||||
<Content Include="Libs\QRCoder\Assets\nuget-icon.png" />
|
||||
<Content Include="Releases.txt" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>.NET Framework 3.5 SP1</ProductName>
|
||||
<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.
|
||||
|
||||
185
vCardEditor_Test/ContactRepositoryTest.cs
Normal file
185
vCardEditor_Test/ContactRepositoryTest.cs
Normal file
@@ -0,0 +1,185 @@
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
using NSubstitute;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Thought.vCards;
|
||||
using vCardEditor.Repository;
|
||||
using VCFEditor.Repository;
|
||||
|
||||
namespace vCardEditor_Test
|
||||
{
|
||||
[TestClass]
|
||||
public class ContactRepositoryTest
|
||||
{
|
||||
[TestMethod]
|
||||
public void NewFileOpened_EmtpyVCF_Test()
|
||||
{
|
||||
var fileHandler = Substitute.For<IFileHandler>();
|
||||
fileHandler.ReadAllLines(Arg.Any<string>()).Returns(Entries.vcfEmtpy);
|
||||
var repo = Substitute.For<ContactRepository>(fileHandler);
|
||||
|
||||
repo.LoadContacts("file.vcf");
|
||||
|
||||
Assert.IsTrue(repo.Contacts.Count == 0);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void NewFileOpened_IncorrectVCF_Test()
|
||||
{
|
||||
var fileHandler = Substitute.For<IFileHandler>();
|
||||
fileHandler.ReadAllLines(Arg.Any<string>()).Returns(Entries.vcfIncorrect);
|
||||
fileHandler.FileExist(Arg.Any<string>()).Returns(true);
|
||||
var repo = Substitute.For<ContactRepository>(fileHandler);
|
||||
|
||||
repo.LoadContacts("file.vcf");
|
||||
|
||||
Assert.IsTrue(repo.Contacts.Count == 0);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void NewFileOpened_Utf8Entry_Test()
|
||||
{
|
||||
var fileHandler = Substitute.For<IFileHandler>();
|
||||
fileHandler.FileExist(Arg.Any<string>()).Returns(true);
|
||||
fileHandler.ReadAllLines(Arg.Any<string>()).Returns(Entries.vcfUtf8Entry);
|
||||
var repo = Substitute.For<ContactRepository>(fileHandler);
|
||||
var contacts = repo.LoadContacts("file.vcf");
|
||||
|
||||
Assert.AreEqual(repo.Contacts[0].Name, "Oum Alaâ");
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void NewFileOpened_Address_Test()
|
||||
{
|
||||
var fileHandler = Substitute.For<IFileHandler>();
|
||||
fileHandler.ReadAllLines(Arg.Any<string>()).Returns(Entries.vcfOneEntry);
|
||||
fileHandler.FileExist(Arg.Any<string>()).Returns(true);
|
||||
var repo = Substitute.For<ContactRepository>(fileHandler);
|
||||
var contacts = repo.LoadContacts("file.vcf");
|
||||
Assert.IsTrue(repo.Contacts[0].card.DeliveryAddresses.FirstOrDefault().AddressType.Contains(vCardDeliveryAddressTypes.Work));
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void NewFileOpened_SaveDirtyCellPhone_NotNullWithNotNull_Test()
|
||||
{
|
||||
var fileHandler = Substitute.For<IFileHandler>();
|
||||
fileHandler.ReadAllLines(Arg.Any<string>()).Returns(Entries.vcfFourEntry);
|
||||
fileHandler.FileExist(Arg.Any<string>()).Returns(true);
|
||||
|
||||
var repo = Substitute.For<ContactRepository>(fileHandler);
|
||||
repo.LoadContacts("file.vcf");
|
||||
repo.Contacts[0].isDirty=true;
|
||||
|
||||
string phone = "0011223344";
|
||||
var newCard = new vCard();
|
||||
newCard.Phones.Add(new vCardPhone(phone, vCardPhoneTypes.Cellular));
|
||||
|
||||
repo.SaveDirtyVCard(0, newCard);
|
||||
|
||||
|
||||
var card = repo.Contacts[0].card;
|
||||
Assert.AreEqual(card.Phones.GetFirstChoice(vCardPhoneTypes.Cellular).FullNumber, phone);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void NewFileOpened_SaveDirtyCellPhone_NotNullWithNull_Test()
|
||||
{
|
||||
var fileHandler = Substitute.For<IFileHandler>();
|
||||
fileHandler.ReadAllLines(Arg.Any<string>()).Returns(Entries.vcfFourEntry);
|
||||
fileHandler.FileExist(Arg.Any<string>()).Returns(true);
|
||||
|
||||
var repo = Substitute.For<ContactRepository>(fileHandler);
|
||||
repo.LoadContacts("file.vcf");
|
||||
repo.Contacts[0].isDirty = true;
|
||||
|
||||
repo.SaveDirtyVCard(0, new vCard());
|
||||
|
||||
|
||||
var card = repo.Contacts[0].card;
|
||||
Assert.AreEqual(card.Phones.Count, 0);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void NewFileOpened_SaveDirtyCellPhone_NullWithNotNull_Test()
|
||||
{
|
||||
var fileHandler = Substitute.For<IFileHandler>();
|
||||
fileHandler.ReadAllLines(Arg.Any<string>()).Returns(Entries.vcfFourEntry);
|
||||
fileHandler.FileExist(Arg.Any<string>()).Returns(true);
|
||||
var repo = Substitute.For<ContactRepository>(fileHandler);
|
||||
repo.LoadContacts("file.vcf");
|
||||
repo.Contacts[2].isDirty = true;
|
||||
|
||||
string phone = "0011223344";
|
||||
var newCard = new vCard();
|
||||
newCard.Phones.Add(new vCardPhone(phone, vCardPhoneTypes.Cellular));
|
||||
repo.SaveDirtyVCard(2, newCard);
|
||||
|
||||
var card = repo.Contacts[2].card;
|
||||
Assert.AreEqual(card.Phones.GetFirstChoice(vCardPhoneTypes.Cellular).FullNumber, phone);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void NewFileOpened_SaveDirtyCellPhone_NullWithNull_Test()
|
||||
{
|
||||
var fileHandler = Substitute.For<IFileHandler>();
|
||||
fileHandler.ReadAllLines(Arg.Any<string>()).Returns(Entries.vcfFourEntry);
|
||||
fileHandler.FileExist(Arg.Any<string>()).Returns(true);
|
||||
var repo = Substitute.For<ContactRepository>(fileHandler);
|
||||
repo.LoadContacts("file.vcf");
|
||||
repo.Contacts[3].isDirty = true;
|
||||
|
||||
repo.SaveDirtyVCard(3, new vCard());
|
||||
|
||||
var card = repo.Contacts[2].card;
|
||||
Assert.IsNull(card.Phones.GetFirstChoice(vCardPhoneTypes.Cellular));
|
||||
}
|
||||
|
||||
|
||||
[TestMethod]
|
||||
public void NewFileOpened_v21_Test()
|
||||
{
|
||||
var fileHandler = Substitute.For<IFileHandler>();
|
||||
fileHandler.ReadAllLines(Arg.Any<string>()).Returns(Entries.vcfWikiv21);
|
||||
fileHandler.FileExist(Arg.Any<string>()).Returns(true);
|
||||
var repo = Substitute.For<ContactRepository>(fileHandler);
|
||||
repo.LoadContacts("file.vcf");
|
||||
repo.Contacts[0].isDirty = true;
|
||||
|
||||
repo.SaveDirtyVCard(0, new vCard());
|
||||
|
||||
var card = repo.Contacts[0].card;
|
||||
Assert.IsNull(card.Phones.GetFirstChoice(vCardPhoneTypes.Cellular));
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void AddEmptyContact_ContactNotNull_Test()
|
||||
{
|
||||
var fileHandler = Substitute.For<IFileHandler>();
|
||||
fileHandler.ReadAllLines(Arg.Any<string>()).Returns(Entries.vcfOneEntry);
|
||||
fileHandler.FileExist(Arg.Any<string>()).Returns(true);
|
||||
|
||||
var repo = Substitute.For<ContactRepository>(fileHandler);
|
||||
repo.LoadContacts("file.vcf");
|
||||
|
||||
repo.AddEmptyContact();
|
||||
|
||||
|
||||
Assert.IsTrue(repo.Contacts.Count > 0);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void AddEmptyContact_ContactIsNull_Test()
|
||||
{
|
||||
var fileHandler = Substitute.For<IFileHandler>();
|
||||
var repo = Substitute.For<ContactRepository>(fileHandler);
|
||||
|
||||
repo.AddEmptyContact();
|
||||
|
||||
|
||||
Assert.IsTrue(repo.Contacts.Count == 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
193
vCardEditor_Test/Entries.cs
Normal file
193
vCardEditor_Test/Entries.cs
Normal file
@@ -0,0 +1,193 @@
|
||||
namespace vCardEditor_Test
|
||||
{
|
||||
public class Entries
|
||||
{
|
||||
public static string[] vcfEmtpy
|
||||
{
|
||||
get
|
||||
{
|
||||
return "".Split('\n');
|
||||
}
|
||||
}
|
||||
|
||||
public static string[] vcfIncorrect
|
||||
{
|
||||
get
|
||||
{
|
||||
return "abcdef".Split('\n');
|
||||
}
|
||||
}
|
||||
|
||||
public static string[] vcfOneEntry
|
||||
{
|
||||
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" +
|
||||
"LABEL;QUOTED-PRINTABLE;WORK;PREF:Rue Th. Decuyper 6A=Bruxelles 1200=Belgique\n" +
|
||||
"TEL;CELL:+1234 56789\n" +
|
||||
"EMAIL;INTERNET:jean.dupont@example.com\n" +
|
||||
"END:VCARD";
|
||||
return s.Split('\n');
|
||||
}
|
||||
}
|
||||
|
||||
public static string[] vcfThreeEntry
|
||||
{
|
||||
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" +
|
||||
"TEL;CELL:+1234 56789\n" +
|
||||
"EMAIL;INTERNET:jean.dupont@example.com\n" +
|
||||
"END:VCARD\n" +
|
||||
"BEGIN:VCARD\n" +
|
||||
"VERSION:2.1\n" +
|
||||
"FN:Jean Dupont2\n" +
|
||||
"N:Dupont;Jean\n" +
|
||||
"ADR;WORK;PREF;QUOTED-PRINTABLE:;Bruxelles 1200=Belgique;6A Rue Th. Decuyper\n" +
|
||||
"TEL;CELL:+1234 56789\n" +
|
||||
"EMAIL;INTERNET:jean.dupont@example.com\n" +
|
||||
"END:VCARD\n" +
|
||||
"BEGIN:VCARD\n" +
|
||||
"VERSION:2.1\n" +
|
||||
"FN:Jean Dupont3\n" +
|
||||
"N:Dupont;Jean\n" +
|
||||
"ADR;WORK;PREF;QUOTED-PRINTABLE:;Bruxelles 1200=Belgique;6A Rue Th. Decuyper\n" +
|
||||
"TEL;CELL:+1234 56789\n" +
|
||||
"EMAIL;INTERNET:jean.dupont@example.com\n" +
|
||||
"END:VCARD";
|
||||
return s.Split('\n');
|
||||
}
|
||||
}
|
||||
public static string[] vcfFourEntry
|
||||
{
|
||||
get
|
||||
{
|
||||
string s = "BEGIN:VCARD\n" +
|
||||
"VERSION:2.1\n" +
|
||||
"FN:Jean Dupont1\n" +
|
||||
"N:Dupont;Jean1\n" +
|
||||
"ADR;WORK;PREF;QUOTED-PRINTABLE:;Bruxelles 1200=Belgique;6A Rue Th. Decuyper\n" +
|
||||
"TEL;CELL:+1234 56789\n" +
|
||||
"EMAIL;INTERNET:jean.dupont@example.com\n" +
|
||||
"END:VCARD\n" +
|
||||
"BEGIN:VCARD\n" +
|
||||
"VERSION:2.1\n" +
|
||||
"FN:Jean Dupont2\n" +
|
||||
"N:Dupont;Jean\n" +
|
||||
"ADR;WORK;PREF;QUOTED-PRINTABLE:;Bruxelles 1200=Belgique;6A Rue Th. Decuyper\n" +
|
||||
"TEL;CELL:+1234 56789\n" +
|
||||
"EMAIL;INTERNET:jean.dupont@example.com\n" +
|
||||
"END:VCARD\n" +
|
||||
"BEGIN:VCARD\n" +
|
||||
"VERSION:2.1\n" +
|
||||
"FN:Jean Dupont3\n" +
|
||||
"N:Dupont;Jean\n" +
|
||||
"ADR;WORK;PREF;QUOTED-PRINTABLE:;Bruxelles 1200=Belgique;6A Rue Th. Decuyper\n" +
|
||||
"EMAIL;INTERNET:jean.dupont@example.com\n" +
|
||||
"END:VCARD\n" +
|
||||
"BEGIN:VCARD\n" +
|
||||
"VERSION:2.1\n" +
|
||||
"FN:Jean Dupont4\n" +
|
||||
"N:Dupont;Jean\n" +
|
||||
"ADR;WORK;PREF;QUOTED-PRINTABLE:;Bruxelles 1200=Belgique;6A Rue Th. Decuyper\n" +
|
||||
"EMAIL;INTERNET:jean.dupont@example.com\n" +
|
||||
"END:VCARD";
|
||||
return s.Split('\n');
|
||||
}
|
||||
}
|
||||
public static string[] vcfUtf8Entry
|
||||
{
|
||||
get
|
||||
{
|
||||
string s = "BEGIN:VCARD\n" +
|
||||
"VERSION:2.1\n" +
|
||||
"N;CHARSET=UTF-8;ENCODING=QUOTED-PRINTABLE:=41=6C=61=C3=A2;=4F=75=6D;;;\n" +
|
||||
"FN;CHARSET=UTF-8;ENCODING=QUOTED-PRINTABLE:=4F=75=6D=20=41=6C=61=C3=A2\n" +
|
||||
"END:VCARD";
|
||||
return s.Split('\n');
|
||||
}
|
||||
}
|
||||
|
||||
public static string[] vcfWikiv21
|
||||
{
|
||||
get
|
||||
{
|
||||
string s = "BEGIN:VCARD" +
|
||||
"VERSION:2.1\n" +
|
||||
"N:Gump;Forrest;;Mr.\n" +
|
||||
"FN:Forrest Gump\n" +
|
||||
"ORG:Bubba Gump Shrimp Co.\n" +
|
||||
"TITLE:Shrimp Man\n" +
|
||||
"PHOTO;GIF:http://www.example.com/dir_photos/my_photo.gif\n" +
|
||||
"TEL;WORK;VOICE:(111) 555-1212\n" +
|
||||
"TEL;HOME;VOICE:(404) 555-1212\n" +
|
||||
"ADR;WORK;PREF:;;100 Waters Edge;Baytown;LA;30314;United States of America\n" +
|
||||
"LABEL;WORK;PREF;ENCODING=QUOTED-PRINTABLE;CHARSET=UTF-8:100 Waters Edge=0D=\n" +
|
||||
" =0ABaytown\\, LA 30314=0D=0AUnited States of America\n" +
|
||||
"ADR;HOME:;;42 Plantation St.;Baytown;LA;30314;United States of America\n" +
|
||||
"LABEL;HOME;ENCODING=QUOTED-PRINTABLE;CHARSET=UTF-8:42 Plantation St.=0D=0A=\n" +
|
||||
" Baytown, LA 30314=0D=0AUnited States of America\n" +
|
||||
"EMAIL:forrestgump@example.com\n" +
|
||||
"REV:20080424T195243Z\n" +
|
||||
"END:VCARD";
|
||||
return s.Split('\n');
|
||||
}
|
||||
}
|
||||
|
||||
public static string[] vcfwithExternalPhoto
|
||||
{
|
||||
get
|
||||
{
|
||||
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');
|
||||
}
|
||||
}
|
||||
|
||||
public static string[] vcfwithInternalPhoto
|
||||
{
|
||||
get
|
||||
{
|
||||
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:/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAUDBAQEAwUEBAQFBQUGBwwIBwcHBw8LCwkMEQ8SEhEPERETFhwXExQaFRERGCEYGh0dHx8fExciJCIeJBweHx7/2wBDAQUFBQcGBw4ICA4eFBEUHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh7/wAARCABcAFwDASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4e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V+IvhpGb17qw8+wnJzvtht3fWvRvhte/bPDdvKxBLKDXRA+YxDICOnIoA8W0Pwz49TfbpPaXdtjGLxmOaZqPws1vUpt1xpXh5CerKrZr29QicKoH0qtq1/Dp2nz3kx+SJSxoA8t8N/BTTLaRZtTnZ8f8sUIMf5Vwnx88N674SubXXtDhZtMtplk2Qg7olDZx7LxXrnwz+I1r40W9EVjPavbNjbIRl+D0x9KzLnxRqF94qudB17SNmj3IaOJ5EGGzwOfxNAHWfDbxDH4n8Gadq6MC08Cs49CR0ro6+cvCl54q8B+L9YtdOs5NQ0GO6b/AEeJctEvHIycAYr0xPiv4ee03oHa5x/x7Bhvz6fWgCH4oS/a/F/hjTI8lzcuXA7ApxXosS7YkX0UCvPfAumanrXiKbxbrlu1uWAW1gcYKAZAb05Br0SgCrq6B9Ku0PeBx/46a+drdBJ4G1Gyx/x6OB9MAmvo+6ANrKD0KH+VfPdiqg+MocfIsxAHp+7oA9B+CV35nhSxQnJNuDXoi57dK8l+BLMNEs0zwIQK9b6HFAAzAAepqlqWmwalYS2lzuMcv3gDir5APWigDitT8I31jYRQeELm0011++0sG8tzW/ounXCabbprDW91eRgbpViCgn1A7VrUUAeeaZGtr8Wbq1kVTHcWjSFSMgktXbjSdLD7xptmG658hc/yrkdWRU+KlrIowxswCfbdXdUAIqqoCqAAOgApaKKAP//Z\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');
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Binary file not shown.
@@ -1,118 +1,264 @@
|
||||
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 Moq;
|
||||
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
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
[TestClass]
|
||||
public class MainPresenterTest
|
||||
{
|
||||
#region vCard Entries
|
||||
public string[] vcfOneEntry
|
||||
[TestMethod]
|
||||
public void NewFileOpened_OpenInvalidExtension_Test()
|
||||
{
|
||||
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" +
|
||||
"LABEL;QUOTED-PRINTABLE;WORK;PREF:Rue Th. Decuyper 6A=Bruxelles 1200=Belgique\n" +
|
||||
"TEL;CELL:+1234 56789\n" +
|
||||
"EMAIL;INTERNET:jean.dupont@example.com\n" +
|
||||
"END:VCARD";
|
||||
return s.Split('\n');
|
||||
}
|
||||
|
||||
var fileHandler = Substitute.For<IFileHandler>();
|
||||
fileHandler.ReadAllLines(Arg.Any<string>()).Returns(Entries.vcfOneEntry);
|
||||
var repo = Substitute.For<ContactRepository>(fileHandler);
|
||||
var view = Substitute.For<IMainView>();
|
||||
_ = new MainPresenter(view, repo);
|
||||
view.NewFileOpened += Raise.EventWith(new EventArg<string>("filename.aaa"));
|
||||
|
||||
view.Received().DisplayMessage(Arg.Any<string>(), Arg.Any<string>());
|
||||
}
|
||||
|
||||
public string[] vcfThreeEntry
|
||||
{
|
||||
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" +
|
||||
"TEL;CELL:+1234 56789\n" +
|
||||
"EMAIL;INTERNET:jean.dupont@example.com\n" +
|
||||
"END:VCARD\n" +
|
||||
"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" +
|
||||
"TEL;CELL:+1234 56789\n" +
|
||||
"EMAIL;INTERNET:jean.dupont@example.com\n" +
|
||||
"END:VCARD\n" +
|
||||
"BEGIN:VCARD\n" +
|
||||
"VERSION:2.1\n" +
|
||||
"FN:Jean Dupont3\n" +
|
||||
"N:Dupont;Jean\n" +
|
||||
"ADR;WORK;PREF;QUOTED-PRINTABLE:;Bruxelles 1200=Belgique;6A Rue Th. Decuyper\n" +
|
||||
"TEL;CELL:+1234 56789\n" +
|
||||
"EMAIL;INTERNET:jean.dupont@example.com\n" +
|
||||
"END:VCARD";
|
||||
return s.Split('\n');
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
[TestMethod]
|
||||
public void NewFileOpenedTest()
|
||||
public void NewFileOpened_OpenNewFile_Test()
|
||||
{
|
||||
var handler = new Mock<IFileHandler>();
|
||||
var repo = new Mock<ContactRepository>(handler.Object);
|
||||
var view = new Mock<IMainView>();
|
||||
handler.Setup(x => x.ReadAllLines("filename"))
|
||||
.Returns(vcfOneEntry);
|
||||
|
||||
var fileHandler = Substitute.For<IFileHandler>();
|
||||
fileHandler.ReadAllLines(Arg.Any<string>()).Returns(Entries.vcfOneEntry);
|
||||
fileHandler.FileExist(Arg.Any<string>()).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);
|
||||
view.NewFileOpened += Raise.EventWith(new EventArg<string>("filename.vcf"));
|
||||
|
||||
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"));
|
||||
|
||||
}
|
||||
|
||||
|
||||
var presenter = new MainPresenter(view.Object, repo.Object);
|
||||
view.Raise(m => m.NewFileOpened += null, new EventArg<string>("filename"));
|
||||
[TestMethod]
|
||||
public void NewFileOpened_OpenNewOneWhileAnotherOneIsDirty_Test()
|
||||
{
|
||||
|
||||
var fileHandler = Substitute.For<IFileHandler>();
|
||||
fileHandler.ReadAllLines(Arg.Any<string>()).Returns(Entries.vcfThreeEntry);
|
||||
fileHandler.FileExist(Arg.Any<string>()).Returns(true);
|
||||
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);
|
||||
|
||||
var presenter = new MainPresenter(view, repo);
|
||||
view.NewFileOpened += Raise.EventWith(new EventArg<string>("filename.vcf"));
|
||||
repo.Contacts[1].isDirty = true;
|
||||
|
||||
view.NewFileOpened += Raise.EventWith(new EventArg<string>("filename2.vcf"));
|
||||
|
||||
view.Received().AskMessage(Arg.Any<string>(), Arg.Any<string>());
|
||||
|
||||
view.Verify(m => m.DisplayContacts(It.Is<BindingList<Contact>>(x => x.Count == 1)));
|
||||
view.Verify(m => m.DisplayContacts(It.Is<BindingList<Contact>>(x => x[0].card.FormattedName == "Jean Dupont1")));
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void DeleteTest()
|
||||
public void SaveFile_FirstTime()
|
||||
{
|
||||
var handler = new Mock<IFileHandler>();
|
||||
var repo = new Mock<ContactRepository>(handler.Object);
|
||||
var view = new Mock<IMainView>();
|
||||
handler.Setup(x => x.ReadAllLines("filename"))
|
||||
.Returns(vcfThreeEntry);
|
||||
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.Object, repo.Object);
|
||||
view.Raise(m => m.NewFileOpened += null, new EventArg<string>("filename"));
|
||||
var presenter = new MainPresenter(view, repo);
|
||||
view.NewFileOpened += Raise.EventWith(new EventArg<string>("aaa.vcf"));
|
||||
|
||||
view.SaveContactsSelected += Raise.Event();
|
||||
|
||||
fileHandler.Received().MoveFile("aaa.vcf", "aaa.vcf.old0");
|
||||
}
|
||||
|
||||
|
||||
|
||||
[TestMethod]
|
||||
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>();
|
||||
|
||||
|
||||
_ = new MainPresenter(view, repo);
|
||||
view.NewFileOpened += Raise.EventWith(new EventArg<string>("aaa.vcf"));
|
||||
|
||||
view.SaveContactsSelected += Raise.Event();
|
||||
|
||||
fileHandler.Received().MoveFile("aaa.vcf", "aaa.vcf.old1");
|
||||
}
|
||||
|
||||
|
||||
[TestMethod]
|
||||
public void DeleteContact_ShouldDelete_Test()
|
||||
{
|
||||
var fileHandler = Substitute.For<IFileHandler>();
|
||||
fileHandler.ReadAllLines(Arg.Any<string>()).Returns(Entries.vcfThreeEntry);
|
||||
fileHandler.FileExist(Arg.Any<string>()).Returns(true);
|
||||
var repo = Substitute.For<ContactRepository>(fileHandler);
|
||||
repo.GetExtension(Arg.Any<string>()).Returns(".vcf");
|
||||
var view = Substitute.For<IMainView>();
|
||||
|
||||
_ = new MainPresenter(view, repo);
|
||||
view.NewFileOpened += Raise.EventWith(new EventArg<string>("aaa.vcf"));
|
||||
|
||||
//Mouse click on second row.
|
||||
repo.Object.Contacts[1].isSelected = true;
|
||||
repo.Contacts[1].isSelected = true;
|
||||
|
||||
//Delete the second one.
|
||||
view.Raise(m => m.DeleteContact += null, null, null);
|
||||
|
||||
|
||||
Assert.AreEqual(repo.Object.Contacts.Count, 2);
|
||||
Assert.AreEqual(repo.Object.Contacts[1].card.FormattedName, "Jean Dupont3");
|
||||
view.DeleteContact += Raise.Event();
|
||||
|
||||
Assert.AreEqual(repo.Contacts.Count, 2);
|
||||
Assert.AreEqual(repo.Contacts[1].card.FormattedName, "Jean Dupont3");
|
||||
}
|
||||
|
||||
|
||||
[TestMethod]
|
||||
public void CopyTextToClipboardHandler_ShouldCopyvCard()
|
||||
{
|
||||
|
||||
var fileHandler = Substitute.For<IFileHandler>();
|
||||
fileHandler.ReadAllLines(Arg.Any<string>()).Returns(Entries.vcfOneEntry);
|
||||
fileHandler.FileExist(Arg.Any<string>()).Returns(true);
|
||||
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);
|
||||
fileHandler.FileExist(Arg.Any<string>()).Returns(true);
|
||||
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, repo.Contacts[0].card.DeliveryAddresses.Count);
|
||||
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void AddressAddedHandler_ShouldAddAddress_Test()
|
||||
{
|
||||
|
||||
var fileHandler = Substitute.For<IFileHandler>();
|
||||
fileHandler.ReadAllLines(Arg.Any<string>()).Returns(Entries.vcfOneEntryWithTwoAddress);
|
||||
fileHandler.FileExist(Arg.Any<string>()).Returns(true);
|
||||
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, repo.Contacts[0].card.DeliveryAddresses.Count);
|
||||
Assert.AreEqual(2, repo.Contacts[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);
|
||||
fileHandler.FileExist(Arg.Any<string>()).Returns(true);
|
||||
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, repo.Contacts[0].card.DeliveryAddresses.Count);
|
||||
Assert.AreEqual(2, repo.Contacts[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);
|
||||
fileHandler.FileExist(Arg.Any<string>()).Returns(true);
|
||||
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);
|
||||
fileHandler.FileExist(Arg.Any<string>()).Returns(true);
|
||||
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, repo.Contacts[0].card.Photos.Count);
|
||||
Assert.IsTrue(repo.Contacts[0].isDirty);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
15
vCardEditor_Test/app.config
Normal file
15
vCardEditor_Test/app.config
Normal 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>
|
||||
9
vCardEditor_Test/packages.config
Normal file
9
vCardEditor_Test/packages.config
Normal file
@@ -0,0 +1,9 @@
|
||||
<?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" />
|
||||
</packages>
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
@@ -11,9 +11,10 @@
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>vCardEditor_Test</RootNamespace>
|
||||
<AssemblyName>vCardEditor_Test</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
||||
<TargetFrameworkVersion>v4.8.1</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||
<TargetFrameworkProfile />
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
@@ -23,6 +24,7 @@
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
@@ -31,13 +33,26 @@
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<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="Moq">
|
||||
<HintPath>Lib\Moq.dll</HintPath>
|
||||
<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>
|
||||
</Reference>
|
||||
@@ -45,6 +60,12 @@
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="System.Deployment" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.6.0.0\lib\net461\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Threading.Tasks.Extensions, Version=4.2.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Threading.Tasks.Extensions.4.5.4\lib\net461\System.Threading.Tasks.Extensions.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
@@ -55,6 +76,8 @@
|
||||
</CodeAnalysisDependentAssemblyPaths>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="ContactRepositoryTest.cs" />
|
||||
<Compile Include="Entries.cs" />
|
||||
<Compile Include="FixedListTest.cs" />
|
||||
<Compile Include="MainPresenterTest.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
@@ -66,7 +89,8 @@
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="Lib\" />
|
||||
<None Include="app.config" />
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
|
||||
Reference in New Issue
Block a user