private void GetValue(Project project)
        {
            var foundPlugin = this.model.InputPlugins.Single(it => it.Id == project.InputPlugin.PluginId);

            model.Name = project.Name;

            foundPlugin.Source.SetConfiguration(project.InputPlugin.Configuration);
            var pluginModel = new PluginViewModel
                { Id = foundPlugin.Id, Name = foundPlugin.Name, Configuration = foundPlugin.Source.GetConfigControl() };

            this.model.SelectedInputPlugin = pluginModel;
            InputPluginsComboBox.SelectedItem = pluginModel;

            foreach (var outputPlugin1 in project.OutputPlugins)
            {
                var foundOutputPlugin = this.model.OutputPlugins.Single(it => it.Id == outputPlugin1.PluginId);

                foundOutputPlugin.Source.SetConfiguration(outputPlugin1.Configuration);
                var outputPlugin = new PluginViewModel
                    {
                        Id = foundOutputPlugin.Id,
                        Name = foundOutputPlugin.Name,
                        Configuration = foundOutputPlugin.Source.GetConfigControl()
                    };

                this.model.SelectedOutputPlugins.Add(outputPlugin);
            }
        }
        public UpdateProject(Project project)
        {
            InitializeComponent();

            model = new UpdateProjectViewModel();
            DataContext = model;

            this.GetValue(project);
        }
Exemplo n.º 3
0
 public void OnBuildStatusChanged(Project project, BuildState buildState, BuildStatus buildStatus)
 {
     if (BuildStatusChanged != null)
     {
         BuildStatusChanged(this, new BuildStatusChangedEventArgs
             {
                 Project = project,
                 BuildState = buildState,
                 BuildStatus = buildStatus
             });
     }
 }
Exemplo n.º 4
0
        public static void ShouldBeAbleToOutput()
        {
            var outputQue = new OutputQue();

            var project = new Project()
            {
                Name = "Hello",
                OutputPlugins = new List<PluginConfiguration>
                                                      {
                                                              new PluginConfiguration()
                                                              {
                                                                  PluginId = Guid.Parse("282356A9-3E91-4405-B54B-072709E1DA09"),
                                                                  Configuration = new SoundPluginConfiguration
                                                                                      {
                                                                                         Broken = @"D:\chimes.wav",
                                                                                         Fixed = @"D:\chimes.wav",
                                                                                      }
                                                              },

                                                              new PluginConfiguration()
                                                              {
                                                                  PluginId = Guid.Parse("7C9641FC-A6DE-4854-B583-CCD559C6C037"),
                                                                  Configuration = new LightPluginConfiguration()
                                                                                      {
                                                                                          Device = "Device2",
                                                                                          Miliseconds = 15000,
                                                                                          Path = @"C:\Program Files\Gembird\Power Manager\pm.exe",
                                                                                          Socket = "Socket1"
                                                                                      }
                                                              },

                                                              new PluginConfiguration()
                                                              {
                                                                  PluginId = Guid.Parse("603e7da9-4cb1-4ac7-b84e-7ce12b3cbee3"),
                                                                  Configuration = new TextToSpeechConfiguration()
                                                                                      {
                                                                                          BuildBrokenPhrase = "There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration in some form, by injected humour, or randomised words which don't look even slightly believable. If you are going to use a passage of Lorem Ipsum, you need to be sure there isn't anything embarrassing hidden in the middle of text. All the Lorem Ipsum generators on the Internet tend to repeat predefined chunks as necessary, making this the first true generator on the Internet. It uses a dictionary of over 200 Latin words, combined with a handful of model sentence structures, to generate Lorem Ipsum which looks reasonable. The generated Lorem Ipsum is therefore always free from repetition, injected humour, or non-characteristic words etc.",
                                                                                          BuildFixedPhrase = "I want to grape you in the mouth"
                                                                                      }
                                                              }
                                                      }
            };

            PluginLocator.Initialize(@".");

            outputQue.Start();

            outputQue.Add(new ProcessRequest
            {
                Project = project,
                ProjectState = new ProjectState
                {
                    BuildState = new BuildState(),
                    BuildStatus = BuildStatus.Broken
                }
            });

            outputQue.Add(new ProcessRequest
            {
                Project = project,
                ProjectState = new ProjectState
                {
                    BuildState = new BuildState(),
                    BuildStatus = BuildStatus.Fixed
                }
            });

            outputQue.Add(new ProcessRequest
            {
                Project = project,
                ProjectState = new ProjectState
                {
                    BuildState = new BuildState(),
                    BuildStatus = BuildStatus.Broken
                }
            });

            Thread.Sleep(100000);
        }
Exemplo n.º 5
0
        private void ActivateProjectAgent(Project project)
        {
            var plugin = (IInputPlugin)PluginLocator.Current.GetInstanceById(project.InputPlugin.PluginId);

            var agent = new ProjectAgent
                {
                    Project = project,
                    InputPlugin = plugin,
                    IsSuccessfulLastTime = true    // Default.
                };

            plugin.StatusReceived += ProjectStatusReceived;
            plugin.SetConfiguration(project.InputPlugin.Configuration);

            projectAgents.Add(agent);
        }
Exemplo n.º 6
0
 public void AddProject(Project project)
 {
     projects.Add(project);
     ActivateProjectAgent(project);
     projectsRepository.SaveProjects(projects);
 }
Exemplo n.º 7
0
 private void QueueOutputEvent(Project project, BuildState buildState, BuildStatus buildStatus)
 {
     this.consumer.Add(new ProcessRequest
                           {
                               Project = project,
                               ProjectState = new ProjectState
                                 {
                                     BuildState = buildState,
                                     BuildStatus = buildStatus
                                 }
                           });
     OnBuildStatusChanged(project, buildState, buildStatus);
 }