namespace Maestro.Commons {\r
public static class ObjectExtensions {\r
\r
- public static void SafeCall(this Control ctrl, Action x) {\r
+ public static void SafeCall(this Control ctrl, Action x, bool force = false) {\r
if (x != null) {\r
- if (ctrl.InvokeRequired) {\r
+ if (ctrl.InvokeRequired || force) {\r
ctrl.BeginInvoke(x);\r
} else {\r
x();\r
}\r
}\r
}\r
+\r
}\r
}\r
using Newtonsoft.Json;\r
using System;\r
+using System.Linq;\r
using System.Collections.Generic;\r
using System.IO;\r
\r
public bool EnableCustomMetadataId { get; set; }\r
public MetadataProvider[] Metadatas { get; set; }\r
public Target[] Targets { get; set; }\r
+\r
+ public T GetMetadataProvider<T>() {\r
+ MetadataProvider provider = Metadatas?.Where(m => { return m is T; }).FirstOrDefault();\r
+ T result = default(T);\r
+ try {\r
+ result = (T)Convert.ChangeType(provider, typeof(T));\r
+ } finally { }\r
+ return result;\r
+ }\r
}\r
\r
public class Player {\r
public bool CreateSubFolder { get; set; }\r
public string Tag { get; set; }\r
public bool SaveMetadata {get; set;}\r
+ public bool DisableFileVersioning { get; set; }\r
public bool SendEmailOnError { get; set; }\r
public string ErrorEmailRecipient { get; set; }\r
public string ErrorEmailPattern { get; set; }\r
<Reference Include="LinkDotNet.MessageHandling.Contracts, Version=0.2.0.0, Culture=neutral, processorArchitecture=MSIL">\r
<HintPath>..\packages\LinkDotNet.MessageBus.Contracts.0.1.1\lib\LinkDotNet.MessageHandling.Contracts.dll</HintPath>\r
</Reference>\r
- <Reference Include="Microsoft.VisualStudio.OLE.Interop, Version=7.1.40304.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">\r
- <HintPath>..\packages\Microsoft.VisualStudio.OLE.Interop.7.10.6070\lib\Microsoft.VisualStudio.OLE.Interop.dll</HintPath>\r
- <Private>True</Private>\r
- </Reference>\r
- <Reference Include="Microsoft.VisualStudio.Shell.Interop, Version=7.1.40304.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">\r
- <HintPath>..\packages\Microsoft.VisualStudio.Shell.Interop.7.10.6071\lib\Microsoft.VisualStudio.Shell.Interop.dll</HintPath>\r
- <Private>True</Private>\r
- </Reference>\r
- <Reference Include="Microsoft.VisualStudio.Shell.Interop.10.0, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">\r
- <EmbedInteropTypes>True</EmbedInteropTypes>\r
- <HintPath>..\packages\Microsoft.VisualStudio.Shell.Interop.10.0.10.0.30319\lib\Microsoft.VisualStudio.Shell.Interop.10.0.dll</HintPath>\r
- <Private>True</Private>\r
- </Reference>\r
- <Reference Include="Microsoft.VisualStudio.Shell.Interop.11.0, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">\r
- <EmbedInteropTypes>True</EmbedInteropTypes>\r
- <HintPath>..\packages\Microsoft.VisualStudio.Shell.Interop.11.0.11.0.61030\lib\Microsoft.VisualStudio.Shell.Interop.11.0.dll</HintPath>\r
- <Private>True</Private>\r
- </Reference>\r
- <Reference Include="Microsoft.VisualStudio.Shell.Interop.8.0, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">\r
- <HintPath>..\packages\Microsoft.VisualStudio.Shell.Interop.8.0.8.0.50727\lib\Microsoft.VisualStudio.Shell.Interop.8.0.dll</HintPath>\r
- <Private>True</Private>\r
- </Reference>\r
- <Reference Include="Microsoft.VisualStudio.TextManager.Interop, Version=7.1.40304.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">\r
- <HintPath>..\packages\Microsoft.VisualStudio.TextManager.Interop.7.10.6070\lib\Microsoft.VisualStudio.TextManager.Interop.dll</HintPath>\r
- <Private>True</Private>\r
- </Reference>\r
- <Reference Include="Microsoft.VisualStudio.TextManager.Interop.8.0, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">\r
- <HintPath>..\packages\Microsoft.VisualStudio.TextManager.Interop.8.0.8.0.50727\lib\Microsoft.VisualStudio.TextManager.Interop.8.0.dll</HintPath>\r
- <Private>True</Private>\r
- </Reference>\r
<Reference Include="Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">\r
<HintPath>..\packages\Newtonsoft.Json.10.0.3\lib\net20\Newtonsoft.Json.dll</HintPath>\r
</Reference>\r
<Name>MediaCubeClient</Name>\r
</ProjectReference>\r
<ProjectReference Include="..\OctopusClient\OctopusClient.csproj">\r
- <Project>{8CC7C930-9DBF-487B-AED5-776937A649D5}</Project>\r
+ <Project>{8cc7c930-9dbf-487b-aed5-776937a649d5}</Project>\r
<Name>OctopusClient</Name>\r
</ProjectReference>\r
<ProjectReference Include="..\PasswordEncrypter\PasswordEncrypter.csproj">\r
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();\r
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle();\r
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle();\r
+ System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle7 = new System.Windows.Forms.DataGridViewCellStyle();\r
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle8 = new System.Windows.Forms.DataGridViewCellStyle();\r
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle9 = new System.Windows.Forms.DataGridViewCellStyle();\r
- System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle10 = new System.Windows.Forms.DataGridViewCellStyle();\r
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle();\r
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle();\r
- System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle7 = new System.Windows.Forms.DataGridViewCellStyle();\r
+ System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle10 = new System.Windows.Forms.DataGridViewCellStyle();\r
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle11 = new System.Windows.Forms.DataGridViewCellStyle();\r
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle12 = new System.Windows.Forms.DataGridViewCellStyle();\r
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle13 = new System.Windows.Forms.DataGridViewCellStyle();\r
- System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle14 = new System.Windows.Forms.DataGridViewCellStyle();\r
this.groupSource = new System.Windows.Forms.GroupBox();\r
this.dataGridSource = new System.Windows.Forms.DataGridView();\r
this.bindingSource = new System.Windows.Forms.BindingSource(this.components);\r
this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel();\r
- this.txtSelectedSource = new System.Windows.Forms.TextBox();\r
+ this.textSelectedSource = new System.Windows.Forms.TextBox();\r
this.label1 = new System.Windows.Forms.Label();\r
this.buttonMetadata = new System.Windows.Forms.Button();\r
this.panel2 = new System.Windows.Forms.Panel();\r
this.trafficIDSelector = new TrafficClient.TrafficIDSelector();\r
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();\r
this.labelSelectedMetadata = new System.Windows.Forms.Label();\r
- this.txtSelectedMetadata = new System.Windows.Forms.TextBox();\r
+ this.textSelectedMetadata = new System.Windows.Forms.TextBox();\r
this.menuButtonActions = new Maestro.MenuButton();\r
this.groupTarget = new System.Windows.Forms.GroupBox();\r
this.panelActions = new System.Windows.Forms.TableLayoutPanel();\r
this.columnLabel = new System.Windows.Forms.DataGridViewTextBoxColumn();\r
this.columnID = new System.Windows.Forms.DataGridViewTextBoxColumn();\r
this.columnStatus = new System.Windows.Forms.DataGridViewTextBoxColumn();\r
- this.columnProgress = new Maestro.Commons.DataGridViewProgressColumn();\r
this.columnStarted = new System.Windows.Forms.DataGridViewTextBoxColumn();\r
this.columnFinished = new System.Windows.Forms.DataGridViewTextBoxColumn();\r
this.columnInput = new System.Windows.Forms.DataGridViewTextBoxColumn();\r
this.Level = new System.Windows.Forms.DataGridViewTextBoxColumn();\r
this.messageDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();\r
this.systemMessageBindingSource = new System.Windows.Forms.BindingSource(this.components);\r
+ this.columnProgress = new Maestro.Commons.DataGridViewProgressColumn();\r
this.metadataInfoBindingSource = new System.Windows.Forms.BindingSource(this.components);\r
this.groupSource.SuspendLayout();\r
((System.ComponentModel.ISupportInitialize)(this.dataGridSource)).BeginInit();\r
this.tableLayoutPanel2.ColumnCount = 2;\r
this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));\r
this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());\r
- this.tableLayoutPanel2.Controls.Add(this.txtSelectedSource, 0, 1);\r
+ this.tableLayoutPanel2.Controls.Add(this.textSelectedSource, 0, 1);\r
this.tableLayoutPanel2.Controls.Add(this.label1, 0, 0);\r
this.tableLayoutPanel2.Controls.Add(this.buttonMetadata, 1, 1);\r
this.tableLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Bottom;\r
this.tableLayoutPanel2.Size = new System.Drawing.Size(394, 62);\r
this.tableLayoutPanel2.TabIndex = 12;\r
// \r
- // txtSelectedSource\r
+ // textSelectedSource\r
// \r
- this.txtSelectedSource.BackColor = System.Drawing.SystemColors.ActiveCaption;\r
- this.txtSelectedSource.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;\r
- this.txtSelectedSource.Dock = System.Windows.Forms.DockStyle.Fill;\r
- this.txtSelectedSource.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238)));\r
- this.txtSelectedSource.Location = new System.Drawing.Point(3, 28);\r
- this.txtSelectedSource.Name = "txtSelectedSource";\r
- this.txtSelectedSource.Size = new System.Drawing.Size(292, 26);\r
- this.txtSelectedSource.TabIndex = 10;\r
- this.txtSelectedSource.TextChanged += new System.EventHandler(this.OnInfoTextChanged);\r
+ this.textSelectedSource.BackColor = System.Drawing.SystemColors.ActiveCaption;\r
+ this.textSelectedSource.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;\r
+ this.textSelectedSource.Dock = System.Windows.Forms.DockStyle.Fill;\r
+ this.textSelectedSource.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238)));\r
+ this.textSelectedSource.Location = new System.Drawing.Point(3, 28);\r
+ this.textSelectedSource.Name = "textSelectedSource";\r
+ this.textSelectedSource.Size = new System.Drawing.Size(292, 26);\r
+ this.textSelectedSource.TabIndex = 10;\r
// \r
// label1\r
// \r
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));\r
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());\r
this.tableLayoutPanel1.Controls.Add(this.labelSelectedMetadata, 0, 0);\r
- this.tableLayoutPanel1.Controls.Add(this.txtSelectedMetadata, 0, 1);\r
+ this.tableLayoutPanel1.Controls.Add(this.textSelectedMetadata, 0, 1);\r
this.tableLayoutPanel1.Controls.Add(this.menuButtonActions, 1, 1);\r
this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Bottom;\r
this.tableLayoutPanel1.Location = new System.Drawing.Point(10, 399);\r
this.labelSelectedMetadata.TabIndex = 13;\r
this.labelSelectedMetadata.Text = "Selected metadata";\r
// \r
- // txtSelectedMetadata\r
+ // textSelectedMetadata\r
// \r
- this.txtSelectedMetadata.BackColor = System.Drawing.SystemColors.ActiveCaption;\r
- this.txtSelectedMetadata.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;\r
- this.txtSelectedMetadata.Dock = System.Windows.Forms.DockStyle.Fill;\r
- this.txtSelectedMetadata.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238)));\r
- this.txtSelectedMetadata.Location = new System.Drawing.Point(3, 28);\r
- this.txtSelectedMetadata.Name = "txtSelectedMetadata";\r
- this.txtSelectedMetadata.Size = new System.Drawing.Size(162, 26);\r
- this.txtSelectedMetadata.TabIndex = 12;\r
- this.txtSelectedMetadata.TextChanged += new System.EventHandler(this.OnInfoTextChanged);\r
+ this.textSelectedMetadata.BackColor = System.Drawing.SystemColors.ActiveCaption;\r
+ this.textSelectedMetadata.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;\r
+ this.textSelectedMetadata.Dock = System.Windows.Forms.DockStyle.Fill;\r
+ this.textSelectedMetadata.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238)));\r
+ this.textSelectedMetadata.Location = new System.Drawing.Point(3, 28);\r
+ this.textSelectedMetadata.Name = "textSelectedMetadata";\r
+ this.textSelectedMetadata.Size = new System.Drawing.Size(162, 26);\r
+ this.textSelectedMetadata.TabIndex = 12;\r
+ this.textSelectedMetadata.TextChanged += new System.EventHandler(this.OnMetadataIDChanged);\r
// \r
// menuButtonActions\r
// \r
this.columnLabel,\r
this.columnID,\r
this.columnStatus,\r
- this.columnProgress,\r
this.columnStarted,\r
this.columnFinished,\r
this.columnInput,\r
this.columnOutput,\r
this.columnKillDate});\r
this.dataGridJobs.DataSource = this.bindingSourceJobs;\r
- dataGridViewCellStyle8.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;\r
- dataGridViewCellStyle8.BackColor = System.Drawing.SystemColors.Window;\r
- dataGridViewCellStyle8.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));\r
- dataGridViewCellStyle8.ForeColor = System.Drawing.SystemColors.ControlText;\r
- dataGridViewCellStyle8.SelectionBackColor = System.Drawing.Color.Gainsboro;\r
- dataGridViewCellStyle8.SelectionForeColor = System.Drawing.Color.Black;\r
- dataGridViewCellStyle8.WrapMode = System.Windows.Forms.DataGridViewTriState.False;\r
- this.dataGridJobs.DefaultCellStyle = dataGridViewCellStyle8;\r
+ dataGridViewCellStyle7.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;\r
+ dataGridViewCellStyle7.BackColor = System.Drawing.SystemColors.Window;\r
+ dataGridViewCellStyle7.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));\r
+ dataGridViewCellStyle7.ForeColor = System.Drawing.SystemColors.ControlText;\r
+ dataGridViewCellStyle7.SelectionBackColor = System.Drawing.Color.Gainsboro;\r
+ dataGridViewCellStyle7.SelectionForeColor = System.Drawing.Color.Black;\r
+ dataGridViewCellStyle7.WrapMode = System.Windows.Forms.DataGridViewTriState.False;\r
+ this.dataGridJobs.DefaultCellStyle = dataGridViewCellStyle7;\r
this.dataGridJobs.Dock = System.Windows.Forms.DockStyle.Fill;\r
this.dataGridJobs.EditMode = System.Windows.Forms.DataGridViewEditMode.EditProgrammatically;\r
this.dataGridJobs.Location = new System.Drawing.Point(3, 3);\r
this.dataGridJobs.Name = "dataGridJobs";\r
- dataGridViewCellStyle9.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;\r
- dataGridViewCellStyle9.BackColor = System.Drawing.SystemColors.Control;\r
- dataGridViewCellStyle9.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));\r
- dataGridViewCellStyle9.ForeColor = System.Drawing.SystemColors.WindowText;\r
- dataGridViewCellStyle9.SelectionBackColor = System.Drawing.SystemColors.Highlight;\r
- dataGridViewCellStyle9.SelectionForeColor = System.Drawing.SystemColors.HighlightText;\r
- dataGridViewCellStyle9.WrapMode = System.Windows.Forms.DataGridViewTriState.True;\r
- this.dataGridJobs.RowHeadersDefaultCellStyle = dataGridViewCellStyle9;\r
+ dataGridViewCellStyle8.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;\r
+ dataGridViewCellStyle8.BackColor = System.Drawing.SystemColors.Control;\r
+ dataGridViewCellStyle8.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));\r
+ dataGridViewCellStyle8.ForeColor = System.Drawing.SystemColors.WindowText;\r
+ dataGridViewCellStyle8.SelectionBackColor = System.Drawing.SystemColors.Highlight;\r
+ dataGridViewCellStyle8.SelectionForeColor = System.Drawing.SystemColors.HighlightText;\r
+ dataGridViewCellStyle8.WrapMode = System.Windows.Forms.DataGridViewTriState.True;\r
+ this.dataGridJobs.RowHeadersDefaultCellStyle = dataGridViewCellStyle8;\r
this.dataGridJobs.RowHeadersVisible = false;\r
- dataGridViewCellStyle10.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));\r
- this.dataGridJobs.RowsDefaultCellStyle = dataGridViewCellStyle10;\r
+ dataGridViewCellStyle9.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));\r
+ this.dataGridJobs.RowsDefaultCellStyle = dataGridViewCellStyle9;\r
this.dataGridJobs.RowTemplate.DefaultCellStyle.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));\r
this.dataGridJobs.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;\r
this.dataGridJobs.Size = new System.Drawing.Size(988, 92);\r
this.columnStatus.Name = "columnStatus";\r
this.columnStatus.Width = 66;\r
// \r
- // columnProgress\r
- // \r
- this.columnProgress.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;\r
- this.columnProgress.DataPropertyName = "Progress";\r
- dataGridViewCellStyle7.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;\r
- dataGridViewCellStyle7.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));\r
- dataGridViewCellStyle7.NullValue = null;\r
- this.columnProgress.DefaultCellStyle = dataGridViewCellStyle7;\r
- this.columnProgress.HeaderText = "Progress";\r
- this.columnProgress.Name = "columnProgress";\r
- this.columnProgress.Resizable = System.Windows.Forms.DataGridViewTriState.True;\r
- this.columnProgress.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;\r
- this.columnProgress.Width = 200;\r
- // \r
// columnStarted\r
// \r
this.columnStarted.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;\r
this.dataGridMessages.AutoSizeRowsMode = System.Windows.Forms.DataGridViewAutoSizeRowsMode.DisplayedCells;\r
this.dataGridMessages.BackgroundColor = System.Drawing.Color.White;\r
this.dataGridMessages.BorderStyle = System.Windows.Forms.BorderStyle.None;\r
- dataGridViewCellStyle11.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;\r
- dataGridViewCellStyle11.BackColor = System.Drawing.SystemColors.Window;\r
- dataGridViewCellStyle11.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F);\r
- dataGridViewCellStyle11.ForeColor = System.Drawing.SystemColors.WindowText;\r
- dataGridViewCellStyle11.SelectionBackColor = System.Drawing.Color.Transparent;\r
- dataGridViewCellStyle11.SelectionForeColor = System.Drawing.Color.Transparent;\r
- dataGridViewCellStyle11.WrapMode = System.Windows.Forms.DataGridViewTriState.True;\r
- this.dataGridMessages.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle11;\r
+ dataGridViewCellStyle10.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;\r
+ dataGridViewCellStyle10.BackColor = System.Drawing.SystemColors.Window;\r
+ dataGridViewCellStyle10.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F);\r
+ dataGridViewCellStyle10.ForeColor = System.Drawing.SystemColors.WindowText;\r
+ dataGridViewCellStyle10.SelectionBackColor = System.Drawing.Color.Transparent;\r
+ dataGridViewCellStyle10.SelectionForeColor = System.Drawing.Color.Transparent;\r
+ dataGridViewCellStyle10.WrapMode = System.Windows.Forms.DataGridViewTriState.True;\r
+ this.dataGridMessages.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle10;\r
this.dataGridMessages.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;\r
this.dataGridMessages.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {\r
this.timeDataGridViewTextBoxColumn,\r
this.Level,\r
this.messageDataGridViewTextBoxColumn});\r
this.dataGridMessages.DataSource = this.systemMessageBindingSource;\r
- dataGridViewCellStyle12.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;\r
- dataGridViewCellStyle12.BackColor = System.Drawing.SystemColors.Window;\r
- dataGridViewCellStyle12.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));\r
- dataGridViewCellStyle12.ForeColor = System.Drawing.SystemColors.ControlText;\r
- dataGridViewCellStyle12.SelectionBackColor = System.Drawing.Color.Transparent;\r
- dataGridViewCellStyle12.SelectionForeColor = System.Drawing.SystemColors.ControlText;\r
- dataGridViewCellStyle12.WrapMode = System.Windows.Forms.DataGridViewTriState.False;\r
- this.dataGridMessages.DefaultCellStyle = dataGridViewCellStyle12;\r
+ dataGridViewCellStyle11.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;\r
+ dataGridViewCellStyle11.BackColor = System.Drawing.SystemColors.Window;\r
+ dataGridViewCellStyle11.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));\r
+ dataGridViewCellStyle11.ForeColor = System.Drawing.SystemColors.ControlText;\r
+ dataGridViewCellStyle11.SelectionBackColor = System.Drawing.Color.Transparent;\r
+ dataGridViewCellStyle11.SelectionForeColor = System.Drawing.SystemColors.ControlText;\r
+ dataGridViewCellStyle11.WrapMode = System.Windows.Forms.DataGridViewTriState.False;\r
+ this.dataGridMessages.DefaultCellStyle = dataGridViewCellStyle11;\r
this.dataGridMessages.Dock = System.Windows.Forms.DockStyle.Fill;\r
this.dataGridMessages.EditMode = System.Windows.Forms.DataGridViewEditMode.EditProgrammatically;\r
this.dataGridMessages.Location = new System.Drawing.Point(3, 3);\r
this.dataGridMessages.Name = "dataGridMessages";\r
- dataGridViewCellStyle13.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;\r
- dataGridViewCellStyle13.BackColor = System.Drawing.SystemColors.Control;\r
- dataGridViewCellStyle13.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F);\r
- dataGridViewCellStyle13.ForeColor = System.Drawing.SystemColors.WindowText;\r
- dataGridViewCellStyle13.SelectionBackColor = System.Drawing.SystemColors.Control;\r
- dataGridViewCellStyle13.SelectionForeColor = System.Drawing.SystemColors.WindowText;\r
- dataGridViewCellStyle13.WrapMode = System.Windows.Forms.DataGridViewTriState.True;\r
- this.dataGridMessages.RowHeadersDefaultCellStyle = dataGridViewCellStyle13;\r
+ dataGridViewCellStyle12.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;\r
+ dataGridViewCellStyle12.BackColor = System.Drawing.SystemColors.Control;\r
+ dataGridViewCellStyle12.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F);\r
+ dataGridViewCellStyle12.ForeColor = System.Drawing.SystemColors.WindowText;\r
+ dataGridViewCellStyle12.SelectionBackColor = System.Drawing.SystemColors.Control;\r
+ dataGridViewCellStyle12.SelectionForeColor = System.Drawing.SystemColors.WindowText;\r
+ dataGridViewCellStyle12.WrapMode = System.Windows.Forms.DataGridViewTriState.True;\r
+ this.dataGridMessages.RowHeadersDefaultCellStyle = dataGridViewCellStyle12;\r
this.dataGridMessages.RowHeadersVisible = false;\r
- dataGridViewCellStyle14.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F);\r
- this.dataGridMessages.RowsDefaultCellStyle = dataGridViewCellStyle14;\r
+ dataGridViewCellStyle13.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F);\r
+ this.dataGridMessages.RowsDefaultCellStyle = dataGridViewCellStyle13;\r
this.dataGridMessages.RowTemplate.DefaultCellStyle.BackColor = System.Drawing.Color.Transparent;\r
this.dataGridMessages.RowTemplate.DefaultCellStyle.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F);\r
this.dataGridMessages.RowTemplate.DefaultCellStyle.SelectionBackColor = System.Drawing.Color.Transparent;\r
// \r
this.systemMessageBindingSource.DataSource = typeof(Maestro.SystemMessage);\r
// \r
+ // columnProgress\r
+ // \r
+ this.columnProgress.Name = "columnProgress";\r
+ // \r
// metadataInfoBindingSource\r
// \r
this.metadataInfoBindingSource.DataSource = typeof(Maestro.Metadata.MetadataInfo);\r
private System.Windows.Forms.GroupBox groupMetadata;\r
private System.Windows.Forms.GroupBox groupTarget;\r
private System.Windows.Forms.Button btnExecute;\r
- private System.Windows.Forms.TextBox txtSelectedSource;\r
+ private System.Windows.Forms.TextBox textSelectedSource;\r
private System.Windows.Forms.Label labelSelectedMetadata;\r
- private System.Windows.Forms.TextBox txtSelectedMetadata;\r
+ private System.Windows.Forms.TextBox textSelectedMetadata;\r
private System.Windows.Forms.TableLayoutPanel panelActions;\r
private System.Windows.Forms.GroupBox groupActions;\r
private System.Windows.Forms.DataGridView dataGridJobs;\r
selectedMetadata = value;\r
movieSegments = null;\r
segments = null;\r
- txtSelectedMetadata.Text = value?.ID;\r
+ textSelectedMetadata.Text = value?.ID;\r
}\r
}\r
\r
InitializeOctopusSelector();\r
InitializeTrafficSelector();\r
InitializeMediaCubeApi();\r
- txtSelectedMetadata.ReadOnly = !Configuration.EnableCustomMetadataId;\r
+ textSelectedMetadata.ReadOnly = !Configuration.EnableCustomMetadataId;\r
}\r
\r
private void InitializeTrafficSelector() {\r
- TrafficMetadata metadata = Configuration.Metadatas.Where(m => { return m is TrafficMetadata; }).FirstOrDefault() as TrafficMetadata;\r
+ TrafficMetadata metadata = Configuration.GetMetadataProvider<TrafficMetadata>();\r
if (metadata == null)\r
return;\r
trafficIDSelector.Configuration = new TrafficConfiguration() {\r
}\r
\r
private void InitializeOctopusSelector() {\r
- OctopusMetadata metadata = Configuration.Metadatas.Where(m => { return m is OctopusMetadata; }).FirstOrDefault() as OctopusMetadata;\r
+ OctopusMetadata metadata = Configuration.GetMetadataProvider<OctopusMetadata>();\r
if (metadata == null)\r
return;\r
octopusIDSelector.Configuration = new OctopusConfiguration() {\r
\r
private ArchiveMetadata GetArchiveMetadata() {\r
ArchiveMetadata result = null;\r
- SourceIDType idType = GetSourceType(txtSelectedMetadata.Text);\r
+ SourceIDType idType = GetSourceType(textSelectedMetadata.Text);\r
Cursor.Current = Cursors.WaitCursor;\r
switch (idType) {\r
case SourceIDType.MediaCube:\r
result = GetMediaCubeMetadata();\r
- txtSelectedMetadata.Text = result.itemHouseId;\r
+ textSelectedMetadata.Text = result.itemHouseId;\r
break;\r
case SourceIDType.OctopusID:\r
result = GetOctopusMetadata();\r
}\r
\r
private ArchiveMetadata GetTrafficMetadata() {\r
- string id = txtSelectedMetadata.Text;\r
+ string id = textSelectedMetadata.Text;\r
if (String.IsNullOrEmpty(id))\r
return null;\r
TrafficAPI api = trafficIDSelector.trafficAPI;\r
\r
private ArchiveMetadata GetOctopusMetadata() {\r
ArchiveMetadata result = new ArchiveMetadata();\r
- string id = txtSelectedMetadata.Text;\r
+ string id = textSelectedMetadata.Text;\r
OctopusAPI api = octopusIDSelector.GetClient();\r
IEnumerable<Story> storyEnum = api.GetStoriesById(id);\r
if (storyEnum != null)\r
}\r
\r
private void UpdateEditArchiveMetadataEnabled() {\r
- ctxiModifyArchiveMetadata.Enabled = !String.IsNullOrEmpty(txtSelectedSource.Text);\r
+ ctxiModifyArchiveMetadata.Enabled = !String.IsNullOrEmpty(textSelectedMetadata.Text);\r
}\r
\r
private void UpdateDefineSegmentEnabled() {\r
using OctopusClient;\r
using System;\r
using System.Collections.Generic;\r
-using System.Collections.ObjectModel;\r
using System.Drawing;\r
using System.Linq;\r
using System.Windows.Forms;\r
}\r
set {\r
selectedSource = value;\r
- txtSelectedSource.Text = selectedSource.Name;\r
+ textSelectedSource.Text = selectedSource.Name;\r
UpdateEditArchiveMetadataEnabled();\r
}\r
}\r
logger.Debug("NEXIO source created");\r
}\r
\r
- MessageBus.Subscribe<CreateFileActionMsg>(OnFileInvolved);\r
- MessageBus.Subscribe<ModifyFileActionMsg>(OnFileInvolved);\r
+ MessageBus.Subscribe<RemoveFileActionMsg>(OnFileInvolved);\r
\r
source.Startup(localAddress);\r
bindingSource.DataSource = source;\r
}\r
\r
private void OnFileInvolved(FileActionMsg m) {\r
- Collection<ISourceItem> source = bindingSource.DataSource as Collection<ISourceItem>;\r
- if (source == null)\r
- return;\r
- ISourceItem item = source.Where(x => x.Name.Equals(m.FileName)).SingleOrDefault();\r
- if (item == null)\r
- return;\r
-\r
- item.IsHighlighted = true;\r
+ UpdateSelectedSources();\r
}\r
\r
private void dataGridSource_CellMouseEnter(object sender, DataGridViewCellEventArgs e) {\r
if (selectedrows == null)\r
return;\r
if (e.ColumnIndex == 0) {\r
- UpdateSelectedSources(selectedrows);\r
+ UpdateSelectedSources();\r
return;\r
}\r
if (IsPlayColumn(e.ColumnIndex)) {\r
}\r
}\r
\r
- private void UpdateSelectedSources(DataGridViewSelectedRowCollection selectedRows) {\r
+ private void UpdateSelectedSources() {\r
String name;\r
+ var selectedRows = dataGridSource.SelectedRows;\r
bool valueOfCheckBoxes = GetValueOfCheckBoxes(selectedRows);\r
int nameIndex = dataGridSource.Columns.Cast<DataGridViewColumn>().Where(x => x.HeaderText == StringResources.NEV).SingleOrDefault().Index;\r
int checkBoxIndex = dataGridSource.Columns.Cast<DataGridViewColumn>().Where(x => x.GetType() == typeof(DataGridViewCheckBoxColumn)).SingleOrDefault().Index;\r
private void dataGridSource_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e) {\r
if (e.RowIndex < 0)\r
return;\r
- var selectedRows = dataGridSource.SelectedRows;\r
- UpdateSelectedSources(selectedRows);\r
- }\r
-\r
- public void SourceDeleted(String fileName) {\r
- int index = dataGridSource.Columns.Cast<DataGridViewColumn>().Where(x => x.HeaderText == StringResources.NEV).SingleOrDefault().Index;\r
- foreach (DataGridViewRow actual in selectedSourceRows) {\r
- String actualName = actual.Cells[index].Value as string;\r
- if (fileName.Equals(actualName)) {\r
- selectedSourceRows.Remove(actual);\r
- if (txtSelectedSource.InvokeRequired) {\r
- SetTextCallback d = new SetTextCallback(SetTextSelectedSourceAndMetadataButtonEnabled);\r
- Invoke(d);\r
- } else\r
- SetTextSelectedSourceAndMetadataButtonEnabled();\r
- return;\r
- }\r
- }\r
- }\r
-\r
- private void SetTextSelectedSourceAndMetadataButtonEnabled() {\r
- SetTextSelectedSourceTextFromCheckBoxes();\r
- SetMetadataButtonEnabled(selectedSourceRows.Count > 0);\r
+ UpdateSelectedSources();\r
}\r
\r
private void dataGridSource_KeyDown(object sender, KeyEventArgs e) {\r
- if (e.KeyCode == Keys.Space && dataGridSource.CurrentCell.GetType() != typeof(DataGridViewCheckBoxCell)) {\r
- var selectedRows = dataGridSource.SelectedRows;\r
- UpdateSelectedSources(selectedRows);\r
- }\r
+ if (e.KeyCode != Keys.Space || dataGridSource.CurrentCell.GetType() == typeof(DataGridViewCheckBoxCell))\r
+ return;\r
+ UpdateSelectedSources();\r
}\r
\r
private void buttonMetadata_Click(object sender, EventArgs e) {\r
if (result.Count == 1) {\r
trafficMetadataSelected?.Invoke(result[0].MediaID, result[0].VariantID);\r
UpdateEditArchiveMetadataEnabled();\r
- txtSelectedMetadata.Text = result[0].MediaID;\r
+ textSelectedMetadata.Text = result[0].MediaID;\r
} else {\r
TrafficLookupResultSelector lookupResult = new TrafficLookupResultSelector(result, trafficMetadataSelected);\r
lookupResult.ShowDialog();\r
List<Story> list = stories.ToList();\r
if (list.Count == 1) {\r
UpdateEditArchiveMetadataEnabled();\r
- txtSelectedMetadata.Text = list[0].ID;\r
+ textSelectedMetadata.Text = list[0].ID;\r
octopusMetadataSelected?.Invoke(list[0].ID);\r
} else {\r
OctopusLookupResultSelector box = new OctopusLookupResultSelector(list, octopusMetadataSelected);\r
}\r
if (list.Count == 1) {\r
UpdateEditArchiveMetadataEnabled();\r
- txtSelectedMetadata.Text = list[0].ID;\r
+ textSelectedMetadata.Text = list[0].ID;\r
octopusMetadataSelected?.Invoke(list[0].ID);\r
//octopusIDSelector.IDSelectedFromOutside(list[0].ID);\r
return;\r
MediaCubeApi = mediaCubeApi,\r
SourceConfig = Configuration.Source,\r
TargetConfig = target,\r
- ID = txtSelectedMetadata.Text,\r
+ ID = textSelectedMetadata.Text,\r
InputFileName = sourceItem.Name,\r
Segments = segments == null ? null : new List<Segment>(segments),\r
ArchiveMetadata = ArchiveMetadata.DeepClone(archiveMetadata),\r
return result;\r
}\r
\r
- private void OnInfoTextChanged(object sender, EventArgs e) {\r
- if (!sender.Equals(txtSelectedSource))\r
- ApplyProcessorButtonsLogic();\r
+ private void OnMetadataIDChanged(object sender, EventArgs e) {\r
+ ApplyProcessorButtonsLogic();\r
ApplyMetaDataButtonLogic();\r
}\r
\r
\r
private void ApplyProcessorButtonsLogic() {\r
ClearSelectedProcessors();\r
- if (!String.IsNullOrEmpty(txtSelectedSource.Text) && !String.IsNullOrEmpty(txtSelectedMetadata.Text)) {\r
+ if (!String.IsNullOrEmpty(textSelectedMetadata.Text) && !String.IsNullOrEmpty(textSelectedMetadata.Text)) {\r
ChangeProcessButtonsState(true);\r
} else {\r
ChangeProcessButtonsState(false);\r
\r
private void ApplyProcessorButtonsLogicWithoutArchiveMetadataButton() {\r
ClearSelectedProcessors();\r
- if (!String.IsNullOrEmpty(txtSelectedMetadata.Text) && !String.IsNullOrEmpty(txtSelectedMetadata.Text)) {\r
+ if (!String.IsNullOrEmpty(textSelectedMetadata.Text) && !String.IsNullOrEmpty(textSelectedMetadata.Text)) {\r
ChangeProcessButtonsState(true);\r
} else {\r
ChangeProcessButtonsState(false);\r
private BlockingCollection<ITargetProcessor> jobsQueue = new BlockingCollection<ITargetProcessor>();\r
private BackgroundWorker processorWorker;\r
public IMessageBus MessageBus { get; set; }\r
- public ConfigurationInfo Configuration;\r
+ private ConfigurationInfo configuration;\r
+ public ConfigurationInfo Configuration {\r
+ get { return configuration; }\r
+ set {\r
+ //Try modban indulva, ennek mar futnia kell\r
+ configuration = value;\r
+ InitializeSource();\r
+ }\r
+ }\r
private TraficMetadataSelected trafficMetadataSelected;\r
private OctopusMetadataSelected octopusMetadataSelected;\r
private Color newMSGColor;\r
}\r
\r
private void InitializeComponents() {\r
- InitializeSource();\r
InitializeMetadata();\r
InitializeTarget();\r
InitializeJobs();\r
<metadata name="columnStatus.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">\r
<value>True</value>\r
</metadata>\r
- <metadata name="columnProgress.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">\r
- <value>True</value>\r
- </metadata>\r
<metadata name="columnStarted.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">\r
<value>True</value>\r
</metadata>\r
\r
public MeastroFormNotifyIcon(ConfigurationInfo config, IMessageBus messageBus) {\r
Config = config;\r
- form.Configuration = config;\r
form.MessageBus = messageBus;\r
+ form.Configuration = config;\r
\r
messageBus.Subscribe<CreateFileActionMsg>(OnFileCreated);\r
messageBus.Subscribe<RemoveFileActionMsg>(OnFileRemoved);\r
notification.Icon = System.Drawing.SystemIcons.Information;\r
notification.Click += Notification_Click;\r
notification.BalloonTipClicked += Notification_BalloonTipClicked;\r
+ notification.BalloonTipClosed += Notification_BalloonTipClosed; ;\r
+ }\r
+\r
+ private void Notification_BalloonTipClosed(object sender, EventArgs e) {\r
+ notification.Visible = false;\r
}\r
\r
private void OnFileCreated(FileActionMsg m) {\r
}\r
\r
public void Show(string tooltipText) {\r
- if (tooltipText == null)\r
+ if (tooltipText == null || form.Visible)\r
return;\r
notification.BalloonTipText = tooltipText;\r
notification.Visible = true;\r
form.Activate();\r
}\r
\r
- public void BeginShowForm() {\r
- Task.Run(() => {\r
- ShowForm(); \r
- });\r
+ public void ShowFormMinimized() {\r
+ notification.Visible = false;\r
+ form.WindowState = FormWindowState.Minimized;\r
+ form.Show();\r
}\r
\r
public void HideForm() {\r
using System.Collections.Generic;\r
using System.Drawing;\r
using System.IO;\r
+using System.Linq;\r
using System.Reflection;\r
using System.Runtime.InteropServices;\r
using System.Security.AccessControl;\r
/// </summary>\r
[STAThread]\r
static void Main() {\r
- //string appGuid = ((GuidAttribute)Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(GuidAttribute), false).GetValue(0)).Value.ToString();\r
- //string mutexId = string.Format("Global\\{{{0}}}", appGuid);\r
- //bool createdNew;\r
- //var allowEveryoneRule = new MutexAccessRule(new SecurityIdentifier(WellKnownSidType.WorldSid, null), MutexRights.FullControl, AccessControlType.Allow);\r
- //var securitySettings = new MutexSecurity();\r
- //securitySettings.AddAccessRule(allowEveryoneRule);\r
- //using (var mutex = new Mutex(false, mutexId, out createdNew, securitySettings)) {\r
- // var hasHandle = false;\r
- // try {\r
- // try {\r
- // hasHandle = mutex.WaitOne(500, false);\r
- // if (hasHandle == false)\r
- // MessageBox.Show("A MediaCube Maestro alkalmazás már fut egy példányban.");\r
- // }\r
- // catch (AbandonedMutexException) {\r
- // hasHandle = true;\r
- // }\r
- // }\r
- // finally {\r
- // if (hasHandle) {\r
- // Application.EnableVisualStyles();\r
- // Application.SetCompatibleTextRenderingDefault(false);\r
- // Application.Run(new TrayApplicationContext());\r
- // mutex.ReleaseMutex();\r
- // }\r
- // }\r
- //}\r
- Application.EnableVisualStyles();\r
- Application.SetCompatibleTextRenderingDefault(false);\r
- Application.Run(new TrayApplicationContext());\r
+ string appGuid = ((GuidAttribute)Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(GuidAttribute), false).GetValue(0)).Value.ToString();\r
+ string mutexId = string.Format("Global\\{{{0}}}", appGuid);\r
+ bool createdNew;\r
+ var allowEveryoneRule = new MutexAccessRule(new SecurityIdentifier(WellKnownSidType.WorldSid, null), MutexRights.FullControl, AccessControlType.Allow);\r
+ var securitySettings = new MutexSecurity();\r
+ securitySettings.AddAccessRule(allowEveryoneRule);\r
+ using (var mutex = new Mutex(false, mutexId, out createdNew, securitySettings)) {\r
+ var hasHandle = false;\r
+ try {\r
+ try {\r
+ hasHandle = mutex.WaitOne(500, false);\r
+ if (hasHandle == false)\r
+ MessageBox.Show("A MediaCube Maestro alkalmazás már fut egy példányban.");\r
+ }\r
+ catch (AbandonedMutexException) {\r
+ hasHandle = true;\r
+ }\r
+ }\r
+ finally {\r
+ if (hasHandle) {\r
+ Application.EnableVisualStyles();\r
+ Application.SetCompatibleTextRenderingDefault(false);\r
+ Application.Run(new TrayApplicationContext());\r
+ mutex.ReleaseMutex();\r
+ }\r
+ }\r
+ }\r
+ //Application.EnableVisualStyles();\r
+ //Application.SetCompatibleTextRenderingDefault(false);\r
+ //Application.Run(new TrayApplicationContext());\r
}\r
}\r
\r
private IMessageBus messageBus = new MessageBus();\r
\r
public TrayApplicationContext() {\r
- Splash splash = new Splash();\r
- Task.Run(() => {\r
- Application.Run(splash);\r
- });\r
\r
+ String[] arguments = Environment.GetCommandLineArgs();\r
+ if (!arguments.ToList().Contains("nosplash")) {\r
+ Splash splash = new Splash();\r
+ Task.Run(() => {\r
+ Application.Run(splash);\r
+ });\r
+ }\r
CreateForms();\r
CreateTrayIcon();\r
}\r
private void CreateForm(string file) {\r
try {\r
ConfigurationInfo config = Loader.Get(file);\r
- //string decryptedstring = StringCipher.Decrypt(encryptedstring, password);\r
-\r
if (!config.Active)\r
return;\r
+ ApplyCommandLineParameters(ref config);\r
MeastroFormNotifyIcon form = new MeastroFormNotifyIcon(config, messageBus);\r
forms.Add(form);\r
- if (!config.StartInTray)\r
+ if (config.StartInTray)\r
+ form.ShowFormMinimized();\r
+ else\r
form.ShowForm();\r
}\r
catch (Exception e) {\r
}\r
}\r
\r
+ private void ApplyCommandLineParameters(ref ConfigurationInfo config) {\r
+ String[] arguments = Environment.GetCommandLineArgs();\r
+ string replacementHost = arguments.ToList().Where(i => i.StartsWith("http") || i.StartsWith("https")).FirstOrDefault();\r
+ if (String.IsNullOrEmpty(replacementHost))\r
+ return;\r
+ var mediaCubeProvider = config.GetMetadataProvider<MediaCubeMetadata>();\r
+ mediaCubeProvider.Server.Address = replaceAuthority(replacementHost, mediaCubeProvider.Server.Address);\r
+ var octopusProvider = config.GetMetadataProvider<OctopusMetadata>();\r
+ octopusProvider.Server.Address = replaceAuthority(replacementHost, octopusProvider.Server.Address);\r
+ if (config.Source is NEXIOSource)\r
+ config.Source.Local.Address = replaceAuthority(replacementHost, config.Source.Local.Address);\r
+ }\r
+\r
+ private Uri replaceAuthority(string replacementHost, Uri address) {\r
+ if (address == null)\r
+ return address;\r
+ Uri replacementUri = new Uri(replacementHost);\r
+ var builder = new UriBuilder(address);\r
+ builder.Host = replacementUri.Host;\r
+ builder.Port = replacementUri.Port;\r
+ return builder.Uri;\r
+ }\r
+\r
private List<MenuItem> CreateMenuItems() {\r
List<MenuItem> menuItems = new List<MenuItem>();\r
menuItems.Add(new MenuItem("Mindet megjeleníti", ShowAll));\r
}\r
\r
private void ClearDataGridView() {\r
- this.parent.SafeCall(() => {\r
- Clear();\r
- }\r
- );\r
+ parent.SafeCall(() => Clear());\r
cache.Clear();\r
initialized = false;\r
}\r
\r
public void OnRenamed(object sender, RenamedEventArgs e) {\r
logger.Debug("{0} {1} {2}", e.ChangeType, e.OldName, e.Name);\r
- var item = this.Where(x => x.Name == e.OldName).SingleOrDefault();\r
- if (item == null)\r
- return;\r
- if (item.CanHandle(acceptableExtensions)) {\r
- item.FileInfo = new FileInfo(e.FullPath);\r
+ FileInfo fiOld = new FileInfo(e.OldFullPath);\r
+ FileInfo fiNew = new FileInfo(e.FullPath);\r
+ if (fiOld.Extension.Equals(fiNew.Extension)) {\r
+ var item = this.Where(x => x.Name == e.OldName).SingleOrDefault();\r
+ if (item == null || !item.CanHandle(acceptableExtensions))\r
+ return;\r
parent.SafeCall(() => {\r
+ item.FileInfo = new FileInfo(e.FullPath);\r
+ item.IsHighlighted = true;\r
messageBus.Send(new ModifyFileActionMsg() {\r
FileName = e.Name,\r
Source = parent\r
});\r
});\r
+ } else {\r
+ var newItem = CreateItem(fiNew, true);\r
+ if (newItem.CanHandle(acceptableExtensions))\r
+ SafeCreateItem(newItem);\r
+ else {\r
+ var item = this.Where(x => x.Name == e.OldName).SingleOrDefault();\r
+ SafeDeleteItem(item);\r
+ }\r
}\r
}\r
\r
private void OnChanged(object sender, FileSystemEventArgs e) {\r
logger.Debug("{0} {1}", e.ChangeType, e.Name);\r
- var item = this.Where(x => x.Name == e.Name).SingleOrDefault();\r
- if (item == null)\r
+ var item = this.Where(x => x.Name == e.Name).FirstOrDefault();\r
+ if (item == null || !item.CanHandle(acceptableExtensions))\r
return;\r
- if (item.CanHandle(acceptableExtensions)) {\r
+ parent.SafeCall(() => {\r
item.FileInfo = new FileInfo(e.FullPath);\r
- parent.SafeCall(() => {\r
- messageBus.Send(new ModifyFileActionMsg() {\r
- FileName = e.Name,\r
- Source = parent\r
- });\r
+ item.IsHighlighted = true;\r
+ messageBus.Send(new ModifyFileActionMsg() {\r
+ FileName = e.Name,\r
+ Source = parent\r
});\r
- }\r
+ });\r
}\r
\r
private void OnCreated(object sender, FileSystemEventArgs e) {\r
//TODO enable cancel\r
+ var item = CreateItem(new FileInfo(e.FullPath), true);\r
+ if (!item.CanHandle(acceptableExtensions))\r
+ return;\r
CreatedFileMonitor createdFileMonitor = new CreatedFileMonitor(e.FullPath);\r
createdFileMonitor.RunWorkerCompleted += (s1, e1) => {\r
FileInfo fileInfo = e1.Result as FileInfo;\r
- parent.SafeCall(() => {\r
- Insert(0, CreateItem(fileInfo, true));\r
- messageBus.Send(new CreateFileActionMsg() {\r
- FileName = fileInfo.Name,\r
- Source = parent\r
- });\r
- });\r
+ var completedItem = CreateItem(fileInfo, true);\r
+ SafeCreateItem(completedItem);\r
};\r
logger.Debug("{0} {1}", e.ChangeType, e.Name);\r
}\r
\r
+ private void SafeCreateItem(FileSourceItem item) {\r
+ parent.SafeCall(() => {\r
+ Insert(0, item);\r
+ messageBus.Send(new CreateFileActionMsg() {\r
+ FileName = item.Name,\r
+ Source = parent\r
+ });\r
+ });\r
+ }\r
+\r
private void OnDeleted(object sender, FileSystemEventArgs e) {\r
logger.Debug("{0} {1}", e.ChangeType, e.Name);\r
- var enumList = this.Where(item => item.Name.Equals(e.Name))?.ToList();\r
- FileSourceItem fileSourceItem = enumList.Count == 0 ? null : enumList.First();\r
- if (fileSourceItem == null)\r
+ FileSourceItem item = this.Where(i => i.Name.Equals(e.Name)).FirstOrDefault();\r
+ if (item == null || !item.CanHandle(acceptableExtensions))\r
return;\r
- if (fileSourceItem.CanHandle(acceptableExtensions)) {\r
- parent.SafeCall(() => {\r
- Remove(fileSourceItem);\r
- messageBus.Send(new RemoveFileActionMsg() {\r
- FileName = e.Name,\r
- Source = parent\r
- });\r
+ SafeDeleteItem(item);\r
+ }\r
+\r
+ private void SafeDeleteItem(FileSourceItem item) {\r
+ parent.SafeCall(() => {\r
+ Remove(item);\r
+ messageBus.Send(new RemoveFileActionMsg() {\r
+ FileName = item.Name,\r
+ Source = parent\r
});\r
- MaestroForm form = (MaestroForm)parent;\r
- form.SourceDeleted(e.Name);\r
- return;\r
- }\r
+ });\r
}\r
\r
public void ApplySort(ListSortDescriptionCollection sorts) {\r
TerminateClient(targetFTP);\r
}\r
\r
+ private void DeleteFile(string currentFile) {\r
+ targetFTP.DeleteFile(currentFile);\r
+ }\r
+\r
protected override void UploadFile() {\r
using (FileStream istream = File.OpenRead(Input)) {\r
using (Stream ostream = targetFTP.OpenWrite(OutputName)) {\r
workFlowAction.destination = Output;\r
Status = "Folyamatban";\r
//DateTime started = DateTime.Now;\r
+ string currentFile = GetOutputFilePath(workingDir, OutputName);\r
+ if (FileExists(currentFile) && parameters.TargetConfig.DisableFileVersioning)\r
+ DeleteFile(currentFile);\r
UploadFile();\r
//logger.Info("Spend (s):" + (DateTime.Now - started).TotalSeconds);\r
ExecuteCompleted();\r
return result;\r
}\r
\r
+ private void DeleteFile(string currentFile) {\r
+ File.Delete(currentFile);\r
+ }\r
\r
private string GetOutputName() {\r
if (String.IsNullOrEmpty(OutputName))\r
string nameWithoutExtension = parameters.TargetConfig.OutputFormat.Replace("%ID%", ID).Replace("%SOURCENAME%", Path.GetFileNameWithoutExtension(InputName));\r
string extension = InputName.Contains(".") ? InputName.Substring(InputName.LastIndexOf(".")) : DEFAULT_EXTENSION;\r
extension = extension.ToUpper();\r
-\r
string result = String.Format(FILENAME, nameWithoutExtension, extension);\r
- int version = 1;\r
- while (FileExists(GetOutputFilePath(workingDir, result))) {\r
- string versioned = String.Format(VERSIONED_FILENAME, nameWithoutExtension, version, extension);\r
- logger.Debug(ALREADY_EXISTS, result, versioned);\r
- result = versioned;\r
- version++;\r
+ if (!parameters.TargetConfig.DisableFileVersioning) {\r
+ int version = 1;\r
+ while (FileExists(GetOutputFilePath(workingDir, result))) {\r
+ string versioned = String.Format(VERSIONED_FILENAME, nameWithoutExtension, version, extension);\r
+ logger.Debug(ALREADY_EXISTS, result, versioned);\r
+ result = versioned;\r
+ version++;\r
+ }\r
}\r
return result;\r
}\r
--- /dev/null
+""\r
+{\r
+"FILE_VERSION" = "9237"\r
+"ENLISTMENT_CHOICE" = "NEVER"\r
+"PROJECT_FILE_RELATIVE_PATH" = ""\r
+"NUMBER_OF_EXCLUDED_FILES" = "0"\r
+"ORIGINAL_PROJECT_FILE_PATH" = ""\r
+"NUMBER_OF_NESTED_PROJECTS" = "0"\r
+"SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROJECT"\r
+}\r
tpRundown.Text = Resources.ADASTUKOR;\r
tpStoryFolder.Text = Resources.MAPPA;\r
linkID.Text = Resources.KERESES;\r
- bindingRundown.Add(Resources.VALASSZON_ELEMET);\r
- bindingStoryFolder.Add(Resources.VALASSZON_ELEMET);\r
+ //bindingRundown.Add(Resources.VALASSZON_ELEMET);\r
+ //bindingStoryFolder.Add(Resources.VALASSZON_ELEMET);\r
}\r
\r
private void OctopusIDSelector_Load(object sender, EventArgs e) {\r
--- /dev/null
+#A user.dir mindig a test projekt mappaja, a relativ hivatkozasok ehhez kepest ertendok. \r
+#JobEngine\r
+jobengine.loglevel=INFO\r
+jobengine.jobsteps.root=../user.jobengine.osgi.server/resources/executors\r
+jobengine.jobtemplates.root=../user.jobengine.osgi.server/resources/templates\r
+jobengine.jobsteps.alternate.root=../user.jobengine.executors/bin/user/jobengine/server/steps\r
+jobengine.db.url=jdbc:db2://10.228.198.1:50000/mediaarc:retrieveMessagesFromServerOnGetMessage=true;\r
+jobengine.db.user=db2admin\r
+jobengine.db.password=password\r
+jobengine.octopus.api.address=http://10.10.1.11/api/v1\r
+jobengine.octopus.api.user=mam\r
+jobengine.octopus.api.password=napocska\r
+jobengine.nosql.db.url=jdbc:db2://10.228.198.1:50000/mccache:retrieveMessagesFromServerOnGetMessage=true;\r
+jobengine.nosql.db.user=db2admin\r
+jobengine.nosql.db.password=password\r
+jobengine.nexio.db.url=jdbc:sqlserver://10.10.1.59:1433;databaseName=NXDB;\r
+jobengine.nexio.db.user=sa\r
+jobengine.nexio.db.password=resolve\r
+#System\r
+jetty.home=../user.jobengine.osgi.rest/\r
+jetty.etc.config.urls=etc/user-jetty.xml,etc/user-jetty-ssl.xml,etc/user-jetty-ssl-context.xml,etc/user-jetty-http.xml,etc/user-jetty-https.xml\r
+log4j.configuration=../-configuration/log4j.properties\r
+log4j.configurationFile=../-configuration/log4j2.xml
\ No newline at end of file
\r
public class OctopusDataMinerTest {\r
\r
- private OctopusDataMiner sut;\r
-\r
@BeforeClass\r
public static void initialize() throws Exception {\r
// System.setProperty("jobengine.nosql.db.url",\r
\r
Properties properties = new Properties();\r
URL srcLocation = MethodHandles.lookup().lookupClass().getProtectionDomain().getCodeSource().getLocation();\r
- URL location = new URL(srcLocation, "../../-configuration/mediacube-dev.properties");\r
+ //URL location = new URL(srcLocation, "../../-configuration/mediacube-dev.properties");\r
+ URL location = new URL(srcLocation, "../../-configuration/mediacube-dev-user.properties");\r
properties.load(new FileInputStream(location.toURI().getPath().toString()));\r
System.getProperties().putAll(properties);\r
\r
}\r
\r
- @Test\r
- public void run() {\r
- sut = new OctopusDataMiner();\r
- sut.run();\r
- }\r
-\r
- @Test\r
- public void integrationTestWithClear() {\r
- // fixture\r
- sut = new OctopusDataMiner();\r
- sut.clear();\r
-\r
- // Exercise\r
- sut.run();\r
- }\r
+ private OctopusDataMiner sut;\r
\r
@Test\r
public void deleteOrphanStories() {\r
try {\r
- DB db = NoSQLClient.getDB(\r
- "jdbc:db2://10.228.198.1:50000/mccache:retrieveMessagesFromServerOnGetMessage=true;", "db2admin",\r
- "password", "test");\r
+ DB db = NoSQLClient.getDB("jdbc:db2://10.228.198.1:50000/mccache:retrieveMessagesFromServerOnGetMessage=true;", "db2admin", "password", "test");\r
DBCollection collection = db.getCollection("testCollection");\r
\r
long id1 = 1, id2 = 2, id3 = 3, id4 = 4, id5 = 5;\r
}\r
}\r
\r
+ @Test\r
+ public void integrationTestWithClear() {\r
+ // fixture\r
+ sut = new OctopusDataMiner();\r
+ sut.clear();\r
+\r
+ // Exercise\r
+ sut.run();\r
+ }\r
+\r
+ @Test\r
+ public void run() {\r
+ sut = new OctopusDataMiner();\r
+ sut.run();\r
+ }\r
+\r
@Test\r
public void test() throws SQLException {\r
IOctopusAPI api = new OctopusAPI();\r
List<DBObject> stories = api.getStories();\r
for (DBObject actual : stories) {\r
if (actual.containsField("rundown")) {\r
- BasicDBList rundowns = (BasicDBList)actual.get("rundown");\r
+ BasicDBList rundowns = (BasicDBList) actual.get("rundown");\r
BasicDBList objs = (BasicDBList) actual.get("mosObjects");\r
- if(objs.size() > 0)\r
+ if (objs.size() > 0)\r
System.out.println(rundowns);\r
}\r
}\r
db2ts "create index media_houseid for text on media(houseid) UPDATE FREQUENCY D(*) H(*) M(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59) UPDATE MINIMUM 1 connect to mc"\r
db2ts "create index mediafile_houseid for text on mediafile(houseid) UPDATE FREQUENCY D(*) H(*) M(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59) UPDATE MINIMUM 1 connect to mc"\r
\r
+\r
db2ts "update index item_title for text connect to mc"\r
db2ts "update index item_desc for text connect to mc"\r
db2ts "update index item_houseid for text connect to mc"\r