Esempio n. 1
0
        /// <summary>
        /// Create a new NdefVcardRecord based on an already supplied contact information
        /// from Windows Phone 8 Contact data. This data type is used by the WP address book.
        /// Internally, this class will convert the Contact class instance to a ContactInformation
        /// instance using an own mapping algorithm, as only ContactInformation can be used
        /// for working with vCard data.
        /// </summary>
        /// <param name="contact">Contact to be used for creating this record.</param>
        /// <param name="vCardFormat">Optionally specify the VCardFormat to use for creating
        /// the textual payload data.</param>
        /// <returns>A new instance of an NdefVcardRecord that uses the supplied contact information.</returns>
        public async static Task <NdefVcardRecord> CreateFromContact(Contact contact,
                                                                     VCardFormat vCardFormat = VCardFormat.Version2_1)
        {
            var contactInfo = await ConvertContactToInformation(contact);

            return(await CreateFromContactInformation(contactInfo, vCardFormat));
        }
        public override void Configure(Container container)
        {
            container.Register <IDbConnectionFactory>(
                new OrmLiteConnectionFactory("~/Northwind.sqlite".MapHostAbsolutePath(), SqliteDialect.Provider));

            //Use Redis Cache
            //container.Register<ICacheClient>(new PooledRedisClientManager());

            VCardFormat.Register(this);
        }
        public override void Configure(Container container)
        {
            container.Register <IDbConnectionFactory>(
                new OrmLiteConnectionFactory("~/Northwind.sqlite".MapHostAbsolutePath(), SqliteOrmLiteDialectProvider.Instance));

            //Using an in-memory cache
            container.Register <ICacheClient>(new MemoryCacheClient());

            //Or if Haz Redis
            //container.Register<ICacheClient>(new PooledRedisClientManager());

            VCardFormat.Register(this);
        }
Esempio n. 4
0
        public override void Configure(Container container)
        {
            container.Register <IDbConnectionFactory>(
                new OrmLiteConnectionFactory(MapProjectPath("~/App_Data/Northwind.sqlite"), SqliteDialect.Provider));

            //Use Redis Cache
            //container.Register<ICacheClient>(new PooledRedisClientManager());

            VCardFormat.Register(this);

            Plugins.Add(new AutoQueryFeature {
                MaxLimit = 100
            });
            Plugins.Add(new AdminFeature());

            Plugins.Add(new CorsFeature());
        }
Esempio n. 5
0
        /// <summary>
        /// Create a new NdefVcardRecord based on an already supplied contact information
        /// from Windows Phone 8 ContactInformation data. The ContactInformation type is able
        /// to convert data into the vCard format.
        /// </summary>
        /// <param name="contactInfo">ContactInformation to be used for creating this record.</param>
        /// <param name="vCardFormat">Optionally specify the VCardFormat to use for creating
        /// the textual payload data.</param>
        /// <returns>A new instance of an NdefVcardRecord that uses the supplied contact information.</returns>
        public async static Task <NdefVcardRecord> CreateFromContactInformation(ContactInformation contactInfo, VCardFormat vCardFormat = VCardFormat.Version2_1)
        {
            var vcardRecord = new NdefVcardRecord
            {
                VCardFormatToWrite = vCardFormat,
                ContactData        = contactInfo
            };
            await vcardRecord.AssemblePayload();

            return(vcardRecord);
        }
Esempio n. 6
0
 /// <summary>
 /// Create a new NdefVcardRecord based on an already supplied contact information
 /// from Windows Phone 8 Contact data. This data type is used by the WP address book.
 /// Internally, this class will convert the Contact class instance to a ContactInformation
 /// instance using an own mapping algorithm, as only ContactInformation can be used
 /// for working with vCard data.
 /// </summary>
 /// <param name="contact">Contact to be used for creating this record.</param>
 /// <param name="vCardFormat">Optionally specify the VCardFormat to use for creating
 /// the textual payload data.</param>
 /// <returns>A new instance of an NdefVcardRecord that uses the supplied contact information.</returns>
 public async static Task<NdefVcardRecord> CreateFromContact(Contact contact,
     VCardFormat vCardFormat = VCardFormat.Version2_1)
 {
     var contactInfo = await ConvertContactToInformation(contact);
     return await CreateFromContactInformation(contactInfo, vCardFormat);
 }
Esempio n. 7
0
 /// <summary>
 /// Create a new NdefVcardRecord based on an already supplied contact information
 /// from Windows Phone 8 ContactInformation data. The ContactInformation type is able
 /// to convert data into the vCard format.
 /// </summary>
 /// <param name="contactInfo">ContactInformation to be used for creating this record.</param>
 /// <param name="vCardFormat">Optionally specify the VCardFormat to use for creating
 /// the textual payload data.</param>
 /// <returns>A new instance of an NdefVcardRecord that uses the supplied contact information.</returns>
 public async static Task<NdefVcardRecord> CreateFromContactInformation(ContactInformation contactInfo, VCardFormat vCardFormat = VCardFormat.Version2_1)
 {
     var vcardRecord = new NdefVcardRecord
     {
         VCardFormatToWrite = vCardFormat,
         ContactData = contactInfo
     };
     await vcardRecord.AssemblePayload();
     return vcardRecord;
 }