Exemplo n.º 1
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            Microsoft.Win32.OpenFileDialog dlg = new Microsoft.Win32.OpenFileDialog
            {
                FileName    = "rawnand.bin",
                DefaultExt  = ".bin",
                Filter      = "Raw NAND dump (.bin or .bin.*)|*.bin*",
                Multiselect = true
            };

            if (dlg.ShowDialog() == true)
            { // it's nullable so i HAVE to compare it to true
                string[] files = dlg.FileNames;
                if (files != null && files.Length > 0)
                {
                    IList <Stream> streams = new List <Stream>();
                    foreach (string file in files)
                    {
                        streams.Add(new FileInfo(file).OpenRead()); // Change to Open when write support is added
                    }
                    Stream NANDSource = new CombinationStream(streams);

                    if (!NANDService.InsertNAND(NANDSource, false))
                    {
                        MessageBox.Show("Invalid NAND dump!");
                    }
                }
            }
        }
Exemplo n.º 2
0
        private void PickNANDButtonClick(object sender, RoutedEventArgs e)
        {
            FileInfo[] files = Extensions.Extensions.RequestOpenFilesFromUser(".bin", "Raw NAND dump (.bin or .bin.*)|*.bin*", "Select raw NAND dump", "rawnand.bin");

            if (files != null)
            {
                IList <IStorage> streams = new List <IStorage>();
                foreach (FileInfo file in files)
                {
                    streams.Add(file.OpenRead().AsStorage()); // Change to Open when write support is added
                }
                IStorage NANDSource = new ConcatenationStorage(streams, true);

                if (!NANDService.InsertNAND(NANDSource, false))
                {
                    MessageBox.Show("Invalid NAND dump!");
                }
            }
        }