/// <summary> /// Creates a MmsPart from a file and specifies another part name /// </summary> /// <param name="filename">A valid path to a existing file</param> /// <param name="partname">The name of the part in the mms file</param> public static MmsPart FromFile(string filename, string partname) { try { using (var stream = File.OpenRead(filename)) { return(MmsPart.FromStream(stream, partname)); } } catch (Exception e) { throw new MmsException("Failed to load content from file", e); } }
public void AddPart(string name, Stream stream) { Parts.Add(MmsPart.FromStream(stream, name)); }