本文整理汇总了C#中ICategory类的典型用法代码示例。如果您正苦于以下问题:C# ICategory类的具体用法?C# ICategory怎么用?C# ICategory使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ICategory类属于命名空间,在下文中一共展示了ICategory类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnCategoryDeleted
public void OnCategoryDeleted(ICategory category)
{
if (CategoryDeleted != null)
{
CategoryDeleted(new SingleItemEventArgs<ICategory>(category));
}
}
示例2: Rule
public Rule(ICategory applyCategory, IAction action, ICondition condition, string name)
{
m_condition = condition;
m_action = action;
m_applyCategory = applyCategory;
m_name = name;
}
示例3: GetTemplateBindsForCategory
public IEnumerable<ITemplateBind> GetTemplateBindsForCategory(ICategory category)
{
//ITemplateBind bind;
//bind = this.GetBind(TemplateBindType.CategoryTemplate, category.ID);
//如果栏目不存在绑定,则查找模块的绑定
//if (false || bind == null)
//{
// int moduleID = cbll.Get(a => a.ID == categoryID).ModuleID;
// bind = GetBind(TemplateBindType.ModuleCategoryTemplate, moduleID.ToString());
//}
ITemplateBind bind= this.GetBind(TemplateBindType.CategoryTemplate, category.Id);
if (bind != null) yield return bind;
bind= this.GetBind(TemplateBindType.CategoryArchiveTemplate, category.Id);
if (bind != null) yield return bind;
/*
IDictionary<TemplateBindType, ITemplateBind> templates = new Dictionary<TemplateBindType, ITemplateBind>();
if (bind != null)
{
templates.Add(TemplateBindType.CategoryTemplate, bind);
}
if (bindArchive != null)
{
templates.Add(TemplateBindType.CategoryArchiveTemplate, bindArchive);
}
return templates;
*/
}
示例4: PopulateFrom
public void PopulateFrom(ICategory input) {
this.Description = input.Description;
this.ParentCategoryId = input.ParentCategoryId;
this.PictureId = input.PictureId;
this.DisplayOrder = input.DisplayOrder;
this.Published = input.Published;
this.Deleted = input.Deleted;
this.CreatedOnUtc = input.CreatedOnUtc;
this.UpdatedOnUtc = input.UpdatedOnUtc;
this.CategoryTemplateId = input.CategoryTemplateId;
this.MetaKeywords = input.MetaKeywords;
this.MetaDescription = input.MetaDescription;
this.MetaTitle = input.MetaTitle;
this.PageSize = input.PageSize;
this.AllowCustomersToSelectPageSize = input.AllowCustomersToSelectPageSize;
this.PageSizeOptions = input.PageSizeOptions;
this.PriceRanges = input.PriceRanges;
this.ShowOnHomePage = input.ShowOnHomePage;
this.IncludeInTopMenu = input.IncludeInTopMenu;
this.HasDiscountsApplied = input.HasDiscountsApplied;
this.SubjectToAcl = input.SubjectToAcl;
this.LimitedToStores = input.LimitedToStores;
this.Name = input.Name;
this.ID = input.ID;
this.ID = input.ID;
}
示例5: HomeController
public HomeController(ICategory catsvc,IProduct prodsvc,ICart cartsvc, ICheckout checkoutsvc, ICommon commonsvc)
{
_categoryService = catsvc;
_productService = prodsvc;
_cartService = cartsvc;
_checkoutService = checkoutsvc;
_commonService = commonsvc;
}
示例6: GetCellValue
private string GetCellValue(ICategory phase)
{
if (phase == null || phase.Contributions == null) return string.Empty;
int count = phase.Contributions.Select(x => x.Contributor).Distinct().Count();
if (count <= 0) return string.Empty;
return count.ToString();
}
示例7: AddContribution
public void AddContribution(ICategory contributionProject)
{
var list = (Contributions as List<ICategory>);
// Don't add duplicates
if (list.Any(x => x.Name == contributionProject.Name && x.URL == contributionProject.URL)) return;
list.Add(contributionProject);
}
示例8: Post
public Post(IUser userRepository, ICategory categoryRepository, ITag tagRepository, IComment commentRepository)
{
_postsTable = context.GetTable<PostEntity>();
_commentRepository = commentRepository;
_tagRepository = tagRepository;
_categoryRepository = categoryRepository;
_userRepository = userRepository;
}
示例9: Equals
public bool Equals(ICategory other)
{
if (ReferenceEquals(this, other))
return true;
if (other == null)
return false;
return this.EventType == other.EventType && this.Name == other.Name;
}
示例10: HomeController
public HomeController(IPost postRepository, IUser userRepository, ICategory categoryRepository, ITag tagRepository, ISettings settingsRepository, ICacheService cacheService)
: base (settingsRepository)
{
_postRepository = postRepository;
_userRepository = userRepository;
_categoryRepository = categoryRepository;
_tagRepository = tagRepository;
_cacheService = cacheService;
}
示例11: Item
public Item(string name, decimal price, string description, string size, ICategory category, IImage img = null)
{
this.Name = name;
this.Img = img;
this.Price = price;
this.Description = description;
this.Size = size;
this.Category = category;
}
示例12: Init
public void Init(ICategory category)
{
if (!category.Engine.CanBeClassify)
{
throw new CannotBeClassifyException("Class must be prepared to classification firstly.");
}
this._category = category;
}
示例13: InitContext
public static void InitContext()
{
if (InitEvent != null)
{
CategoryService = InitEvent(typeof(ICategory)) as ICategory;
PostService = InitEvent(typeof(IPost)) as IPost;
PostTagMapService = InitEvent(typeof(IPostTagMap)) as IPostTagMap;
TagService = InitEvent(typeof(ITag)) as ITag;
}
}
示例14: GetProbabilities
private static void GetProbabilities(ITargetObject titanicPassenger, ICategory category, out double survivedProbability, out double notSurvivedProbability)
{
IClassifer classifer = new Classifer();
classifer.Init(category);
Dictionary<string, double> classification = classifer.GetClassification(titanicPassenger);
survivedProbability = classification["Edible"];
notSurvivedProbability = classification["Poisonous"];
}
示例15: GetCanonicalUrl
public string GetCanonicalUrl(ICategory category)
{
var productCategoryUrl = category.UrlName;
while (category.Parent != null)
{
category = category.Parent;
productCategoryUrl = string.Format("{0}/{1}", category.UrlName, productCategoryUrl);
}
return productCategoryUrl;
}