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


C# System.Collections.Generic.List.AddRange方法代码示例

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


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

示例1: __encode

 public System.Collections.Generic.List<byte> __encode()
 {
     var data = new System.Collections.Generic.List<byte>();
     data.AddRange(Proto4z.BaseProtoObject.encodeUI64(uID));
     data.AddRange(Proto4z.BaseProtoObject.encodeString(token));
     data.AddRange(Proto4z.BaseProtoObject.encodeUI32(expire));
     return data;
 }
开发者ID:qinlikang,项目名称:breeze,代码行数:8,代码来源:ProtoServerCommon.cs

示例2: __encode

 public System.Collections.Generic.List<byte> __encode()
 {
     var ret = new System.Collections.Generic.List<byte>();
     ret.AddRange(BaseProtoObject.encodeUI32(packLen));
     ret.AddRange(BaseProtoObject.encodeUI16(reserve));
     ret.AddRange(BaseProtoObject.encodeUI16(protoID));
     return ret;
 }
开发者ID:roger912,项目名称:zsummerX,代码行数:8,代码来源:Program.cs

示例3: ToBytes

 public byte[] ToBytes()
 {
     System.Collections.Generic.List<byte> dataBuffer = new System.Collections.Generic.List<byte>();
     dataBuffer.AddRange(TypeMarshal.ToBytes<ushort>((ushort)(this.BlockT.blockType)));
     dataBuffer.AddRange(TypeMarshal.ToBytes<uint>(this.BlockT.blockLen));
     dataBuffer.AddRange(TypeMarshal.ToBytes<byte>(this.numChannels));
     dataBuffer.AddRange(TypeMarshal.ToBytes<TS_RFX_CHANNELT>(this.channels[0]));
     return dataBuffer.ToArray();
 }
开发者ID:yazeng,项目名称:WindowsProtocolTestSuites,代码行数:9,代码来源:TS_RFX_CHANNELS.cs

示例4: __encode

 public System.Collections.Generic.List<byte> __encode()
 {
     var data = new System.Collections.Generic.List<byte>();
     data.AddRange(Proto4z.BaseProtoObject.encodeUI64(this.id));
     data.AddRange(Proto4z.BaseProtoObject.encodeUI64(this.serviceID));
     data.AddRange(Proto4z.BaseProtoObject.encodeString(this.streamBlob));
     data.AddRange(Proto4z.BaseProtoObject.encodeUI16(this.status));
     data.AddRange(Proto4z.BaseProtoObject.encodeUI64(this.timestamp));
     return data;
 }
开发者ID:toyang,项目名称:breeze,代码行数:10,代码来源:ProtoOffline.cs

示例5: Create

 /// <summary>
 /// 
 /// </summary>
 /// <param name="lt"></param>
 /// <param name="rt"></param>
 /// <param name="lb"></param>
 /// <param name="rb"></param>
 /// <returns></returns>
 public static AttributeBase Create( float[] lt, float[] rt, float[] lb, float[] rb )
 {
     System.Collections.Generic.List<float> values = new System.Collections.Generic.List<float>( 2 * 4 );
     values.AddRange( lt );
     values.AddRange( rt );
     values.AddRange( lb );
     values.AddRange( rb );
     var self = new AttributeBase( AttributeBase.Target.kVertex, null,
         values.ToArray(), null );
     return self;
 }
开发者ID:cfm-art,项目名称:SpriteStudioPlayerForUGUI,代码行数:19,代码来源:VertexUpdater.cs

示例6: __encode

        public System.Collections.Generic.List<byte> __encode()
        {
            Proto4z.ui32 sttLen = 0;
            Proto4z.ui64 tag = 3;

            var data = new System.Collections.Generic.List<byte>();
            data.AddRange(retCode.__encode());
            data.AddRange(users.__encode());
            sttLen = (System.UInt32)data.Count + 8;
            var ret = new System.Collections.Generic.List<byte>();
            ret.AddRange(sttLen.__encode());
            ret.AddRange(tag.__encode());
            ret.AddRange(data);
            return ret;
        }
开发者ID:jimmy486,项目名称:breeze,代码行数:15,代码来源:ProtoLogin.cs

示例7: BuildElementList

            protected override IList<Microsoft.VisualStudio.Modeling.ModelElement> BuildElementList(object component)
            {
                Microsoft.VisualStudio.Modeling.DomainClassInfo domainClassInfo = DomainRoleInfo.RolePlayer;
                if (domainClassInfo == null || component == null)
                    return new System.Collections.Generic.List<Microsoft.VisualStudio.Modeling.ModelElement>();

                Microsoft.VisualStudio.Modeling.Store store = this.GetStore(component);

                DomainRole domainRole = component as DomainRole;
                System.Collections.Generic.List<Microsoft.VisualStudio.Modeling.ModelElement> list = new System.Collections.Generic.List<Microsoft.VisualStudio.Modeling.ModelElement>();
                list.AddRange(domainRole.Relationship.GetMetaModel().PropertyGridEditors);

                System.Collections.Generic.IList<Microsoft.VisualStudio.Modeling.ModelElement> ilist = store.ElementDirectory.FindElements(domainClassInfo, false);
                foreach (Microsoft.VisualStudio.Modeling.ModelElement modelElement in ilist)
                {
                    PropertyGridEditor p = modelElement as PropertyGridEditor;
                    bool bFound = false;
                    foreach (PropertyGridEditor e in list)
                        if (e.Name == p.Name)
                        {
                            bFound = true;
                            break;
                        }

                    if (!bFound)
                        list.Add(p);
                }
                return list;
            }
开发者ID:apoorv-vijay-joshi,项目名称:FSE-2011-PDE,代码行数:29,代码来源:PropertyGridEditorBaseTypeDescriptor.cs

示例8: FromProperty

        public static Specification FromProperty(PropertyInfo property)
        {
            System.Collections.Generic.List<string> enumList = new System.Collections.Generic.List<string>();
            if (property.PropertyType.IsEnum)
            {
                enumList.AddRange(Enum.GetNames(property.PropertyType));
            }
            
            var attrs = property.GetCustomAttributes(true);
            var oa = attrs.OfType<OptionAttribute>();
            if (oa.Count() == 1)
            {
                var spec = OptionSpecification.FromAttribute(oa.Single(), property.PropertyType, enumList);
                if (spec.ShortName.Length == 0 && spec.LongName.Length == 0)
                {
                    return spec.WithLongName(property.Name.ToLowerInvariant(), enumList);
                }
                return spec;
            }

            var va = attrs.OfType<ValueAttribute>();
            if (va.Count() == 1)
            {
                return ValueSpecification.FromAttribute(va.Single(), property.PropertyType);
            }

            throw new InvalidOperationException();
        }
开发者ID:cosmo0,项目名称:commandline,代码行数:28,代码来源:Specification.cs

示例9: Start

 void Start()
 {
     Foxes = new System.Collections.Generic.List<GameObject>();
     Foxes.AddRange(new[] { DownLeftFox, DownRightFox, UpLeftFox, UpRightFox });
     SetUnvisibleAll();
     DownRightFox.SetActive(true);
 }
开发者ID:Vsailor,项目名称:Eggmania,代码行数:7,代码来源:ArrowButtonScript.cs

示例10: ProcessRequest

        //TODO simple JSON writer
        //struct Info
        //{
        //    public string Provider { get; set; }
        //}
        public override void ProcessRequest(WebRequest request)
        {
            //We don't need a list here, but I rather get away from the lock quicker.
            var dependencies = new System.Collections.Generic.List<ResourceDependancy>();
            WebServer.ForEachPage((page) =>
            {
                var dpd = page.GetDependencies();
                if (dpd != null)
                {
                    dependencies.AddRange(dpd);
                }
            });

            //Since we are using a list we can make it a bit easier
            request.Writer.Buffer(dependencies.Count);

            foreach (var item in dependencies)
            {
                request.Writer.Buffer((byte)item.Type);
                request.Writer.Buffer(item.Url);
            }

            dependencies.Clear();
            dependencies = null;

            request.WriteOut("application/octet-stream");
        }
开发者ID:DeathCradle,项目名称:Terraria-s-Dedicated-Server-Mod,代码行数:32,代码来源:WebModules.cs

示例11: BasicTest

 public void BasicTest()
 {
     System.Collections.Generic.List<string> TestObject = new System.Collections.Generic.List<string>();
     TestObject.AddRange(new string[] { "this", "is", "a", "test" });
     ListMapping<int, string> Results = TestObject.Permute();
     Assert.Equal(24, Results.Keys.Count);
     foreach (int Key in Results.Keys)
         foreach (string Item in Results[Key])
             Assert.True(Item == "this" || Item == "is" || Item == "a" || Item == "test");
 }
开发者ID:kaytie,项目名称:Craig-s-Utility-Library,代码行数:10,代码来源:PermutationExtensions.cs

示例12: ToBytes

 public byte[] ToBytes()
 {
     System.Collections.Generic.List<byte> dataBuffer = new System.Collections.Generic.List<byte>();
     dataBuffer.AddRange(TypeMarshal.ToBytes<ushort>((ushort)this.CodecChannelT.blockType));
     dataBuffer.AddRange(TypeMarshal.ToBytes<uint>(this.CodecChannelT.blockLen));
     dataBuffer.AddRange(TypeMarshal.ToBytes<byte>(this.CodecChannelT.codecId));
     dataBuffer.AddRange(TypeMarshal.ToBytes<byte>(this.CodecChannelT.channelId));
     dataBuffer.AddRange(TypeMarshal.ToBytes<byte>(this.regionFlags));
     dataBuffer.AddRange(TypeMarshal.ToBytes<ushort>(this.numRects));
     foreach (TS_RFX_RECT rect in this.rects)
     {
         dataBuffer.AddRange(TypeMarshal.ToBytes<TS_RFX_RECT>(rect));
     }
     dataBuffer.AddRange(TypeMarshal.ToBytes<ushort>(this.regionType));
     dataBuffer.AddRange(TypeMarshal.ToBytes<ushort>(this.numTilesets));
     return dataBuffer.ToArray();
 }
开发者ID:yazeng,项目名称:WindowsProtocolTestSuites,代码行数:17,代码来源:TS_RFX_REGION.cs

示例13: ShouldCallOnMessageAfterSplitFrame

        public void ShouldCallOnMessageAfterSplitFrame()
        {
            const string part1 = "Writing tests";
            const string part2 = " is good for your health";
            const string expected = part1 + part2;

            var bytes = new System.Collections.Generic.List<byte>();
            bytes.Add(0);
            bytes.AddRange(Encoding.UTF8.GetBytes(part1));

            var bytes2 = new System.Collections.Generic.List<byte>();
            bytes.AddRange(Encoding.UTF8.GetBytes(part2));
            bytes.Add(255);

            string result = null;
            _onMessage = s => result = s;

            _handler.Recieve(bytes);
            _handler.Recieve(bytes2);
            Assert.AreEqual(expected, result);
        }
开发者ID:joeyespo,项目名称:Fleck,代码行数:21,代码来源:Draft76HandlerTests.cs

示例14: Create

 /// <summary>
 /// 
 /// </summary>
 /// <param name="isVisible"></param>
 public static AttributeBase Create( int? integer, float[] point, float[] rect, string message )
 {
     bool[] has = { integer.HasValue, point != null, rect != null, message != null };
     int[] iValues = new int[1];
     if ( integer.HasValue ) {
         iValues[0] = integer.Value;
     }
     var floats = new System.Collections.Generic.List<float>( 6 );
     if ( point != null ) {
         floats.AddRange( point );
     }
     if ( rect != null ) {
         floats.AddRange( rect );
     }
     string[] texts = null;
     if ( message != null ) {
         texts = new string[] { message };
     }
     var self = new AttributeBase( AttributeBase.Target.kUserNotify, iValues, floats.ToArray(), has, texts );
     return self;
 }
开发者ID:cfm-art,项目名称:SpriteStudioPlayerForUGUI,代码行数:25,代码来源:UserDataNorifier.cs

示例15: ShouldCallOnMessageOnCompleteFrame

        public void ShouldCallOnMessageOnCompleteFrame()
        {
            const string expected = "Once upon a time...";
            var bytes = new System.Collections.Generic.List<byte>();
            bytes.Add(0);
            bytes.AddRange(Encoding.UTF8.GetBytes(expected));
            bytes.Add(255);

            string result = null;
            _onMessage = s => result = s;

            _handler.Recieve(bytes);
            Assert.AreEqual(expected, result);
        }
开发者ID:joeyespo,项目名称:Fleck,代码行数:14,代码来源:Draft76HandlerTests.cs


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