From 5a261158c670e32b19ed3c183bc33d1e1c190a59 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bellai=20=C3=81d=C3=A1m?= Date: Thu, 28 Sep 2017 13:19:05 +0000 Subject: [PATCH] git-tfs-id: [http://tfs.userrendszerhaz.hu:8080/tfs/DefaultCollection]$/MediaCube;C30482 --- client/Maestro/MaestroForm.Metadata.cs | 1 - client/Maestro/MaestroForm.Target.cs | 69 ++++++++++++++------------ 2 files changed, 37 insertions(+), 33 deletions(-) diff --git a/client/Maestro/MaestroForm.Metadata.cs b/client/Maestro/MaestroForm.Metadata.cs index 8c663d81..5dc07076 100644 --- a/client/Maestro/MaestroForm.Metadata.cs +++ b/client/Maestro/MaestroForm.Metadata.cs @@ -121,7 +121,6 @@ namespace Maestro { StoryFolder folder = storyFolders[0]; model.StuffID = folder.ID; model.StuffTitle = folder.Name; - //leírás a story body a jsonos } else if (story.Rundowns != null) { List rundowns = api.GetRundownsByStoryID(story.ID).ToList(); Rundown rundown = rundowns[0]; diff --git a/client/Maestro/MaestroForm.Target.cs b/client/Maestro/MaestroForm.Target.cs index 40143ba1..a8e31f34 100644 --- a/client/Maestro/MaestroForm.Target.cs +++ b/client/Maestro/MaestroForm.Target.cs @@ -30,36 +30,36 @@ namespace Maestro { private void CreateTarget(Target target) { logger.Debug("Creating target {0}", target); - CheckBox checkBox = new CheckBox() { - Appearance = Appearance.Button, - Text = target.Label, - UseVisualStyleBackColor = true, - Dock = DockStyle.Top - }; - checkBox.CheckStateChanged += (s, e) => { - if (checkBox.Checked) { - List processors = new List(); - foreach (String actual in selectedSources) { - string typeName = string.Format("{0}.{1}", typeof(ITargetProcessor).Namespace, target.Processor); - Type type = Type.GetType(typeName); - - //ISourceItem actualFile = new FileSourceItem() { FileInfo = new System.IO.FileInfo(actual), }; - ISourceItem selectedFile = GetSourceItemFromBindingSource(actual);//bindingSource.Current as ISourceItem; - string id = selectedMetadata.ID; - object[] parameters = new object[] { this, Configuration.Source, target, selectedFile.Name, id, segments, mediaCubeApi }; - ITargetProcessor processor = (ITargetProcessor)Activator.CreateInstance(type, parameters); - processors.Add(processor); - } - currentProcessors.Add(checkBox, processors); - } else - currentProcessors.Remove(checkBox); - - btnExecute.Enabled = currentProcessors.Count > 0; - }; - - panelActions.Controls.Add(checkBox); - panelActions.RowCount = panelActions.Controls.Count; - + CheckBox checkBox = new CheckBox() { + Appearance = Appearance.Button, + Text = target.Label, + UseVisualStyleBackColor = true, + Dock = DockStyle.Top + }; + checkBox.CheckStateChanged += (s, e) => { + if (checkBox.Checked) { + List processors = new List(); + foreach (String actual in selectedSources) { + string typeName = string.Format("{0}.{1}", typeof(ITargetProcessor).Namespace, target.Processor); + Type type = Type.GetType(typeName); + + //ISourceItem actualFile = new FileSourceItem() { FileInfo = new System.IO.FileInfo(actual), }; + ISourceItem selectedFile = GetSourceItemFromBindingSource(actual);//bindingSource.Current as ISourceItem; + string id = selectedMetadata.ID; + object[] parameters = new object[] { this, Configuration.Source, target, selectedFile.Name, id, segments, mediaCubeApi }; + ITargetProcessor processor = (ITargetProcessor)Activator.CreateInstance(type, parameters); + processors.Add(processor); + } + currentProcessors.Add(checkBox, processors); + } else + currentProcessors.Remove(checkBox); + + btnExecute.Enabled = currentProcessors.Count > 0; + }; + + panelActions.Controls.Add(checkBox); + panelActions.RowCount = panelActions.Controls.Count; + } private ISourceItem GetSourceItemFromBindingSource(string actual) { @@ -126,6 +126,11 @@ namespace Maestro { match = Regex.Match(startingName, pattern); IDType = match.Success ? IDTypes.OctopusID : IDTypes.None; } + buttonMetadata.Enabled = IDType != IDTypes.None;// ? false : true; + //if (IDType == IDTypes.None) + // buttonMetadata.Enabled = false; + //else + // buttonMetadata.Enabled = true; } public void OnTargetPanelsMouseClick(object sender, MouseEventArgs e) { @@ -137,12 +142,12 @@ namespace Maestro { } private void OnExecuteClick(object sender, EventArgs e) { - foreach (var element in currentProcessors) + foreach (var element in currentProcessors) foreach (ITargetProcessor value in element.Value) { jobs.Add(value); jobsQueue.Add(value); } - + ClearSelectedProcessors(); if (processorWorker == null) CreateJobsQueueWorker(); -- 2.54.0