public SettingsSingleton()
        {
            _fileSourceAudio = new FilePersistency <AudioProperties>("AudioSource");
            _audioProperties = new AudioProperties();
            _fileSourceText  = new FilePersistency <TextChanger>("TextSource");
            _textChange      = new TextChanger();

            _folder = _fileSourceAudio.Folder.Path;
        }
示例#2
0
        public EventCatalogSingleton()
        {
            Events = new ObservableCollection <Event>
            {
                new Event(1, "Pitching 2nd semester projects", "Final semester project", "Auditorium 101", new DateTime(2018, 12, 9, 22, 16, 22)),
                new Event(2, "Guru Programming", "Conference projects", "Local 202", new DateTime(2018, 12, 9, 22, 16, 22))
            };
            _filePersistency = new FilePersistency <Event>();

            // Load the Event
        }
示例#3
0
 private DisplayCatalogSingleton()
 {
     _displays = new List <Display>();
     _displays.Add(new Display(1, 1, "navn", "info"));
     _fileSource = new FilePersistency <Display>();
 }
示例#4
0
 /// <summary>
 /// initialisere _location og _file
 /// </summary>
 public LocationCollection()
 {
     _locations = new List <Location>();
     _file      = new FilePersistency <List <Location> >("Locations");
 }
示例#5
0
 /// <summary>
 /// Saves domain objects to file
 /// </summary>
 /// <param name="collection">
 /// Collection of domain objects to save
 /// </param>
 public override void Save(CollectionBase <TDomainClass> collection)
 {
     FilePersistency <TDomainClass> .Save(collection, _fileName);
 }
示例#6
0
 /// <summary>
 /// Reads domain objects from file
 /// </summary>
 /// <returns>
 /// Collection of domain objects
 /// </returns>
 public override async Task <CollectionBase <TDomainClass> > Load()
 {
     return(await FilePersistency <TDomainClass> .Load(_fileName));
 }
示例#7
0
 public void Setup()
 {
     stream   = new Mock <IStreamSource>();
     tweet    = new Mock <ITweetDTO>();
     instance = new FilePersistency(new NullLogger <FilePersistency>(), stream.Object);
 }