public virtual void Save() { if (document.File != null) { document.Save(); } else { SaveAs(); } }
public static ISinapseDocument Create(string name, string fullName, Type type) { // Creates a new instance, then save it to the disk. ISinapseDocument doc = Activator.CreateInstance(type, new object[] { name, new FileInfo(fullName) }) as ISinapseDocument; doc.Save(fullName); return(doc); }
/// <summary> /// Saves the SinapseDocument referenced by this SinapseDocumentInfo to the disk. /// If type is null, only creates an empty file. /// </summary> public void Create() { if (type == null) { File.Create(FullName); } else { // Creates a new instance, then save it to the disk. ISinapseDocument doc = Activator.CreateInstance(type, new object[] { Name, new FileInfo(FullName) }) as ISinapseDocument; doc.Save(FullName); } }