本文整理汇总了C#中ICollection.CopyTo方法的典型用法代码示例。如果您正苦于以下问题:C# ICollection.CopyTo方法的具体用法?C# ICollection.CopyTo怎么用?C# ICollection.CopyTo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ICollection
的用法示例。
在下文中一共展示了ICollection.CopyTo方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Bezier
public Bezier(ICollection<Vector3> p)
{
System.Diagnostics.Debug.Assert(p.Count == 4);
P = new Vector3[p.Count];
p.CopyTo(P, 0);
}
示例2: Invoke
public void Invoke (LogoContext context, ICollection arguments, ref object result) {
// Debug (arguments);
LogoContext cc = new LogoContext (context);
Hashtable dict = cc.Dict;
object[] arguments_list = new object[arguments.Count];
arguments.CopyTo (arguments_list, 0);
int i = 0;
foreach (ArgumentInfo info in args) {
if (i < arguments_list.Length)
dict[info.name] = arguments_list[i];
else if (info.val != null)
dict[info.name] = info.val;
i++;
}
// Collect remaining arguments
if (args.Length > 0 && args[args.Length - 1].collect) {
int col_len = arguments_list.Length - args.Length;
if (col_len < 0)
col_len = 0;
object[] collector = new object[col_len];
if (col_len > 0)
Array.Copy (arguments_list, args.Length, collector, 0, col_len);
dict[args[args.Length - 1].name] = collector;
}
Interpreter interp = new Interpreter ((Interpreter) context.CallingEngine, cc);
result = interp.Execute (tree);
}
示例3: SerializeICollection
internal static void SerializeICollection(SerializationInfo info, ICollection collection, string name)
{
object[] elements = new object[collection.Count];
collection.CopyTo(elements, 0);
SerializeArray(info, elements, name);
}
示例4: EventQueueName
public EventQueueName(Type interfaceType, string operation, ICollection<CorrelationProperty> propertyValues) : this(interfaceType, operation)
{
if (propertyValues != null)
{
this.correlationValues = new CorrelationProperty[propertyValues.Count];
propertyValues.CopyTo(this.correlationValues, 0);
}
}
示例5: List
public List(Type of, ICollection collection)
{
if (of == null) { Console.WriteLine(new StackTrace(true)); throw new NullErr().val; }
this.m_of = of;
this.m_size = collection.Count;
this.m_values = new object[m_size];
collection.CopyTo(this.m_values, 0);
}
示例6: ConfigurationErrorsException
internal ConfigurationErrorsException(ICollection<ConfigurationException> coll) : this(GetFirstException(coll))
{
if (coll.Count > 1)
{
this._errors = new ConfigurationException[coll.Count];
coll.CopyTo(this._errors, 0);
}
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:8,代码来源:ConfigurationErrorsException.cs
示例7: ListItem
public ListItem(int ti, int sti, int ati, int tbti, ICollection dataList, Resco.Controls.AdvancedComboBox.Mapping fieldNames)
: this(ti, sti, ati, tbti)
{
int num = Math.Max(fieldNames.FieldCount, dataList.Count);
this.m_htMap = fieldNames;
this.m_oData = new object[num];
dataList.CopyTo(this.m_oData, 0);
}
示例8: Row
public Row(int templateIndex, int selectedTemplateIndex, ICollection dataList, Resco.Controls.AdvancedList.Mapping fieldNames)
: this(templateIndex, selectedTemplateIndex, -1, -1)
{
int num = Math.Max(fieldNames.FieldCount, dataList.Count);
this.m_htMap = fieldNames;
this.m_oData = new object[num];
dataList.CopyTo(this.m_oData, 0);
}
示例9: ToArray
public static object[] ToArray(ICollection collection)
{
if (collection == null)
return _zeroObjects;
object[] values = new object[collection.Count];
collection.CopyTo(values, 0);
return values;
}
示例10: Queue
public Queue(ICollection col)
: this(col == null ? 32 : col.Count)
{
if (col == null)
throw new ArgumentNullException ("col");
count = capacity;
col.CopyTo (contents, 0);
}
示例11: Spline
public Spline(ICollection<Vector3> p)
{
int i = 0;
T = new float[p.Count];
Q = new Tuple<float, float>[p.Count - 1];
P = new Vector3[p.Count];
p.CopyTo(P, 0);
T[0] = 0;
for (i = 1; i < p.Count - 1; i++) {
T[i] = i / (p.Count - 1);
}
T[p.Count - 1] = 1;
float[] a = new float[p.Count];
float[] b = new float[p.Count];
float[] c = new float[p.Count];
float[] k = new float[p.Count];
i = 0;
float dx = P[i + 1].x - P[i].x;
float dy = P[i + 1].y - P[i].y;
a[i] = 0;
b[i] = 2 / dx;
c[i] = 1 / dx;
k[i] = 3 * dy / (dx * dx);
for (i = 1; i < p.Count - 1; i++) {
dx = P[i + 1].x - P[i].x;
dy = P[i + 1].y - P[i].y;
//float dx1 =
a[i] = 1 / dx;
b[i] = 2 / dx;
c[i] = 1 / dx;
k[i] = 3 * dy / (dx * dx);
}
dx = P[i + 1].x - P[i].x;
dy = P[i + 1].y - P[i].y;
a[i] = 1 / dx;
b[i] = 2 / dx;
c[i] = 0;
k[i] = 3 * dy / (dx * dx);
solve_tridiagonal_in_place_destructive(k, a, b, c);
for (i = 0; i < Q.Length; i++) {
dx = P[i + 1].x - P[i].x;
dy = P[i + 1].y - P[i].y;
Q[i] = Tuple.Create(k[i - 1] * dx - dy, dy - k[i] * dx);
}
}
示例12: ToArray
public static object[] ToArray(ICollection collection, Type type)
{
Array array;
array = Array.CreateInstance(type, collection.Count);
collection.CopyTo(array, 0);
return((object[]) array);
}
示例13: ICollection2StringList
private string[] ICollection2StringList(ICollection il)
{
if (il == null)
return new string[0] ;
string[] sl = new string[il.Count];
il.CopyTo(sl, 0);
return sl;
}
示例14: PropertyValueDisplayedAsAttribute
public PropertyValueDisplayedAsAttribute(string childPropertyName, ICollection displayedStrings)
{
if (childPropertyName == null)
throw new ArgumentException("The name of the child property can't be null");
_displayedStrings = new string[displayedStrings.Count];
displayedStrings.CopyTo(_displayedStrings, 0);
_childPropertyName = childPropertyName;
}
示例15: TreeValidationWorker
public TreeValidationWorker(ICollection<TreeVM> trees)
{
Debug.Assert(trees != null);
lock (((System.Collections.ICollection)trees).SyncRoot)
{
TreeVM[] copy = new TreeVM[trees.Count];
trees.CopyTo(copy, 0);
this._treesLocal = copy;
}
}