Example #1
0
        public MainWindowViewModel(Target target, ISerializerService<Account> accountSerializerService, ISchedulerService accountSchedulerService, 
            IUIVisualizerService uiVisualizerService, IMessageService messageService)
        {
            Argument.IsNotNull(() => accountSerializerService);
            Argument.IsNotNull(() => accountSchedulerService);
            Argument.IsNotNull(() => uiVisualizerService);
            Argument.IsNotNull(() => messageService);
            Argument.IsNotNull(() => target);
            _accountSerializerService = accountSerializerService;
            _accountSchedulerService = accountSchedulerService;
            _uiVisualizerService = uiVisualizerService;
            _messageService = messageService;
            Target = target;
            AddTarget = new Command(OnAddTargetExecute);
            RemoveTarget = new Command(OnRemoveTargetExecute, OnRemoveTargetCanExecute);

            /*var job = JobBuilder.Create<HelloJob>().WithIdentity(new JobKey("Task_1", "TaskGroup")).Build();
            var t =
                TriggerBuilder.Create()
                    .WithIdentity("Trigger_1", "TaskGroup")
                    .StartAt(DateBuilder.TodayAt(21, 15, 0))
                    .EndAt(DateBuilder.TodayAt(21, 18, 0))
                    .Build();
            _accountSchedulerService.Scheduler.ScheduleJob(job, t);
            MessageBox.Show(_accountSchedulerService.Scheduler.IsStarted.ToString());  */
        }
Example #2
0
        public FactoryBase(IFactoriesFacade facade)
        {
            if (facade == null)
                throw new ArgumentNullException("facade");

            LoggerService = facade.Logger;
            PublicationResolver = facade.PublicationResolver;
            Configuration = facade.Configuration;
            CacheAgent = facade.CacheAgent;
            SerializerService = facade.SerializerService;
            CacheAgent.GetLastPublishDateCallBack = GetLastPublishedDateCallBack;
        }
Example #3
0
		public DataClient (IMapperService mapperService, 
			IConnectivityService connectivityService,
			ISerializerService serializerService,
			IHttpService httpService,
			IAppConfig appConfig)
		{
			_mapperService = mapperService.ThrowIfNull ("mapperService");
			_connectivityService = connectivityService.ThrowIfNull ("connectivityService");
			_serializerService = serializerService.ThrowIfNull ("serializerService");
			_httpService = httpService.ThrowIfNull ("httpService");
			_appConfig = appConfig.ThrowIfNull ("appConfig");
		}
Example #4
0
        public FactoriesFacade(IPublicationResolver resolver, ILogger logger, IDD4TConfiguration configuration, ICacheAgent cacheAgent, ISerializerService serializerService)
        {
            if (resolver == null)
                throw new ArgumentNullException("resolver");

            if (logger == null)
                throw new ArgumentNullException("logger");

            if (configuration == null)
                throw new ArgumentNullException("configuration");

            if (cacheAgent == null)
                throw new ArgumentNullException("cacheAgent");

            if (serializerService == null)
                throw new ArgumentNullException("serializerService");

            SerializerService = serializerService;
            Logger = logger;
            PublicationResolver = resolver;
            Configuration = configuration;
            CacheAgent = cacheAgent;
        }
Example #5
0
 /// <inheritdoc />
 public DbcStringReader([NotNull] Stream dbcStream, [NotNull] ISerializerService serializer)
     : base(dbcStream)
 {
     Serializer = serializer ?? throw new ArgumentNullException(nameof(serializer));
 }
Example #6
0
 public AssetService(int scopeId, AssetStorage assetStorage, RemoteWorkspace remoteWorkspace)
 {
     _serializerService = remoteWorkspace.Services.GetService <ISerializerService>();
     _scopeId           = scopeId;
     _assetStorage      = assetStorage;
 }
        public DeviceSharedResourcesViewModel(Func <IResourceViewModel> resourceViewModelGettingFunc,
                                              ISharedResourcesEditorFactory sharedResourcesEditorFactory, ISerializerService serializerService,
                                              IApplicationGlobalCommands applicationGlobalCommands, ITypesContainer container)
        {
            ResourcesCollection           = new ObservableCollection <IResourceViewModel>();
            _resourceViewModelGettingFunc = resourceViewModelGettingFunc;
            _sharedResourcesEditorFactory = sharedResourcesEditorFactory;
            CloseCommand = new RelayCommand <object>(OnCloseExecute);
            OpenResourceForEditingCommand = new RelayCommand <object>(OnOpenResourceForEditingExecute);
            SelectResourceCommand         = new RelayCommand <object>(OnSelectExecute, CanExecuteSelectResource);
            DeleteResourceCommand         = new RelayCommand(OnDeleteExecute, CanExecuteDeleteResource);
            RenameResourceCommand         = new RelayCommand(OnRenameResourceExecute, CanExecuteRenameResource);

            _serializerService         = serializerService;
            _applicationGlobalCommands = applicationGlobalCommands;
            _container = container;

            SaveCommand = new RelayCommand(SaveResources);
            LoadCommand = new RelayCommand(LoadResources);

            //_lastPath = Path.Combine(Path.GetDirectoryName(Assembly.GetEntryAssembly().Location), DEFAULT_FOLDER);
            //_lastFileName = DEFAULT_FOLDER;
            //if (_lastPath != null && !Directory.Exists(_lastPath))
            //	{
            //	Directory.CreateDirectory(_lastPath);
            //	}
            //	else
            //	{
            //
            //	}
        }
 public PostRepository(ISerializerService serializerService, string token)
 {
     this.serializerService = serializerService;
     this.token             = token;
 }
 public OrderMicroserviceRepository(string token, ISerializerService serializerService)
 {
     this.token             = token;
     this.serializerService = serializerService;
 }
Example #10
0
 public AppService(ISerializerService serializeService)
 {
     this.serializeService = serializeService;
 }
Example #11
0
 public abstract Task <IList <(Checksum, object)> > RequestAssetsAsync(int scopeId, ISet <Checksum> checksums, ISerializerService serializerService, CancellationToken cancellationToken);
Example #12
0
        public ProgrammingViewModel(ProgramModel model, LogicDeviceProvider logicDeviceProvider,
                                    LogicElementsFactory elementsFactory, IApplicationGlobalCommands globalCommands, ISerializerService serializerService)
        {
            this._programModel = model;
            this._applicationGlobalCommands = globalCommands;
            this._elementsFactory           = elementsFactory;

            this._serializerService   = serializerService;
            this._logicDeviceProvider = logicDeviceProvider;

            this.SchemesCollection    = new ObservableCollection <SchemeTabViewModel>();
            this.ElementsLibrary      = new ObservableCollection <LogicElementViewModel>();
            this.ConnectionCollection = new ObservableCollection <ConnectionViewModel>();

            this.NewSchemeCommand     = new RelayCommand(this.CreateNewScheme);
            this.SaveProjectCommand   = new RelayCommand(this.SaveProject, this.CanSaveProject);
            this.LoadProjectCommand   = new RelayCommand(this.LoadProject);
            this.DeleteCommand        = new RelayCommand(this.DeleteSelectedElements, this.CanDelete);
            this.ZoomIncrementCommand = new RelayCommand(this.ZoomIncrement, this.CanZooming);
            this.ZoomDecrementCommand = new RelayCommand(this.ZoomDecrement, this.CanZooming);

            this.WriteLogicCommand  = new RelayCommand(this.OnWriteCommand, this.CanWriteLogic);
            this.ReadLogicCommand   = new RelayCommand(this.OnReadCommand, this.CanReadLogic);
            this.StopEmulationLogic = new RelayCommand(this.OnStopEmulation);
        }
Example #13
0
        public FactoriesFacade(IPublicationResolver resolver, ILogger logger, IDD4TConfiguration configuration, ICacheAgent cacheAgent, ISerializerService serializerService)
        {
            if (resolver == null)
            {
                throw new ArgumentNullException("resolver");
            }

            if (logger == null)
            {
                throw new ArgumentNullException("logger");
            }

            if (configuration == null)
            {
                throw new ArgumentNullException("configuration");
            }

            if (cacheAgent == null)
            {
                throw new ArgumentNullException("cacheAgent");
            }

            if (serializerService == null)
            {
                throw new ArgumentNullException("serializerService");
            }

            SerializerService   = serializerService;
            Logger              = logger;
            PublicationResolver = resolver;
            Configuration       = configuration;
            CacheAgent          = cacheAgent;
        }
 public PreferencesManager(ISerializerService serializerService, Container container)
 {
     _Container = container;
     _SerializerService = serializerService;
 }
Example #15
0
 public MicroserviceRepositoryBase(string token, ISerializerService serializerService)
 {
     _token             = token;
     _serializerService = serializerService;
 }
Example #16
0
 public ConfigurationService(IFileSystemService fileSystemService, ISerializerService serializerService)
 {
     _fileSystemService = fileSystemService ?? throw new System.ArgumentNullException(nameof(fileSystemService));
     _serializerService = serializerService ?? throw new System.ArgumentNullException(nameof(serializerService));
 }
Example #17
0
 public SourceTextAsset(Checksum checksum, TextDocumentState state, ISerializerService serializer) :
     base(checksum, WellKnownSynchronizationKind.SourceText)
 {
     _state      = state;
     _serializer = serializer;
 }
Example #18
0
 public ProductMicroserviceRepository(string token, ISerializerService serializerService) : base(token, serializerService)
 {
 }
 protected TokenProvider(IHttpClientFactory httpClientFactory, ITokenStoreManager tokenStoreManager, ITokenSerializerService serializerService)
 {
     this.HttpClientFactory = httpClientFactory;
     this.tokenStoreManager = tokenStoreManager;
     this.serializerService = serializerService;
 }
Example #20
0
        public IReadOnlyCollection <PacketCaptureTestEntry> BuildCaptureEntries(ExpansionType expacType, ISerializerService serializer, IEnumerable <Type> typesToRegister)
        {
            List <PacketCaptureTestEntry> testSource = new List <PacketCaptureTestEntry>(500);

            //Do file loading first because it could fail
            //Then we need to populate the input source for the tests.
            string testPath = Path.Combine(TestContext.CurrentContext.TestDirectory, "PacketCaptures", expacType.ToString());

            //Get every folder
            foreach (string dir in Directory.GetDirectories(testPath))
            {
                //Each directory should fit the form of OpCode name
                //Even though the below is a Path with the directory if we pretend it's a file we can easily get the last part of the path
                //which represents the opcode
                NetworkOperationCode code  = (NetworkOperationCode)Enum.Parse(typeof(NetworkOperationCode), Path.GetFileNameWithoutExtension(dir));
                string[]             files = null;

                try
                {
                    files = Directory.GetFiles(Path.Combine(testPath, dir));
                }
                catch (Exception ee)
                {
                    throw new InvalidOperationException($"Failed to load File: {Path.Combine(testPath, dir)} Exception: {ee.Message} Stack: {ee.StackTrace}");
                }

                //Now we want to load each capture.
                foreach (var cap in files)
                {
                    string filePath = Path.Combine(testPath, dir, cap);
                    //Captures should have a guid on the end of them
                    Guid guid = Guid.Parse(cap.Split('_').Last());

                    try
                    {
                        byte[] bytes = File.ReadAllBytes(filePath);

                        testSource.Add(new PacketCaptureTestEntry(code, bytes, Path.GetFileName(cap)));
                    }
                    catch (Exception e)
                    {
                        throw new InvalidOperationException($"Failed to open File: {filePath} Exception: {e.Message}", e);
                    }
                }
            }

            typesToRegister
            .ToList()
            .ForEach(t => serializer.RegisterType(t));

            //This is kinda hacky but we compile here for test reasons
            serializer.Compile();

            return(testSource);
        }
Example #21
0
 public SolutionAsset(Checksum checksum, object value, ISerializerService serializer)
     : base(checksum, value.GetWellKnownSynchronizationKind())
 {
     _value      = value;
     _serializer = serializer;
 }
Example #22
0
 private Checksum GetParseOptionsChecksum(ISerializerService serializer, CancellationToken cancellationToken)
 => this.SupportsCompilation
         ? ChecksumCache.GetOrCreate(this.ParseOptions, _ => serializer.CreateChecksum(this.ParseOptions, cancellationToken))
         : Checksum.Null;
Example #23
0
 public CustomAssetBuilder(HostWorkspaceServices services)
 {
     _serializer = services.GetService <ISerializerService>();
     _hostSerializationService = services.GetService <IReferenceSerializationService>();
 }
Example #24
0
 public SolutionChecksumFinder(SolutionState state, ISerializerService serializer, CancellationToken cancellationToken) : this()
 {
     _state             = state;
     _serializer        = serializer;
     _cancellationToken = cancellationToken;
 }
Example #25
0
 public AssetProvider(int scopeId, SolutionAssetCache assetCache, IAssetSource assetSource, ISerializerService serializerService)
 {
     _scopeId           = scopeId;
     _assetCache        = assetCache;
     _assetSource       = assetSource;
     _serializerService = serializerService;
 }
Example #26
0
 private WorkspaceAnalyzerReferenceAsset(AnalyzerReference reference, ISerializerService serializer, Checksum checksum)
     : base(checksum, WellKnownSynchronizationKind.AnalyzerReference)
 {
     _reference  = reference;
     _serializer = serializer;
 }
 public TeamApiService(ISerializerService serializerService)
 {
     _serializerService = serializerService;
 }
Example #28
0
 public SimpleAssetSource(ISerializerService serializerService, IReadOnlyDictionary <Checksum, object> map)
 {
     _serializerService = serializerService;
     _map = map;
 }
Example #29
0
 public AssetService(int scopeId, AssetStorage assetStorage, ISerializerService serializerService)
 {
     _scopeId           = scopeId;
     _assetStorage      = assetStorage;
     _serializerService = serializerService;
 }
        public static async Task WriteDataAsync(ObjectWriter writer, SolutionAssetStorage assetStorage, ISerializerService serializer, int scopeId, Checksum[] checksums, CancellationToken cancellationToken)
        {
            writer.WriteInt32(scopeId);

            // special case
            if (checksums.Length == 0)
            {
                writer.WriteInt32(0);
                return;
            }

            if (checksums.Length == 1)
            {
                var checksum = checksums[0];

                var asset = (await assetStorage.GetAssetAsync(scopeId, checksum, cancellationToken).ConfigureAwait(false)) ?? SolutionAsset.Null;
                writer.WriteInt32(1);

                WriteAsset(writer, serializer, checksum, asset, cancellationToken);
                return;
            }

            var assets = await assetStorage.GetAssetsAsync(scopeId, checksums, cancellationToken).ConfigureAwait(false);

            writer.WriteInt32(assets.Count);

            foreach (var(checksum, asset) in assets)
            {
                WriteAsset(writer, serializer, checksum, asset, cancellationToken);
            }
Example #31
0
 public Storage(SolutionState solutionState)
 {
     SolutionState = solutionState;
     _serializer   = SolutionState.Workspace.Services.GetRequiredService <ISerializerService>();
 }
Example #32
0
 public PersistanceService(ISerializerService SerializerService, IDependencyInjectorService InjectorService)
 {
     this.SerializerService = SerializerService;
     this.InjectorService   = InjectorService;
 }
Example #33
0
 public static Checksum Create <T>(WellKnownSynchronizationKind kind, T value, ISerializerService serializer)
 {
     using (var stream = SerializableBytes.CreateWritableStream())
         using (var objectWriter = new ObjectWriter(stream))
         {
             objectWriter.WriteInt32((int)kind);
             serializer.Serialize(value, objectWriter, CancellationToken.None);
             return(Create(stream));
         }
 }
Example #34
0
 public PaymentRemoteRepository(ISerializerService serializerService)
 {
     _serializerService = serializerService;
 }
Example #35
0
		private DataClient CreateDataClient(IMapperService mapperService, 
			IConnectivityService connectivityService, 
			ISerializerService serializerService,
			IHttpService httpService,
			IAppConfig appConfig)
		{
			return new DataClient (mapperService, connectivityService, serializerService, httpService, appConfig);
		}
Example #36
0
 public RankingApiService(ISerializerService serializerService)
 {
     SerializerService = serializerService;
 }