internal static object INTERNAL_ConvertFromString(string keyTimeCode) { try { if (keyTimeCode == "Uniform") { throw new NotImplementedException("The Value \"Uniform\" for keyTime is not supported yet."); } else if (keyTimeCode == "Paced") { throw new NotImplementedException("The Value \"Paced\" for keyTime is not supported yet."); } else if (keyTimeCode.EndsWith("%")) { throw new NotImplementedException("The percentage values for keyTime are not supported yet."); } else { #if BRIDGE TimeSpan timeSpan = INTERNAL_BridgeWorkarounds.TimeSpanParse(keyTimeCode, false); #else TimeSpan timeSpan = TimeSpan.Parse(keyTimeCode); #endif return(new KeyTime(timeSpan)); } } catch (Exception ex) { throw new Exception("Invalid KeyTime: " + keyTimeCode, ex); } }
///// <summary> ///// Subtracts the specified Windows.UI.Xaml.Duration from this Windows.UI.Xaml.Duration. ///// </summary> ///// <param name="duration">The Windows.UI.Xaml.Duration to subtract from this Windows.UI.Xaml.Duration.</param> ///// <returns>The subtracted Windows.UI.Xaml.Duration.</returns> //public Duration Subtract(Duration duration); ///// <summary> ///// Converts a Windows.UI.Xaml.Duration to a System.String representation. ///// </summary> ///// <returns>A System.String representation of this Windows.UI.Xaml.Duration.</returns> //public override string ToString(); internal static object INTERNAL_ConvertFromString(string p) { #if BRIDGE TimeSpan timeSpan = INTERNAL_BridgeWorkarounds.TimeSpanParse(p); #else TimeSpan timeSpan = TimeSpan.Parse(p); #endif return(new Duration(timeSpan)); }
static object ConvertTimeSpanFromString(string str) { try { #if BRIDGE TimeSpan returnValue = INTERNAL_BridgeWorkarounds.TimeSpanParse(str); #else TimeSpan returnValue = TimeSpan.Parse(str); #endif return(returnValue); } catch { throw new Exception("Xaml exception: cannot convert \"" + str + "\" to TimeSpan. " + AdviseToFixTheError); } }
///// <summary> ///// Subtracts the specified Windows.UI.Xaml.Duration from this Windows.UI.Xaml.Duration. ///// </summary> ///// <param name="duration">The Windows.UI.Xaml.Duration to subtract from this Windows.UI.Xaml.Duration.</param> ///// <returns>The subtracted Windows.UI.Xaml.Duration.</returns> //public Duration Subtract(Duration duration); ///// <summary> ///// Converts a Windows.UI.Xaml.Duration to a System.String representation. ///// </summary> ///// <returns>A System.String representation of this Windows.UI.Xaml.Duration.</returns> //public override string ToString(); internal static object INTERNAL_ConvertFromString(string p) { if (p.ToLower() == "forever") { return(Duration.Forever); } if (p.ToLower() == "automatic") { return(Duration.Automatic); } #if BRIDGE TimeSpan timeSpan = INTERNAL_BridgeWorkarounds.TimeSpanParse(p); #else TimeSpan timeSpan = TimeSpan.Parse(p); #endif return(new Duration(timeSpan)); }