public Malt() { InitializeComponent(); _all = new List <Classes.MaltType>(); _filteredList = new List <Classes.MaltType>(); SelectedMalt = null; }
/// <summary> /// Ctor /// </summary> /// <param name="malt">Aktuelt malt som skal endres</param> /// <param name="brew_house_efficiency">Angis som et tall mellom 0 og 1</param> /// <param name="original_gravity">Angis som et tall mellom 0.099 og 1.170</param> /// <param name="batch_volume">Antall liter ønsket sluttvolum</param> public ModifyHelper(Classes.MaltType malt, double brew_house_efficiency, double original_gravity, double batch_volume) { if (null != malt) { Malt = new Classes.MaltType(malt); BHE = brew_house_efficiency; OriginalGravity = original_gravity; BatchVolume = batch_volume; } }
public override bool Equals(object obj) { MaltType other = obj as MaltType; if (null != other) { return(this.ToString().Equals(other.ToString())); } return(false); }
public bool GetMalt(string key, out MaltType malt) { malt = null; try { if (ContainsMalt(key)) { malt = new MaltType(_Malts[key]); } } catch { } return(null != malt); }
public bool ReplaceMalt(MaltType malt) { bool ret = false; try { if ((malt != null) && ContainsMalt(malt)) { _Malts[malt.Malttype.ToLower()] = new MaltType(malt); } } catch { } return(ret); }
public bool RemoveMalt(MaltType malt) { bool ret = false; try { if ((malt != null) && ContainsMalt(malt)) { ret = _Malts.Remove(malt.Malttype.ToLower()); } } catch { } return(ret); }
public bool AddMalt(MaltType malt) { bool ret = false; try { if ((malt != null) && (_Malts != null) && !_Malts.ContainsKey(malt.Malttype.ToLower())) { _Malts.Add(malt.Malttype.ToLower(), new MaltType(malt)); ret = _Malts.ContainsKey(malt.Malttype.ToLower()); } } catch { ret = false; } return(ret); }
private void btnOK_Click(object sender, EventArgs e) { DialogResult = DialogResult.Cancel; double value; if (Classes.Util.ValidDouble(txtPercentageAmount.Text, out value) && listView1.SelectedIndices.Count > 0) { SelectedMalt = new Classes.MaltType(_filteredList[listView1.SelectedIndices[0]]); SelectedMalt.MengdeProsent = value; Properties.Settings.Default.Malt_Filter = txtFilter.Text; Properties.Settings.Default.Malt_List = cboMaltLister.Text; Properties.Settings.Default.Malt_Percentage = value; Properties.Settings.Default.Save(); DialogResult = DialogResult.OK; } }
public MaltType(MaltType other) : this() { if (other != null) { this.AnbefaltMengde = other.AnbefaltMengde; this.Bruksområde = other.Bruksområde; this.Enzymaktivitet = other.Enzymaktivitet; this.Fargebidrag = other.Fargebidrag; this.Kategori = other.Kategori; this.Kommentar = other.Kommentar; this.Kornsort = other.Kornsort; this.Malteri = other.Malteri; this.Malttype = other.Malttype; this.MEa = other.MEa; this.MEb = other.MEb; this.Mengde = other.Mengde; this.MengdeProsent = other.MengdeProsent; this.ParsedOk = other.ParsedOk; this.RowDefinition = other.RowDefinition; this.Smaksbidrag = other.Smaksbidrag; this.Type = other.Type; } }
public bool ContainsMalt(MaltType malt) { return((malt != null) && (_Malts != null) && _Malts.ContainsKey(malt.Malttype.ToLower())); }