Beispiel #1
0
 /// <summary>
 /// Serializes the position record into a string suitable for logging or transmitting.
 /// </summary>
 /// <returns>The serialized record.</returns>
 public override string ToString()
 {
     return(string.Format("{0},{1},{2},{3},{4},{5},{6},{7},{8},{9}",
                          TimeUtc.HasValue ? Serialize.ToString(TimeUtc.Value) : string.Empty,
                          !double.IsNaN(Latitude) ? Latitude.ToString() : string.Empty,
                          !double.IsNaN(Longitude) ? Longitude.ToString() : string.Empty,
                          !double.IsNaN(Altitude) ? Altitude.ToString() : string.Empty,
                          !double.IsNaN(Course) ? Course.ToString() : string.Empty,
                          !double.IsNaN(Speed) ? Speed.ToString() : string.Empty,
                          !double.IsNaN(HorizontalAccuracy) ? HorizontalAccuracy.ToString() : string.Empty,
                          !double.IsNaN(VerticalAccurancy) ? VerticalAccurancy.ToString() : string.Empty,
                          Technology != GeoFixTechnology.Unknown ? Technology.ToString() : string.Empty,
                          NetworkStatus != NetworkStatus.Unknown ? NetworkStatus.ToString() : string.Empty));
 }
Beispiel #2
0
        /// <summary>
        /// Renders the timer into a string.
        /// </summary>
        /// <returns>The timer string.</returns>
        public override string ToString()
        {
            string s;

            switch (type)
            {
            case RecurringTimerType.Disabled:

                return("Disabled");

            case RecurringTimerType.Minute:

                return("Minute");

            case RecurringTimerType.QuarterHour:

                s = timeOffset.ToString();

                return(string.Format("QuarterHour,{0}", s.Substring(s.IndexOf(':') + 1)));

            case RecurringTimerType.Hourly:

                s = timeOffset.ToString();

                return(string.Format("Hourly,{0}", s.Substring(s.IndexOf(':') + 1)));

            case RecurringTimerType.Daily:

                return(string.Format("Daily,{0}", timeOffset.ToString()));

            case RecurringTimerType.Interval:

                return(string.Format("Interval,{0}", Serialize.ToString(timeOffset)));

            default:

                throw new NotImplementedException();
            }
        }
Beispiel #3
0
 /// <summary>
 /// Sets a name/value pair in the user's profile.
 /// </summary>
 /// <param name="name">The name.</param>
 /// <param name="value">The value.</param>
 public void Set(string name, Uri value)
 {
     Set(name, Serialize.ToString(value));
 }
Beispiel #4
0
 /// <summary>
 /// Sets a name/value pair in the user's profile.
 /// </summary>
 /// <param name="name">The name.</param>
 /// <param name="value">The value.</param>
 public void Set(string name, NetworkBinding value)
 {
     Set(name, Serialize.ToString(value));
 }
Beispiel #5
0
 /// <summary>
 /// Sets a name/value pair in the user's profile.
 /// </summary>
 /// <param name="name">The name.</param>
 /// <param name="value">The value.</param>
 public void Set(string name, IPAddress value)
 {
     Set(name, Serialize.ToString(value));
 }
Beispiel #6
0
 /// <summary>
 /// Sets a name/value pair in the user's profile.
 /// </summary>
 /// <param name="name">The name.</param>
 /// <param name="value">The value.</param>
 public void Set(string name, DateTime value)
 {
     Set(name, Serialize.ToString(value));
 }
Beispiel #7
0
 /// <summary>
 /// Sets a name/value pair in the user's profile.
 /// </summary>
 /// <param name="name">The name.</param>
 /// <param name="value">The value.</param>
 public void Set(string name, TimeSpan value)
 {
     Set(name, Serialize.ToString(value));
 }
Beispiel #8
0
 /// <summary>
 /// Sets the value of a named table column in the current row as
 /// a HEX encoded byte array.
 /// </summary>
 /// <param name="columnName">The column name.</param>
 /// <param name="value">The column value.</param>
 /// <remarks>
 /// <note>
 /// This method will do nothing if the <paramref name="columnName" />
 /// passed does not map to a table column.
 /// </note>
 /// </remarks>
 public void Set(string columnName, byte[] value)
 {
     Set(columnName, value != null ? Serialize.ToString(value) : string.Empty);
 }
Beispiel #9
0
 /// <summary>
 /// Sets the value of a named table column in the current row.
 /// </summary>
 /// <param name="columnName">The column name.</param>
 /// <param name="value">The column value.</param>
 /// <remarks>
 /// <note>
 /// This method will do nothing if the <paramref name="columnName" />
 /// passed does not map to a table column.
 /// </note>
 /// </remarks>
 public void Set(string columnName, Guid value)
 {
     Set(columnName, Serialize.ToString(value));
 }
Beispiel #10
0
 /// <summary>
 /// Sets the value of a named table column in the current row.
 /// </summary>
 /// <param name="columnName">The column name.</param>
 /// <param name="value">The column value.</param>
 /// <remarks>
 /// <note>
 /// This method will do nothing if the <paramref name="columnName" />
 /// passed does not map to a table column.
 /// </note>
 /// </remarks>
 public void Set(string columnName, NetworkBinding value)
 {
     Set(columnName, value != null ? Serialize.ToString(value) : string.Empty);
 }
Beispiel #11
0
 /// <summary>
 /// Sets the value of a named table column in the current row.
 /// </summary>
 /// <param name="columnName">The column name.</param>
 /// <param name="value">The column value.</param>
 /// <remarks>
 /// <note>
 /// This method will do nothing if the <paramref name="columnName" />
 /// passed does not map to a table column.
 /// </note>
 /// </remarks>
 public void Set(string columnName, DateTime value)
 {
     Set(columnName, Serialize.ToString(value));
 }
Beispiel #12
0
 /// <summary>
 /// Sets the value of a named table column in the current row.
 /// </summary>
 /// <param name="columnName">The column name.</param>
 /// <param name="value">The column value.</param>
 /// <remarks>
 /// <note>
 /// This method will do nothing if the <paramref name="columnName" />
 /// passed does not map to a table column.
 /// </note>
 /// </remarks>
 public void Set(string columnName, TimeSpan value)
 {
     Set(columnName, Serialize.ToString(value));
 }
Beispiel #13
0
 /// <summary>
 /// Serializes the specified fields of the position record into a string suitable for logging or transmitting.
 /// </summary>
 /// <param name="fields">A <see cref="GeoFixField" /> bitmap describing the fields to be written.</param>
 /// <returns>The serialized record.</returns>
 public string ToString(GeoFixField fields)
 {
     return(string.Format("{0},{1},{2},{3},{4},{5},{6},{7},{8},{9}",
                          (fields & GeoFixField.TimeUtc) != 0 && TimeUtc.HasValue ? Serialize.ToString(TimeUtc.Value) : string.Empty,
                          (fields & GeoFixField.Latitude) != 0 && !double.IsNaN(Latitude) ? Latitude.ToString() : string.Empty,
                          (fields & GeoFixField.Longitude) != 0 && !double.IsNaN(Longitude) ? Longitude.ToString() : string.Empty,
                          (fields & GeoFixField.Altitude) != 0 && !double.IsNaN(Altitude) ? Altitude.ToString() : string.Empty,
                          (fields & GeoFixField.Course) != 0 && !double.IsNaN(Course) ? Course.ToString() : string.Empty,
                          (fields & GeoFixField.Speed) != 0 && !double.IsNaN(Speed) ? Speed.ToString() : string.Empty,
                          (fields & GeoFixField.HorizontalAccuracy) != 0 && !double.IsNaN(HorizontalAccuracy) ? HorizontalAccuracy.ToString() : string.Empty,
                          (fields & GeoFixField.VerticalAccurancy) != 0 && !double.IsNaN(VerticalAccurancy) ? VerticalAccurancy.ToString() : string.Empty,
                          (fields & GeoFixField.Technology) != 0 && Technology != GeoFixTechnology.Unknown ? Technology.ToString() : string.Empty,
                          (fields & GeoFixField.NetworkStatus) != 0 && NetworkStatus != NetworkStatus.Unknown ? NetworkStatus.ToString() : string.Empty));
 }