Exemplo n.º 1
0
 internal BirdGroup(BirdGroupFeature birdGroupFeature)
 {
     GroupSize = birdGroupFeature.Size;
     switch (birdGroupFeature.Species)
     {
         case 'M':
         case 'm':
             Species = BirdGroupSpecies.Marbled;
             break;
         case 'K':
         case 'k':
             Species = BirdGroupSpecies.Kittlitz;
             break;
         case 'U':
         case 'u':
             Species = BirdGroupSpecies.Unidentified;
             break;
         default:
             Species = BirdGroupSpecies.Pending;
             break;
     }
     switch (birdGroupFeature.Behavior)
     {
         case 'W':
         case 'w':
             Behavior = BirdGroupBehavior.Water;
             break;
         case 'F':
         case 'f':
             Behavior = BirdGroupBehavior.Flying;
             break;
         default:
             Species = BirdGroupSpecies.Pending;
             break;
     }
     Comment = birdGroupFeature.Comments;
     BirdGroupFeature = birdGroupFeature;
 }
 private static BirdGroupFeature FromFeature(Feature feature)
 {
     if (feature == null)
         return null;
     if (!feature.IsEditing)
         feature.StartEditing();
     var birdGroup = new BirdGroupFeature { Feature = feature };
     birdGroup.LoadAttributes();
     BirdGroups[birdGroup.Guid] = birdGroup;
     return birdGroup;
 }
Exemplo n.º 3
0
 public bool Save(Observation observation)
 {
     if (BirdGroupFeature == null)
         BirdGroupFeature = BirdGroupFeature.FromObservation(observation);
     BirdGroupFeature.Size = GroupSize;
     BirdGroupFeature.Behavior = Behavior.ToString()[0];
     BirdGroupFeature.Species = Species.ToString()[0];
     BirdGroupFeature.Comments = Comment;
     return BirdGroupFeature.Save();
 }