コード例 #1
0
        /// <summary>
        /// Creates IXeroCoreApi for Public App.
        /// </summary>
        /// <returns>IXeroCoreApi instance</returns>
        private static IXeroCoreApi PublicApp()
        {
            var tokenStore = new MemoryTokenStore();
            var user       = new ApiUser {
                Identifier = Environment.MachineName
            };
            var publicAuth = new PublicAuthenticator(tokenStore);

            return(new Xero.Api.Infrastructure.Applications.Public.Core(publicAuth, user)
            {
                UserAgent = "Xero API - Invoice Application Demo"
            });
        }
コード例 #2
0
        private static IXeroCoreApi PublicApp()
        {
            var tokenStore = new MemoryTokenStore();
            var user       = new ApiUser {
                Identifier = Environment.MachineName
            };

            var publicAuth = new PublicAuthenticator(tokenStore, new XeroApiSettings());

            return(new Infrastructure.Applications.Public.Core(publicAuth, user)
            {
                UserAgent = "Xero API - Listing example"
            });
        }