Inheritance: MonoBehaviour
        internal static ReadCoilsInputsResponse ReadDiscretes(ReadCoilsInputsRequest request, DataStore dataStore, ModbusDataCollection<bool> dataSource)
        {
            DiscreteCollection data = DataStore.ReadData<DiscreteCollection, bool>(dataStore, dataSource, request.StartAddress, request.NumberOfPoints, dataStore.SyncRoot);
            ReadCoilsInputsResponse response = new ReadCoilsInputsResponse(request.FunctionCode, request.SlaveAddress, data.ByteCount, data);

            return response;
        }
Exemplo n.º 2
0
 public void It_should_fetch_a_valid_addon()
 {
     var data = new DataStore();
     var addon = data.GetAddonByKey("sqlserver");
     Assert.NotNull(addon);
     Assert.Equal("sqlserver", addon.Key);
 }
Exemplo n.º 3
0
        public List<HistoryModel> GetHistory(string symbol, DateTime? startDate, DateTime? endDate)
        {
            using (var db = new DataStore<HistoryModel>("history"))
            {
                if (startDate == null || endDate == null)
                {
                    startDate = DateTime.Now.AddYears(-3);
                    endDate = DateTime.Now;
                }

                var history = db.GetCollection().Where(x => x.Symbol == symbol && x.Date >= startDate.Value && x.Date <= endDate.Value);
                if (!history.Any())
                {
                    var json = _yqlService.FetchHistory(symbol, startDate.Value, endDate.Value);
                    var jobj = JObject.Parse(json);
                    if (Convert.ToInt32(((JValue)(jobj["query"]["count"])).Value) > 0)
                    {
                        history = Helper.DeserializeJson<List<HistoryModel>>(JArray.Parse(jobj["query"]["results"]["quote"].ToString()));
                        history.ToList().ForEach(x => x.Symbol = symbol);
                        SaveHistory(history.ToList());
                    }
                }
                return history.ToList();
            }
        }
Exemplo n.º 4
0
 public override void Serialize(string path, DataStore currentData)
 {
     foreach (var item in statements)
     {
         item.Serialize(path,currentData);
     }
 }
Exemplo n.º 5
0
 public void SaveSubSectors(List<SectorModel> list)
 {
     using (var db = new DataStore<SectorModel>("subsectors"))
     {
         db.SaveMany(list);
     }
 }
Exemplo n.º 6
0
 internal CachedList(IList list, DataStore dataStore, IMemberMapping childPropertyMapping, object key)
     : base(list)
 {
     this.key = key;
     this.dataStore = dataStore;
     this.childPropertyMapping = childPropertyMapping;
 }
Exemplo n.º 7
0
 public void SaveSectors(List<SectorModel> sectors)
 {
     using (var db = new DataStore<SectorModel>("sectors"))
     {
         db.SaveMany(sectors);
     }
 }
Exemplo n.º 8
0
 public List<SectorModel> GetCachedSectors()
 {
     using (var db = new DataStore<SectorModel>("sectors"))
     {
         return db.GetCollection();
     }
 }
        internal static ReadHoldingInputRegistersResponse ReadRegisters(ReadHoldingInputRegistersRequest request, DataStore dataStore, ModbusDataCollection<ushort> dataSource)
        {
            RegisterCollection data = DataStore.ReadData<RegisterCollection, ushort>(dataStore, dataSource, request.StartAddress, request.NumberOfPoints, dataStore.SyncRoot);
            ReadHoldingInputRegistersResponse response = new ReadHoldingInputRegistersResponse(request.FunctionCode, request.SlaveAddress, data);

            return response;
        }
Exemplo n.º 10
0
        public MainForm()
        {
            InitializeComponent();
            data = new DataStore();

            //Set AutoGenerateColumns False
            dataGridView1.AutoGenerateColumns = false;

            //Set Columns Count
            dataGridView1.ColumnCount = 3;

            //Add Columns
            dataGridView1.Columns[0].Name = "Post";
            dataGridView1.Columns[0].HeaderText = "Post";
            dataGridView1.Columns[0].DataPropertyName = "Rentedatum";

            dataGridView1.Columns[1].HeaderText = "Bedrag";
            dataGridView1.Columns[1].Name = "Bedrag";
            dataGridView1.Columns[1].DataPropertyName = "Bedrag";

            dataGridView1.Columns[2].Name = "NaarNaam";
            dataGridView1.Columns[2].HeaderText = "NaarNaam";
            dataGridView1.Columns[2].DataPropertyName = "NaarNaam";

            //this.dataGridView1.DataSource = data.Transactions;
        }
Exemplo n.º 11
0
 public PagesModule(DataStore store)
 {
     _Store = store;
     Get["/"] = Home;
     Get["/Apps"] = Apps;
     Get["/About"] = About;
 }
Exemplo n.º 12
0
        public async Task Process()
        {
            var bytes = File.ReadAllBytes(Environment.CurrentDirectory + @"\icon.png");

            var versions = this.Versions();
            var version = versions.Values.First();

            var queued = new ImageQueued
            {
                Identifier = Guid.NewGuid(),
                OriginalExtension = Naming.DefaultExtension,
                
            };
            queued.FileNameFormat = queued.Identifier.ToString() + "_{0}.{1}";

            await this.container.Save(string.Format("{0}_original.jpeg", queued.Identifier), bytes);

            var store = new DataStore(connectionString);

            var processor = new Processor(new DataStore(connectionString), versions);
            await processor.Process(queued);

            var data = await this.container.Get(string.Format("{0}_test.gif", queued.Identifier));
            Assert.IsNotNull(data);

            var entities = await this.table.QueryByRow<ImageEntity>("test");
            var entity = entities.FirstOrDefault();

            Assert.IsNotNull(entity);
            Assert.AreEqual(version.Format.MimeType, entity.MimeType);
            Assert.AreEqual(string.Format(Naming.PathFormat, this.container.Name, entity.FileName), entity.RelativePath);
        }
Exemplo n.º 13
0
 /// <summary>
 /// Creates a new SqlObjectReader.
 /// </summary>
 internal SqlObjectReader(SqlDataStore dataStore, SqlDataReader reader, Type mappedType, bool polymorphic)
 {
     this.dataStore = dataStore;
     this.reader = reader;
     this.polymorphic = polymorphic;
     this.MappedType = mappedType;
 }
Exemplo n.º 14
0
 protected DataStorageManager(DataStore dataStore)
 {
     this.dataStore = dataStore;
     this.typeMappings = new TypeMappingCollection();
     this.registeredMemberTypeMappings = new RegisteredMemberMappingCollection();
     this.relationshipMappings = new RelationshipMappingCollection();
 }
Exemplo n.º 15
0
        public MasterMateria(MateriaType type, DataStore data)
            : base()
        {
            Name = "Master" + type.ToString();
            Type = type;

            switch (type)
            {
                case MateriaType.Magic:
                    Description = "Equips all magical spells";
                    _abilities = data.GetMagicSpells().Select(x => x.Name).ToList();
                    break;
                case MateriaType.Command:
                    Description = "Equips all commands";
                    // TODO : define command abilities
                    _abilities = new List<string> { "Sense", "Steal" };
                    break;
                case MateriaType.Summon:
                    Description = "Equips all summon spells";
                    _abilities = data.GetSummonSpells().Select(x => x.Name).ToList();
                    break;

                case MateriaType.Support:
                case MateriaType.Independent:
                    throw new ImplementationException("No master materia definition for type " + type);
            }

            Tiers = new int[1];
        }
Exemplo n.º 16
0
 public Customer(string name, Statement statementGenerator)
 {
     Name = name;
     Rentals = new List<Rental>();
     StatementGenerator = statementGenerator;
     CurrentDataStore = new DataStore();
 }
 public static TodoListRepository CreateTodoListRepository()
 {
     var configProvider = new ConfigProvider();
     var connectionProvider = new ConnectionProvider(configProvider);
     var databaseProvider = new DatabaseProvider(connectionProvider);
     var dataStore = new DataStore(databaseProvider);
     return new TodoListRepository(dataStore);
 }
Exemplo n.º 18
0
 internal DataStoreShard(DataStore owner, System.Net.HostEndPoint endPoint)
 {
     _owner = owner;
     _endPoint = endPoint;
     _subscribeListenerClient = Allocate();
     _subscribeListenerThread = new Thread(ListenerLoop);
     _subscribeListenerThread.Start();
 }
Exemplo n.º 19
0
 // The user must not create a configuration directly.
 internal Configuration(Type configType, DataStore dataStore, IReadOnlyDictionary<string, object> attributes,
     TypeConverter converter)
 {
     Type = configType;
     DataStore = dataStore;
     Attributes = attributes;
     Converter = converter;
 }
Exemplo n.º 20
0
        internal static WriteSingleCoilRequestResponse WriteSingleCoil(WriteSingleCoilRequestResponse request,
            DataStore dataStore, ModbusDataCollection<bool> dataSource)
        {
            DataStore.WriteData(dataStore, new DiscreteCollection(request.Data[0] == Modbus.CoilOn), dataSource,
                request.StartAddress, dataStore.SyncRoot);

            return request;
        }
Exemplo n.º 21
0
        internal static WriteMultipleCoilsResponse WriteMultipleCoils(WriteMultipleCoilsRequest request,
            DataStore dataStore, ModbusDataCollection<bool> dataSource)
        {
            DataStore.WriteData(dataStore, request.Data.Take(request.NumberOfPoints), dataSource, request.StartAddress,
                dataStore.SyncRoot);
            var response = new WriteMultipleCoilsResponse(request.SlaveAddress, request.StartAddress, request.NumberOfPoints);

            return response;
        }
Exemplo n.º 22
0
 public EnemySkillMateria(int ap, DataStore data)
     : base()
 {
     Name = NAME;
     Description = DESCRIPTION;
     Type = MateriaType.Command;
     AP = ap;
     Data = data;
 }
Exemplo n.º 23
0
        /// <summary>
        /// The main run method called to fill tables in the specified DataStore.
        /// </summary>
        /// <param name="dataStore">The DataStore to work with</param>
        public void Run(DataStore dataStore)
        {
            dataStore.DeleteTable(this.Name);

            DataTable statsData = new DataTable();
            statsData.Columns.Add("SimulationName", typeof(string));
            statsData.Columns.Add("VariableName", typeof(string));
            statsData.Columns.Add("n", typeof(string));
            statsData.Columns.Add("residual", typeof(double));
            statsData.Columns.Add("R^2", typeof(double));
            statsData.Columns.Add("RMSD", typeof(double));
            statsData.Columns.Add("%", typeof(double));
            statsData.Columns.Add("MSD", typeof(double));
            statsData.Columns.Add("SB", typeof(double));
            statsData.Columns.Add("SDSD", typeof(double));
            statsData.Columns.Add("LCS", typeof(double));

            DataTable simulationData = dataStore.GetData("*", this.TableName);
            if (simulationData != null)
            {
                DataView view = new DataView(simulationData);
                string[] columnNames = DataTableUtilities.GetColumnNames(simulationData);

                foreach (string observedColumnName in columnNames)
                {
                    if (observedColumnName.StartsWith("Observed."))
                    {
                        string predictedColumnName = observedColumnName.Replace("Observed.", "Predicted.");
                        if (simulationData.Columns.Contains(predictedColumnName))
                        {
                            DataColumn predictedColumn = simulationData.Columns[predictedColumnName];
                            DataColumn observedColumn = simulationData.Columns[observedColumnName];
                            if (predictedColumn.DataType == typeof(double) &&
                                observedColumn.DataType == typeof(double))
                            {
                                // Calculate stats for each simulation and store them in a rows in our stats table.
                                string[] simulationNames = dataStore.SimulationNames;
                                foreach (string simulationName in simulationNames)
                                {
                                    string seriesName = simulationName;
                                    view.RowFilter = "SimName = '" + simulationName + "'";
                                    CalcStatsRow(view, observedColumnName, predictedColumnName, seriesName, statsData);
                                }

                                // Calculate stats for all simulations and store in a row of the stats table.
                                string overallSeriesName = "Combined " + observedColumnName.Replace("Observed.", "");
                                view.RowFilter = null;
                                CalcStatsRow(view, observedColumnName, predictedColumnName, overallSeriesName, statsData);
                            }
                        }
                    }
                }

                // Write the stats data to the DataStore
                dataStore.WriteTable(null, this.Name, statsData);
            }
        }
Exemplo n.º 24
0
        public SecuredPagesModule(DataStore data)
        {
            _Data = data;
            Before.AddItemToEndOfPipeline(CheckAuth);

            Get["/Sites"] = Sites;
            Put["/Sites/{slug}/Notifications/Email"] = EnableEmailNotification;
            Get["/Deploy/{key}"] = Deploy;
            Post["/Deploy/{key}"] = DoDeploy;
        }
Exemplo n.º 25
0
 public static void Init(DataStore dataStore)
 {
     Sentences = new SentenceRepository(dataStore, "SentenceText");
     Vocabulary = new VocabRepository(dataStore, "Text");
     GrammarEntries = new GrammarEntryRepository(dataStore, "Text");
     GrammarRoles = new GrammarRolesRepository(dataStore, "RoleName");
     Users = new UserRepository(dataStore, "UserID", "Email");
     Topics = new TopicRepository(dataStore, "Index", "ToicName");
     Sessions = new SessionRepository(dataStore, "UserID");
 }
Exemplo n.º 26
0
        public void BeforeScenario()
        {
            Service.Instance.RegisterValueRetriever(new FriendNamesValueRetriever());

            Clock = new Clock();

            Store = new DataStore();

            Fixture = new Fixture();
        }
Exemplo n.º 27
0
        /// <summary>
        /// Factory method for default data store - register values set to 0 and discrete values set to false.
        /// </summary>
        public static DataStore CreateDefaultDataStore(ushort coilsCount, ushort inputsCount, ushort holdingRegistersCount, ushort inputRegistersCount)
        {
            DataStore dataStore = new DataStore();

            Enumerable.Repeat(false, coilsCount).ForEach(value => dataStore.CoilDiscretes.Add(value));
            Enumerable.Repeat(false, inputsCount).ForEach(value => dataStore.InputDiscretes.Add(value));
            Enumerable.Repeat((ushort) 0, holdingRegistersCount).ForEach(value => dataStore.HoldingRegisters.Add(value));
            Enumerable.Repeat((ushort) 0, inputRegistersCount).ForEach(value => dataStore.InputRegisters.Add(value));

            return dataStore;
        }
Exemplo n.º 28
0
Arquivo: Filler.cs Projeto: kblc/Test
        public Filler( DataStore.MainInterface storeToFill  )
        {
            dataStore = storeToFill;

            DateTime basis = DateTime.UtcNow;
            Enumerable.Range(0, 100).ToList().ForEach(_ =>
            {
                dates.Add(basis);
                basis = basis.Add(new TimeSpan(1, rng.Next(0, 3), rng.Next(0, 2), rng.Next(0, 2)));
            });
        }
Exemplo n.º 29
0
Arquivo: Filler.cs Projeto: kblc/Test
        private void CreatePatient(DataStore.Doctor doc)
        {
            DataStore.Person person = new DataStore.Person()
            {
                Id = entityIdCounter++,
                Tag = "person"
            };
            dataStore.Entities.Add(person);
            dataStore.Relations.Add(new Tuple<DataStore.Entity, DataStore.Entity>(doc, person));

            bool missing = rng.Next(0, 100) == 1;

            DataStore.AgeComponent age = new DataStore.AgeComponent()
            {
                EntityId = person.Id,
                Unit = rng.Next(0, 10000) >= 10000 - 1 ? DataStore.AgeUnit.Years : DataStore.AgeUnit.Month,
                IsMissing = missing,
                Value = missing ? rng.NextDouble() : rng.Next(30, 70)
            };

            dataStore.AgeComponents.Add(age);

            foreach (var visitDate in dates)
            {
                DataStore.Measurement meas = new DataStore.Measurement()
                {
                    Id=entityIdCounter++,
                    Tag="measurement"
                };
                dataStore.Entities.Add(meas);
                dataStore.Relations.Add(new Tuple<DataStore.Entity, DataStore.Entity>(person, meas));

                bool missing2 = rng.Next(0, 100) == 1;

                DataStore.HeightComponent height = new DataStore.HeightComponent()
                {
                    EntityId = meas.Id,
                    Unit = rng.Next(0, 10000) >= 10000 - 1 ? DataStore.LengthUnit.Inch: DataStore.LengthUnit.Meter,
                    IsMissing = missing2,
                    Value = missing2 ? rng.NextDouble() : (rng.NextDouble()+1)
                };

                bool missing3 = rng.Next(0, 100) == 1;
                DataStore.TimestampComponent timestamp = new DataStore.TimestampComponent()
                {
                    EntityId=meas.Id,
                    IsMissing=missing3,
                    Timestamp= missing3?DateTime.MinValue:visitDate
                };

                dataStore.TimestampComponents.Add(timestamp);
                dataStore.HeightComponents.Add(height);
            }
        }
Exemplo n.º 30
0
        public SecuredPagesModule(DataStore data, IApiService api, IDeploymentService deploy)
        {
            _Data = data;
            _Api = api;
            _Deploy = deploy;
            Before.AddItemToEndOfPipeline(CheckAuth);

            Get["/Sites"] = Sites;
            Put["/Sites/{slug}/Notifications/Email"] = EnableEmailNotification;
            Get["/Deploy/{key}"] = Deploy;
            Post["/Deploy/{key}"] = DoDeploy;
        }
Exemplo n.º 31
0
 public IAsyncResult BeginSetNews(NewsItem[] newsItems)
 {
     return(DataStore.BeginSetByKey(Manager.GameId, Manager.PrivateKey, null, null, "GameNews", NewsToData(newsItems)));
 }
Exemplo n.º 32
0
 protected override void Start()
 {
     base.Start();
     DataStore.Subscribe("me:attending", NoteMeAttending);
     DataStore.Subscribe("me:intent:eyesClosed", NoteMeIntentEyesClosed);
 }
Exemplo n.º 33
0
 // GET api/<controller>/5
 public virtual T Get(int id)
 {
     return(DataStore.GetById(id));
 }
Exemplo n.º 34
0
        public NewsItem[] GetNews()
        {
            var dataStore = DataStore.GetByKey(Manager.GameId, Manager.PrivateKey, null, null, "GameNews");

            return(dataStore == null ? new NewsItem[0] : GetNewsFromData(dataStore.Data));
        }
Exemplo n.º 35
0
 public void ReadDataCountTooLarge()
 {
     Assert.Throws <InvalidModbusRequestException>(() => DataStore.ReadData <DiscreteCollection, bool>(new DataStore(),
                                                                                                       new ModbusDataCollection <bool>(true, false, true, true), 1, 5, new object()));
 }
Exemplo n.º 36
0
        internal static ReadCoilsInputsResponse ReadDiscretes(ReadCoilsInputsRequest request, DataStore dataStore,
                                                              ModbusDataCollection <bool> dataSource)
        {
            DiscreteCollection data = DataStore.ReadData <DiscreteCollection, bool>(dataStore, dataSource,
                                                                                    request.StartAddress, request.NumberOfPoints, dataStore.SyncRoot);
            ReadCoilsInputsResponse response = new ReadCoilsInputsResponse(request.FunctionCode, request.SlaveAddress,
                                                                           data.ByteCount, data);

            return(response);
        }
Exemplo n.º 37
0
 public void WriteDataStartAddressZero()
 {
     DataStore.WriteData(new DataStore(), new DiscreteCollection(false),
                         new ModbusDataCollection <bool>(true, true), 0, new object());
 }
Exemplo n.º 38
0
        public ItemsViewModel()
        {
            Title            = "Browse";
            Items            = new ObservableCollection <Item>();
            LoadItemsCommand = new Command(async() => await ExecuteLoadItemsCommand());

            MessagingCenter.Subscribe <NewItemPage, Item>(this, "AddItem", async(obj, item) =>
            {
                var newItem = item as Item;
                try
                {
                    Items.Add(newItem);
                    if (App.currentConnectionType == ConnectionType.Offline)
                    {
                        App.offlineSync.OfflineItems = Items;
                    }
                    await DataStore.AddItemAsync(newItem);
                }
                catch (Exception e)
                {
                    Console.WriteLine(e.Message);
                }
            });

            MessagingCenter.Subscribe <ItemDetailPage, Item>(this, "ChangeItem", async(obj, item) =>
            {
                var changedItem = item as Item;
                try
                {
                    var oldItem         = Items.FirstOrDefault(i => i.Id == changedItem.Id);
                    int oldItemIndex    = Items.IndexOf(oldItem);
                    Items[oldItemIndex] = changedItem;
                    if (App.currentConnectionType == ConnectionType.Offline)
                    {
                        App.offlineSync.OfflineItems = Items;
                    }
                    await DataStore.UpdateItemAsync(changedItem);
                }
                catch (Exception e)
                {
                    Console.WriteLine(e.Message);
                }
            });

            MessagingCenter.Subscribe <ItemDetailPage, Item>(this, "DeleteItem", async(obj, item) =>
            {
                try
                {
                    var deletedItem = item as Item;
                    //var oldItem = Items.FirstOrDefault(i => i.Id == deletedItem.Id);
                    //int deletedItemIndex = Items.IndexOf(oldItem);
                    Items.Remove(deletedItem);
                    if (App.currentConnectionType == ConnectionType.Offline)
                    {
                        App.offlineSync.OfflineItems = Items;
                    }
                    await DataStore.DeleteItemAsync(deletedItem.Id.ToString());
                }
                catch (Exception e)
                {
                    Console.WriteLine(e.Message);
                }
            });
        }
 public ImportQuantitySearchTestFixture(DataStore dataStore, Format format, TestFhirServerFactory testFhirServerFactory)
     : base(dataStore, format, testFhirServerFactory)
 {
 }
Exemplo n.º 40
0
        private async Task ExecuteLoadDataCommand()
        {
            if (IsBusy)
            {
                return;
            }

            IsBusy = true;

            try
            {
                //Character


                DatasetChars.Clear();

                var dataset = await DataStore.GetAllAsync_Character(true);



                //Sort the list

                dataset = dataset

                          .OrderBy(a => a.Name)

                          .ThenBy(a => a.Description)

                          .ThenByDescending(a => a.Level)

                          .ToList();



                // Then load the data structure

                foreach (var data_char in dataset)

                {
                    DatasetChars.Add(data_char);
                }



                //Monsters
                DatasetMons.Clear();


                var datasetmons = BattleViewModel._instance.BattleEngine.MonsterList;

                //Sort the list
                datasetmons = datasetmons
                              .OrderBy(a => a.Name)
                              .ThenBy(a => a.Description)
                              .ThenByDescending(a => a.Level)
                              .ToList();

                // Then load the data structure
                foreach (var datamons in datasetmons)
                {
                    DatasetMons.Add(datamons);
                }

                //Items
                DatasetItems.Clear();
                var dataset_items = await DataStore.GetAllAsync_Item(true);

                //Sort the list
                dataset_items = dataset_items
                                .OrderBy(a => a.Name)
                                .ThenBy(a => a.Description)
                                .ThenByDescending(a => a.Value)
                                .ToList();

                // Then load the data structure
                foreach (var data_items in dataset_items)
                {
                    DatasetItems.Add(data_items);
                }
            }

            catch (Exception ex)
            {
                Debug.WriteLine(ex);
            }

            finally
            {
                IsBusy = false;
            }
        }
Exemplo n.º 41
0
 public StaticUnitLoader(DataStore store)
 {
     this.store = store;
 }
Exemplo n.º 42
0
 public IAsyncResult SetNews(NewsItem[] newsItems, Action <bool> callback)
 {
     return(DataStore.BeginSetByKey(Manager.GameId, Manager.PrivateKey, null, null, "GameNews", NewsToData(newsItems), result => callback(EndSetNews(result))));
 }
Exemplo n.º 43
0
 public Manager(DataStore store, BulkDataStore bulkStore)
 {
     this.Store     = store;
     this.BulkStore = bulkStore;
 }
Exemplo n.º 44
0
        public NewsItem[] EndGetNews(IAsyncResult result)
        {
            var dataStore = DataStore.EndGetByKey(result);

            return(dataStore == null ? new NewsItem[0] : GetNewsFromData(dataStore.Data));
        }
Exemplo n.º 45
0
 public void WriteDataStartAddressTooLarge()
 {
     Assert.Throws <InvalidModbusRequestException>(() => DataStore.WriteData(new DataStore(), new DiscreteCollection(true), new ModbusDataCollection <bool>(true), 2,
                                                                             new object()));
 }
Exemplo n.º 46
0
 public IAsyncResult BeginGetNews()
 {
     return(DataStore.BeginGetByKey(Manager.GameId, Manager.PrivateKey, null, null, "GameNews"));
 }
Exemplo n.º 47
0
 public void ReadDataStartAddressZero()
 {
     DataStore.ReadData <DiscreteCollection, bool>(new DataStore(),
                                                   new ModbusDataCollection <bool>(true, false, true, true, true, true), 0, 5, new object());
 }
Exemplo n.º 48
0
        public async Task Reads_the_operations_from_the_store()
        {
            await NubeClient.PushChangesAsync();

            await DataStore.Received().GetOperationsAsync(100);
        }
Exemplo n.º 49
0
 public void ReadDataStartAddressTooLarge()
 {
     Assert.Throws <InvalidModbusRequestException>(() =>
                                                   DataStore.ReadData <DiscreteCollection, bool>(new DataStore(), new ModbusDataCollection <bool>(), 3, 2,
                                                                                                 new object()));
 }
Exemplo n.º 50
0
 public virtual void Delete([FromBody] T value)
 {
     DataStore.Delete(value);
 }
Exemplo n.º 51
0
 public Pull_table()
 {
     DataStore.InsertAsync(Arg.Any <TestItem>()).Returns(true);
     DataStore.InsertAsync(Arg.Any <TestItem2>()).Returns(true);
     DataStore.UpdateAsync(Arg.Any <TestItem>()).Returns(true);
 }
Exemplo n.º 52
0
 public bool EndSetNews(IAsyncResult result)
 {
     return(RequestHelper.WasSuccessful(DataStore.EndSetByKey(result)));
 }
Exemplo n.º 53
0
 private void init_reader()
 {
     this.Initialize();
     this.dsDefault  = new DataStore(new SqlServer2005Handler(), "System.Data.SqlClient", Configuration.ConnectionString, DeklaritTransaction.TransactionSlotName);
     this.m_Disposed = false;
 }
Exemplo n.º 54
0
        // Having this at the ViewModel, because it has the DataStore
        // That allows the feature to work for both SQL and the MOCk datastores...
        public async Task <bool> InsertUpdateAsync(Monster data)
        {
            var myReturn = await DataStore.InsertUpdateAsync_Monster(data);

            return(myReturn);
        }
Exemplo n.º 55
0
 // DELETE api/<controller>/5
 public virtual void Delete(int id)
 {
     DataStore.Delete(id);
 }
Exemplo n.º 56
0
        // Call to database to ensure most recent
        public async Task <Monster> GetAsync(string id)
        {
            var myData = await DataStore.GetAsync_Monster(id);

            return(myData);
        }
Exemplo n.º 57
0
 // GET api/<controller>
 public virtual IEnumerable <T> Get()
 {
     return(DataStore.Get());
 }
Exemplo n.º 58
0
 public StudentsController(DataStore dataStore)
 {
     _dataStore = dataStore;
 }
Exemplo n.º 59
0
 public bool SetNews(NewsItem[] newsItems)
 {
     return(RequestHelper.WasSuccessful(DataStore.SetByKey(Manager.GameId, Manager.PrivateKey, null, null, "GameNews", NewsToData(newsItems))));
 }
Exemplo n.º 60
0
 public IAsyncResult GetNews(Action <NewsItem[]> callback)
 {
     return(DataStore.BeginGetByKey(Manager.GameId, Manager.PrivateKey, null, null, "GameNews", result => callback(EndGetNews(result))));
 }