Beispiel #1
0
 private void ProcessChange(Darwin.Objects.SeasonCheckbox c)
 {
     if (c.Checked)
     {
         SpeciesFlagInformation |= (c).SeasonFlag;
     }
     else
     {
         SpeciesFlagInformation ^= (c).SeasonFlag;
     }
 }
Beispiel #2
0
 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();
 }
Beispiel #3
0
 private void SpeciesFlags_Load(object sender, EventArgs e)
 {
     SpeciesFlagInformation = new SpeciesEnumFlags();
 }
Beispiel #4
0
 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)
 {
 }
Beispiel #5
0
        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);
        }
Beispiel #6
0
        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;
        }
Beispiel #7
0
        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;
        }