private void UpdateFoldersInPath(string directory)
        {
            // look for a date in the folder name and change it if the year does not match
            DateTime existingFolderDate;

            string folderName = new DirectoryInfo(directory).Name;

            if (DateTime.TryParse(folderName.Split(' ').First(), out existingFolderDate))
            {

                Logger.Log("Found date in folder name: " + existingFolderDate + " for " + directory);
                // get date of all photos
                var files = Directory.GetFiles(directory, "*.*", SearchOption.TopDirectoryOnly);
                foreach (string file in files)
                {
                    //Logger.Log(file);
                    DateTime originalFileTime = Directory.GetCreationTime(file);
                    if (originalFileTime.Subtract(existingFolderDate).Days > minNumDaysDiff)
                    {
                        Logger.Log(String.Format("Change {0} to {1} for {2}", originalFileTime, existingFolderDate, file));
                        File.SetCreationTime(file, existingFolderDate);
                        File.SetLastWriteTime(file, existingFolderDate);
                    }
                }
            }

            string[] directories = Directory.GetDirectories(directory);

            foreach (string subFolder in directories)
            {
                UpdateFoldersInPath(subFolder);
            }
        }
        public MainWindow()
        {
            InitializeComponent();

            briefing = new Briefing();
            installHandler = new InstallHandler(this, briefing);
            VisibilityHandler = new VisibilityHandler(this);
            VisibilityHandler.showProfileSettings();

            TextBox_Briefing_Text.IsReadOnly = false;
            TextBox_Briefing_Text.AcceptsReturn = true;

            // Get arma profilefolders
            String arma3Folder = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + @"\Arma 3";
            String arma3OtherFolder = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + @"\Arma 3 - Other Profiles";

            // Find default arma profilename
            if (Directory.Exists(arma3Folder))
            {
                string[] files = Directory.GetFiles(arma3Folder, "*.Arma3Profile");

                string filename = new DirectoryInfo(files[0]).Name;
                string[] names = filename.Split('.');

                Combobox_Profile_Name.Items.Add(names[0]);
            }

            // Find all custom arma profilenames
            if (Directory.Exists(arma3OtherFolder))
            {
                string[] subdirectoryEntries = Directory.GetDirectories(arma3OtherFolder);
                foreach (string subdirectory in subdirectoryEntries)
                {
                    Combobox_Profile_Name.Items.Add(new DirectoryInfo(subdirectory).Name);
                }

            }

            // Set all combobox to first value
            ComboBox_Briefing_Side.SelectedIndex = 0;
            ComboBox_Briefing_Title.SelectedIndex = 0;
            Combobox_Mission_Gametype.SelectedIndex = 0;
            Combobox_Profile_Name.SelectedIndex = 0;
            Combobox_Mission_Map.SelectedIndex = 0;
            Combobox_Profile_Editor.SelectedIndex = 0;
        }
        protected npandaySettingsVendorsVendor GetVendorForGnu(String libPath)
        {
            if (libPath == null)
                throw new ExecutionException("NPANDAY-9011-000: Could not detect GNU vendor: No CSCC_LIB_PATH Found");

            if (libPath.EndsWith("lib" + Path.DirectorySeparatorChar + "cscc" + Path.DirectorySeparatorChar + "lib"))
            {
                string installR = new DirectoryInfo(libPath).Parent.Parent.Parent.FullName;
                string[] tokenizedInstallRoot = installR.Split(Path.DirectorySeparatorChar);
                string vendorVersion = tokenizedInstallRoot[tokenizedInstallRoot.Length - 1];
                if (!isValidVersion(vendorVersion))
                {
                    throw new ExecutionException("NPANDAY-9011-001: Invalid version format for dotGNU: Version = " +
                        vendorVersion + ", Root = " + installR);
                }

                npandaySettingsVendorsVendor vendor = new npandaySettingsVendorsVendor();
                vendor.vendorName = "DotGNU";
                vendor.vendorVersion = vendorVersion;
                npandaySettingsVendorsVendorFrameworksFramework[] vendorFrameworks
                    = new npandaySettingsVendorsVendorFrameworksFramework[1];
                npandaySettingsVendorsVendorFrameworksFramework vf = new npandaySettingsVendorsVendorFrameworksFramework();
                vf.installRoot = Path.Combine(installR, "bin");
                vf.frameworkVersion = "2.0.50727";//doesn't matter
                vendorFrameworks[0] = vf; ;
                vendor.frameworks = vendorFrameworks;
                return vendor;
            }
            throw new ExecutionException("NPANDAY-9011-002: CSCC_LIB_PATH found but could not determine vendor information");
        }