Пример #1
0
        public void Init()
        {
            var settings = Settings.ExchangePrd;

            Its.Configuration.Settings.SettingsDirectory = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".config");

            var authSettings = Its.Configuration.Settings.Get <AuthSettings>();

            if (String.IsNullOrWhiteSpace(authSettings.ClientId))
            {
                throw new Exception(String.Format("Create a file called AuthSettings.json in {0} and provide your O365 credentials via this JSON object:\r\n {1}", Its.Configuration.Settings.SettingsDirectory, AuthSettings.GetJsonTemplate()));
            }
            var xauth =
                new XAuth.Auth(authSettings);

            _client = new OutlookServicesClient(settings.Environment.EndpointUri, () => xauth.GetAccessToken(settings.Environment.ResourceId));

            _tempContact = new Contact
            {
                DisplayName = "Test User" + new Random().NextDouble(),
                GivenName   = "GivenName",
                Surname     = "Surname"
            };

            _client.Me.Contacts.AddContactAsync(_tempContact).Wait();
        }
Пример #2
0
        public void Init()
        {
            var settings = Settings.SharePointPrd;

            var auth = new XAuth.Auth(settings.Auth);

            client = new SharePointClient(settings.Environment.EndpointUri, () => auth.GetAccessToken(settings.Environment.ResourceId));
        }
Пример #3
0
        public void Init()
        {
            var settings = Settings.SharePointPrd;

            var auth = new XAuth.Auth(settings.Auth);

            client = new SharePointClient(settings.Environment.EndpointUri, () => auth.GetAccessToken(settings.Environment.ResourceId));
        }
Пример #4
0
        public void Init()
        {
            var settings = Settings.ExchangePrd;

            var xauth =
                new XAuth.Auth(settings.Auth);

            client = new OutlookServicesClient(settings.Environment.EndpointUri, () => xauth.GetAccessToken(settings.Environment.ResourceId));
        }
Пример #5
0
        public void Init()
        {
            var settings = Settings.ExchangePrd;

            Its.Configuration.Settings.SettingsDirectory = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".config");

            var authSettings = Its.Configuration.Settings.Get<AuthSettings>();

            if(String.IsNullOrWhiteSpace(authSettings.ClientId))
                throw new Exception(String.Format("Create a file called AuthSettings.json in {0} and provide your O365 credentials via this JSON object:\r\n {1}", Its.Configuration.Settings.SettingsDirectory, AuthSettings.GetJsonTemplate()));
            var xauth =
                new XAuth.Auth(authSettings);

            client = new OutlookServicesClient(settings.Environment.EndpointUri, () => xauth.GetAccessToken(settings.Environment.ResourceId));
        }
Пример #6
0
        public void Init()
        {
            var settings = Settings.ExchangePrd;
            var xauth    =
                new XAuth.Auth(settings.Auth);

            client = new OutlookServicesClient(settings.Environment.EndpointUri, () => xauth.GetAccessToken(settings.Environment.ResourceId));

            tempContact = new Contact
            {
                DisplayName = "Test User" + new Random().NextDouble(),
                GivenName   = "GivenName",
                Surname     = "Surname"
            };

            client.Me.Contacts.AddContactAsync(tempContact).Wait();
        }
Пример #7
0
        public void Init()
        {
            var settings = Settings.ExchangePrd;

            Its.Configuration.Settings.SettingsDirectory = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".config");

            var authSettings = Its.Configuration.Settings.Get <AuthSettings>();

            if (String.IsNullOrWhiteSpace(authSettings.ClientId))
            {
                throw new Exception(String.Format("Create a file called AuthSettings.json in {0} and provide your O365 credentials via this JSON object:\r\n {1}", Its.Configuration.Settings.SettingsDirectory, AuthSettings.GetJsonTemplate()));
            }
            var xauth =
                new XAuth.Auth(authSettings);

            client = new OutlookServicesClient(settings.Environment.EndpointUri, () => xauth.GetAccessToken(settings.Environment.ResourceId));
        }
Пример #8
0
        public void Init()
        {
            var settings = Settings.ExchangePrd;

            Its.Configuration.Settings.SettingsDirectory = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".config");

            var authSettings = Its.Configuration.Settings.Get<AuthSettings>();

            if (String.IsNullOrWhiteSpace(authSettings.ClientId))
                throw new Exception(String.Format("Create a file called AuthSettings.json in {0} and provide your O365 credentials via this JSON object:\r\n {1}", Its.Configuration.Settings.SettingsDirectory, AuthSettings.GetJsonTemplate()));
            var xauth =
                new XAuth.Auth(authSettings);

            _client = new OutlookServicesClient(settings.Environment.EndpointUri, () => xauth.GetAccessToken(settings.Environment.ResourceId));

            _tempContact = new Contact
            {
                DisplayName = "Test User" + new Random().NextDouble(),
                GivenName = "GivenName",
                Surname = "Surname"
            };

            _client.Me.Contacts.AddContactAsync(_tempContact).Wait();
        }