示例#1
0
        //TODO get system icons for file types and cache them internally
        // ignoring ones that can change.. (ie; executables and images)
        // getting image thumbs may be a w***e though :(

        public PackRatUI()
        {
            InitializeComponent();

            this.AllowDrop  = true;
            this.DragEnter += new DragEventHandler(PackRat_DragEnter);
            this.DragDrop  += new DragEventHandler(PackRat_DragDrop);

            saveState = new SaveState();

            // hook our instance up to the static DbgWin defined in Program
            LogWin          = Program.LogWin;
            LogWin.Location = new Point(this.Location.X + 32, this.Location.Y);
            LogWin.Show();
            Log("Hooked up LogWin", LogType.Init);
            Log("Starting application", LogType.GUI);

            if (PWin == null)
            {
                PWin = Program.ProgWin;
                Log("Hooked up ProgWin", LogType.GUI);
            }

            Log("Init Archive() and registering callbacks", LogType.Init);
            Archive.OnLog       = DbgWin.Log;
            PRX                 = new Archive();
            PRX.OnTaskComplete += Mba_TaskComplete;
            PRX.OnError        += Mba_Error;
            PRX.OnRequestPWD   += Mba_RequestPWD;
            PRX.OnNameConflict += Mba_OnNameConflict;
            PRX.ProgressReport += Mba_Progress;
            DirCurrent          = PRX.RootPath.GUID;
            PRX.RootPath.Flags  = NodeFlag.Virtual;
        }
示例#2
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(true);

            string[] args = Environment.GetCommandLineArgs();

            foreach (string arg in args)
            {
                if (arg.ToLower() == "no_recursion")
                {
                    Utils.DebugFlags |= Utils.Debug.NO_RECURSION;
                }
                if (arg.ToLower() == "log_to_console")
                {
                    Utils.DebugFlags |= Utils.Debug.LOG_TO_CONSOLE;
                }
                if (arg.ToLower() == "no_threading")
                {
                    Utils.DebugFlags |= Utils.Debug.NO_THREADING;
                }
                if (arg.ToLower() == "no_collisions")
                {
                    Utils.DebugFlags |= Utils.Debug.NO_COLLISIONS;
                }
                if (arg.ToLower() == "overwrite_files")
                {
                    Utils.DebugFlags |= Utils.Debug.OVERWRITE_FILES;
                }
                if (arg.ToLower() == "no_reports")
                {
                    Utils.DebugFlags |= Utils.Debug.NO_REPORTS;
                }
                if (arg.ToLower() == "no_compression")
                {
                    Utils.DebugFlags |= Utils.Debug.NO_COMPRESSION;
                }
                if (arg.ToLower() == "no_encryption")
                {
                    Utils.DebugFlags |= Utils.Debug.NO_ENCRYPTION;
                }
                if (arg.ToLower() == "no_hashing")
                {
                    Utils.DebugFlags |= Utils.Debug.NO_HASHING;
                }
                if (arg.ToLower() == "leave_temp_files")
                {
                    Utils.DebugFlags |= Utils.Debug.LEAVE_TEMP_FILES;
                }
            }

            LogWin  = new DbgWin();
            PRUI    = new PackRatUI();
            ProgWin = new ProgressWin();

            DbgWin.Log($"CMD Opts: {Utils.DebugFlags.ToString()}", LogType.Warning);

            Application.Run(PRUI);
        }