Esempio n. 1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="PSetDemo"/> class.
        /// </summary>
        /// <param name="credentialsProvider">The credentials provider.</param>
        public PSetDemo(ICredentialsProvider credentialsProvider)
        {
            Debug.Assert(credentialsProvider != null, "The credentials provider must previously be created and provided.");

            // Create the Property Set service client based on the Property Set service URL specified in the Config
            // and based on the credentials provider that was previously created.
            this.psetClient = new PSetClient(
                new PSetClientConfig {
                ServiceURI = new Uri(Config.PSetServiceUrl)
            },
                credentialsProvider);

            // Create the change set client used to handle large amounts of data.
            this.changeSetClient = new System.Net.Http.HttpClient();
        }
Esempio n. 2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="UsageExamplesDemo"/> class.
        /// </summary>
        /// <param name="credentialsProvider">The credentials provider.</param>
        public UsageExamplesDemo(ICredentialsProvider credentialsProvider)
        {
            if (credentialsProvider is null)
            {
                throw new ArgumentNullException(nameof(credentialsProvider));
            }

            // Create the Organizer service client based on the Organizer service URL specified in the Config
            // and based on the credentials provider that was previously created.
            this.orgClient = new OrgClient(
                new OrgClientConfig {
                ServiceURI = new Uri(Config.OrgServiceUrl)
            },
                credentialsProvider);

            // Create the Property Set service client based on the Property Set service URL specified in the Config
            // and based on the credentials provider that was previously created.
            this.psetClient = new PSetClient(
                new PSetClientConfig {
                ServiceURI = new Uri(Config.PSetServiceUrl)
            },
                credentialsProvider);
        }