protected virtual void PresentContext(ContextElement element, IPresentableItem item, TreeModelNode modelNode, PresentationState state) { PresentItem(item, element, state, UnitTestElementImage.TestContainer); }
public void Present(IUnitTestElement element, IPresentableItem item, TreeModelNode node, PresentationState state) { if (element is NBehaveUnitTestElementBase) { presenter.UpdateItem(element, node, item, state); } }
protected virtual void PresentSpecification(FieldElement element, IPresentableItem item, TreeModelNode modelNode, PresentationState state) { PresentItem(item, element, state, UnitTestElementImage.Test); }
protected virtual void PresentBehaviorSpecification(BehaviorSpecificationElement element, IPresentableItem item, TreeModelNode modelNode, PresentationState state) { PresentItem(item, element, state, UnitTestElementImage.Test); }
public void Present(IUnitTestElement element, IPresentableItem item, TreeModelNode node, PresentationState state) { if (element is Element) { this._presenter.UpdateItem(element, node, item, state); } }
protected virtual void PresentTestFixture(CSUnitTestFixtureElement value, IPresentableItem item, TreeModelNode modelNode, PresentationState state) { item.Clear(); if (IsNodeParentNatural(modelNode, value)) { item.RichText = new CLRTypeName(value.GetTypeClrName()).ShortName; } else { var name = new CLRTypeName(value.GetTypeClrName()); if (string.IsNullOrEmpty(name.NamespaceName)) { item.RichText = string.Format("{0}", name.ShortName); } else { item.RichText = string.Format("{0}.{1}", name.NamespaceName, name.ShortName); } } Image typeImage = UnitTestManager.GetStandardImage(UnitTestElementImage.TestContainer); Image stateImage = UnitTestManager.GetStateImage(state); if (stateImage != null) { item.Images.Add(stateImage); } else if (typeImage != null) { item.Images.Add(typeImage); } AppendOccurencesCount(item, modelNode, "test"); }
static void PresentItem(IPresentableItem item, Element element, PresentationState state, UnitTestElementImage type) { item.RichText = element.GetTitle(); SetTextColor(item, element); SetImage(item, state, type); }
protected virtual void PresentBehavior(BehaviorElement element, IPresentableItem item, TreeModelNode modelNode, PresentationState state) { PresentItem(item, element, state, UnitTestElementImage.TestContainer); }
protected virtual void PresentTest(CSUnitTestElement value, IPresentableItem item, TreeModelNode modelNode, PresentationState state) { item.Clear(); if (value.Fixture.GetTypeClrName() != value.GetTypeClrName()) { item.RichText = string.Format("{0}.{1}", new CLRTypeName(value.GetTypeClrName()).ShortName, value.MethodName); } else { item.RichText = value.MethodName; } if (value.IsExplicit) { item.RichText.SetForeColor(SystemColors.GrayText); } Image typeImage = UnitTestManager.GetStandardImage(UnitTestElementImage.Test); Image stateImage = UnitTestManager.GetStateImage(state); if (stateImage != null) { item.Images.Add(stateImage); } else if (typeImage != null) { item.Images.Add(typeImage); } }
private void PresentAdorements(object value, IPresentableItem item, TreeModelNode structureElement, PresentationState state) { // Emphasize root element var element = value as IDeclaredElement; if (element == null) { var envoy = value as DeclaredElementEnvoy <ITypeElement>; if (envoy != null) { element = envoy.GetValidDeclaredElement(); } } if (Equals(element, TypeElement)) { item.RichText.SetStyle(FontStyle.Bold); } // Recursion was stopped, i.e. same type member appeared higher in the chain /* * if ((modelNode.Modifiers & TreeModelNodeModifiers.Recursive) != TreeModelNodeModifiers.None) * item.Images.Add(ourRecursionImage, "Recursive inheritance", ImagePlacement.RIGHT); */ }
public void Present(IUnitTestElement element, IPresentableItem item, TreeModelNode node, PresentationState state) { if (element is ChildTestElement) { node.Model.Comparer = _comparer; } }
public void Present(IUnitTestElement element, IPresentableItem item, TreeModelNode node, PresentationState state) { if (!(element is TestClassElement)) { return; } treePresenter.UpdateItem(element, node, item, state); }
public string GetDescription(IPresentableItem item) { var description = this.itemPresenter.GetDescription(item); var markdown = new Markdown(); var transformedDescription = markdown.Transform(description); return transformedDescription; }
public string GetDescription(IPresentableItem item) { var description = this.itemPresenter.GetDescription(item); var markdown = new Markdown(); var transformedDescription = markdown.Transform(description); return(transformedDescription); }
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); }
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); }
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; } }
static void SetTextColor(IPresentableItem item, Element element) { if (element.Explicit) { item.RichText.SetForeColor(SystemColors.GrayText); } item.RichText.SetForeColor(SystemColors.GrayText, 0, element.GetTitlePrefix().Length); }
private void PresentFeature(NBehaveFeatureTestElement value, IPresentableItem item, TreeModelNode modelNode, PresentationState state) { TreeModelNode parentModel; if (_treeModels.TryGetValue(value, out parentModel) == false) { parentModel = modelNode.Parent; _treeModels.Add(value, parentModel); } }
public override void Present( StructuredPresenter <TreeModelNode, IPresentableItem> presenter, IPresentableItem item, TreeModelNode modelNode, PresentationState state ) { item.RichText = GetDirectiveText(); item.Images.Add(PsiWebThemedIcons.AspDirective.Id); }
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); }
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); } }
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); } }
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); } }
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); } }
/// <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; }
private void PresentTestElement(GallioTestElement value, IPresentableItem item, TreeModelNode modelNode, PresentationState state) { item.Clear(); item.RichText = value.TestName; #if RESHARPER_60_OR_NEWER if (value.Explicit) { item.RichText.SetForeColor(SystemColors.GrayText); } var typeImage = UnitTestIconManager.GetStandardImage(UnitTestElementImage.Test); var stateImage = UnitTestIconManager.GetStateImage(state); if (stateImage != null) { item.Images.Add(stateImage); } else if (typeImage != null) { item.Images.Add(typeImage); } #else if (value.IsExplicit) { item.RichText.SetForeColor(SystemColors.GrayText); } Image image = UnitTestManager.GetStateImage(state); if (image == null) { image = UnitTestManager.GetStandardImage(value.IsTestCase ? UnitTestElementImage.Test : UnitTestElementImage.TestCategory); } if (image != null) { item.Images.Add(image); } if (!value.IsTestCase) { AppendOccurencesCount(item, modelNode, "test"); } #endif }
/// <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); }
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")); } }
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); } }
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); } // if the children have inheritance information, we must add en empty inheritance icon so that the text is aligned else if (_element.Parent is T4CSharpCodeStructureDeclaredElement structureDeclaredElement && structureDeclaredElement.ChildrenWithInheritance) { item.Images.Add(PsiServicesThemedIcons.Empty.Id); } }
private static void PresentTestElement(GallioTestElement value, IPresentableItem item, TreeModelNode modelNode, PresentationState state) { item.Clear(); item.RichText = value.TestName; if (value.Explicit) item.RichText.SetForeColor(SystemColors.GrayText); var typeImage = UnitTestIconManager.GetStandardImage(UnitTestElementImage.Test); var stateImage = UnitTestIconManager.GetStateImage(state); if (stateImage != null) { item.Images.Add(stateImage); } else if (typeImage != null) { item.Images.Add(typeImage); } }
/// <summary> /// Presents unit test. ///</summary> public void Present(UnitTestElement element, IPresentableItem item, TreeModelNode node, PresentationState state) { if (element == null) { throw new ArgumentNullException("element"); } if (item == null) { throw new ArgumentNullException("item"); } if (node == null) { throw new ArgumentNullException("node"); } if (state == null) { throw new ArgumentNullException("state"); } presenter.UpdateItem(element, node, item, state); }
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); } }
private static void PresentTestElement(GallioTestElement value, IPresentableItem item, TreeModelNode modelNode, PresentationState state) { item.Clear(); item.RichText = value.TestName; if (value.Explicit) { item.RichText.SetForeColor(SystemColors.GrayText); } var typeImage = UnitTestIconManager.GetStandardImage(UnitTestElementImage.Test); var stateImage = UnitTestIconManager.GetStateImage(state); if (stateImage != null) { item.Images.Add(stateImage); } else if (typeImage != null) { item.Images.Add(typeImage); } }
private void PresentTestElement(GallioTestElement value, IPresentableItem item, TreeModelNode modelNode, PresentationState state) { item.Clear(); item.RichText = value.TestName; #if RESHARPER_60_OR_NEWER if (value.Explicit) item.RichText.SetForeColor(SystemColors.GrayText); var typeImage = UnitTestIconManager.GetStandardImage(UnitTestElementImage.Test); var stateImage = UnitTestIconManager.GetStateImage(state); if (stateImage != null) { item.Images.Add(stateImage); } else if (typeImage != null) { item.Images.Add(typeImage); } #else if (value.IsExplicit) item.RichText.SetForeColor(SystemColors.GrayText); Image image = UnitTestManager.GetStateImage(state); if (image == null) image = UnitTestManager.GetStandardImage(value.IsTestCase ? UnitTestElementImage.Test : UnitTestElementImage.TestCategory); if (image != null) item.Images.Add(image); if (! value.IsTestCase) AppendOccurencesCount(item, modelNode, "test"); #endif }
private void PresentAdorements(object value, IPresentableItem item, TreeModelNode structureElement, PresentationState state) { // Emphasize root element var element = value as IDeclaredElement; if (element == null) { var envoy = value as DeclaredElementEnvoy<ITypeElement>; if (envoy != null) element = envoy.GetValidDeclaredElement(); } if (Equals(element, TypeElement)) item.RichText.SetStyle(FontStyle.Bold); // Recursion was stopped, i.e. same type member appeared higher in the chain /* if ((modelNode.Modifiers & TreeModelNodeModifiers.Recursive) != TreeModelNodeModifiers.None) item.Images.Add(ourRecursionImage, "Recursive inheritance", ImagePlacement.RIGHT); */ }
public IEnumerable <Category> GetCategories(IPresentableItem item) { return(this.itemPresenter.GetCategories(item)); }
public void Present(UnitTestElement element, IPresentableItem item, TreeModelNode node, PresentationState state) { Presenter.UpdateItem(element, node, item, state); }
public void Present(UnitTestElement element, IPresentableItem item, TreeModelNode node, PresentationState state) { _presenter.Present(element, item, node, state); }
/// <summary> /// Presents unit test. ///</summary> public void Present(UnitTestElement element, IPresentableItem item, TreeModelNode node, PresentationState state) { if (element == null) throw new ArgumentNullException("element"); if (item == null) throw new ArgumentNullException("item"); if (node == null) throw new ArgumentNullException("node"); if (state == null) throw new ArgumentNullException("state"); presenter.UpdateItem(element, node, item, state); }
public IEnumerable<Category> GetCategories(IPresentableItem item) { return this.itemPresenter.GetCategories(item); }
private void PresentStep(NBehaveStepTestElement value, IPresentableItem item, TreeModelNode modelNode, PresentationState state) { }
private void PresentBackgroundScenario(NBehaveBackgroundTestElement value, IPresentableItem item, TreeModelNode structureelement, PresentationState state) { }
/// <summary> /// Get default description from <see cref="Atomia.Store.Core.IProductProvider"/> /// </summary> public string GetDescription(IPresentableItem item) { var product = productProvider.GetProduct(item.ArticleNumber); return product.Description; }
public void Present(UnitTestElement element, IPresentableItem item, TreeModelNode node, PresentationState state) { var testElement = element as StorEvilUnitTestElement; if (testElement == null) return; item.RichText = element.ShortName; }
public void Present(IUnitTestElement element, IPresentableItem item, TreeModelNode node, PresentationState state) { if (element is NBehaveUnitTestElementBase) presenter.UpdateItem(element, node, item, state); }
public string GetName(IPresentableItem item) { return(this.itemPresenter.GetName(item)); }
public abstract void Present(StructuredPresenter <TreeModelNode, IPresentableItem> presenter, IPresentableItem item, TreeModelNode modelNode, PresentationState state);
public void Present(IUnitTestElement element, IPresentableItem presentableItem, TreeModelNode node, PresentationState state) { if ((element is XunitTestClassElement) || (element is XunitTestMethodElement)) Presenter.UpdateItem(element, node, presentableItem, state); }
/// <summary> /// Get categories from <see cref="Atomia.Store.Core.IProductProvider"/> /// </summary> public IEnumerable<Category> GetCategories(IPresentableItem item) { var product = productProvider.GetProduct(item.ArticleNumber); return product.Categories; }