当前位置: 首页>>代码示例>>C#>>正文


C# IList.CopyTo方法代码示例

本文整理汇总了C#中IList.CopyTo方法的典型用法代码示例。如果您正苦于以下问题:C# IList.CopyTo方法的具体用法?C# IList.CopyTo怎么用?C# IList.CopyTo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IList的用法示例。


在下文中一共展示了IList.CopyTo方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SmallDocumentBlockList

 /// <summary>
 /// Initializes a new instance of the <see cref="SmallDocumentBlockList"/> class.
 /// </summary>
 /// <param name="blocks">a list of SmallDocumentBlock instances</param>
 public SmallDocumentBlockList(IList blocks)
 {
     SmallDocumentBlock[] array = new SmallDocumentBlock[blocks.Count];
     blocks.CopyTo(array, 0);
     ListManagedBlock[] tmp = (ListManagedBlock[])array;
     this.SetBlocks(ref tmp);
 }
开发者ID:uwitec,项目名称:web-mvc-logistics,代码行数:11,代码来源:SmallDocumentBlockList.cs

示例2: SignatureAnalysis

 internal SignatureAnalysis(string text, int paramIndex, IList<ISignature> signatures)
 {
     _text = text;
     _paramIndex = paramIndex;
     _signatures = new ISignature[signatures.Count];
     signatures.CopyTo(_signatures, 0);
     Array.Sort(_signatures, (x, y) => x.Parameters.Count - y.Parameters.Count);
 }
开发者ID:TerabyteX,项目名称:main,代码行数:8,代码来源:SignatureAnalysis.cs

示例3: SignatureAnalysis

 internal SignatureAnalysis(string text, int paramIndex, IList<ISignature> signatures, string lastKeywordArgument = null) {
     _text = text;
     _paramIndex = paramIndex;
     _signatures = new ISignature[signatures.Count];
     signatures.CopyTo(_signatures, 0);
     _lastKeywordArgument = lastKeywordArgument;
     Array.Sort(_signatures, (x, y) => x.Parameters.Count - y.Parameters.Count);
 }
开发者ID:omnimark,项目名称:PTVS,代码行数:8,代码来源:SignatureAnalysis.cs

示例4: InElement

        // Initialize for searching a list of values
		public InElement(ExpressionElement operand, IList listElements)
		{
			MyOperand = operand;

			ExpressionElement[] arr = new ExpressionElement[listElements.Count];
			listElements.CopyTo(arr, 0);

			MyArguments = new List<ExpressionElement>(arr);
			this.ResolveForListSearch();
		}
开发者ID:netgrim,项目名称:FleeSharp,代码行数:11,代码来源:In.cs

示例5:

 private ReactiveDownloader
     (IList<OneSongHeader> Songs, String UserAgent, String FolderPath, Boolean GenerateNewFilenames, String FilenameTemplate)
 {
     this._songs = new OneSongHeader[Songs.Count];
     Songs.CopyTo(this._songs, 0);
     this._userAgent = UserAgent;
     this._folderPath = FolderPath;
     this._generateNewFilenames = GenerateNewFilenames;
     this._filenameTemplate = FilenameTemplate;
 }
开发者ID:Klotos,项目名称:MyzukaRuGrabber,代码行数:10,代码来源:ReactiveDownloader.cs

示例6: PersonArray

 public PersonArray(IList<Person> mdos)
 {
     if (mdos == null || mdos.Count <= 0)
     {
         return;
     }
     Person[] ary = new Person[mdos.Count];
     mdos.CopyTo(ary, 0);
     setProps(ary);
 }
开发者ID:kunalkot,项目名称:mdws,代码行数:10,代码来源:PersonArray.cs

示例7: UserArray

 public UserArray(IList<User> mdo)
 {
     if (mdo == null || mdo.Count == 0)
     {
         return;
     }
     User[] userAry = new User[mdo.Count];
     mdo.CopyTo(userAry, 0);
     buildArray(userAry);
 }
开发者ID:kunalkot,项目名称:mdws,代码行数:10,代码来源:UserArray.cs

示例8: ListToArray

        private string[] ListToArray(IList<string> stringList)
        {
            if (null == stringList)
            {
                return null;
            }

            string[] stringArray = new string[stringList.Count];
            stringList.CopyTo(stringArray, 0);
            return stringArray;
        }
开发者ID:docschmidt,项目名称:azure-powershell,代码行数:11,代码来源:GetAzureStorageCORSRule.cs

示例9: Contain_All_The_Same_Items

        public void Contain_All_The_Same_Items(IList<int> inputData)
        {
            int[] initialData = new int[inputData.Count];
            inputData.CopyTo(initialData, 0);

            inputData.RandomShuffle();

            foreach (var initialItem in initialData)
            {
                Assert.That(inputData, Contains.Item(initialItem));
            }
        }
开发者ID:philpursglove,项目名称:DDDEastAnglia,代码行数:12,代码来源:Given_A_List_Of_Items_RandomShuffle_Should.cs

示例10: Reduction

		internal Reduction(Rule rule, IList<Token> tokens): base() {
			if (rule == null) {
				throw new ArgumentNullException("rule");
			}
			if (tokens == null) {
				throw new ArgumentNullException("tokens");
			}
			this.rule = rule;
			Token[] tokenArray = new Token[tokens.Count];
			tokens.CopyTo(tokenArray, 0);
			this.tokens = Array.AsReadOnly(tokenArray);
		}
开发者ID:avonwyss,项目名称:bsn-goldparser,代码行数:12,代码来源:Reduction.cs

示例11: DataPointSelectionChangedEventArgs

 public DataPointSelectionChangedEventArgs(IList<DataPoint> removedItems, IList<DataPoint> addedItems)
 {
     if (addedItems != null)
     {
         this._addedItems = new DataPoint[addedItems.Count];
         addedItems.CopyTo(this._addedItems, 0);
     }
     if (removedItems == null)
         return;
     this._removedItems = new DataPoint[removedItems.Count];
     removedItems.CopyTo(this._removedItems, 0);
 }
开发者ID:sulerzh,项目名称:chart,代码行数:12,代码来源:DataPointSelectionChangedEventArgs.cs

示例12: FindBestConstructor

 internal static bool FindBestConstructor(Type t, IList<object> parameters, out ConstructorInfo constructorInfo, out object[] convertedParameters)
 {
   MethodBase methodBase;
   object[] parameterObjects = new object[parameters.Count];
   parameters.CopyTo(parameterObjects, 0);
   if (ReflectionHelper.FindBestMember(t.GetConstructors(), parameterObjects, out methodBase, out convertedParameters))
   {
     constructorInfo = (ConstructorInfo) methodBase;
     return true;
   }
   constructorInfo = null;
   return false;
 }
开发者ID:davinx,项目名称:MediaPortal-2,代码行数:13,代码来源:AbstractNamespaceHandler.cs

示例13: GetAttributesFrom

 private XmlNodeList GetAttributesFrom(XmlNode node, IList<string> arguments, bool warnIfEmpty)
 {
     string[] array = new string[arguments.Count];
     arguments.CopyTo(array, 0);
     string xpath = "@" + string.Join("|@", array);
     XmlNodeList xmlNodeList = node.SelectNodes(xpath);
     if (xmlNodeList.Count == 0 && warnIfEmpty && arguments.Count == 1)
         this.Log.LogWarning("Argument '{0}' did not match any attributes", new object[1]
     {
       (object) arguments[0]
     });
     return xmlNodeList;
 }
开发者ID:micahlmartin,项目名称:XmlTransformer,代码行数:13,代码来源:AttributeTransform.cs

示例14: ThinkAsync

        public async Task<int> ThinkAsync(IList<char> gameBoard)
        {
            // Copy the contents of the IList to a string.
            char[] arrayTmp = new char[9];
            gameBoard.CopyTo(arrayTmp, 0);
            string board = new String(arrayTmp);

            // Frequently take the center square if the board is empty.
            System.Random random = new System.Random((int)System.DateTime.Now.Ticks);
            if (random.Next() % 2 == 0 && gameBoard.All<char>((ch) => ch == m_emptySymbol.Symbol))
            {
                return 4;
            }

            // Approximate counts of iterations the algorithm makes for each number of available moves at the root level.
            uint[] allIterations = { 0u, 2u, 5u, 15u, 50u, 200u, 930u, 7300u, 60000u, 550000u };
            var moves = MiniMax.AvailableMoves(board, m_emptySymbol.Symbol);
            uint totalIterations = allIterations[moves.Length - 1];

            // Report every 1%.
            uint nextReportIter = totalIterations / 100;
            uint iterBy = nextReportIter;

            // This is called on every iteration of the minimax algorithm.
            MiniMax.CallBackFn callback = /*[total_iterations, &next_report_iter, iter_by, reporter]*/(int iter_count) =>
            {
                if (iter_count == nextReportIter)
                {
                    double progress = 100.0 * iter_count / totalIterations;
                    //reporter.report(Math.Min(progress, 100.0));
                    nextReportIter += iterBy;
                }
            };

            // Run the minimax algorithm in parallel if there are enough iterations.
            // Otherwise, run it serially, as the overhead of parallelism may not benefit.
            int iterCount = 0;
            System.Tuple<int, int> t;
            //if (totalIterations > 500)
            //{
            //    t = parallel_minimax(board, m_symbol, m_opponentSymbol, m_emptySymbol, m_symbol, iterCount, callback);
            //}
            //else
            //{
            t = await MiniMax.Minimax(board, m_symbol.Symbol, m_opponentSymbol.Symbol, m_emptySymbol.Symbol, m_symbol.Symbol, iterCount, callback);
            //}

            // Return the index part.
            return t.Item1;
        }
开发者ID:fellipetenorio,项目名称:mobile-services-samples,代码行数:50,代码来源:ComputerPlayer.cs

示例15: TaggedAppointmentArray

        public TaggedAppointmentArray(string tag, IList<Appointment> mdos)
        {
            if (mdos == null || mdos.Count == 0)
            {
                this.count = 0;
                return;
            }

            Appointment[] appts = new Appointment[mdos.Count];
            mdos.CopyTo(appts, 0);

            initialize(tag, appts);
        }
开发者ID:kunalkot,项目名称:mdws,代码行数:13,代码来源:TaggedAppointmentArray.cs


注:本文中的IList.CopyTo方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。