Esempio n. 1
0
        public unsafe static Progress PollProgress()
        {
            var       ptr      = poll_progress();
            ProgressC progress = new ProgressC();

            progress = (ProgressC)Marshal.PtrToStructure(ptr, typeof(ProgressC));
            Progress prog = new Progress
            {
                Finished           = progress.finished != 0,
                NewFile            = progress.new_file != 0,
                NewState           = progress.new_state != 0,
                ProgressS          = progress.state,
                ProgressPercentage = progress.progress,
                File = progress.file_name
            };

            return(prog);
        }
Esempio n. 2
0
        public unsafe static Progress StartPacking(string twinsPath, string imagePathName)
        {
            var       ptr      = start_packing(twinsPath, imagePathName);
            ProgressC progress = new ProgressC();

            progress = (ProgressC)Marshal.PtrToStructure(ptr, typeof(ProgressC));
            Progress prog = new Progress
            {
                Finished           = progress.finished != 0,
                NewFile            = progress.new_file != 0,
                NewState           = progress.new_state != 0,
                ProgressS          = progress.state,
                ProgressPercentage = progress.progress,
                File = progress.file_name
            };

            return(prog);
        }