本文整理汇总了C#中DataStore类的典型用法代码示例。如果您正苦于以下问题:C# DataStore类的具体用法?C# DataStore怎么用?C# DataStore使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
DataStore类属于命名空间,在下文中一共展示了DataStore类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PagesModule
public PagesModule(DataStore store)
{
_Store = store;
Get["/"] = Home;
Get["/Apps"] = Apps;
Get["/About"] = About;
}
示例2: DataStorageManager
protected DataStorageManager(DataStore dataStore)
{
this.dataStore = dataStore;
this.typeMappings = new TypeMappingCollection();
this.registeredMemberTypeMappings = new RegisteredMemberMappingCollection();
this.relationshipMappings = new RelationshipMappingCollection();
}
示例3: MainForm
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;
}
示例4: ReadRegisters
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;
}
示例5: GetHistory
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();
}
}
示例6: MasterMateria
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];
}
示例7: SaveSubSectors
public void SaveSubSectors(List<SectorModel> list)
{
using (var db = new DataStore<SectorModel>("subsectors"))
{
db.SaveMany(list);
}
}
示例8: SaveSectors
public void SaveSectors(List<SectorModel> sectors)
{
using (var db = new DataStore<SectorModel>("sectors"))
{
db.SaveMany(sectors);
}
}
示例9: CachedList
internal CachedList(IList list, DataStore dataStore, IMemberMapping childPropertyMapping, object key)
: base(list)
{
this.key = key;
this.dataStore = dataStore;
this.childPropertyMapping = childPropertyMapping;
}
示例10: Customer
public Customer(string name, Statement statementGenerator)
{
Name = name;
Rentals = new List<Rental>();
StatementGenerator = statementGenerator;
CurrentDataStore = new DataStore();
}
示例11: GetCachedSectors
public List<SectorModel> GetCachedSectors()
{
using (var db = new DataStore<SectorModel>("sectors"))
{
return db.GetCollection();
}
}
示例12: ReadDiscretes
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;
}
示例13: Serialize
public override void Serialize(string path, DataStore currentData)
{
foreach (var item in statements)
{
item.Serialize(path,currentData);
}
}
示例14: Process
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);
}
示例15: It_should_fetch_a_valid_addon
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);
}