/// <summary> /// Initialises a new instance of the <see cref="RawObservations"/> class. /// </summary> public RawObservations() { this.version = 3; this.location = string.Empty; this.date = string.Empty; this.notes = string.Empty; this.length = ObservationLength.Unspecified; this.intensity = ObservationIntensity.NotRecorded; this.timeOfDay = ObservationTimeOfDay.NotRecorded; this.weather = ObservationWeather.NotRecorded; this.habitats = new RawHabitats(); this.species = new TypeString(); this.heard = new TypeString(); }
/// <summary> /// Initialises a new instance of the <see cref="CalendarItem"/> calendar. /// </summary> /// <param name="day">the day of the event</param> /// <param name="name">the name of the event</param> /// <param name="intensity"> /// The intensity of the event. /// </param> public CalendarItem( string day, string name, ObservationIntensity intensity, string path, Action <string> openEventData) { this.Day = day; this.Name = name; this.Intensity = intensity; this.path = path; this.openEventData = openEventData; this.SelectNewEvent = new CommonCommand( this.Select); }
/// <summary> /// Set a new intensity in the model. /// </summary> /// <param name="newIntensity">new intensity</param> public void SetIntensity(ObservationIntensity newIntensity) { this.observations.Intensity = newIntensity; }
/// <summary> /// Set the new observation intensity /// </summary> /// <param name="newIntensity">new length</param> private void NewObservationIntensity(ObservationIntensity newIntensity) { this.observations.SetIntensity(newIntensity); }
/// <summary> /// Convert from a <see cref="ObservationIntensity"/> to a <see cref="Brush"/> /// </summary> /// <param name="value">original value</param> /// <param name="targetType">target type is not used.</param> /// <param name="parameter">parameter is not used.</param> /// <param name="culture">culture is not used.</param> /// <returns>new brush</returns> public object Convert( object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { Color convertedColour; if ( value == null || value.GetType() != typeof(ObservationIntensity)) { convertedColour = Colors.HotPink; } else { ObservationIntensity convertedState = (ObservationIntensity)value; switch (convertedState) { case ObservationIntensity.Snapshot: convertedColour = Colors.Indigo; break; case ObservationIntensity.H: convertedColour = Colors.DarkGreen; break; case ObservationIntensity.M: convertedColour = Colors.ForestGreen; break; case ObservationIntensity.L: convertedColour = Colors.Olive; break; case ObservationIntensity.Run: convertedColour = Colors.DarkBlue; break; case ObservationIntensity.Cycling: convertedColour = Colors.MediumBlue; break; case ObservationIntensity.Walk: convertedColour = Colors.RoyalBlue; break; case ObservationIntensity.Commute: convertedColour = Colors.IndianRed; break; case ObservationIntensity.RailJourney: convertedColour = Colors.DarkGoldenrod; break; case ObservationIntensity.SeaJourney: convertedColour = Colors.Goldenrod; break; default: convertedColour = Colors.Black; break; } } return(new SolidColorBrush(convertedColour)); }