コード例 #1
0
ファイル: App.xaml.cs プロジェクト: zelezoltan/game-of-life
        private void App_Startup(Object sender, StartupEventArgs e)
        {
            // Create the persistence
            _persistence = new Persistence.Persistence();

            // Create the model and inject the persistence
            _model = new Model.Model(_persistence);

            // Create the view model and inject the model
            _viewModel = new ViewModel.ViewModel(_model);
            _viewModel.LoadConfiguration += new EventHandler(ViewModel_LoadConfiguration);
            _viewModel.Play += new EventHandler(ViewModel_Play);
            _viewModel.Step += new EventHandler(ViewModel_Step);
            //_viewModel.Pause += new EventHandler(ViewModel_Pause);
            _viewModel.CanvasClick          += new EventHandler(ViewModel_CanvasClicked);
            _viewModel.OpenNewPatternWindow += new EventHandler(ViewModel_OpenNewPatternWindow);
            _viewModel.CreatePattern        += new EventHandler <ViewModel.NewPatternEventArgs>(ViewModel_CreatePattern);

            // Create the view
            _view             = new MainWindow();
            _view.DataContext = _viewModel;
            _view.Show();

            // Create the timer
            _timer          = new DispatcherTimer();
            _timer.Interval = TimeSpan.FromSeconds(0.1);
            _timer.Tick    += new EventHandler(TimerTick);
        }
コード例 #2
0
        static void Main(string[] args)
        {
            var st = new Student();

            st.AddName("Chuks");
            st.AddName("Gaby");
            st.AddName("Winnie");
            st.AddName("Samuel");
            st.AddName("Lola");
            st.AddName("Muna");

            //st.Save(@"C:\Users\seana\Documents\students.txt");
            string fname = @"C:\Users\seana\Documents\students.txt";
            var    p     = new Persistence.Persistence();

            p.SaveToFile(st, fname, true);
            Process.Start(fname);



            Console.WriteLine("Hello");
            Console.WriteLine(st);


            Console.ReadLine();
        }
コード例 #3
0
        public VFSFileStream(VFSFile file, BlockParser blockParser, FileSystemOptions options, BlockAllocation blockAllocation, BlockManipulator blockManipulator, Persistence.Persistence persistence)
        {
            _file = file;
            _blockParser = blockParser;
            _options = options;
            _blockAllocation = blockAllocation;
            _blockManipulator = blockManipulator;
            _persistence = persistence;

            _writeBuffer = new byte[_options.BlockSize];
        }
コード例 #4
0
ファイル: FileSystem.cs プロジェクト: RainsSoft/VFSPrototype
        internal FileSystem(FileSystemOptions options)
        {
            _options = options;

            _blockManipulator = new BlockManipulator(_options.Location, _options.BlockSize, _options.MasterBlockSize);
            _blockParser = new BlockParser(_options);
            _persistence = new Persistence.Persistence(_blockParser, _blockManipulator);
            _blockAllocation = _options.BlockAllocation;

            InitializeFileSystem();
        }
コード例 #5
0
ファイル: Model.cs プロジェクト: zelezoltan/game-of-life
 /// <summary>
 /// Creating a model
 /// </summary>
 /// <param name="persistence">Persistence object to be injected</param>
 public Model(Persistence.Persistence persistence)
 {
     this._persistence = persistence;
     this._generation  = 0;
     this._size        = 0;
 }