コード例 #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;
 }
コード例 #2
0
 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;
 }
コード例 #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();
 }