protected Element(MSpecUnitTestProvider provider,
                          IPsi psiModuleManager,
                          ICache cacheManager,
                          Element parent,
                          ProjectModelElementEnvoy projectEnvoy,
                          IClrTypeName declaringTypeName,
                          bool isIgnored)
        {
            if (declaringTypeName == null)
            {
                throw new ArgumentNullException("declaringTypeName");
            }

            if (projectEnvoy != null)
            {
                this._projectEnvoy = projectEnvoy;
            }

            this._provider = provider;
            this._declaringTypeName = declaringTypeName;
            this._psiModuleManager = psiModuleManager;
            this._cacheManager = cacheManager;

            if (isIgnored)
            {
                this.ExplicitReason = "Ignored";
            }

            this.TypeName = declaringTypeName;
            this.Parent = parent;

            this.Children = new List<IUnitTestElement>();
            this.State = UnitTestElementState.Valid;
            this._taskFactory = new UnitTestTaskFactory(this._provider.ID);
        }
        static void SetTextColor(IPresentableItem item, Element element)
        {
            if (element.Explicit)
            {
                item.RichText.SetForeColor(SystemColors.GrayText);
            }

            item.RichText.SetForeColor(SystemColors.GrayText, 0, element.GetTitlePrefix().Length);
        }
 protected FieldElement(MSpecUnitTestProvider provider,
                        IPsi psiModuleManager,
                        ICache cacheManager,
                        Element parent,
                        ProjectModelElementEnvoy projectEnvoy,
                        IClrTypeName declaringTypeName,
                        string fieldName,
                        bool isIgnored)
     : base(provider, psiModuleManager, cacheManager, parent, projectEnvoy, declaringTypeName, isIgnored || parent.Explicit)
 {
     this._fieldName = fieldName;
 }
        static void PresentItem(IPresentableItem item, Element element, PresentationState state, UnitTestElementImage type)
        {
            item.RichText = element.GetPresentation();

            SetTextColor(item, element);
        }
 void RemoveChild(Element behaviorElement)
 {
     this.Children.Remove(behaviorElement);
 }
 void AddChild(Element behaviorElement)
 {
     this.Children.Add(behaviorElement);
 }