Exemplo n.º 1
0
        public DeviceSelectionPanel()
        {
            DeviceTypes          = App.Instance.Registries.Registry <PluginDeviceType>().Registered.Select(el => el.DeviceType).ToArray();
            _deviceControlGroups = new Dictionary <DeviceType, DeviceControlGroup>(DeviceTypes.Length * 2);

            var designMode = DesignerProperties.GetIsInDesignMode(this);

            foreach (var deviceType in DeviceTypes)
            {
                var controlGroup = _deviceControlGroups[deviceType] = new DeviceControlGroup(deviceType, designMode);
                controlGroup.DeviceComboBox.SelectionChanged += DeviceComboBox_SelectionChanged;
                controlGroup.ConfigButton.Click  += DeviceConfigBtn_Click;
                controlGroup.PreviewButton.Click += DevicePreviewBtn_Click;
                SelectedDevices[deviceType]       = new SelectedDevice();
                SelectedConsumers[deviceType]     = new SelectedConsumer();
            }
            InitializePanel();
            Loaded += (sender, args) => UpdateDevices();
        }
Exemplo n.º 2
0
        public void RunExecution()
        {
            if (ExecutionItems == null)
            {
                return;
            }

            if (string.IsNullOrEmpty(ConnectionString))
            {
                MessageBox.Show("The connection string must be set before executing");
                return;
            }
            if (SelectedConsumer == null)
            {
                MessageBox.Show("You need to select a consumer before running");
                return;
            }

            IsQueryRunning = true;

            WorkFlowManager = new WorkflowManager();
            var consumer = SelectedConsumer.CreateInstance();
            //_executor = new TaskExecuter.TaskExecuter(Options, ConnectionString, ExecutionItems, consumer);
            //WorkFlowManager.RunWorkFlowAsync(_executor, (executionResult) =>
            //{
            //    IsQueryRunning = false;
            //    // Modal window need to be started from STA thread.
            //    DispatcherSupplier.CurrentDispatcher.Invoke(
            //        DispatcherPriority.Normal,
            //        new ThreadStart(() =>
            //        {
            //            // Show the Execution Summary window with results.
            //            ExecutionSummaryWindow win = new ExecutionSummaryWindow(executionResult, this);
            //            win.ShowDialog();
            //            _executor.Dispose();
            //        })
            //        );

            //}
            //    , string.Empty
            //    , string.Empty);
        }