Пример #1
0
        protected static void AddElementSQL(SqlConnection connect)
        {
            //Responsible for adding parameters in database
            Dictionary <string, string> elements = new Dictionary <string, string>();

            //Read elements
            Console.Clear();
            ReadParameters obj = new ReadParameters();

            elements = obj.DoRead();

            //Store elements to BBDD
            StoreSQL store = new StoreSQL();

            store.WriteSQL(elements, connect);

            //Close application or add a new element
            Console.WriteLine("Do you want to add a new item? (yes/not)");
            if (Console.ReadLine().ToLower().Equals("yes"))
            {
                AddElementSQL(connect);
            }

            //End program
            Environment.Exit(0);
        }
Пример #2
0
        protected static void AddElementFile(string path)
        {
            //Responsible for adding parameters in file
            Dictionary <string, string> elements = new Dictionary <string, string>();

            //Read elements
            Console.Clear();
            ReadParameters obj = new ReadParameters();

            elements = obj.DoRead();

            //Store elements to File
            ConfigurationFile store = new ConfigurationFile();

            store.StoreFile(elements, path);

            //Close application or add a new element
            Console.WriteLine("Do you want to add a new item? (yes/not)");
            if (Console.ReadLine().ToLower().Equals("yes"))
            {
                AddElementFile(path);
            }

            //End program
            Environment.Exit(0);
        }
Пример #3
0
        public async Task <T> ReadAsync(string id, ReadParameters parameters = null, CancellationToken cancellationToken = default)
        {
            var path = GetRoute <T>(id);

            parameters = parameters ?? new ReadParameters();

            var queryParameters = parameters.GetQueryParameters();

            var result = await _client.ExecuteAsync <ObjectApiResult>(path, Method.GET, cancellationToken, queryParameters, parameters.NotFoundReturnsNull);

            return(result?.ToHubSpotObject <T>());
        }
Пример #4
0
        public override Task <ReadResult> Read(ReadParameters request, ServerCallContext context)
        {
            if (data.Count != request.NumSamples)
            {
                data = new List <double>(request.NumSamples);
                for (int x = 0; x < request.NumSamples; ++x)
                {
                    data.Add(1.1 + x);
                }
            }

            var response = new ReadResult();

            response.Wfm.AddRange(data);
            response.Status = 0;

            return(Task.FromResult(response));
        }
Пример #5
0
        public GameEngine()
        {
            ReadParameters readParam = new ReadParameters();

            //readParam.LoadLanguage();

            #region NewGame

            //Generate places
            _gestionPlaces  = new GestionPlaces();
            _leave          = false;
            _previousChoice = 0;
            start();

            //

            #endregion
        }