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); }
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(); }
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]; }
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(); }
/// <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; }