Ejemplo n.º 1
0
 public RelayRepository(Func <IReposetoryOpenedResult> openStorageFunc, IKeyValueStorageHolder kvStorageHolder, IThreadNotifier uiNotifier, IWorker <Action> bgNotifier, string repoName)
 {
     _openStorageFunc = openStorageFunc;
     _kvStorageHolder = kvStorageHolder;
     _sync            = new object();
     _backWorker      = bgNotifier;
     _repoName        = repoName;
     _uiNotifier      = uiNotifier;
     _locomotives     = new ObservableCollection <ILocomotive>();        // we assumed that ctor called from UI
     _locomotives.CollectionChanged += LocomotivesOnCollectionChanged;
 }
Ejemplo n.º 2
0
        public PsnLogRelay(
            IPsnDataInformation psnDataInformation,
            IPsnData psnData,
            IPsnConfiguration psnConfiguration,
            IPsnProtocolConfiguration psnConfigurationLowLevel,
            IPsnDataCustomConfigration psnDataCustomConfigration,
            IThreadNotifier uiNotifier,
            IWorker <Action> bworker,
            IStorage <IPsnProtocolConfiguration> psnProtocolStorage,
            IPsnDataCustomConfigurationsStorage psnDataCustomConfigurationStorage,
            IKeyValueStorageHolder repoStorageHolder)
        {
            _logIntegrity       = PsnLogIntegrity.Unknown;
            _psnDataInformation = psnDataInformation;
            _psnData            = psnData;
            _psnDataPaged       = _psnData.PagesInformation;

            _psnConfiguration         = psnConfiguration;
            _psnConfigurationLowLevel = psnConfigurationLowLevel;

            _psnDataCustomConfigration = new PsnDataCustomConfigurationSimple(
                psnDataCustomConfigration.Id,
                psnDataCustomConfigration.PsnConfigurationId,
                psnDataCustomConfigration.CustomLogName);

            _uiNotifier         = uiNotifier;
            _bworker            = bworker;
            _psnProtocolStorage = psnProtocolStorage;
            _psnDataCustomConfigurationStorage = psnDataCustomConfigurationStorage;

            _meters = new ObservableCollection <IPsnMeter>();

            // TODO: i get logs for FTP logs also
            //_unicSignalIdStorage = new KeyValueStringStorageXmlMemCache(Path.Combine(Support.GetAppDataDirectoryPathAndCreateItIfNeeded(), Id.UnicString + ".Id.xml"));
            _unicSignalIdStorage = repoStorageHolder.GetStorage(Id.UnicString);
            //_unicSignalIdStorage = new KvStorageDbreezed(Id.UnicString);

            RebuildMetersUnsafe();
        }