Merge branch 'develop' into IobMan
This commit is contained in:
+5
-3
@@ -4,9 +4,11 @@
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
|
||||
</startup>
|
||||
<appSettings>
|
||||
<add key="checkPeriod" value="500" />
|
||||
<add key="targetExe" value="C:\tmp\IOB-WIN\IOB-WIN.exe" />
|
||||
<add key="ArgsList" value="SIMUL_01,SIMUL_02" />
|
||||
<add key="checkPeriod" value="20" />
|
||||
<add key="chekMult" value="25"/>
|
||||
<add key="watchDogMult" value="1000"/>
|
||||
<!--<add key="targetExe" value="C:\tmp\IOB-WIN\IOB-WIN.exe" />
|
||||
<add key="ArgsList" value="SIMUL_01,SIMUL_02" />-->
|
||||
<!--<add key="ArgsList" value="SIMUL_01,SIMUL_02,SIMUL_03,SIMUL_04" />-->
|
||||
</appSettings>
|
||||
</configuration>
|
||||
@@ -0,0 +1,3 @@
|
||||
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd">
|
||||
<Costura />
|
||||
</Weavers>
|
||||
@@ -0,0 +1,111 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
|
||||
<!-- This file was generated by Fody. Manual changes to this file will be lost when your project is rebuilt. -->
|
||||
<xs:element name="Weavers">
|
||||
<xs:complexType>
|
||||
<xs:all>
|
||||
<xs:element name="Costura" minOccurs="0" maxOccurs="1">
|
||||
<xs:complexType>
|
||||
<xs:all>
|
||||
<xs:element minOccurs="0" maxOccurs="1" name="ExcludeAssemblies" type="xs:string">
|
||||
<xs:annotation>
|
||||
<xs:documentation>A list of assembly names to exclude from the default action of "embed all Copy Local references", delimited with line breaks</xs:documentation>
|
||||
</xs:annotation>
|
||||
</xs:element>
|
||||
<xs:element minOccurs="0" maxOccurs="1" name="IncludeAssemblies" type="xs:string">
|
||||
<xs:annotation>
|
||||
<xs:documentation>A list of assembly names to include from the default action of "embed all Copy Local references", delimited with line breaks.</xs:documentation>
|
||||
</xs:annotation>
|
||||
</xs:element>
|
||||
<xs:element minOccurs="0" maxOccurs="1" name="Unmanaged32Assemblies" type="xs:string">
|
||||
<xs:annotation>
|
||||
<xs:documentation>A list of unmanaged 32 bit assembly names to include, delimited with line breaks.</xs:documentation>
|
||||
</xs:annotation>
|
||||
</xs:element>
|
||||
<xs:element minOccurs="0" maxOccurs="1" name="Unmanaged64Assemblies" type="xs:string">
|
||||
<xs:annotation>
|
||||
<xs:documentation>A list of unmanaged 64 bit assembly names to include, delimited with line breaks.</xs:documentation>
|
||||
</xs:annotation>
|
||||
</xs:element>
|
||||
<xs:element minOccurs="0" maxOccurs="1" name="PreloadOrder" type="xs:string">
|
||||
<xs:annotation>
|
||||
<xs:documentation>The order of preloaded assemblies, delimited with line breaks.</xs:documentation>
|
||||
</xs:annotation>
|
||||
</xs:element>
|
||||
</xs:all>
|
||||
<xs:attribute name="CreateTemporaryAssemblies" type="xs:boolean">
|
||||
<xs:annotation>
|
||||
<xs:documentation>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.</xs:documentation>
|
||||
</xs:annotation>
|
||||
</xs:attribute>
|
||||
<xs:attribute name="IncludeDebugSymbols" type="xs:boolean">
|
||||
<xs:annotation>
|
||||
<xs:documentation>Controls if .pdbs for reference assemblies are also embedded.</xs:documentation>
|
||||
</xs:annotation>
|
||||
</xs:attribute>
|
||||
<xs:attribute name="DisableCompression" type="xs:boolean">
|
||||
<xs:annotation>
|
||||
<xs:documentation>Embedded assemblies are compressed by default, and uncompressed when they are loaded. You can turn compression off with this option.</xs:documentation>
|
||||
</xs:annotation>
|
||||
</xs:attribute>
|
||||
<xs:attribute name="DisableCleanup" type="xs:boolean">
|
||||
<xs:annotation>
|
||||
<xs:documentation>As part of Costura, embedded assemblies are no longer included as part of the build. This cleanup can be turned off.</xs:documentation>
|
||||
</xs:annotation>
|
||||
</xs:attribute>
|
||||
<xs:attribute name="LoadAtModuleInit" type="xs:boolean">
|
||||
<xs:annotation>
|
||||
<xs:documentation>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.</xs:documentation>
|
||||
</xs:annotation>
|
||||
</xs:attribute>
|
||||
<xs:attribute name="IgnoreSatelliteAssemblies" type="xs:boolean">
|
||||
<xs:annotation>
|
||||
<xs:documentation>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.</xs:documentation>
|
||||
</xs:annotation>
|
||||
</xs:attribute>
|
||||
<xs:attribute name="ExcludeAssemblies" type="xs:string">
|
||||
<xs:annotation>
|
||||
<xs:documentation>A list of assembly names to exclude from the default action of "embed all Copy Local references", delimited with |</xs:documentation>
|
||||
</xs:annotation>
|
||||
</xs:attribute>
|
||||
<xs:attribute name="IncludeAssemblies" type="xs:string">
|
||||
<xs:annotation>
|
||||
<xs:documentation>A list of assembly names to include from the default action of "embed all Copy Local references", delimited with |.</xs:documentation>
|
||||
</xs:annotation>
|
||||
</xs:attribute>
|
||||
<xs:attribute name="Unmanaged32Assemblies" type="xs:string">
|
||||
<xs:annotation>
|
||||
<xs:documentation>A list of unmanaged 32 bit assembly names to include, delimited with |.</xs:documentation>
|
||||
</xs:annotation>
|
||||
</xs:attribute>
|
||||
<xs:attribute name="Unmanaged64Assemblies" type="xs:string">
|
||||
<xs:annotation>
|
||||
<xs:documentation>A list of unmanaged 64 bit assembly names to include, delimited with |.</xs:documentation>
|
||||
</xs:annotation>
|
||||
</xs:attribute>
|
||||
<xs:attribute name="PreloadOrder" type="xs:string">
|
||||
<xs:annotation>
|
||||
<xs:documentation>The order of preloaded assemblies, delimited with |.</xs:documentation>
|
||||
</xs:annotation>
|
||||
</xs:attribute>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
</xs:all>
|
||||
<xs:attribute name="VerifyAssembly" type="xs:boolean">
|
||||
<xs:annotation>
|
||||
<xs:documentation>'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed.</xs:documentation>
|
||||
</xs:annotation>
|
||||
</xs:attribute>
|
||||
<xs:attribute name="VerifyIgnoreCodes" type="xs:string">
|
||||
<xs:annotation>
|
||||
<xs:documentation>A comma-separated list of error codes that can be safely ignored in assembly verification.</xs:documentation>
|
||||
</xs:annotation>
|
||||
</xs:attribute>
|
||||
<xs:attribute name="GenerateXsd" type="xs:boolean">
|
||||
<xs:annotation>
|
||||
<xs:documentation>'false' to turn off automatic generation of the XML Schema file.</xs:documentation>
|
||||
</xs:annotation>
|
||||
</xs:attribute>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
</xs:schema>
|
||||
+25
-1
@@ -1,5 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="..\packages\Costura.Fody.4.1.0\build\Costura.Fody.props" Condition="Exists('..\packages\Costura.Fody.4.1.0\build\Costura.Fody.props')" />
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
@@ -11,6 +12,8 @@
|
||||
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
||||
<NuGetPackageImportStamp>
|
||||
</NuGetPackageImportStamp>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
@@ -31,7 +34,13 @@
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<ApplicationIcon>IobManIcon.ico</ApplicationIcon>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Costura, Version=4.1.0.0, Culture=neutral, PublicKeyToken=9919ef960d84173d, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Costura.Fody.4.1.0\lib\net40\Costura.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\NLog.4.6.8\lib\net45\NLog.dll</HintPath>
|
||||
</Reference>
|
||||
@@ -53,6 +62,9 @@
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="..\VersGen\VersGen.cs">
|
||||
<Link>VersGen.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="iobAdapt.cs" />
|
||||
<Compile Include="IOBManPanel.cs">
|
||||
<SubType>Form</SubType>
|
||||
@@ -63,6 +75,10 @@
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="utils.cs" />
|
||||
<Content Include="IobManIcon.ico" />
|
||||
<Content Include="Resources\IobManIcon.ico">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<EmbeddedResource Include="IOBManPanel.resx">
|
||||
<DependentUpon>IOBManPanel.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
@@ -94,7 +110,7 @@
|
||||
<DependentUpon>Settings.settings</DependentUpon>
|
||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||
</Compile>
|
||||
<None Include="Test.bat">
|
||||
<None Include="Resources\Test.bat">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
@@ -103,4 +119,12 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup />
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||
<PropertyGroup>
|
||||
<ErrorText>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}.</ErrorText>
|
||||
</PropertyGroup>
|
||||
<Error Condition="!Exists('..\packages\Costura.Fody.4.1.0\build\Costura.Fody.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Costura.Fody.4.1.0\build\Costura.Fody.props'))" />
|
||||
<Error Condition="!Exists('..\packages\Fody.6.0.5\build\Fody.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Fody.6.0.5\build\Fody.targets'))" />
|
||||
</Target>
|
||||
<Import Project="..\packages\Fody.6.0.5\build\Fody.targets" Condition="Exists('..\packages\Fody.6.0.5\build\Fody.targets')" />
|
||||
</Project>
|
||||
Generated
+229
-63
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+357
-49
@@ -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
|
||||
|
||||
/// <summary>
|
||||
/// Totale processi avviati
|
||||
/// </summary>
|
||||
protected int numProcAvviati;
|
||||
/// <summary>
|
||||
/// Totale processi running
|
||||
/// </summary>
|
||||
protected int numProcRunning;
|
||||
/// <summary>
|
||||
/// Counter per verifica watchdog dei processi da riattivare...
|
||||
/// </summary>
|
||||
protected int watchDogMult = utils.CRI("watchDogMult");
|
||||
/// <summary>
|
||||
/// Counter per verifica processi (ogni volta ceh va a zero faccio vero check)
|
||||
/// </summary>
|
||||
protected int chekMult = utils.CRI("chekMult");
|
||||
/// <summary>
|
||||
/// Elenco ARGS (uno per child da avviare)
|
||||
/// </summary>
|
||||
@@ -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
|
||||
}
|
||||
/// <summary>
|
||||
/// Chiama apertura + update status...
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -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
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Apro un child x fare udpate con parametro che impedisca avvio IOB
|
||||
/// </summary>
|
||||
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);
|
||||
}
|
||||
/// <summary>
|
||||
/// Chiudo primo processo child (se ce ne sono)
|
||||
/// </summary>
|
||||
@@ -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();
|
||||
}
|
||||
/// <summary>
|
||||
/// Cerca nell'elenco il processo corrente
|
||||
@@ -205,25 +263,104 @@ namespace IOB_MAN
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Effettua tutte le verifiche periodiche...
|
||||
/// Effettua tutte le verifiche periodiche a timer...
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void MainTimer_Tick(object sender, EventArgs e)
|
||||
{
|
||||
checkRunningchild();
|
||||
showUpdate();
|
||||
updateProgBar();
|
||||
chekProcessStatus();
|
||||
checkWatchdog();
|
||||
}
|
||||
/// <summary>
|
||||
/// Controllo periodico dei processi DA RIATTIVARE
|
||||
/// </summary>
|
||||
private void checkWatchdog()
|
||||
{
|
||||
watchDogMult--;
|
||||
if (watchDogMult < 0)
|
||||
{
|
||||
watchDogMult = utils.CRI("watchDogMult");
|
||||
// verifico se ci siano processi (da ARGS LIST) NON running --> li riavvio!
|
||||
List<iobAdapt> proc2restart = new List<iobAdapt>();
|
||||
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();
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Controllo periodico dei processi attivi
|
||||
/// </summary>
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Verifica se i proc child siano ancora in RUN
|
||||
/// </summary>
|
||||
private void checkRunningchild()
|
||||
{
|
||||
int pid = 0;
|
||||
List<int> proc2rem = new List<int>();
|
||||
List<iobAdapt> item2rem = new List<iobAdapt>();
|
||||
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}");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Chiama apertura + update status...
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void openALLToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
}
|
||||
/// <summary>
|
||||
/// Chiama chiusura + update status...
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void closeALLToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
closeAllChild();
|
||||
updateStatus();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Chiama Restart (close/start) + update status...
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -120,4 +120,13 @@
|
||||
<metadata name="MainTimer.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>154, 17</value>
|
||||
</metadata>
|
||||
<metadata name="statusStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>283, 17</value>
|
||||
</metadata>
|
||||
<metadata name="menuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>420, 17</value>
|
||||
</metadata>
|
||||
<metadata name="menuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>420, 17</value>
|
||||
</metadata>
|
||||
</root>
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 139 KiB |
@@ -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")]
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 139 KiB |
+8
-2
@@ -4,6 +4,7 @@ namespace IOB_MAN
|
||||
{
|
||||
public class iobAdapt
|
||||
{
|
||||
protected DateTime lastSeen { get; set; } = DateTime.Now;
|
||||
/// <summary>
|
||||
/// Codice univoco macchina
|
||||
/// </summary>
|
||||
@@ -15,7 +16,7 @@ namespace IOB_MAN
|
||||
/// <summary>
|
||||
/// DataOra avvio dell'IOB
|
||||
/// </summary>
|
||||
public DateTime startTime { get; set; }
|
||||
public DateTime startTime { get; set; } = DateTime.Now;
|
||||
/// <summary>
|
||||
/// Calcola uptime processo...
|
||||
/// </summary>
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="Costura.Fody" version="4.1.0" targetFramework="net461" />
|
||||
<package id="Fody" version="6.0.5" targetFramework="net461" developmentDependency="true" />
|
||||
<package id="NLog" version="4.6.8" targetFramework="net461" />
|
||||
<package id="NLog.Config" version="4.6.8" targetFramework="net461" />
|
||||
<package id="NLog.Schema" version="4.6.8" targetFramework="net461" />
|
||||
|
||||
Vendored
+1
-1
@@ -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'
|
||||
|
||||
Reference in New Issue
Block a user