private void ProcessChange(Darwin.Objects.SeasonCheckbox c) { if (c.Checked) { SpeciesFlagInformation |= (c).SeasonFlag; } else { SpeciesFlagInformation ^= (c).SeasonFlag; } }
public SearchResults(SearchType _SearchType, object _kingdom, object _phylum, object _class, object _order, object _family, object _genus, string _name, string _anytext, MonthEumFlags _monthEumFlags, SpeciesEnumFlags _speciesEnumFlags, DistributionFlags _distFlags, SpeciesColour _speciesColour, bool inYVP = false, int _status = -1) { //_Kingdom = _kingdom; if (_kingdom != null) { _Kingdom = int.Parse(_kingdom.ToString()); } else { _Kingdom = null; }; if (_phylum != null) { _Phylum = int.Parse(_phylum.ToString()); } else { _Phylum = null; }; if (_class != null) { _Class = int.Parse(_class.ToString()); } else { _Class = null; }; if (_order != null) { _Order = int.Parse(_order.ToString()); } else { _Order = null; }; if (_family != null) { _Family = int.Parse(_family.ToString()); } else { _Family = null; }; if (_genus != null) { _Genus = int.Parse(_genus.ToString()); } else { _Genus = null; }; _Name = _name; _AnyText = _anytext; _Seasons = _monthEumFlags; _Flags = _speciesEnumFlags; _DistFlags = _distFlags; _SpeciesColour = _speciesColour; _inYVP = inYVP; _Status = _status; _searchtype = _SearchType; InitializeComponent(); }
private void SpeciesFlags_Load(object sender, EventArgs e) { SpeciesFlagInformation = new SpeciesEnumFlags(); }
public SearchResults(object _kingdom, object _phylum, object _class, object _order, object _family, object _genus, string _name, string _anytext, MonthEumFlags _monthEumFlags, SpeciesEnumFlags _speciesEnumFlags, DistributionFlags _distFlags, SpeciesColour _speciesColour, bool inYVP = false, int _status = -1) : this(SearchType.Normal, _kingdom, _phylum, _class, _order, _family, _genus, _name, _anytext, _monthEumFlags, _speciesEnumFlags, _distFlags, _speciesColour, false, -1) { }
private void treeView1_NodeMouseDoubleClick(object sender, TreeNodeMouseClickEventArgs e) { SearchResults s; SpeciesEnumFlags senf = new SpeciesEnumFlags(); DistributionFlags df = new DistributionFlags(); MonthEumFlags mef = new MonthEumFlags(); SpeciesColour sc = new SpeciesColour(); switch (e.Node.Level) { case 0: s = new SearchResults(int.Parse(e.Node.Name), null, null, null, null, null, "", "", mef, senf, df, sc); break; case 1: s = new SearchResults(null,int.Parse(e.Node.Name), null, null, null, null, "", "", mef, senf, df, sc); break; case 2: s = new SearchResults(null, null,int.Parse(e.Node.Name), null, null, null, "", "", mef, senf, df, sc); break; case 3: s = new SearchResults(null, null, null,int.Parse(e.Node.Name), null, null, "", "", mef, senf, df, sc); break; case 4: s = new SearchResults(null, null, null, null,int.Parse(e.Node.Name), null, "", "", mef, senf, df, sc); break; case 5: s = new SearchResults(null, null, null, null, null,int.Parse(e.Node.Name), "", "", mef, senf, df, sc); break; default: s = new SearchResults(null, null, null, null, null, null, "", "", mef, senf, df, sc); break; } s.StartPosition = FormStartPosition.CenterScreen; s.Show(this); }
private static void SetFlag(int? Input, SpeciesEnumFlags Flagset, SpeciesEnumFlags FlagToSet, out SpeciesEnumFlags ValueOut, out int? Value) { int takeoff = 0; ValueOut = Flagset; if ((Input - FlagToSet.GetHashCode()) >= 0) { ValueOut ^= FlagToSet; takeoff = FlagToSet.GetHashCode(); } else { //ValueOut ^= FlagToSet; } Value = Input - takeoff; }
private static SpeciesEnumFlags ConvertToFlags(int? CurrentFlags) { SpeciesEnumFlags returnval = new SpeciesEnumFlags(); SetFlag(CurrentFlags, returnval, SpeciesEnumFlags.Diurnal, out returnval, out CurrentFlags); SetFlag(CurrentFlags, returnval, SpeciesEnumFlags.Nocturnal, out returnval, out CurrentFlags); SetFlag(CurrentFlags, returnval, SpeciesEnumFlags.Irritant, out returnval, out CurrentFlags); SetFlag(CurrentFlags, returnval, SpeciesEnumFlags.Stinging, out returnval, out CurrentFlags); SetFlag(CurrentFlags, returnval, SpeciesEnumFlags.Biting, out returnval, out CurrentFlags); SetFlag(CurrentFlags, returnval, SpeciesEnumFlags.Medicinal, out returnval, out CurrentFlags); SetFlag(CurrentFlags, returnval, SpeciesEnumFlags.Ediable, out returnval, out CurrentFlags); SetFlag(CurrentFlags, returnval, SpeciesEnumFlags.Poisonous, out returnval, out CurrentFlags); return returnval; }