public SelectWebHooksWizardPage(ConnectedServiceProviderContext context,
            ConnectedServiceInstance instance)
        {
            // set up the configuration dialog
            Title = Resources.SelectWebHooksPageTitle;
            Description = Resources.SelectWebHooksPageDescription;
            Legend = Resources.SelectWebHooksPageLegend;
            SelectWebHooksLabel = Resources.SelectWebHooksPageDescription;
            Context = context;
            Instance = instance;

            WebHookReceiverOptions = new ObservableCollection<WebHookReceiverOption>();

            // load up the view
            View = new Views.SelectWebHooksWizardPageView
            {
                DataContext = this
            };

            // handle properties changing and user input
            WebHookReceiverOptions.CollectionChanged += WebHookReceiverOptions_CollectionChanged;

            // load the receiver options from the JSON file
            LoadReceiverOptions();
        }
Exemplo n.º 2
0
 public ConnectedServiceSansUI(bool cancel)
 {
     instance      = new ConnectedServiceInstance();
     instance.Name = "Azure IoT Hub";
     instance.Metadata.Add("Cancel", cancel);
     instance.Metadata.Add("TPM", true);
 }
        public override Task <ConnectedServiceInstance> GetFinishedServiceInstanceAsync()
        {
            ConnectedServiceInstance instance = new ConnectedServiceInstance();

            instance.Name = "Contoso Service";
            return(Task.FromResult(instance));
        }
        /// <summary>
        /// This method is called when the user finishes configuring the service.
        /// It returns the 'finished' ConnectedServiceInstance that will be passed to the Handler.
        /// </summary>
        public override Task <ConnectedServiceInstance> GetFinishedServiceInstanceAsync()
        {
            ConnectedServiceInstance instance = new ConnectedServiceInstance();

            instance.Name = "ProgressIndicatorSample";
            return(Task.FromResult(instance));
        }
        /// <summary>
        /// Configures the selected ConnectedServiceInstance.
        /// </summary>
        public override Task<bool> ConfigureServiceInstanceAsync(ConnectedServiceInstance instance, CancellationToken ct)
        {
            // setting the Column1 property to "Configured" to show that this instance has been configured
            instance.Metadata["Column1"] = "Configured";

            return Task.FromResult(true);
        }
Exemplo n.º 6
0
        /// <summary>
        /// Configures the selected ConnectedServiceInstance.
        /// </summary>
        public override Task <bool> ConfigureServiceInstanceAsync(ConnectedServiceInstance instance, CancellationToken ct)
        {
            // setting the Column1 property to "Configured" to show that this instance has been configured
            instance.Metadata["Column1"] = "Configured";

            return(Task.FromResult(true));
        }
        public SelectWebHooksWizardPage(ConnectedServiceProviderContext context,
                                        ConnectedServiceInstance instance)
        {
            // set up the configuration dialog
            Title               = Resources.SelectWebHooksPageTitle;
            Description         = Resources.SelectWebHooksPageDescription;
            Legend              = Resources.SelectWebHooksPageLegend;
            SelectWebHooksLabel = Resources.SelectWebHooksPageDescription;
            Context             = context;
            Instance            = instance;

            WebHookReceiverOptions = new ObservableCollection <WebHookReceiverOption>();

            // load up the view
            View = new Views.SelectWebHooksWizardPageView
            {
                DataContext = this
            };

            // handle properties changing and user input
            WebHookReceiverOptions.CollectionChanged += WebHookReceiverOptions_CollectionChanged;

            // load the receiver options from the JSON file
            LoadReceiverOptions();
        }
        public override Task<ConnectedServiceConfigurator> CreateConfiguratorAsync(ConnectedServiceProviderContext context)
        {
            ConnectedServiceInstance instance = new ConnectedServiceInstance();
            ConnectedServiceConfigurator configurator = new AddWebHookWizard(context, instance);
            TelemetryWrapper.Refresh();

            return Task.FromResult(configurator);
        }
Exemplo n.º 9
0
 public AddWebHookWizard(ConnectedServiceProviderContext context,
                         ConnectedServiceInstance instance)
 {
     Context  = context;
     Instance = instance;
     Pages.Add(new SelectWebHooksWizardPage(context, instance));
     Pages.Add(new AddConfigurationSettingsWizardPage(context, instance));
     IsNextEnabled = false;
 }
 public AddWebHookWizard(ConnectedServiceProviderContext context,
     ConnectedServiceInstance instance)
 {
     Context = context;
     Instance = instance;
     Pages.Add(new SelectWebHooksWizardPage(context,instance));
     Pages.Add(new AddConfigurationSettingsWizardPage(context, instance));
     IsNextEnabled = false;
 }
Exemplo n.º 11
0
        public override Task <ConnectedServiceConfigurator> CreateConfiguratorAsync(ConnectedServiceProviderContext context)
        {
            ConnectedServiceInstance     instance     = new ConnectedServiceInstance();
            ConnectedServiceConfigurator configurator = new AddWebHookWizard(context, instance);

            TelemetryWrapper.Refresh();
            TelemetryWrapper.RecordEvent("WebHook Experience Started");

            return(Task.FromResult(configurator));
        }
Exemplo n.º 12
0
        /// <summary>
        /// Creates a new ConnectedServiceInstance with the specified values.
        /// </summary>
        private ConnectedServiceInstance CreateInstance(string name, string column1, string detail1, string detail2)
        {
            ConnectedServiceInstance instance = new ConnectedServiceInstance();

            instance.Name       = name;
            instance.InstanceId = name;
            instance.Metadata.Add("Column1", column1);
            instance.Metadata.Add("Detail1", detail1);
            instance.Metadata.Add("Detail2", detail2);
            return(instance);
        }
        public override async Task <ConnectedServiceInstance> CreateServiceInstanceAsync(CancellationToken ct)
        {
            ConnectedServiceInstance result         = null;
            IAzureIoTHub             createdAccount = await this.Authenticator.CreateIoTHub(this.iotHubAccountManager, ct).ConfigureAwait(false);

            if (createdAccount != null)
            {
                result = AzureIoTHubAccountProviderGrid.CreateServiceInstance(createdAccount);
            }
            return(result);
        }
        public override Task<ConnectedServiceConfigurator> CreateConfiguratorAsync(ConnectedServiceProviderContext context)
        {
            ConnectedServiceInstance instance = new ConnectedServiceInstance();

            var wizard = new WizardViewModel();
            wizard.Pages.Add(new SelectApiAppViewModel(context, instance));
            wizard.Pages.Add(new ApiManagementIngestViewModel(context, instance));

            ConnectedServiceConfigurator configurator = wizard as ConnectedServiceConfigurator;

            return Task.FromResult(configurator);
        }
 /// <summary>
 /// This method is called when the user finishes configuring the service.
 /// It returns the 'finished' ConnectedServiceInstance that will be passed to the Handler.
 /// </summary>
 public override Task<ConnectedServiceInstance> GetFinishedServiceInstanceAsync()
 {
     ConnectedServiceInstance instance = new ConnectedServiceInstance();
     // Pass the Service Name the user can enter to the Instance Name,
     // used to specify the name of the folder under Service References
     instance.Name = this.ServiceName;
     // An example for how to pass additional info from the Configuration View to the Handler
     // Looking at the Templates\SampleServiceTemplate.cs you'll notice $ServiceInstance.ExtraInfo$ token
     // HandlerHelper.AddFileAsync() parses these properties for token replacement
     instance.Metadata.Add("ExtraInfo", this.ExtraInformation);
     return Task.FromResult(instance);
 }
Exemplo n.º 16
0
        /// <summary>
        /// This method is called when the user finishes configuring the service.
        /// It returns the 'finished' ConnectedServiceInstance that will be passed to the Handler.
        /// </summary>
        public override Task <ConnectedServiceInstance> GetFinishedServiceInstanceAsync()
        {
            ConnectedServiceInstance instance = new ConnectedServiceInstance();

            // Pass the Service Name the user can enter to the Instance Name,
            // used to specify the name of the folder under Service References
            instance.Name = this.ServiceName;
            // An example for how to pass additional info from the Configuration View to the Handler
            // Looking at the Templates\SampleServiceTemplate.cs you'll notice $ServiceInstance.ExtraInfo$ token
            // HandlerHelper.AddFileAsync() parses these properties for token replacement
            instance.Metadata.Add("ExtraInfo", this.ExtraInformation);
            return(Task.FromResult(instance));
        }
Exemplo n.º 17
0
        public TestConnectedServiceHandlerContext(ConnectedServiceInstance serviceInstance    = null,
                                                  ConnectedServiceHandlerHelper handlerHelper = null, IVsHierarchy projectHierarchy = null) : base()
        {
            ServiceInstance  = serviceInstance;
            HandlerHelper    = handlerHelper;
            ProjectHierarchy = projectHierarchy;

            var mockLogger = new Mock <ConnectedServiceLogger>();

            mockLogger.Setup(l => l.WriteMessageAsync(It.IsAny <LoggerMessageCategory>(), It.IsAny <string>()))
            .Returns(Task.CompletedTask);
            Logger = mockLogger.Object;
        }
Exemplo n.º 18
0
        /// <summary>
        /// Adds a new service instance to the grid.
        /// </summary>
        public override Task <ConnectedServiceInstance> CreateServiceInstanceAsync(CancellationToken ct)
        {
            int instanceNumber = this.instances.Count + 1;
            ConnectedServiceInstance newInstance = this.CreateInstance(
                "#" + instanceNumber,
                instanceNumber + " column1",
                instanceNumber + " detail1",
                instanceNumber + " detail2");

            this.instances.Add(newInstance);

            return(Task.FromResult(newInstance));
        }
Exemplo n.º 19
0
        public override Task <ConnectedServiceConfigurator> CreateConfiguratorAsync(ConnectedServiceProviderContext context)
        {
            ConnectedServiceInstance instance = new ConnectedServiceInstance();

            var wizard = new WizardViewModel();

            wizard.Pages.Add(new SelectApiAppViewModel(context, instance));
            wizard.Pages.Add(new ApiManagementIngestViewModel(context, instance));

            ConnectedServiceConfigurator configurator = wizard as ConnectedServiceConfigurator;

            return(Task.FromResult(configurator));
        }
Exemplo n.º 20
0
 public AddConfigurationSettingsWizardPage(ConnectedServiceProviderContext context,
                                           ConnectedServiceInstance instance)
 {
     Context  = context;
     Instance = instance;
     View     = new AddConfigurationSettingsWizardPageView
     {
         DataContext = this
     };
     ReceiverSecrets = new ObservableCollection <WebHookReceiverSecret>();
     ReceiverSecrets.CollectionChanged += ReceiverSecrets_CollectionChanged;
     Title       = Resources.AddConfigurationSettingsWizardPageTitle;
     Description = Resources.AddConfigurationSettingsWizardPageDescription;
     Legend      = Resources.AddConfigurationSettingsWizardPageLegend;
 }
 public AddConfigurationSettingsWizardPage(ConnectedServiceProviderContext context,
     ConnectedServiceInstance instance)
 {
     Context = context;
     Instance = instance;
     View = new AddConfigurationSettingsWizardPageView
     {
         DataContext = this
     };
     ReceiverSecrets = new ObservableCollection<WebHookReceiverSecret>();
     ReceiverSecrets.CollectionChanged += ReceiverSecrets_CollectionChanged;
     Title = Resources.AddConfigurationSettingsWizardPageTitle;
     Description = Resources.AddConfigurationSettingsWizardPageDescription;
     Legend = Resources.AddConfigurationSettingsWizardPageLegend;
 }
        /// <summary>
        /// Creates an entry displayed in the grid
        /// </summary>
        public override Task <ConnectedServiceInstance> CreateServiceInstanceAsync(CancellationToken ct)
        {
            // Called by the Create link in the bottom left corner, if enabled
            int instanceNumber = this.instances.Count + 1;
            ConnectedServiceInstance newInstance = this.CreateInstance(
                "#" + instanceNumber,
                instanceNumber + " column2",
                instanceNumber + " column3",
                instanceNumber + " detail1",
                instanceNumber + " detail2",
                instanceNumber + " detail3");

            this.instances.Add(newInstance);

            return(Task.FromResult(newInstance));
        }
        private static ConnectedServiceInstance CreateServiceInstance(IAzureIoTHub iotHubAccount)
        {
            ConnectedServiceInstance instance = new ConnectedServiceInstance();

            instance.InstanceId = iotHubAccount.Id;
            instance.Name       = iotHubAccount.Properties["IoTHubName"];

            foreach (var property in iotHubAccount.Properties)
            {
                instance.Metadata.Add(property.Key, property.Value);
            }

            instance.Metadata.Add("IoTHubAccount", iotHubAccount);
            instance.Metadata.Add("Cancel", false);
            instance.Metadata.Add("TPM", false);

            return(instance);
        }
        private static ConnectedServiceInstance CreateServiceInstance(IAzureIoTHub iotHubAccount)
        {
            ConnectedServiceInstance instance = new ConnectedServiceInstance();

            instance.InstanceId = iotHubAccount.Id;
            instance.Name = iotHubAccount.Properties["IoTHubName"];

            foreach (var property in iotHubAccount.Properties)
            {
                instance.Metadata.Add(property.Key, property.Value);
            }

            instance.Metadata.Add("IoTHubAccount", iotHubAccount);
            instance.Metadata.Add("Cancel", false);
            instance.Metadata.Add("TPM", false);

            return instance;
        }
        public SelectApiAppViewModel(ConnectedServiceProviderContext context,
            ConnectedServiceInstance instance)
        {
            Context = context;
            Title = Resources.Page1Title;
            Description = Resources.Page1Subtitle;
            Legend = Resources.Page1Legend;

            View = new SelectApiAppView
            {
                DataContext = this
            };

            _dispatcher = Dispatcher.CurrentDispatcher;

            ApiApps = new List<ApiAppResource>();
            Instance = instance;
        }
Exemplo n.º 26
0
        public SelectApiAppViewModel(ConnectedServiceProviderContext context,
                                     ConnectedServiceInstance instance)
        {
            Context     = context;
            Title       = Resources.Page1Title;
            Description = Resources.Page1Subtitle;
            Legend      = Resources.Page1Legend;

            View = new SelectApiAppView
            {
                DataContext = this
            };

            _dispatcher = Dispatcher.CurrentDispatcher;

            ApiApps  = new List <ApiAppResource>();
            Instance = instance;
        }
        public ApiManagementIngestViewModel(ConnectedServiceProviderContext context,
            ConnectedServiceInstance instance)
        {
            Context = context;
            Title = Resources.Page2Title;
            Description = Resources.Page2Subtitle;
            Legend = Resources.Page2Legend;

            View = new ApiManagementIngestView
            {
                DataContext = this
            };

            _dispatcher = Dispatcher.CurrentDispatcher;

            Products = new ObservableCollection<ApiManagementProduct>();
            Products.CollectionChanged += Products_CollectionChanged;
            Instance = instance;
        }
        public ApiManagementIngestViewModel(ConnectedServiceProviderContext context,
                                            ConnectedServiceInstance instance)
        {
            Context     = context;
            Title       = Resources.Page2Title;
            Description = Resources.Page2Subtitle;
            Legend      = Resources.Page2Legend;

            View = new ApiManagementIngestView
            {
                DataContext = this
            };

            _dispatcher = Dispatcher.CurrentDispatcher;

            Products = new ObservableCollection <ApiManagementProduct>();
            Products.CollectionChanged += Products_CollectionChanged;
            Instance = instance;
        }
 public override Task<bool> ConfigureServiceInstanceAsync(ConnectedServiceInstance instance, CancellationToken ct)
 {
     return base.ConfigureServiceInstanceAsync(instance, ct);
 }
 public override Task <bool> ConfigureServiceInstanceAsync(ConnectedServiceInstance instance, CancellationToken ct)
 {
     return(base.ConfigureServiceInstanceAsync(instance, ct));
 }
 /// <summary>
 /// Creates a new ConnectedServiceInstance with the specified values.
 /// </summary>
 private ConnectedServiceInstance CreateInstance(string name, string column1, string detail1, string detail2)
 {
     ConnectedServiceInstance instance = new ConnectedServiceInstance();
     instance.Name = name;
     instance.InstanceId = name;
     instance.Metadata.Add("Column1", column1);
     instance.Metadata.Add("Detail1", detail1);
     instance.Metadata.Add("Detail2", detail2);
     return instance;
 }
 /// <summary>
 /// Configures the specific instance, a unit within the overall service
 /// </summary>
 /// <returns></returns>
 public override Task <bool> ConfigureServiceInstanceAsync(ConnectedServiceInstance instance, CancellationToken ct)
 {
     // Called by the Configure link on the right pane
     instance.Metadata["Column2"] = "Configured";
     return(Task.FromResult(true));
 }
 /// <summary>
 /// Configures the specific instance, a unit within the overall service
 /// </summary>
 /// <returns></returns>
 public override Task<bool> ConfigureServiceInstanceAsync(ConnectedServiceInstance instance, CancellationToken ct)
 {
     // Called by the Configure link on the right pane
     instance.Metadata["Column2"] = "Configured";
     return Task.FromResult(true);
 }
 /// <summary>
 /// This method is called when the user finishes configuring the service.
 /// It returns the 'finished' ConnectedServiceInstance that will be passed to the Handler.
 /// </summary>
 public override Task<ConnectedServiceInstance> GetFinishedServiceInstanceAsync()
 {
     ConnectedServiceInstance instance = new ConnectedServiceInstance();
     instance.Name = "ProgressIndicatorSample";
     return Task.FromResult(instance);
 }
 public override Task<ConnectedServiceInstance> GetFinishedServiceInstanceAsync()
 {
     ConnectedServiceInstance instance = new ConnectedServiceInstance();
     return Task.FromResult(instance);
 }
Exemplo n.º 36
0
 public ConnectedServiceSansUI(bool cancel)
 {
     instance = new ConnectedServiceInstance();
     instance.Name = "Azure IoT Hub";
     instance.Metadata.Add("Cancel", cancel);
     instance.Metadata.Add("TPM", true);
 }