diff --git a/IOB-MAN/App.config b/IOB-MAN/App.config index 02dc44ed..3dc05dd0 100644 --- a/IOB-MAN/App.config +++ b/IOB-MAN/App.config @@ -4,9 +4,11 @@ - - - + + + + \ No newline at end of file diff --git a/IOB-MAN/FodyWeavers.xml b/IOB-MAN/FodyWeavers.xml new file mode 100644 index 00000000..5029e706 --- /dev/null +++ b/IOB-MAN/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/IOB-MAN/FodyWeavers.xsd b/IOB-MAN/FodyWeavers.xsd new file mode 100644 index 00000000..44a53744 --- /dev/null +++ b/IOB-MAN/FodyWeavers.xsd @@ -0,0 +1,111 @@ + + + + + + + + + + + + A list of assembly names to exclude from the default action of "embed all Copy Local references", delimited with line breaks + + + + + A list of assembly names to include from the default action of "embed all Copy Local references", delimited with line breaks. + + + + + A list of unmanaged 32 bit assembly names to include, delimited with line breaks. + + + + + A list of unmanaged 64 bit assembly names to include, delimited with line breaks. + + + + + The order of preloaded assemblies, delimited with line breaks. + + + + + + This will copy embedded files to disk before loading them into memory. This is helpful for some scenarios that expected an assembly to be loaded from a physical file. + + + + + Controls if .pdbs for reference assemblies are also embedded. + + + + + Embedded assemblies are compressed by default, and uncompressed when they are loaded. You can turn compression off with this option. + + + + + As part of Costura, embedded assemblies are no longer included as part of the build. This cleanup can be turned off. + + + + + Costura by default will load as part of the module initialization. This flag disables that behavior. Make sure you call CosturaUtility.Initialize() somewhere in your code. + + + + + Costura will by default use assemblies with a name like 'resources.dll' as a satellite resource and prepend the output path. This flag disables that behavior. + + + + + A list of assembly names to exclude from the default action of "embed all Copy Local references", delimited with | + + + + + A list of assembly names to include from the default action of "embed all Copy Local references", delimited with |. + + + + + A list of unmanaged 32 bit assembly names to include, delimited with |. + + + + + A list of unmanaged 64 bit assembly names to include, delimited with |. + + + + + The order of preloaded assemblies, delimited with |. + + + + + + + + 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. + + + + + A comma-separated list of error codes that can be safely ignored in assembly verification. + + + + + 'false' to turn off automatic generation of the XML Schema file. + + + + + \ No newline at end of file diff --git a/IOB-MAN/IOB-MAN.csproj b/IOB-MAN/IOB-MAN.csproj index 7f92fa24..162b615c 100644 --- a/IOB-MAN/IOB-MAN.csproj +++ b/IOB-MAN/IOB-MAN.csproj @@ -1,5 +1,6 @@  + Debug @@ -11,6 +12,8 @@ v4.6.1 512 true + + AnyCPU @@ -31,7 +34,13 @@ prompt 4 + + IobManIcon.ico + + + ..\packages\Costura.Fody.4.1.0\lib\net40\Costura.dll + ..\packages\NLog.4.6.8\lib\net45\NLog.dll @@ -53,6 +62,9 @@ + + VersGen.cs + Form @@ -63,6 +75,10 @@ + + + Always + IOBManPanel.cs @@ -94,7 +110,7 @@ Settings.settings True - + PreserveNewest @@ -103,4 +119,12 @@ + + + Questo progetto fa riferimento a uno o più pacchetti NuGet che non sono presenti in questo computer. Usare lo strumento di ripristino dei pacchetti NuGet per scaricarli. Per altre informazioni, vedere http://go.microsoft.com/fwlink/?LinkID=322105. Il file mancante è {0}. + + + + + \ No newline at end of file diff --git a/IOB-MAN/IOBManPanel.Designer.cs b/IOB-MAN/IOBManPanel.Designer.cs index df9ab084..105090ed 100644 --- a/IOB-MAN/IOBManPanel.Designer.cs +++ b/IOB-MAN/IOBManPanel.Designer.cs @@ -29,37 +29,46 @@ private void InitializeComponent() { this.components = new System.ComponentModel.Container(); - this.btnOpen = new System.Windows.Forms.Button(); this.btnClose = new System.Windows.Forms.Button(); this.MainTimer = new System.Windows.Forms.Timer(this.components); - this.lblNumChild = new System.Windows.Forms.Label(); + this.statusStrip1 = new System.Windows.Forms.StatusStrip(); + this.tsProgBar = new System.Windows.Forms.ToolStripProgressBar(); + this.tsslNumProc = new System.Windows.Forms.ToolStripStatusLabel(); + this.panel1 = new System.Windows.Forms.Panel(); + this.btnMaximixeAll = new System.Windows.Forms.Button(); + this.btnMinimizeAll = new System.Windows.Forms.Button(); + this.menuStrip1 = new System.Windows.Forms.MenuStrip(); + this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.loadConfToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.updateModeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.processManagerToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.closeALLToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.restartALLToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); + this.panel2 = new System.Windows.Forms.Panel(); this.dgvManagedItems = new System.Windows.Forms.DataGridView(); this.btnCloseAll = new System.Windows.Forms.Button(); this.btnRestartAll = new System.Windows.Forms.Button(); - this.btnUpdateMode = new System.Windows.Forms.Button(); + this.statusStrip1.SuspendLayout(); + this.panel1.SuspendLayout(); + this.menuStrip1.SuspendLayout(); + this.tableLayoutPanel1.SuspendLayout(); + this.panel2.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.dgvManagedItems)).BeginInit(); this.SuspendLayout(); // - // btnOpen - // - this.btnOpen.Location = new System.Drawing.Point(11, 11); - this.btnOpen.Margin = new System.Windows.Forms.Padding(2); - this.btnOpen.Name = "btnOpen"; - this.btnOpen.Size = new System.Drawing.Size(108, 27); - this.btnOpen.TabIndex = 1; - this.btnOpen.Text = "Open"; - this.btnOpen.UseVisualStyleBackColor = true; - this.btnOpen.Click += new System.EventHandler(this.btnOpen_Click); - // // btnClose // - this.btnClose.Location = new System.Drawing.Point(133, 11); - this.btnClose.Margin = new System.Windows.Forms.Padding(2); + this.btnClose.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.btnClose.BackColor = System.Drawing.SystemColors.WindowText; + this.btnClose.ForeColor = System.Drawing.Color.Yellow; + this.btnClose.Location = new System.Drawing.Point(11, 92); + this.btnClose.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); this.btnClose.Name = "btnClose"; - this.btnClose.Size = new System.Drawing.Size(108, 27); + this.btnClose.Size = new System.Drawing.Size(96, 26); this.btnClose.TabIndex = 70; this.btnClose.Text = "Close SEL"; - this.btnClose.UseVisualStyleBackColor = true; + this.btnClose.UseVisualStyleBackColor = false; this.btnClose.Click += new System.EventHandler(this.btnClose_Click); // // MainTimer @@ -67,79 +76,224 @@ this.MainTimer.Interval = 500; this.MainTimer.Tick += new System.EventHandler(this.MainTimer_Tick); // - // lblNumChild + // statusStrip1 // - this.lblNumChild.AutoSize = true; - this.lblNumChild.Location = new System.Drawing.Point(12, 40); - this.lblNumChild.Name = "lblNumChild"; - this.lblNumChild.Size = new System.Drawing.Size(16, 13); - this.lblNumChild.TabIndex = 73; - this.lblNumChild.Text = "..."; - this.lblNumChild.Click += new System.EventHandler(this.lblNumChild_Click); + this.statusStrip1.ImageScalingSize = new System.Drawing.Size(20, 20); + this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.tsProgBar, + this.tsslNumProc}); + this.statusStrip1.Location = new System.Drawing.Point(0, 376); + this.statusStrip1.Name = "statusStrip1"; + this.statusStrip1.Padding = new System.Windows.Forms.Padding(1, 0, 10, 0); + this.statusStrip1.Size = new System.Drawing.Size(689, 22); + this.statusStrip1.TabIndex = 82; + this.statusStrip1.Text = "statusStrip1"; + // + // tsProgBar + // + this.tsProgBar.Name = "tsProgBar"; + this.tsProgBar.Size = new System.Drawing.Size(75, 16); + // + // tsslNumProc + // + this.tsslNumProc.Name = "tsslNumProc"; + this.tsslNumProc.Size = new System.Drawing.Size(16, 17); + this.tsslNumProc.Text = "..."; + // + // panel1 + // + this.panel1.Controls.Add(this.menuStrip1); + this.panel1.Dock = System.Windows.Forms.DockStyle.Top; + this.panel1.Location = new System.Drawing.Point(0, 0); + this.panel1.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); + this.panel1.Name = "panel1"; + this.panel1.Size = new System.Drawing.Size(689, 31); + this.panel1.TabIndex = 83; + this.panel1.Paint += new System.Windows.Forms.PaintEventHandler(this.panel1_Paint); + // + // btnMaximixeAll + // + this.btnMaximixeAll.BackColor = System.Drawing.SystemColors.Highlight; + this.btnMaximixeAll.ForeColor = System.Drawing.SystemColors.ControlLightLight; + this.btnMaximixeAll.Location = new System.Drawing.Point(11, 11); + this.btnMaximixeAll.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); + this.btnMaximixeAll.Name = "btnMaximixeAll"; + this.btnMaximixeAll.Size = new System.Drawing.Size(96, 26); + this.btnMaximixeAll.TabIndex = 81; + this.btnMaximixeAll.Text = "Show ALL"; + this.btnMaximixeAll.UseVisualStyleBackColor = false; + this.btnMaximixeAll.Click += new System.EventHandler(this.btnMaximixeAll_Click); + // + // btnMinimizeAll + // + this.btnMinimizeAll.BackColor = System.Drawing.SystemColors.Highlight; + this.btnMinimizeAll.ForeColor = System.Drawing.SystemColors.ControlLightLight; + this.btnMinimizeAll.Location = new System.Drawing.Point(11, 41); + this.btnMinimizeAll.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); + this.btnMinimizeAll.Name = "btnMinimizeAll"; + this.btnMinimizeAll.Size = new System.Drawing.Size(96, 26); + this.btnMinimizeAll.TabIndex = 80; + this.btnMinimizeAll.Text = "Hide ALL"; + this.btnMinimizeAll.UseVisualStyleBackColor = false; + this.btnMinimizeAll.Click += new System.EventHandler(this.btnMinimizeAll_Click); + // + // menuStrip1 + // + this.menuStrip1.ImageScalingSize = new System.Drawing.Size(20, 20); + this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.fileToolStripMenuItem, + this.processManagerToolStripMenuItem}); + this.menuStrip1.Location = new System.Drawing.Point(0, 0); + this.menuStrip1.Name = "menuStrip1"; + this.menuStrip1.Padding = new System.Windows.Forms.Padding(4, 2, 0, 2); + this.menuStrip1.Size = new System.Drawing.Size(689, 24); + this.menuStrip1.TabIndex = 82; + this.menuStrip1.Text = "menuStrip1"; + // + // fileToolStripMenuItem + // + this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.loadConfToolStripMenuItem, + this.updateModeToolStripMenuItem}); + this.fileToolStripMenuItem.Name = "fileToolStripMenuItem"; + this.fileToolStripMenuItem.Size = new System.Drawing.Size(37, 20); + this.fileToolStripMenuItem.Text = "&File"; + // + // loadConfToolStripMenuItem + // + this.loadConfToolStripMenuItem.Name = "loadConfToolStripMenuItem"; + this.loadConfToolStripMenuItem.Size = new System.Drawing.Size(146, 22); + this.loadConfToolStripMenuItem.Text = "&Load conf"; + this.loadConfToolStripMenuItem.Click += new System.EventHandler(this.loadConfToolStripMenuItem_Click); + // + // updateModeToolStripMenuItem + // + this.updateModeToolStripMenuItem.Name = "updateModeToolStripMenuItem"; + this.updateModeToolStripMenuItem.Size = new System.Drawing.Size(146, 22); + this.updateModeToolStripMenuItem.Text = "&Update Mode"; + this.updateModeToolStripMenuItem.Click += new System.EventHandler(this.updateModeToolStripMenuItem_Click); + // + // processManagerToolStripMenuItem + // + this.processManagerToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.closeALLToolStripMenuItem, + this.restartALLToolStripMenuItem}); + this.processManagerToolStripMenuItem.Name = "processManagerToolStripMenuItem"; + this.processManagerToolStripMenuItem.Size = new System.Drawing.Size(109, 20); + this.processManagerToolStripMenuItem.Text = "&Process Manager"; + this.processManagerToolStripMenuItem.Click += new System.EventHandler(this.processManagerToolStripMenuItem_Click); + // + // closeALLToolStripMenuItem + // + this.closeALLToolStripMenuItem.Name = "closeALLToolStripMenuItem"; + this.closeALLToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.closeALLToolStripMenuItem.Text = "Clo&se ALL"; + this.closeALLToolStripMenuItem.Click += new System.EventHandler(this.closeALLToolStripMenuItem_Click); + // + // restartALLToolStripMenuItem + // + this.restartALLToolStripMenuItem.Name = "restartALLToolStripMenuItem"; + this.restartALLToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.restartALLToolStripMenuItem.Text = "&Restart ALL"; + this.restartALLToolStripMenuItem.Click += new System.EventHandler(this.restartALLToolStripMenuItem_Click); + // + // tableLayoutPanel1 + // + this.tableLayoutPanel1.ColumnCount = 2; + this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 120F)); + this.tableLayoutPanel1.Controls.Add(this.panel2, 0, 0); + this.tableLayoutPanel1.Controls.Add(this.dgvManagedItems, 0, 0); + this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill; + this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 31); + this.tableLayoutPanel1.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); + this.tableLayoutPanel1.Name = "tableLayoutPanel1"; + this.tableLayoutPanel1.RowCount = 1; + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tableLayoutPanel1.Size = new System.Drawing.Size(689, 345); + this.tableLayoutPanel1.TabIndex = 85; + // + // panel2 + // + this.panel2.BackColor = System.Drawing.SystemColors.ControlLightLight; + this.panel2.Controls.Add(this.btnRestartAll); + this.panel2.Controls.Add(this.btnCloseAll); + this.panel2.Controls.Add(this.btnClose); + this.panel2.Controls.Add(this.btnMinimizeAll); + this.panel2.Controls.Add(this.btnMaximixeAll); + this.panel2.Dock = System.Windows.Forms.DockStyle.Fill; + this.panel2.Location = new System.Drawing.Point(571, 2); + this.panel2.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); + this.panel2.Name = "panel2"; + this.panel2.Size = new System.Drawing.Size(116, 341); + this.panel2.TabIndex = 85; // // dgvManagedItems // this.dgvManagedItems.AllowUserToAddRows = false; this.dgvManagedItems.AllowUserToDeleteRows = false; + this.dgvManagedItems.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); this.dgvManagedItems.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; - this.dgvManagedItems.Location = new System.Drawing.Point(11, 70); + this.dgvManagedItems.Location = new System.Drawing.Point(3, 3); this.dgvManagedItems.Name = "dgvManagedItems"; this.dgvManagedItems.ReadOnly = true; - this.dgvManagedItems.Size = new System.Drawing.Size(647, 246); - this.dgvManagedItems.TabIndex = 75; - this.dgvManagedItems.SelectionChanged += new System.EventHandler(this.dgvManagedItems_SelectionChanged); + this.dgvManagedItems.RowHeadersWidth = 51; + this.dgvManagedItems.Size = new System.Drawing.Size(563, 339); + this.dgvManagedItems.TabIndex = 76; + this.dgvManagedItems.CellDoubleClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgvManagedItems_CellDoubleClick); // // btnCloseAll // - this.btnCloseAll.Location = new System.Drawing.Point(552, 11); + this.btnCloseAll.BackColor = System.Drawing.SystemColors.ControlDarkDark; + this.btnCloseAll.ForeColor = System.Drawing.SystemColors.ControlLightLight; + this.btnCloseAll.Location = new System.Drawing.Point(11, 148); this.btnCloseAll.Margin = new System.Windows.Forms.Padding(2); this.btnCloseAll.Name = "btnCloseAll"; - this.btnCloseAll.Size = new System.Drawing.Size(108, 27); - this.btnCloseAll.TabIndex = 77; + this.btnCloseAll.Size = new System.Drawing.Size(96, 26); + this.btnCloseAll.TabIndex = 82; this.btnCloseAll.Text = "Close ALL"; - this.btnCloseAll.UseVisualStyleBackColor = true; - this.btnCloseAll.Click += new System.EventHandler(this.button1_Click); + this.btnCloseAll.UseVisualStyleBackColor = false; + this.btnCloseAll.Click += new System.EventHandler(this.btnCloseAll_Click); // // btnRestartAll // - this.btnRestartAll.Location = new System.Drawing.Point(429, 11); + this.btnRestartAll.BackColor = System.Drawing.SystemColors.ControlDarkDark; + this.btnRestartAll.ForeColor = System.Drawing.SystemColors.ControlLightLight; + this.btnRestartAll.Location = new System.Drawing.Point(11, 178); this.btnRestartAll.Margin = new System.Windows.Forms.Padding(2); this.btnRestartAll.Name = "btnRestartAll"; - this.btnRestartAll.Size = new System.Drawing.Size(108, 27); - this.btnRestartAll.TabIndex = 78; + this.btnRestartAll.Size = new System.Drawing.Size(96, 26); + this.btnRestartAll.TabIndex = 83; this.btnRestartAll.Text = "Restart ALL"; - this.btnRestartAll.UseVisualStyleBackColor = true; - this.btnRestartAll.Click += new System.EventHandler(this.button2_Click); - // - // btnUpdateMode - // - this.btnUpdateMode.Location = new System.Drawing.Point(280, 11); - this.btnUpdateMode.Margin = new System.Windows.Forms.Padding(2); - this.btnUpdateMode.Name = "btnUpdateMode"; - this.btnUpdateMode.Size = new System.Drawing.Size(108, 27); - this.btnUpdateMode.TabIndex = 79; - this.btnUpdateMode.Text = "Update mode"; - this.btnUpdateMode.UseVisualStyleBackColor = true; + this.btnRestartAll.UseVisualStyleBackColor = false; + this.btnRestartAll.Click += new System.EventHandler(this.btnRestartAll_Click); // // IOBManPanel // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.BackColor = System.Drawing.SystemColors.ControlLight; - this.ClientSize = new System.Drawing.Size(670, 409); - this.Controls.Add(this.btnUpdateMode); - this.Controls.Add(this.btnRestartAll); - this.Controls.Add(this.btnCloseAll); - this.Controls.Add(this.dgvManagedItems); - this.Controls.Add(this.lblNumChild); - this.Controls.Add(this.btnClose); - this.Controls.Add(this.btnOpen); + this.ClientSize = new System.Drawing.Size(689, 398); + this.Controls.Add(this.tableLayoutPanel1); + this.Controls.Add(this.panel1); + this.Controls.Add(this.statusStrip1); this.IsMdiContainer = true; - this.Margin = new System.Windows.Forms.Padding(2); + this.MainMenuStrip = this.menuStrip1; + this.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); this.Name = "IOBManPanel"; this.Text = "IOB MANAGER"; this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.IOBManPanel_FormClosing); this.Load += new System.EventHandler(this.IOBManPanel_Load_1); + this.statusStrip1.ResumeLayout(false); + this.statusStrip1.PerformLayout(); + this.panel1.ResumeLayout(false); + this.panel1.PerformLayout(); + this.menuStrip1.ResumeLayout(false); + this.menuStrip1.PerformLayout(); + this.tableLayoutPanel1.ResumeLayout(false); + this.panel2.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.dgvManagedItems)).EndInit(); this.ResumeLayout(false); this.PerformLayout(); @@ -147,14 +301,26 @@ } #endregion - private System.Windows.Forms.Button btnOpen; private System.Windows.Forms.Button btnClose; private System.Windows.Forms.Timer MainTimer; - private System.Windows.Forms.Label lblNumChild; - private System.Windows.Forms.DataGridView dgvManagedItems; + private System.Windows.Forms.StatusStrip statusStrip1; + private System.Windows.Forms.ToolStripStatusLabel tsslNumProc; + private System.Windows.Forms.ToolStripProgressBar tsProgBar; + private System.Windows.Forms.Panel panel1; + private System.Windows.Forms.Button btnMinimizeAll; + private System.Windows.Forms.Button btnMaximixeAll; + private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1; + private System.Windows.Forms.Panel panel2; + private System.Windows.Forms.DataGridView dgvManagedItems; + private System.Windows.Forms.MenuStrip menuStrip1; + private System.Windows.Forms.ToolStripMenuItem fileToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem loadConfToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem updateModeToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem processManagerToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem closeALLToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem restartALLToolStripMenuItem; private System.Windows.Forms.Button btnCloseAll; private System.Windows.Forms.Button btnRestartAll; - private System.Windows.Forms.Button btnUpdateMode; } } diff --git a/IOB-MAN/IOBManPanel.cs b/IOB-MAN/IOBManPanel.cs index 58e97ecf..91e50163 100644 --- a/IOB-MAN/IOBManPanel.cs +++ b/IOB-MAN/IOBManPanel.cs @@ -1,13 +1,45 @@ -using System; +using System; using System.Collections.Generic; using System.Diagnostics; +using System.IO; using System.Linq; +using System.Runtime.InteropServices; +using System.Threading; using System.Windows.Forms; namespace IOB_MAN { + + + public partial class IOBManPanel : Form { + #region area gestione hode/max finestre + + private const int SW_SHOWNORMAL = 1; + private const int SW_SHOWMINIMIZED = 2; + private const int SW_SHOWMAXIMIZED = 3; + [DllImport("user32.dll")] + private static extern bool ShowWindowAsync(IntPtr hWnd, int nCmdShow); + + #endregion + + /// + /// Totale processi avviati + /// + protected int numProcAvviati; + /// + /// Totale processi running + /// + protected int numProcRunning; + /// + /// Counter per verifica watchdog dei processi da riattivare... + /// + protected int watchDogMult = utils.CRI("watchDogMult"); + /// + /// Counter per verifica processi (ogni volta ceh va a zero faccio vero check) + /// + protected int chekMult = utils.CRI("chekMult"); /// /// Elenco ARGS (uno per child da avviare) /// @@ -25,11 +57,15 @@ namespace IOB_MAN { InitializeComponent(); myInit(); + updateStatus(); } private void myInit() { utils.lgInfo("Starting App"); + // init prog bar + tsProgBar.Maximum = 100; + tsProgBar.Step = 1; // gestione eventi binding source ElencoIOB.AddingNew += ElencoIOB_AddingNew; ElencoIOB.ListChanged += ElencoIOB_ListChanged; @@ -39,7 +75,7 @@ namespace IOB_MAN TargetExe = utils.CRS("targetExe"); if (string.IsNullOrEmpty(TargetExe)) { - TargetExe = string.Format(@"{0}\Test.bat", Application.StartupPath); + TargetExe = string.Format(@"{0}\Resources\Test.bat", Application.StartupPath); } utils.lgInfo($"Target exe: {TargetExe}"); string ArgsString = utils.CRS("ArgsList"); @@ -48,7 +84,7 @@ namespace IOB_MAN { var rand = new Random(); // ne creo rand (5-15) di default... - for (int i = 0; i < rand.Next(5, 15); i++) + for (int i = 0; i < rand.Next(5, 10); i++) { ArgsList.Add("127.0.0.1"); } @@ -78,18 +114,20 @@ namespace IOB_MAN private void updateStatus() { // aggiorno labels - lblNumChild.Text = $"Avviati {ElencoIOB.Count} processi child"; - //dgvManagedItems.bind - } - /// - /// Chiama apertura + update status... - /// - /// - /// - private void btnOpen_Click(object sender, EventArgs e) - { - apriChild(); - updateStatus(); + tsslNumProc.Text = $"Configurati {ArgsList.Count} processi | Avviati: {numProcAvviati} | Attivi: {numProcRunning}"; + // colore da num proc... + if (numProcRunning == ArgsList.Count) + { + tsslNumProc.ForeColor = System.Drawing.Color.Green; + } + else if (numProcAvviati < ArgsList.Count) + { + tsslNumProc.ForeColor = System.Drawing.Color.DarkRed; + } + else + { + tsslNumProc.ForeColor = System.Drawing.Color.OrangeRed; + } } /// @@ -105,7 +143,8 @@ namespace IOB_MAN psi = new ProcessStartInfo { FileName = TargetExe, - Arguments = item + Arguments = item, + WindowStyle = ProcessWindowStyle.Minimized }; //childProc.StartInfo = psi; @@ -123,7 +162,8 @@ namespace IOB_MAN utils.lgInfo($"Avviato child process per {item} | pid: {p.Id}"); } - + numProcAvviati = ArgsList.Count; + numProcRunning = numProcAvviati; #if false string path = Application.StartupPath; @@ -151,6 +191,23 @@ namespace IOB_MAN #endif } + /// + /// Apro un child x fare udpate con parametro che impedisca avvio IOB + /// + private void apriOneUpdate() + { + ProcessStartInfo psi = null; + + // da testare x aprire chiudere risorsa... + psi = new ProcessStartInfo + { + FileName = TargetExe, + Arguments = "NONE", + WindowStyle = ProcessWindowStyle.Normal + }; + // avvio processo + Process p = Process.Start(psi); + } /// /// Chiudo primo processo child (se ce ne sono) /// @@ -187,11 +244,12 @@ namespace IOB_MAN { // errore era già chiuso.. } - // rimuovo da datasource - ElencoIOB.RemoveAt(riga.Index); + // indico NON running su datasource + ((iobAdapt)ElencoIOB[riga.Index]).isRunning = false; } } } + updateStatus(); } /// /// Cerca nell'elenco il processo corrente @@ -205,25 +263,104 @@ namespace IOB_MAN } /// - /// Effettua tutte le verifiche periodiche... + /// Effettua tutte le verifiche periodiche a timer... /// /// /// private void MainTimer_Tick(object sender, EventArgs e) { - checkRunningchild(); - showUpdate(); + updateProgBar(); + chekProcessStatus(); + checkWatchdog(); } + /// + /// Controllo periodico dei processi DA RIATTIVARE + /// + private void checkWatchdog() + { + watchDogMult--; + if (watchDogMult < 0) + { + watchDogMult = utils.CRI("watchDogMult"); + // verifico se ci siano processi (da ARGS LIST) NON running --> li riavvio! + List proc2restart = new List(); + foreach (iobAdapt item in ElencoIOB.List) + { + if (!item.isRunning) + { + // segno da eliminare e riavviare + proc2restart.Add(item); + } + } + // se ho da riavviare... elimino! + foreach (var item in proc2restart) + { + ElencoIOB.Remove(item); + utils.lgInfo($"Chiusura processo non running | IOB: {item.CodIOB} | pid: {item.pID}"); + } + // gestisco processi chiusi + ProcessStartInfo psi = null; + // li faccio ripartire! + foreach (var item in proc2restart) + { + // da testare x aprire chiudere risorsa... + psi = new ProcessStartInfo + { + FileName = TargetExe, + Arguments = item.CodIOB, + WindowStyle = ProcessWindowStyle.Minimized + }; + + //childProc.StartInfo = psi; + Process p = Process.Start(psi); + // accodo nuovo IOB... + iobAdapt newIob = new iobAdapt(); + DateTime adesso = DateTime.Now; + newIob.CodIOB = item.CodIOB; + newIob.startTime = adesso; + newIob.pID = p.Id; + newIob.isRunning = true; + // aggiungo a datasource + ElencoIOB.Add(newIob); + utils.lgInfo($"Riavvio processo | IOB: {newIob.CodIOB} | pid: {newIob.pID}"); + } + // aggiorno datagrid! + dgvManagedItems.Invalidate(); + } + } + /// + /// Controllo periodico dei processi attivi + /// + private void chekProcessStatus() + { + chekMult--; + if (chekMult < 0) + { + chekMult = utils.CRI("chekMult"); + checkRunningchild(); + updateStatus(); + } + } + + private void updateProgBar() + { + tsProgBar.PerformStep(); + if (tsProgBar.Value >= tsProgBar.Maximum) + { + tsProgBar.Value = 0; + } + } + /// /// Verifica se i proc child siano ancora in RUN /// private void checkRunningchild() { - int pid = 0; - List proc2rem = new List(); List item2rem = new List(); bool needRem = false; + numProcRunning = numProcAvviati; + // leggo 1 sola volta TUTTO elenco processi... Process[] processList = Process.GetProcesses(); @@ -241,23 +378,25 @@ namespace IOB_MAN } if (needRem) { - proc2rem.Add(item.pID); item2rem.Add(item); + item.isRunning = false; + numProcRunning--; + } + else + { + item.isRunning = true; } } - +#if false // ora procdedo alla cancellazione... foreach (var item in item2rem) { ElencoIOB.Remove(item); - } + } +#endif // aggiorno datagrid! dgvManagedItems.Invalidate(); - } - - private void showUpdate() - { - // aggiorna visualizzazioni... + updateStatus(); } private void IOBManPanel_FormClosing(object sender, FormClosingEventArgs e) @@ -273,15 +412,38 @@ namespace IOB_MAN { item2rem.Add(item); } - - + // processod a elenco noto foreach (var item in item2rem) { - Process p = Process.GetProcessById(item.pID); - p.CloseMainWindow(); - ElencoIOB.Remove(item); + if (item.isRunning) + { + try + { + Process p = Process.GetProcessById(item.pID); + p.CloseMainWindow(); + ElencoIOB.Remove(item); + } + catch + { } + } } - + // per sicurezza CERCO i processi x nome... + string nomeProc = Path.GetFileName(TargetExe); + var stillRunningProc = Process.GetProcessesByName(nomeProc); + if (stillRunningProc != null) + { + foreach (var item in stillRunningProc) + { + Process p = Process.GetProcessById(item.Id); + p.CloseMainWindow(); + } + } + // resetto elenco! + ElencoIOB.Clear(); + numProcAvviati = 0; + numProcRunning = 0; + // update! + updateStatus(); } private void dgvManagedItems_SelectionChanged(object sender, EventArgs e) @@ -302,17 +464,6 @@ namespace IOB_MAN } - private void button1_Click(object sender, EventArgs e) - { - closeAllChild(); - } - - private void button2_Click(object sender, EventArgs e) - { - // chiude tutto - closeAllChild(); - apriChild(); - } private void lblNumChild_Click(object sender, EventArgs e) { @@ -323,6 +474,163 @@ namespace IOB_MAN { } + + + private void dgvManagedItems_CellDoubleClick(object sender, DataGridViewCellEventArgs e) + { + // seleziono riga... + int pid = -1; + if (e.RowIndex >= 0) + { + //dgvManagedItems.CurrentCell = dgvManagedItems.Rows[e.RowIndex].Cells[0]; + + dgvManagedItems.Rows[e.RowIndex].Selected = true; + using (var riga = dgvManagedItems.Rows[e.RowIndex]) + { + int.TryParse(riga.Cells["pID"].Value.ToString(), out pid); + if (pid >= 0) + { + // provo a vedere SE ci sia il processo e di conseguenza lo chiudo... + try + { + Process p = Process.GetProcessById(pid); + // cerco e chiudo quelli che mi interessano... + var windowsHandle = p.MainWindowHandle; + ShowWindowAsync(windowsHandle, SW_SHOWNORMAL); + } + catch + { + // errore era già chiuso.. + } + } + } + } + } + + private void btnMinimizeAll_Click(object sender, EventArgs e) + { + foreach (iobAdapt item in ElencoIOB.List) + { + if (item.isRunning) + { + try + { + Process p = Process.GetProcessById(item.pID); + // cerco e chiudo quelli che mi interessano... + var windowsHandle = p.MainWindowHandle; + ShowWindowAsync(windowsHandle, SW_SHOWMINIMIZED); + } + catch (Exception exc) + { + // errore era già chiuso.. + utils.lgError($"Errore in HIDE windows:{Environment.NewLine}{exc}"); + } + } + } + } + + private void btnMaximixeAll_Click(object sender, EventArgs e) + { + foreach (iobAdapt item in ElencoIOB.List) + { + if (item.isRunning) + { + try + { + Process p = Process.GetProcessById(item.pID); + // cerco e chiudo quelli che mi interessano... + var windowsHandle = p.MainWindowHandle; + ShowWindowAsync(windowsHandle, SW_SHOWNORMAL); + } + catch (Exception exc) + { + // errore era già chiuso.. + utils.lgError($"Errore in SHOW windows:{Environment.NewLine}{exc}"); + } + } + } + } + + /// + /// Chiama apertura + update status... + /// + /// + /// + private void openALLToolStripMenuItem_Click(object sender, EventArgs e) + { + } + /// + /// Chiama chiusura + update status... + /// + /// + /// + private void closeALLToolStripMenuItem_Click(object sender, EventArgs e) + { + closeAllChild(); + updateStatus(); + } + + /// + /// Chiama Restart (close/start) + update status... + /// + /// + /// + private void restartALLToolStripMenuItem_Click(object sender, EventArgs e) + { + // chiude tutto + closeAllChild(); + apriChild(); + updateStatus(); + } + + private void loadConfToolStripMenuItem_Click(object sender, EventArgs e) + { + // lettura conf file... + + // apertura + apriChild(); + updateStatus(); + } + + private void updateModeToolStripMenuItem_Click(object sender, EventArgs e) + { + // chiude tutte + closeAllChild(); + Thread.Sleep(1000); + updateStatus(); + // apre solo 1 con conf "fake" x condurre update... + apriOneUpdate(); + Thread.Sleep(1000); + updateStatus(); + // si chiude x permettere update... + this.Close(); + } + + private void panel1_Paint(object sender, PaintEventArgs e) + { + + } + + private void processManagerToolStripMenuItem_Click(object sender, EventArgs e) + { + + } + + private void btnCloseAll_Click(object sender, EventArgs e) + { + // chiude tutto + closeAllChild(); + //apriChild(); + updateStatus(); + } + + private void btnRestartAll_Click(object sender, EventArgs e) + { + // chiude tutto + closeAllChild(); + apriChild(); + updateStatus(); + } } } diff --git a/IOB-MAN/IOBManPanel.resx b/IOB-MAN/IOBManPanel.resx index 414b3c46..d4fb60ee 100644 --- a/IOB-MAN/IOBManPanel.resx +++ b/IOB-MAN/IOBManPanel.resx @@ -120,4 +120,13 @@ 154, 17 + + 283, 17 + + + 420, 17 + + + 420, 17 + \ No newline at end of file diff --git a/IOB-MAN/IobManIcon.ico b/IOB-MAN/IobManIcon.ico new file mode 100644 index 00000000..2f010028 Binary files /dev/null and b/IOB-MAN/IobManIcon.ico differ diff --git a/IOB-MAN/Properties/AssemblyInfo.cs b/IOB-MAN/Properties/AssemblyInfo.cs index 780240fc..6c482ed3 100644 --- a/IOB-MAN/Properties/AssemblyInfo.cs +++ b/IOB-MAN/Properties/AssemblyInfo.cs @@ -6,11 +6,11 @@ using System.Runtime.InteropServices; // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("IOB-MAN")] -[assembly: AssemblyDescription("")] +[assembly: AssemblyDescription("IOB Instance Manager")] [assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] +//[assembly: AssemblyCompany("")] [assembly: AssemblyProduct("IOB-MAN")] -[assembly: AssemblyCopyright("Copyright © 2017")] +//[assembly: AssemblyCopyright("Copyright © 2017")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] @@ -32,5 +32,5 @@ using System.Runtime.InteropServices; // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] +//[assembly: AssemblyVersion("1.0.0.0")] +//[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/IOB-MAN/Resources/IobManIcon.ico b/IOB-MAN/Resources/IobManIcon.ico new file mode 100644 index 00000000..2f010028 Binary files /dev/null and b/IOB-MAN/Resources/IobManIcon.ico differ diff --git a/IOB-MAN/Test.bat b/IOB-MAN/Resources/Test.bat similarity index 100% rename from IOB-MAN/Test.bat rename to IOB-MAN/Resources/Test.bat diff --git a/IOB-MAN/iobAdapt.cs b/IOB-MAN/iobAdapt.cs index 94df4ed5..312c31da 100644 --- a/IOB-MAN/iobAdapt.cs +++ b/IOB-MAN/iobAdapt.cs @@ -4,6 +4,7 @@ namespace IOB_MAN { public class iobAdapt { + protected DateTime lastSeen { get; set; } = DateTime.Now; /// /// Codice univoco macchina /// @@ -15,7 +16,7 @@ namespace IOB_MAN /// /// DataOra avvio dell'IOB /// - public DateTime startTime { get; set; } + public DateTime startTime { get; set; } = DateTime.Now; /// /// Calcola uptime processo... /// @@ -23,7 +24,12 @@ namespace IOB_MAN { get { - TimeSpan uptime = DateTime.Now.Subtract(startTime); + // in primis cerco SE sia running --> aggiorno lastSeen + if (isRunning) + { + lastSeen = DateTime.Now; + } + TimeSpan uptime = lastSeen.Subtract(startTime); return utils.FormatTimeSpan(uptime); } } diff --git a/IOB-MAN/packages.config b/IOB-MAN/packages.config index 44be8695..9c216584 100644 --- a/IOB-MAN/packages.config +++ b/IOB-MAN/packages.config @@ -1,5 +1,7 @@  + + diff --git a/Jenkinsfile b/Jenkinsfile index 3df230c4..f8ae983d 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -16,7 +16,7 @@ pipeline { /* calcolo numero versione... diverso x branch MASTER/DEVELOP */ script { - withEnv(['NEXT_BUILD_NUMBER=613']) { + withEnv(['NEXT_BUILD_NUMBER=615']) { // env.versionNumber = VersionNumber(versionNumberString : '3.0.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2006-01-01', skipFailedBuilds: true) env.versionNumber = VersionNumber(versionNumberString : '3.0.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2006-01-01', skipFailedBuilds: true, overrideBuildsAllTime: '${NEXT_BUILD_NUMBER}') env.APP_NAME = 'MAPO-IOB-WIN'