public override object ConvertFromInvariantString(string value) { if (value == null) { return(null); } Uri result; if (!Uri.TryCreate(value, UriKind.Absolute, out result) || result.Scheme == "file") { return(VideoSource.FromFile(value)); } return(VideoSource.FromUri(result)); }
/// <summary> /// Determines if two video sources are equivalent. /// </summary> /// <param name="other">The other video source.</param> /// <returns> /// True if the video sources are equal, false otherwise. /// </returns> public override bool Equals(VideoSource other) { return(!(other is StreamVideoSource) || ((StreamVideoSource)other).Stream.Equals(Stream)); }
/// <summary> /// Determines if two video sources are equivalent. /// </summary> /// <param name="other">The other video source.</param> /// <returns> /// True if the video sources are equal, false otherwise. /// </returns> public override bool Equals(VideoSource other) { return(!(other is FileVideoSource) || ((FileVideoSource)other).File.Equals(File)); }