public bool Open(string filename) { bool result = false; if (filename.EndsWith(".estates")) { string filenameWithoutSuffix = filename.Replace(".estates", ""); result = _estateManager.BinaryDeserialize(filenameWithoutSuffix + ".estates"); if (!result) { return(false); } if (File.Exists(filenameWithoutSuffix + ".addresses")) { result = _addressManager.BinaryDeserialize(filenameWithoutSuffix + ".addresses"); } } else if (filename.EndsWith(".addresses")) { string filenameWithoutSuffix = filename.Replace(".addresses", ""); result = _addressManager.BinaryDeserialize(filenameWithoutSuffix + ".addresses"); if (!result) { return(false); } if (File.Exists(filenameWithoutSuffix + ".estates")) { result = _estateManager.BinaryDeserialize(filenameWithoutSuffix + ".estates"); } } UnsavedChanges = false; return(result); }