Skip to content

Commit

Permalink
added Vcard example solution, examples about using vCards are under c…
Browse files Browse the repository at this point in the history
…onstruction
  • Loading branch information
GunnarPeipman committed Sep 25, 2010
1 parent ed9876a commit c3e9c32
Show file tree
Hide file tree
Showing 19 changed files with 1,015 additions and 0 deletions.
26 changes: 26 additions & 0 deletions Experiments.Vcard/Experiments.Vcard.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@

Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Experiments.Vcard", "Experiments.Vcard\Experiments.Vcard.csproj", "{F4E7EE4E-46DB-466C-87FB-67328B3AF191}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MvcVcardControllerAction", "MvcVcardControllerAction\MvcVcardControllerAction.csproj", "{60A01FC3-F1F0-4BC5-A33E-5646FDE31BF3}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{F4E7EE4E-46DB-466C-87FB-67328B3AF191}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F4E7EE4E-46DB-466C-87FB-67328B3AF191}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F4E7EE4E-46DB-466C-87FB-67328B3AF191}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F4E7EE4E-46DB-466C-87FB-67328B3AF191}.Release|Any CPU.Build.0 = Release|Any CPU
{60A01FC3-F1F0-4BC5-A33E-5646FDE31BF3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{60A01FC3-F1F0-4BC5-A33E-5646FDE31BF3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{60A01FC3-F1F0-4BC5-A33E-5646FDE31BF3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{60A01FC3-F1F0-4BC5-A33E-5646FDE31BF3}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
54 changes: 54 additions & 0 deletions Experiments.Vcard/Experiments.Vcard/Experiments.Vcard.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{F4E7EE4E-46DB-466C-87FB-67328B3AF191}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Experiments.Vcard</RootNamespace>
<AssemblyName>Experiments.Vcard</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Vcard.cs" />
</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.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
36 changes: 36 additions & 0 deletions Experiments.Vcard/Experiments.Vcard/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Experiments.Vcard")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Experiments.Vcard")]
[assembly: AssemblyCopyright("Copyright © 2010")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("87e63a5a-bab5-4bfc-8dc1-f21dc0331f54")]

// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
53 changes: 53 additions & 0 deletions Experiments.Vcard/Experiments.Vcard/Vcard.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
using System.Text;

namespace Experiments.Vcard
{
public class Vcard
{
public string FirstName { get; set; }
public string LastName { get; set; }
public string Organization { get; set; }
public string JobTitle { get; set; }
public string StreetAddress { get; set; }
public string Zip { get; set; }
public string City { get; set; }
public string CountryName { get; set; }
public string Phone { get; set; }
public string Mobile { get; set; }
public string Email { get; set; }
public string HomePage { get; set; }
public byte[] Image { get; set; }

public override string ToString()
{
var builder = new StringBuilder();
builder.AppendLine("BEGIN:VCARD");
builder.AppendLine("VERSION:2.1");

// Name
builder.AppendLine("N:" + LastName + ";" + FirstName);

// Full name
builder.AppendLine("FN:" + FirstName + " " + LastName);

// Address
builder.Append("ADR;HOME;PREF:;;");
builder.Append(StreetAddress + ";");
builder.Append(City + ";;");
builder.Append(Zip + ";");
builder.AppendLine(CountryName);

// Other data
builder.AppendLine("ORG:" + Organization);
builder.AppendLine("TITLE:" + JobTitle);
builder.AppendLine("TEL;HOME;VOICE:" + Phone);
builder.AppendLine("TEL;CELL;VOICE:" + Mobile);
builder.AppendLine("URL;" + HomePage);
builder.AppendLine("EMAIL;PREF;INTERNET:" + Email);

builder.AppendLine("END:VCARD");

return builder.ToString();
}
}
}
Loading

0 comments on commit c3e9c32

Please sign in to comment.