public void Constructor1_NullItem () { CodeAttributeArgument[] arguments = new CodeAttributeArgument[] { new CodeAttributeArgument (), null }; CodeAttributeArgumentCollection coll = new CodeAttributeArgumentCollection ( arguments); }
public static CodeAttributeArgumentCollection Clone(this CodeAttributeArgumentCollection collection) { if (collection == null) return null; CodeAttributeArgumentCollection c = new CodeAttributeArgumentCollection(); foreach (CodeAttributeArgument argument in collection) c.Add(argument.Clone()); return c; }
public void Constructor0 () { CodeAttributeArgumentCollection coll = new CodeAttributeArgumentCollection (); Assert.IsFalse (((IList) coll).IsFixedSize, "#1"); Assert.IsFalse (((IList) coll).IsReadOnly, "#2"); Assert.AreEqual (0, coll.Count, "#3"); Assert.IsFalse (((ICollection) coll).IsSynchronized, "#4"); Assert.IsNotNull (((ICollection) coll).SyncRoot, "#5"); }
public void AddRange(CodeAttributeArgumentCollection value) { if (value == null) { throw new ArgumentNullException("value"); } int count = value.Count; for (int i = 0; i < count; i++) { this.Add(value[i]); } }
public void Constructor1 () { CodeAttributeArgument caa1 = new CodeAttributeArgument (); CodeAttributeArgument caa2 = new CodeAttributeArgument (); CodeAttributeArgument[] arguments = new CodeAttributeArgument[] { caa1, caa2 }; CodeAttributeArgumentCollection coll = new CodeAttributeArgumentCollection ( arguments); Assert.AreEqual (2, coll.Count, "#1"); Assert.AreEqual (0, coll.IndexOf (caa1), "#2"); Assert.AreEqual (1, coll.IndexOf (caa2), "#3"); }
public CodeAttributeDeclaration(CodeTypeReference attributeType, params CodeAttributeArgument[] arguments) { this.arguments = new CodeAttributeArgumentCollection(); this.attributeType = attributeType; if (attributeType != null) { this.name = attributeType.BaseType; } if (arguments != null) { this.Arguments.AddRange(arguments); } }
public void Constructor1_Deny_Unrestricted () { CodeAttributeArgumentCollection coll = new CodeAttributeArgumentCollection (array); coll.CopyTo (array, 0); Assert.AreEqual (1, coll.Add (caa), "Add"); Assert.AreSame (caa, coll[0], "this[int]"); coll.AddRange (array); coll.AddRange (coll); Assert.IsTrue (coll.Contains (caa), "Contains"); Assert.AreEqual (0, coll.IndexOf (caa), "IndexOf"); coll.Insert (0, caa); coll.Remove (caa); }
/// <devdoc> /// <para> /// Adds the contents of another <see cref='System.CodeDom.CodeAttributeArgumentCollection'/> to the end of the collection. /// </para> /// </devdoc> public void AddRange(CodeAttributeArgumentCollection value) { if (value == null) { throw new ArgumentNullException("value"); } int currentCount = value.Count; for (int i = 0; i < currentCount; i = ((i) + (1))) { this.Add(value[i]); } }
public void AddRange(CodeAttributeArgumentCollection value) { if (value == null) { throw new ArgumentNullException(nameof(value)); } int currentCount = value.Count; for (int i = 0; i < currentCount; i++) { Add(value[i]); } }
public CodeAttributeDeclaration(string name, params CodeAttributeArgument[] arguments) { this.arguments = new CodeAttributeArgumentCollection(); this.Name = name; this.Arguments.AddRange(arguments); }
public CodeAttributeDeclaration(string name) { this.arguments = new CodeAttributeArgumentCollection(); this.Name = name; }
public CodeAttributeArgumentCollection(CodeAttributeArgumentCollection value) { return(default(CodeAttributeArgumentCollection)); }
protected void Rewrite(CodeAttributeArgumentCollection target, CodeAttributeArgumentCollection source, ref bool didRewrite) { foreach (CodeAttributeArgument item in source) { target.Add(this.Rewrite(item, ref didRewrite)); } }
public void AddRange (CodeAttributeArgumentCollection! value) { Contract.Requires(value != null); }
private void RefactorCodeTypeReferencesInAttributeArguments(CodeAttributeArgumentCollection arguments, string oldName, string newName) { foreach (CodeAttributeArgument argument in arguments) { CodeTypeReference typeRef = GetCodeTypeReferenceInCodeExpression(argument.Value); if (typeRef != null) { RefactorCodeTypeReference(typeRef, oldName, newName); } } }
void AddPrimitiveArgument (CodeAttributeArgumentCollection arguments, object obj) { arguments.Add (new CodeAttributeArgument (new CodePrimitiveExpression (obj))); }
public void AddRange () { CodeAttributeArgument caa1 = new CodeAttributeArgument (); CodeAttributeArgument caa2 = new CodeAttributeArgument (); CodeAttributeArgument caa3 = new CodeAttributeArgument (); CodeAttributeArgumentCollection coll1 = new CodeAttributeArgumentCollection (); coll1.Add (caa1); coll1.Add (caa2); CodeAttributeArgumentCollection coll2 = new CodeAttributeArgumentCollection(); coll2.Add (caa3); coll2.AddRange (coll1); Assert.AreEqual (3, coll2.Count, "#1"); Assert.AreEqual (1, coll2.IndexOf (caa1), "#2"); Assert.AreEqual (2, coll2.IndexOf (caa2), "#3"); Assert.AreEqual (0, coll2.IndexOf (caa3), "#4"); CodeAttributeArgumentCollection coll3 = new CodeAttributeArgumentCollection(); coll3.Add (caa3); coll3.AddRange (new CodeAttributeArgument[] {caa1, caa2}); Assert.AreEqual (3, coll2.Count, "#5"); Assert.AreEqual (1, coll2.IndexOf (caa1), "#6"); Assert.AreEqual (2, coll2.IndexOf (caa2), "#7"); Assert.AreEqual (0, coll2.IndexOf (caa3), "#8"); }
public void AddRange_Null_Item () { CodeAttributeArgumentCollection coll = new CodeAttributeArgumentCollection (); coll.AddRange (new CodeAttributeArgument[] { null }); }
public void Insert_Null () { CodeAttributeArgumentCollection coll = new CodeAttributeArgumentCollection (); coll.Insert (0, (CodeAttributeArgument) null); }
public void Add_Null () { CodeAttributeArgumentCollection coll = new CodeAttributeArgumentCollection (); coll.Add ((CodeAttributeArgument) null); }
public void AddRange(CodeAttributeArgumentCollection value) { foreach(CodeAttributeArgument e in value) { List.Add(e); } }
public void Constructor1_Null () { CodeAttributeArgumentCollection coll = new CodeAttributeArgumentCollection ( (CodeAttributeArgument[]) null); }
public CodeAttributeArgumentCollection(CodeAttributeArgumentCollection value) { AddRange(value); }
public void Constructor2 () { CodeAttributeArgument caa1 = new CodeAttributeArgument (); CodeAttributeArgument caa2 = new CodeAttributeArgument (); CodeAttributeArgumentCollection c = new CodeAttributeArgumentCollection (); c.Add (caa1); c.Add (caa2); CodeAttributeArgumentCollection coll = new CodeAttributeArgumentCollection (c); Assert.AreEqual (2, coll.Count, "#1"); Assert.AreEqual (0, coll.IndexOf (caa1), "#2"); Assert.AreEqual (1, coll.IndexOf (caa2), "#3"); }
/// <summary> /// Visits a <see cref="CodeAttributeArgumentCollection"/>. /// </summary> /// <param name="codeAttributeArgumentCollection">The <see cref="CodeAttributeArgumentCollection"/> to visit.</param> protected virtual void VisitCodeAttributeArgumentCollection(CodeAttributeArgumentCollection codeAttributeArgumentCollection) { // Visit all of the CodeAttributeArgument items in the collection. foreach (CodeAttributeArgument item in codeAttributeArgumentCollection.Cast<CodeAttributeArgument>()) { this.VisitCodeAttributeArgument(item); } }
public CodeAttributeDeclaration() { this.arguments = new CodeAttributeArgumentCollection(); }
public void Remove_NotInCollection () { CodeAttributeArgumentCollection coll = new CodeAttributeArgumentCollection (); coll.Remove (new CodeAttributeArgument ()); }
public CodeAttributeArgumentCollection (CodeAttributeArgumentCollection value) { return default(CodeAttributeArgumentCollection); }
public void Remove_Null () { CodeAttributeArgumentCollection coll = new CodeAttributeArgumentCollection (); coll.Remove ((CodeAttributeArgument) null); }
public void AddRange(CodeAttributeArgumentCollection !value) { Contract.Requires(value != null); }
public void AddRange_Null_Collection () { CodeAttributeArgumentCollection coll = new CodeAttributeArgumentCollection (); coll.AddRange ((CodeAttributeArgumentCollection) null); }
public CodeAttributeArgumentCollection( CodeAttributeArgumentCollection value ) { AddRange( value ); }
public void AddRange_Self () { CodeAttributeArgumentCollection coll = new CodeAttributeArgumentCollection (); coll.Add (new CodeAttributeArgument ()); Assert.AreEqual (1, coll.Count, "#1"); coll.AddRange (coll); Assert.AreEqual (2, coll.Count, "#2"); }
public void Remove () { CodeAttributeArgument caa1 = new CodeAttributeArgument (); CodeAttributeArgument caa2 = new CodeAttributeArgument (); CodeAttributeArgumentCollection coll = new CodeAttributeArgumentCollection (); coll.Add (caa1); coll.Add (caa2); Assert.AreEqual (2, coll.Count, "#1"); Assert.AreEqual (0, coll.IndexOf (caa1), "#2"); Assert.AreEqual (1, coll.IndexOf (caa2), "#3"); coll.Remove (caa1); Assert.AreEqual (1, coll.Count, "#4"); Assert.AreEqual (-1, coll.IndexOf (caa1), "#5"); Assert.AreEqual (0, coll.IndexOf (caa2), "#6"); }
public void AddRange(CodeAttributeArgumentCollection value) { throw new NotImplementedException(); }