private void CreateVDir(DirectoryEntry parent, IISVDirElement vdir)
        {
            Log(Level.Info, Resources.IISCreateWebSiteCreateVDir, vdir.VDirName);

            DirectoryEntry siteVDir = null;
            foreach(DirectoryEntry childEntry in parent.Children)
            {
                if(childEntry.Name.Equals(vdir.VDirName, StringComparison.InvariantCulture))
                    siteVDir = childEntry;
            }

            if(siteVDir == null)
                siteVDir = parent.Children.Add(vdir.VDirName, IISConstants.TYPE_VDIR);

            siteVDir.Invoke("SetInfo");
            ApplyProperties(siteVDir, vdir.VDirProperties);
            siteVDir.CommitChanges();

            if (vdir.CreateApp)
            {
                siteVDir.Invoke("AppCreate", true);
            }

            foreach (IISVDirElement childrenVDir in vdir.VDirs)
            {
                CreateVDir(siteVDir, childrenVDir);
            }
            siteVDir.CommitChanges();
        }
 private static void CreateVDir(DirectoryEntry parent, IISVDirElement vdir)
 {
     DirectoryEntry siteVDir = parent.Children.Add(vdir.VDirName, IISConstants.TYPE_VDIR);
     ApplyProperties(siteVDir, vdir.VDirProperties);
     siteVDir.CommitChanges();
     foreach (IISVDirElement childrenVDir in vdir.VDirs)
     {
         CreateVDir(siteVDir, childrenVDir);
     }
     siteVDir.CommitChanges();
 }