本文整理汇总了C#中IPresentableItem类的典型用法代码示例。如果您正苦于以下问题:C# IPresentableItem类的具体用法?C# IPresentableItem怎么用?C# IPresentableItem使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
IPresentableItem类属于命名空间,在下文中一共展示了IPresentableItem类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PresentItem
static void PresentItem(IPresentableItem item, Element element, PresentationState state, UnitTestElementImage type)
{
item.RichText = element.GetTitle();
SetTextColor(item, element);
SetImage(item, state, type);
}
示例2: PresentSpecification
protected virtual void PresentSpecification(FieldElement element,
IPresentableItem item,
TreeModelNode modelNode,
PresentationState state)
{
PresentItem(item, element, state, UnitTestElementImage.Test);
}
示例3: PresentContext
protected virtual void PresentContext(ContextElement element,
IPresentableItem item,
TreeModelNode modelNode,
PresentationState state)
{
PresentItem(item, element, state, UnitTestElementImage.TestContainer);
}
示例4: Present
public void Present(IUnitTestElement element, IPresentableItem item, TreeModelNode node, PresentationState state)
{
if (element is Element)
{
this._presenter.UpdateItem(element, node, item, state);
}
}
示例5: GetDescription
public string GetDescription(IPresentableItem item)
{
var description = this.itemPresenter.GetDescription(item);
var markdown = new Markdown();
var transformedDescription = markdown.Transform(description);
return transformedDescription;
}
示例6: SetTextColor
static void SetTextColor(IPresentableItem item, Element element)
{
if (element.Explicit)
{
item.RichText.SetForeColor(SystemColors.GrayText);
}
item.RichText.SetForeColor(SystemColors.GrayText, 0, element.GetTitlePrefix().Length);
}
示例7: PresentClassElement
private void PresentClassElement(XunitTestClassElement value, IPresentableItem item, TreeModelNode modelNode, PresentationState state)
{
if (IsNodeParentNatural(modelNode, value))
item.RichText = value.TypeName.ShortName;
else if (string.IsNullOrEmpty(value.TypeName.GetNamespaceName()))
item.RichText = value.TypeName.ShortName;
else
item.RichText = string.Format("{0}.{1}", value.TypeName.GetNamespaceName(), value.TypeName.ShortName);
}
示例8: Present
public void Present(IUnitTestElement element, IPresentableItem item, TreeModelNode node, PresentationState state)
{
// We only want to customise how class elements are displayed. If the
// parent node isn't a namespace, and isn't the namespace of the class,
// display the class as namespace qualified
if (!(element is XunitTestClassElement))
return;
treePresenter.UpdateItem(element, node, item, state);
}
示例9: PresentObject
protected override void PresentObject(object value, IPresentableItem item, TreeModelNode modelNode, PresentationState state)
{
var association = value as FileAssociation;
if (association != null)
{
RichText richText = association.Pattern ?? "(empty)";
item.RichText = richText;
}
}
示例10: Present
public override void Present(StructuredPresenter<TreeModelNode, IPresentableItem> presenter, IPresentableItem item,
TreeModelNode modelNode, PresentationState state) {
base.Present(presenter, item, modelNode, state);
if (_element.InheritanceInformation != null)
item.Images.Add(_element.InheritanceInformation.Image, _element.InheritanceInformation.ToolTip);
else {
// if the children have inheritance information, we must add en empty inheritance icon so that the text is aligned
var structureDeclaredElement = _element.Parent as T4CSharpCodeStructureDeclaredElement;
if (structureDeclaredElement != null && structureDeclaredElement.ChildrenWithInheritance)
item.Images.Add(PsiServicesThemedIcons.Empty.Id);
}
}
示例11: SetImage
static void SetImage(IPresentableItem item, PresentationState state, UnitTestElementImage imageType)
{
Image stateImage = UnitTestManager.GetStateImage(state);
Image typeImage = UnitTestManager.GetStandardImage(imageType);
if (stateImage != null)
{
item.Images.Add(stateImage);
}
else if (typeImage != null)
{
item.Images.Add(typeImage);
}
}
示例12: Present
public void Present(UnitTestElement element, IPresentableItem item, TreeModelNode node, PresentationState state)
{
item.RichText = element.GetTitle();
var standardImage = GetImage(element);
var stateImage = UnitTestManager.GetStateImage(state);
if (stateImage != null)
{
item.Images.Add(stateImage);
}
else if (standardImage != null)
{
item.Images.Add(standardImage);
}
}
示例13: GetName
/// <summary>
/// Get actual domain name if available for domain products (registration, transfer),
/// otherwise get default default name from <see cref="Atomia.Store.Core.IProductProvider"/>
/// </summary>
public string GetName(IPresentableItem item)
{
var product = productProvider.GetProduct(item.ArticleNumber);
var domainCategories = domainsProvider.GetDomainCategories();
if (domainCategories.Any(dc => product.Categories.Any(c => c.Name == dc)))
{
var domainNameAttr = item.CustomAttributes.FirstOrDefault(ca => ca.Name == "DomainName");
if (domainNameAttr != default(CustomAttribute)) {
return domainNameAttr.Value;
}
}
return product.Name;
}
示例14: PresentObject
protected override void PresentObject(object value, IPresentableItem item, TreeModelNode modelNode, PresentationState state)
{
if (modelNode.Parent == null)
{
item.RichText.Text = "Issues";
item.Images.Add(ImageLoader.GetImage("youtrack-root"));
}
else
{
var issueItem = (IssueItem)value;
item.RichText.Text = string.Format("[{0} - {1}] {2}", issueItem.Id, issueItem.State, issueItem.Summary);
item.Images.Add(issueItem.Priority == IssueItemPriority.High
? ImageLoader.GetImage("issue-high-priority")
: ImageLoader.GetImage("issue-low-priority"));
}
}
示例15: Present
public void Present(UnitTestElement element, IPresentableItem item, TreeModelNode node, PresentationState state)
{
var testElement = element as StorEvilUnitTestElement;
if (testElement == null)
return;
item.RichText = element.ShortName;
Image standardImage = UnitTestManager.GetStandardImage(UnitTestElementImage.Test);
Image stateImage = UnitTestManager.GetStateImage(state);
if (stateImage != null)
{
item.Images.Add(stateImage);
}
else if (standardImage != null)
{
item.Images.Add(standardImage);
}
}