/// <summary> /// Parse space type. /// </summary> /// <param name="name">Name of the media type.</param> /// <returns><see cref="TeamsMediaType"/> for the name.</returns> public static TeamsMediaType Parse(string name) { TeamsMediaType mediaType = null; if (!MEDIA_TYPES.TryGetValue(name, out mediaType)) { mediaType = new TeamsMediaType(name); } return(mediaType); }
/// <summary> /// Determines whether this instance and another specified <see cref="TeamsMediaType"/> object have the same value. /// </summary> /// <param name="value">The media type to compare to this instance.</param> /// <returns>true if the value of the parameter is the same as the value of this instance; otherwise, false. If value is null, the method returns false.</returns> public bool Equals(TeamsMediaType value) { if (Object.ReferenceEquals(value, null)) { return(false); } if (Object.ReferenceEquals(this, value)) { return(true); } return(this.Name == value.Name); }
/// <summary> /// Instanciate the file data. /// </summary> /// <param name="stream">Stream of the file.</param> /// <param name="fileName">File name of the file.</param> /// <param name="mediaType"><see cref="TeamsMediaType"/> of the file.</param> public TeamsFileData(Stream stream, string fileName, TeamsMediaType mediaType) { this.Stream = stream; this.FileName = fileName; this.MediaTypeName = mediaType.Name; }