public TestTreeNode(string name, TestNodeType nodeType) { this.name = name; this.nodeType = nodeType; this.state = TestState.NotRun; this.nodes = new TestTreeNodeCollection(this); }
/// <summary> /// Initializes a new instance of the <see cref="TestNode"/> class. /// </summary> /// <param name="text">The text of the node.</param> /// <param name="testNodeType">Type of the test node.</param> /// <param name="tagValue">The tag value.</param> /// <remarks> /// The <paramref name="tagValue"/> is put into the <see cref="TestNode.MethodInfo"/> field as /// <see cref="MethodInfo"/> or into the <see cref="ClrType"/>, when it is a <see cref="Type"/>. /// </remarks> public TestNode(string text, TestNodeType testNodeType, object tagValue) { Guard.NotNullOrEmpty(() => text, text); // this.Checked = @checked; this.Checked = true; this.Text = text; this.TestNodeType = testNodeType; if (tagValue is MethodInfo) { this.MethodInfo = tagValue as MethodInfo; } else if (tagValue is Type) { this.ClrType = tagValue as Type; } // <exception cref="ArgumentOutOfRangeException"><c>tagValue</c> is out of range, it has to be of // <see cref="MethodInfo"/> or <see cref="System.Type"/> type.</exception> /*else * { * throw new ArgumentOutOfRangeException("tagValue", "The supplied tagValue has to be of MethodInfo or System.Type type."); * }*/ }
public TestTreeNode(string name, TestNodeType nodeType) { this.name=name; this.nodeType = nodeType; this.state = TestState.NotRun; this.nodes = new TestTreeNodeCollection(this); }
public static void LoadAndSaveImage(TestNodeType nodeType, string outputPath) { using(Image img = LoadImage(nodeType)) { string path = Path.Combine(outputPath,nodeType.ToString())+".png"; img.Save(path); } }
/// <summary> /// Creates a <see cref="TestNode">TreeNode</see> with the /// given text and image key. /// </summary> /// <param name="text">The text of the TreeNode.</param> /// <param name="testNodeType">Type of the test node.</param> /// <param name="tag">The tag used as custom information storage.</param> /// <returns>A new node of the provided data.</returns> private TestNode CreateTreeNode(string text, TestNodeType testNodeType, object tag) { TestNode treeNode = new TestNode(text, testNodeType, tag); // treeNode.ImageIndex = this._objectIconsImageList.Images.IndexOfKey(imageKey); return(treeNode); }
public UnitTreeNode(string name, TestNodeType nodeType, Guid domainIdentifier, Guid testIdentifier) : base(name) { this.testNodeType = nodeType; this.domainIdentifier = domainIdentifier; this.testIdentifier = testIdentifier; this.UpdateImageIndices(); }
public static void LoadAndSaveImage(TestNodeType nodeType, string outputPath) { using (Image img = LoadImage(nodeType)) { string path = Path.Combine(outputPath, nodeType.ToString()) + ".png"; img.Save(path); } }
public static Image LoadImage(TestNodeType nodeType) { Assembly a = Assembly.GetExecutingAssembly(); string imgName = String.Format("MbUnit.Framework.Core.{0}.png",nodeType.ToString()); Stream s = a.GetManifestResourceStream(imgName); // get icon Image icon = Image.FromStream(s); return icon; }
public static Image LoadImage(TestNodeType nodeType) { Assembly a = Assembly.GetExecutingAssembly(); string imgName = String.Format("MbUnit.Framework.Core.{0}.png", nodeType.ToString()); Stream s = a.GetManifestResourceStream(imgName); // get icon Image icon = Image.FromStream(s); return(icon); }
public TaskRowModel(string name, TestNodeType type, ITaskEx task, bool delaySubscribeToTask) { _name = name; _type = type; _task = task; // Normally the TaskRowModel and task are created in the same AppDomain // and then the TaskRowModel is sent back to the main AppDomain. In this // case, we should not subscribe to PropertyChanged until deserialization. if (!delaySubscribeToTask) Subscribe(); }
public TaskRowModel(string name, TestNodeType type, ITaskEx task, bool delaySubscribeToTask) { _name = name; _type = type; _task = task; // Normally the TaskRowModel and task are created in the same AppDomain // and then the TaskRowModel is sent back to the main AppDomain. In this // case, we should not subscribe to PropertyChanged until deserialization. if (!delaySubscribeToTask) { Subscribe(); } }
public UnitTreeNode CreateNode(string name, TestNodeType nodeType, Guid domainIdentifier, Guid testIdentifier) { return(new UnitTreeNode(name, nodeType, domainIdentifier, testIdentifier)); }
public static int ImageIndex(TestNodeType type, TestState state) { return((int)type * testStateCount + (int)state); }
public ContainerRowModel(string name, TestNodeType type, List<RowModel> children) { _name = name; _type = type; _children = children; }
public UnitTreeNode CreateUnitTreeNode(string name, TestNodeType nodeType, Guid domainIdentifier, Guid testIdentifier) { return((UnitTreeNode)this.Invoke(this.createNode, new Object[] { name, nodeType, domainIdentifier, testIdentifier } )); }
public static int ImageIndex(TestNodeType type, TestState state) { return (int)type*testStateCount+(int)state; }
/// <summary> /// Creates a <see cref="TestNode">TreeNode</see> with the /// given text and image key. /// </summary> /// <param name="text">The text of the TreeNode.</param> /// <param name="testNodeType">Type of the test node.</param> /// <param name="tag">The tag used as custom information storage.</param> /// <returns>A new node of the provided data.</returns> private TestNode CreateTreeNode(string text, TestNodeType testNodeType, object tag) { TestNode treeNode = new TestNode(text, testNodeType, tag); // treeNode.ImageIndex = this._objectIconsImageList.Images.IndexOfKey(imageKey); return treeNode; }
public UnitTreeNode CreateUnitTreeNode(string name, TestNodeType nodeType, Guid domainIdentifier, Guid testIdentifier) { return (UnitTreeNode)this.Invoke(this.createNode, new Object[]{name,nodeType,domainIdentifier,testIdentifier} ); }
public UnitTreeNode CreateNode(string name, TestNodeType nodeType, Guid domainIdentifier, Guid testIdentifier) { return new UnitTreeNode(name, nodeType, domainIdentifier, testIdentifier); }
public ContainerRowModel(string name, TestNodeType type, List <RowModel> children) { _name = name; _type = type; _children = children; }