SignalStop() public method

public SignalStop ( ) : void
return void
Ejemplo n.º 1
0
        public static void Dump(Options options)
        {
            using (var streamProvider = new PipBoyStreamProvider(options.RawFile))
            {
                Stream stream;

                if (options.Host != null)
                {
                    stream = streamProvider.Connect(options.Host, options.Port);
                }
                else if (options.InputFile != null)
                {
                    stream = streamProvider.ReadFile(options.InputFile);
                }
                else
                {
                    throw new ArgumentException();
                }

                using (stream)
                {
                    var dumper     = new Dumper(options.GameobjectsFile);
                    var dumpThread = new Thread(_ => dumper.Dump(stream));
                    dumpThread.Start();

                    Console.WriteLine("Dump running... press key to exit");
                    while (dumpThread.IsAlive && !Console.KeyAvailable)
                    {
                        Thread.Sleep(100);
                    }
                    dumper.SignalStop();
                    dumpThread.Join();
                }
            }
        }
Ejemplo n.º 2
0
        public static void Dump(Options options)
        {
            using (var streamProvider = new PipBoyStreamProvider(options.RawFile))
            {
                Stream stream;

                if (options.Host != null)
                {
                    stream = streamProvider.Connect(options.Host, options.Port);
                }
                else if (options.InputFile != null)
                {
                    stream = streamProvider.ReadFile(options.InputFile);
                }
                else
                {
                    throw new ArgumentException();
                }

                using (stream)
                {
                    var dumper = new Dumper(options.GameobjectsFile);
                    var dumpThread = new Thread(_ => dumper.Dump(stream));
                    dumpThread.Start();

                    Console.WriteLine("Dump running... press key to exit");
                    while (dumpThread.IsAlive && !Console.KeyAvailable)
                    {
                        Thread.Sleep(100);
                    }
                    dumper.SignalStop();
                    dumpThread.Join();
                }
            }
        }