-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvCardWriter.cs
More file actions
54 lines (44 loc) · 1.93 KB
/
vCardWriter.cs
File metadata and controls
54 lines (44 loc) · 1.93 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
using System;
using System.Collections.Generic;
using System.Text;
namespace MyProject.vCard
{
/*class vCardWriter : vCardReader
{
public vCardWriter() :base()
{
}
public string Text
{
get
{
string r="";
r += "BEGIN:VCARD" + Environment.NewLine + "VERSION:2.1" + Environment.NewLine;
r += "N:" + Surname + ";" + GivenName + ";" + MiddleName + ";" + Prefix + ";" + Suffix + Environment.NewLine;
r += "FN:" + FormattedName + Environment.NewLine;
if (!String.IsNullOrEmpty(Title))
r += "TITLE:" + Title + Environment.NewLine;
if (!String.IsNullOrEmpty(Org))
r += "ORG:" + Title + Environment.NewLine;
if (Birthday != null)
r += "BDAY:" + Birthday.ToString("yyyyMMdd") + Environment.NewLine;
foreach (Email email in Emails)
{
r += "EMAIL" + (email.pref ? ";PREF" : "") + ( (email.homeWorkType == HomeWorkType.home) ? ";HOME" : ";WORK") + ":" + email.address + Environment.NewLine;
}
foreach (Phone p in Phones)
{
r += "TEL" + (p.pref ? ";PREF" : "") + ((p.homeWorkType == HomeWorkType.home) ? ";HOME" : ";WORK") + ";"+ p.phoneType.ToString() +":" + p.number + Environment.NewLine;
}
foreach (Address adr in Addresses)
{
r += "ADR:" + ((adr.homeWorkType == HomeWorkType.home) ? ";HOME" : ";WORK") + ":" + adr.po + ";" + adr.ext +
";" + adr.street + ";" + adr.region + ";" + adr.postcode + ";" + adr.country + Environment.NewLine;
}
// do notes
// do revison
return r;
}
}
}*/
}