本文整理汇总了C#中IStore类的典型用法代码示例。如果您正苦于以下问题:C# IStore类的具体用法?C# IStore怎么用?C# IStore使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IStore类属于命名空间,在下文中一共展示了IStore类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ProjectService
public ProjectService(IStore<Project> ps, IStore<Platform> tps, IMappingEngine mapper, ILoggerService log)
{
TestProjectStore = ps;
TestPlatformStore = tps;
Mapper = mapper;
Log = log;
}
示例2: InitializationModel
public InitializationModel(IStore<Player> playerCollection, IStore<RankingDetail> rankingCollection, IStore<Owner> ownerCollection, IStore<BidDetail> bidCollection)
{
_playerCollection = playerCollection.FindAll().ToList();
_rankingCollection = rankingCollection.FindAll().ToList();
_ownerCollection = ownerCollection.FindAll().ToList();
_bidCollection = bidCollection;
}
示例3: Add
public void Add(IStore store, StoreData data)
{
var datalist = this.datalist;//GetCacheData();
if (datalist == null)
{
return;
}
StoreDataEntity entity = new StoreDataEntity
{
Store = store
,
Data = data
};
string dk = GetDataKey(data.Type, data.Key);
datalist.AddOrUpdate(dk, entity, (string k, StoreDataEntity oldData) =>
{
return entity;
});
if (datalist.Count >= this.capacity)
{
ThreadPool.QueueUserWorkItem(SaveAsync, null);
}
}
示例4: ReducedContentHandler
public ReducedContentHandler(IRRConfiguration config, IHostingEnvironmentWrapper hostingEnvironment, IUriBuilder uriBuilder, IStore store)
{
this.config = config;
this.hostingEnvironment = hostingEnvironment;
this.uriBuilder = uriBuilder;
this.store = store;
}
示例5: Render
public bool Render(IStore store, TextWriter output, out Value result)
{
bool halt;
foreach (KeyValuePair<IEvaluator, INode> branch in this.branches)
{
if (branch.Key.Evaluate (store, output).AsBoolean)
{
store.Enter ();
halt = branch.Value.Render (store, output, out result);
store.Leave ();
return halt;
}
}
if (this.fallback != null)
{
store.Enter ();
halt = this.fallback.Render (store, output, out result);
store.Leave ();
return halt;
}
result = VoidValue.Instance;
return false;
}
示例6: TableStateStore
public TableStateStore(IStore store)
{
if (store == null)
throw new ArgumentNullException("store");
Store = store;
}
示例7: InterceptingStoreDecoration
/// <summary>
/// ctor. requires IStore to wrap
/// </summary>
/// <param name="decorated"></param>
public InterceptingStoreDecoration(IStore decorated, ILogger logger)
: base(decorated)
{
this.Logger = logger;
//init the intercept chains, wrapping them around the core operations
this.CommitOperationIntercept = new InterceptChain<ICommitBag, Nothing>((bag) =>
{
this.Decorated.Commit(bag);
return Nothing.VOID;
});
this.CommitOperationIntercept.Completed += CommitOperationIntercept_Completed;
this.GetOperationIntercept = new InterceptChain<IStoredObjectId, IHasId>((x) =>
{
return this.Decorated.Get(x);
});
this.GetOperationIntercept.Completed += GetOperationIntercept_Completed;
this.GetAllOperationIntercept = new InterceptChain<Nothing, List<IHasId>>((x) =>
{
return this.Decorated.GetAll();
});
this.GetAllOperationIntercept.Completed += GetAllOperationIntercept_Completed;
this.SearchOperationIntercept = new InterceptChain<LogicOfTo<IHasId,bool>, List<IHasId>>((x) =>
{
return this.Decorated.Search(x);
});
this.SearchOperationIntercept.Completed += SearchOperationIntercept_Completed;
}
示例8: UssdContext
public UssdContext(IStore store, UssdRequest request, Dictionary<string, string> data)
{
Store = store;
Request = request;
Data = data;
DataBag = new UssdDataBag(Store, DataBagKey);
}
示例9: StoreInfoPage
public StoreInfoPage(IStore store, ContentMode mode = ContentMode.View)
{
//Setup view model
this.ViewModel = MvxToolbox.LoadViewModel<StoreInfoViewModel>();
this.ViewModel.Store = store;
this.ViewModel.Mode = mode;
InitializeComponent();
//Setup Header
this.HeaderView.BindingContext = this.ViewModel;
//Setup events
this.listView.ItemSelected += itemSelected;
this.ViewModel.Products.ReloadFinished += (sender, e) =>
{
this.listView.EndRefresh();
};
//Setup view model actions
this.ViewModel.ShowStoreDetailsAction = async (s) =>
{
await this.Navigation.PushAsync(new StoreDetailsPage(s, mode));
};
this.ViewModel.AddProductAction = async (p, s) =>
{
await this.Navigation.PushModalAsync(new NavigationPage(new SaveProductPage(p, s)));
};
}
示例10: ProjectVersionService
public ProjectVersionService(IStore<Project> projectStore, IStore<ProjectVersion> projectVersionStore, IMappingEngine mapper, ILoggerService log)
{
ProjectStore = projectStore;
ProjectVersionStore = projectVersionStore;
Mapper = mapper;
Log = log;
}
示例11: MainViewModel
/// <summary>
/// Initializes a new instance of the MainViewModel class.
/// </summary>
public MainViewModel(IStore store, INavigationService nav)
{
this.store = store;
this.nav = nav;
this.Groups = new ObservableCollection<Group>();
}
示例12: DetailViewModel
// If you care for what's inside your TInitializer model,
// add the parameter to the ctor of the view.
// Compare to ListViewModel - where we're not interested in the model.
public DetailViewModel(IStore store, ShowCustomerDetails args)
{
_store = store;
var c = _store.LoadCustomer(args.CustomerId);
Console.WriteLine("Customer details: {0}, {1}", c.Name, c.Birthday);
}
示例13: OnHandle
public override void OnHandle(IStore store,
string collection,
JObject command,
JObject document)
{
IObjectStore st = store.GetCollection(collection);
if (document.Type == JTokenType.Array)
{
var documents = document.Values();
if (documents != null)
foreach (JObject d in documents)
{
var k = d.Property(DocumentMetadata.IdPropertyName);
if (k != null)
st.Set((string)k, d);
}
}
else
{
var k = document.Property(DocumentMetadata.IdPropertyName);
if (k != null)
st.Set((string)k, document);
}
}
示例14: Set
// A method that handles densodb events MUST have this delegate.
public static void Set(IStore dbstore, BSonDoc command)
{
// IStore interface gives you a lowlevel access to DB Structure,
// Every action you take now will jump directly into DB without any event dispatching
// The Istore is preloaded from densodb, and you should not have access to densodb internals.
// Now deserialize message from Bson object.
// should be faster using BsonObject directly but this way is more clear.
var message = command.FromBSon<Message>();
// Get the sender UserProfile
var userprofile = dbstore.GetCollection("users").Where(d => d["UserName"].ToString() == message.From).FirstOrDefault().FromBSon<UserProfile>();
if (userprofile != null)
{
// add message to user's messages
var profilemessages = dbstore.GetCollection(string.Format("messages_{0}", userprofile.UserName));
profilemessages.Set(command);
// add message to user's wall
var profilewall = dbstore.GetCollection(string.Format("wall_{0}", userprofile.UserName));
profilewall.Set(command);
// Now i have user's follower.
foreach (var follower in userprofile.FollowedBy)
{
// Get followers's wall
var followerwall = dbstore.GetCollection(string.Format("wall_{0}", follower));
// store the messages in follower's wall.
followerwall.Set(command);
}
}
}
示例15: MessagingModule
public MessagingModule(Config cfg, IStore store)
: base("/Admin/Messaging")
{
Get["/"] = _ => View["Admin/Messaging/Index"];
Get["/Messages"] = _ => Response.AsJson(new { store.Messages });
Get["/Message/{message}/"] = _ =>
{
Type t = store.ResolveMessageType(_.message);
string kind = "other";
if (typeof(Neva.Messaging.IQuery).IsAssignableFrom(t)) kind = "Query";
if (typeof(Neva.Messaging.ICommand).IsAssignableFrom(t)) kind = "Command";
if (typeof(Neva.Messaging.IEvent).IsAssignableFrom(t)) kind = "Event";
return Response.AsJson(new
{
Name = _.message,
Kind = kind,
Properties = t.GetProperties().Select(p => new
{
p.Name,
p.PropertyType,
IsXml = p.GetCustomAttributes(typeof(XmlAttribute), false).Length > 0
})
});
};
}