Ejemplo n.º 1
0
        internal static DomainFile CreateEmpty(DirectoryInfo directory)
        {
            //Create a stream under an available filename
            FileStream file = null;

            for (int i = 0; file == null; i++)
            {
                FileInfo path = new FileInfo(directory.FullName + Path.DirectorySeparatorChar + "New Domain " + i + ".xml");
                if (!path.Exists)
                {
                    file = path.Create();
                }
            }

            XmlDataSource.WriteEmptyDomain(file);

            return(new DomainFile(file));
        }