Ejemplo n.º 1
0
        public Form1()
        {
            InitializeComponent();
            dirProc    = new DirectoryProcessor();
            encryption = new EncryptionEngine();

            debug = Debugging.Instance;
            debug.SetForm(this);
            Version v     = Assembly.GetExecutingAssembly().GetName().Version;
            string  name  = Assembly.GetExecutingAssembly().GetName().Name;
            string  about = string.Format(CultureInfo.InvariantCulture, @"{0} Version {1}.{2}.{3} (r{4})", name, v.Major, v.Minor, v.Build, v.Revision);

            debug.WriteLine(about);

            // load settings
            bool needSave = false;

            if (Properties.Settings.Default.LastEncryptFilesPath == "")
            {
                Properties.Settings.Default.LastEncryptFilesPath = Environment.SpecialFolder.MyDocuments.ToString();
                needSave = true;
            }
            if (Properties.Settings.Default.LastEncryptSavePath == "")
            {
                Properties.Settings.Default.LastEncryptSavePath = Environment.SpecialFolder.MyDocuments.ToString();
                needSave = true;
            }
            if (Properties.Settings.Default.LastDecryptFilePath == "")
            {
                Properties.Settings.Default.LastDecryptFilePath = Environment.SpecialFolder.MyDocuments.ToString();
                needSave = true;
            }
            if (Properties.Settings.Default.LastDecryptSavePath == "")
            {
                Properties.Settings.Default.LastDecryptSavePath = Environment.SpecialFolder.MyDocuments.ToString();
                needSave = true;
            }
            if (needSave)
            {
                Properties.Settings.Default.Save();
            }
        }
 public BlockFileProcessor(DirectoryProcessor dp)
 {
     directoryProcessor = dp;
 }
 public EncryptionEngine()
 {
     debug              = Debugging.Instance;
     dirProc            = new DirectoryProcessor();
     blockFileProcessor = new BlockFileProcessor(dirProc);
 }