Sanierungsarten nun steuerbar von ausßenhalb
(cherry picked from commit 81b58aa6d0)
# Conflicts:
# SanSystem/FrmSelectNewSan.cs
This commit is contained in:
2
SanSystem/FrmSelectNewSan.Designer.cs
generated
2
SanSystem/FrmSelectNewSan.Designer.cs
generated
@@ -62,6 +62,7 @@
|
||||
this.btn_kurzliner.TabIndex = 2;
|
||||
this.btn_kurzliner.Text = "button3";
|
||||
this.btn_kurzliner.UseVisualStyleBackColor = true;
|
||||
this.btn_kurzliner.Click += new System.EventHandler(this.btn_kurzliner_Click);
|
||||
//
|
||||
// btn_hut
|
||||
//
|
||||
@@ -71,6 +72,7 @@
|
||||
this.btn_hut.TabIndex = 3;
|
||||
this.btn_hut.Text = "button4";
|
||||
this.btn_hut.UseVisualStyleBackColor = true;
|
||||
this.btn_hut.Click += new System.EventHandler(this.btn_hut_Click);
|
||||
//
|
||||
// FrmSelectNewSan
|
||||
//
|
||||
|
||||
@@ -23,6 +23,14 @@ namespace SanSystem
|
||||
///
|
||||
/// </summary>
|
||||
public event EventHandler AddSchachtAnbindungClicked;
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public event EventHandler AddKurzlinerClicked;
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public event EventHandler AddHutprofilClicked;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
@@ -40,19 +48,36 @@ namespace SanSystem
|
||||
EventHandler handler = AddInlinerClicked;
|
||||
if (handler != null) handler(this, e);
|
||||
}
|
||||
protected virtual void OnAddKurzlinerClicked(EventArgs e)
|
||||
{
|
||||
EventHandler handler = AddKurzlinerClicked;
|
||||
if (handler != null) handler(this, e);
|
||||
}
|
||||
protected virtual void OnAddHutClicked(EventArgs e)
|
||||
{
|
||||
EventHandler handler = AddHutprofilClicked;
|
||||
if (handler != null) handler(this, e);
|
||||
}
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public FrmSelectNewSan()
|
||||
/// <param name="mod"></param>
|
||||
public FrmSelectNewSan(int mod)
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
SanArt sanArt = new SanArt(mod);
|
||||
|
||||
btn_inliner.Text = Global.Instance.language.Labels["inliner"];
|
||||
btn_hut.Text = Global.Instance.language.Labels["hut"];
|
||||
btn_kurzliner.Text = Global.Instance.language.Labels["kurzliner"];
|
||||
btn_schacht_anb.Text = Global.Instance.language.Labels["schacht_an"];
|
||||
|
||||
btn_hut.Enabled = btn_kurzliner.Enabled = false;
|
||||
btn_inliner.Enabled = sanArt.SanierungActivated(Sanierungsarten.INLINER);
|
||||
btn_kurzliner.Enabled = sanArt.SanierungActivated(Sanierungsarten.KURZLINER);
|
||||
btn_hut.Enabled = sanArt.SanierungActivated(Sanierungsarten.HUTPROFIL);
|
||||
btn_schacht_anb.Enabled = sanArt.SanierungActivated(Sanierungsarten.SCHACHTANBINDUNG);
|
||||
//btn_hut.Enabled = btn_kurzliner.Enabled = false;
|
||||
}
|
||||
|
||||
private void btn_inliner_Click(object sender, EventArgs e)
|
||||
@@ -66,5 +91,17 @@ namespace SanSystem
|
||||
OnAddSchachtAnbindungClicked(EventArgs.Empty);
|
||||
this.Close();
|
||||
}
|
||||
|
||||
private void btn_kurzliner_Click(object sender, EventArgs e)
|
||||
{
|
||||
OnAddKurzlinerClicked(EventArgs.Empty);
|
||||
this.Close();
|
||||
}
|
||||
|
||||
private void btn_hut_Click(object sender, EventArgs e)
|
||||
{
|
||||
OnAddHutClicked(EventArgs.Empty);
|
||||
this.Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -153,6 +153,7 @@
|
||||
<Compile Include="MassenStatistik.cs" />
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Sanierungsarten.cs" />
|
||||
<Compile Include="UCInliner.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
|
||||
31
SanSystem/Sanierungsarten.cs
Normal file
31
SanSystem/Sanierungsarten.cs
Normal file
@@ -0,0 +1,31 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace SanSystem
|
||||
{
|
||||
enum Sanierungsarten
|
||||
{
|
||||
INLINER = 1,
|
||||
SCHACHTANBINDUNG = 2,
|
||||
KURZLINER = 4,
|
||||
HUTPROFIL = 8,
|
||||
QUICKLOCK = 16
|
||||
}
|
||||
|
||||
class SanArt
|
||||
{
|
||||
private int mod;
|
||||
|
||||
public SanArt(int mod)
|
||||
{
|
||||
this.mod = mod;
|
||||
}
|
||||
public bool SanierungActivated(Sanierungsarten pm)
|
||||
{
|
||||
return (mod & (int)pm) == (int)pm;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -117,7 +117,8 @@ namespace SanSystem
|
||||
|
||||
private void btn_add_san_Click(object sender, EventArgs e)
|
||||
{
|
||||
FrmSelectNewSan frmSelectNewSan = new FrmSelectNewSan();
|
||||
int mod = (int)Sanierungsarten.INLINER ^ (int)Sanierungsarten.SCHACHTANBINDUNG;
|
||||
FrmSelectNewSan frmSelectNewSan = new FrmSelectNewSan(mod);
|
||||
|
||||
frmSelectNewSan.AddInlinerClicked += FrmSelectNewSan_AddInlinerClicked;
|
||||
frmSelectNewSan.AddSchachtAnbindungClicked += FrmSelectNewSan_AddSchachtAnbindungClicked;
|
||||
|
||||
Reference in New Issue
Block a user