本文整理汇总了C#中IList类的典型用法代码示例。如果您正苦于以下问题:C# IList类的具体用法?C# IList怎么用?C# IList使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IList类属于命名空间,在下文中一共展示了IList类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: AssignBatchActionResultsAsync
public async Task AssignBatchActionResultsAsync(IODataClient client,
ODataResponse batchResponse, IList<Func<IODataClient, Task>> actions, IList<int> responseIndexes)
{
var exceptions = new List<Exception>();
for (var actionIndex = 0; actionIndex < actions.Count && !exceptions.Any(); actionIndex++)
{
var responseIndex = responseIndexes[actionIndex];
if (responseIndex >= 0 && responseIndex < batchResponse.Batch.Count)
{
var actionResponse = batchResponse.Batch[responseIndex];
if (actionResponse.Exception != null)
{
exceptions.Add(actionResponse.Exception);
}
else if (actionResponse.StatusCode >= (int)HttpStatusCode.BadRequest)
{
exceptions.Add(WebRequestException.CreateFromStatusCode((HttpStatusCode)actionResponse.StatusCode));
}
else
{
await actions[actionIndex](new ODataClient(client as ODataClient, actionResponse));
}
}
}
if (exceptions.Any())
{
throw exceptions.First();
}
}
开发者ID:ErikWitkowski,项目名称:Simple.OData.Client,代码行数:30,代码来源:ResponseReaderBase.cs
示例2: Execute
public void Execute(IList<Action> operations, Action<IEnumerable<Action>> remaining)
{
for (int i = 0; i < operations.Count; i++)
{
if (_stopping)
break;
operations[i]();
}
}
开发者ID:Nangal,项目名称:Stact,代码行数:10,代码来源:BasicOperationExecutor.cs
示例3: DoChaos
public static void DoChaos(Func<bool> doInjectFault, IList<Action> faults)
{
if (faults!=null
&& faults.Count>0
&& doInjectFault()
)
{
Trace.WriteLine("CHAOSMONKEY STRIKES AGAIN!!!!");
faults[_rnd.Next(faults.Count)]();
}
}
开发者ID:zybermark,项目名称:ChaosDotNet,代码行数:11,代码来源:ChaosHelper.cs
示例4: Execute
public virtual void Execute(IList<Action> ops, Action<IEnumerable<Action>> remainingOps)
{
for (var i = 0; i < ops.Count; i++)
{
if (!AcceptingJobs)
{
remainingOps.NotNull(obj => remainingOps(ops.Skip(i + 1)));
break;
}
ops[i]();
}
}
开发者ID:helios-io,项目名称:helios,代码行数:13,代码来源:BasicExecutor.cs
示例5: EmitArray
/// <summary>
/// Emits an array.
/// </summary>
/// <param name="generator"> The generator. </param>
/// <param name="arrayType"> Type of the array. </param>
/// <param name="emitElements"> The emit elements. </param>
public static void EmitArray(this ILGenerator generator, Type arrayType, IList<Action<ILGenerator>> emitElements)
{
var tLocal = generator.DeclareLocal(arrayType.MakeArrayType());
generator.Emit(OpCodes.Ldc_I4, emitElements.Count);
generator.Emit(OpCodes.Newarr, arrayType);
generator.EmitStoreLocation(tLocal.LocalIndex);
for (var i = 0; i < emitElements.Count; i++) {
generator.EmitLoadLocation(tLocal.LocalIndex);
generator.Emit(OpCodes.Ldc_I4, i);
emitElements[i](generator);
generator.Emit(OpCodes.Stelem_Ref);
}
generator.EmitLoadLocation(tLocal.LocalIndex);
}
开发者ID:virmitio,项目名称:coapp,代码行数:21,代码来源:EmitExtensions.cs
示例6: CheckIfReturnsSpecifiedType
private static void CheckIfReturnsSpecifiedType(ExpressionNode expression, IList<Error> errors, TigerType type)
{
if (!(expression.ReturnType == type)) {
errors.Add(new UnexpectedTypeError(expression.Line, expression.Column, expression.ReturnType,
IntegerType.Create()));
}
}
开发者ID:omederos,项目名称:TigerNET,代码行数:7,代码来源:ErrorsHelper.cs
示例7: DiscoverQueryReferences
public static IList<QueryReference> DiscoverQueryReferences(this SqlExpression expression, ref int level, IList<QueryReference> list)
{
var visitor = new QueryReferencesVisitor(list, level);
visitor.Visit(expression);
level = visitor.Level;
return visitor.References;
}
开发者ID:deveel,项目名称:deveeldb,代码行数:7,代码来源:QueryExpressionExtensions.cs
示例8: foreach
/// <summary>
/// Replaces the intrinsic call site
/// </summary>
/// <param name="context">The context.</param>
/// <param name="typeSystem">The type system.</param>
void IIntrinsicPlatformMethod.ReplaceIntrinsicCall(Context context, ITypeSystem typeSystem, IList<RuntimeParameter> parameters)
{
var result = context.Result;
var op1 = context.Operand1;
var op2 = context.Operand2;
var constant = Operand.CreateConstant(BuiltInSigType.IntPtr, parameters.Count * 4);
var eax = Operand.CreateCPURegister(BuiltInSigType.IntPtr, GeneralPurposeRegister.EAX); // FIXME - need access to virtual register allocator
var edx = Operand.CreateCPURegister(BuiltInSigType.IntPtr, GeneralPurposeRegister.EDX); // FIXME - need access to virtual register allocator
var esp = Operand.CreateCPURegister(BuiltInSigType.IntPtr, GeneralPurposeRegister.ESP); // FIXME - need access to virtual register allocator
var ebp = Operand.CreateCPURegister(BuiltInSigType.IntPtr, GeneralPurposeRegister.EBP); // FIXME - need access to virtual register allocator
context.SetInstruction(X86.Sub, esp, constant);
context.AppendInstruction(X86.Mov, edx, esp);
var size = parameters.Count * 4 + 4;
foreach (var parameter in parameters)
{
context.AppendInstruction(X86.Mov, Operand.CreateMemoryAddress(BuiltInSigType.IntPtr, edx, new IntPtr(size - 4)), Operand.CreateMemoryAddress(BuiltInSigType.IntPtr, ebp, new IntPtr(size + 4)));
size -= 4;
}
context.AppendInstruction(X86.Mov, Operand.CreateMemoryAddress(BuiltInSigType.IntPtr, edx, new IntPtr(size - 4)), op1);
context.AppendInstruction(X86.Mov, eax, op2);
context.AppendInstruction(X86.Call, null, eax);
context.AppendInstruction(X86.Add, esp, constant);
context.AppendInstruction(X86.Mov, result, Operand.CreateCPURegister(result.Type, GeneralPurposeRegister.EAX)); // FIXME - need access to virtual register allocator
}
开发者ID:Zahovay,项目名称:MOSA-Project,代码行数:32,代码来源:InvokeInstanceDelegateWithReturn.cs
示例9: GetLocationSelectedListItem
public static void GetLocationSelectedListItem(IList<Location> locations, out MultiSelectList allLocation, out List<SelectListItem> selectListItems)
{
var multiSelectList = new MultiSelectList(locations, "LocationId", "Province", locations);
allLocation = multiSelectList;
selectListItems =
locations.Select(o => new SelectListItem { Text = o.Province, Value = o.Province }).ToList();
}
开发者ID:jzinedine,项目名称:Cedar,代码行数:7,代码来源:ControllerHelper.cs
示例10: BuildTree
/// <summary>
/// Recursive menu builder
/// </summary>
/// <param name="flatList">Original flat menu items list</param>
/// <param name="parentId">Parent node ID</param>
/// <returns>Hierarchical list</returns>
private IList<SiteMapItem> BuildTree(IList<SiteMapItem> flatList, int parentId)
{
var list = new List<SiteMapItem>();
EnumerableExtensions.ForEach(flatList.Where(x => x.ParentId == parentId), list.Add);
list.ForEach(x => x.Children = BuildTree(flatList, x.Id));
return list;
}
开发者ID:HRINY,项目名称:HRI-Umbraco,代码行数:13,代码来源:SiteMapService.cs
示例11: Compiler
public ICLS_Expression Compiler(IList<Token> tlist, ICLS_Environment content)
{
ICLS_Expression value;
int expbegin = 0;
int expend = FindCodeBlock(tlist, expbegin);
if (expend != tlist.Count - 1)
{
LogError(tlist, "CodeBlock 识别问题,异常结尾", expbegin, expend);
return null;
}
bool succ = Compiler_Expression_Block(tlist, content, expbegin, expend, out value);
if (succ)
{
if (value == null)
{
logger.Log_Warn("编译为null:");
}
return value;
}
else
{
LogError(tlist, "编译失败:", expbegin, expend);
return null;
}
}
开发者ID:GraphicGame,项目名称:CSLightStudio,代码行数:30,代码来源:CLS_Compiler.cs
示例12: SetCurrent
public void SetCurrent(UiEncodingWindowSource source, IList<int> mainIndices, IList<int> additionalIndices)
{
CurrentSource = source;
CurrentMainIndices = mainIndices;
CurrentAdditionalIndices = additionalIndices;
for (int i = mainIndices.Count; i < _mainControls.Count; i++)
_mainControls[i].Visibility = Visibility.Collapsed;
for (int i = additionalIndices.Count; i < _additionalControls.Count; i++)
_additionalControls[i].Visibility = Visibility.Collapsed;
if (CurrentSource == null)
return;
for (int i = 0; i < mainIndices.Count; i++)
{
_mainControls[i].Load(source, mainIndices[i]);
_mainControls[i].Visibility = Visibility.Visible;
}
for (int i = 0; i < additionalIndices.Count; i++)
{
_additionalControls[i].Load(source, additionalIndices[i]);
_additionalControls[i].Visibility = Visibility.Visible;
}
_drawEvent.NullSafeSet();
}
开发者ID:truongan012,项目名称:Pulse,代码行数:28,代码来源:UiEncodingCharactersControl.cs
示例13: Require
public static void Require(IList<string> errors, string fieldValue, string error)
{
if (String.IsNullOrEmpty(fieldValue))
{
errors.Add(error);
}
}
开发者ID:jean-christophe-moinet,项目名称:jcmoinet-test-web,代码行数:7,代码来源:AccountHelpers.cs
示例14: GetHeightFromChildren
private double GetHeightFromChildren(IList<ICanvasItem> children)
{
children.SwapCoordinates();
var maxBottom = GetMaxRightFromChildren(children);
children.SwapCoordinates();
return maxBottom - Top;
}
开发者ID:modulexcite,项目名称:VisualDesigner,代码行数:7,代码来源:ChildrenExpandableCanvasItem.cs
示例15: Draw
public override void Draw(
IList<Point> points,
double thickness,
int miterLimit,
ILogicalToScreenMapper logicalToScreenMapper)
{
// First define the geometric shape
var streamGeometry = new StreamGeometry();
using (var gc = streamGeometry.Open())
{
gc.BeginFigure(points[0], _fillAndClose, _fillAndClose);
points.RemoveAt(0);
gc.PolyLineTo(points, true, true);
}
using (var dc = RenderOpen())
dc.DrawGeometry(
_fillAndClose ? Brushes.White : null,
new Pen(
Brushes.White,
thickness == 1 ? 0.25 : thickness)
{
MiterLimit = miterLimit
},
streamGeometry);
}
开发者ID:Bruhankovi4,项目名称:Emotyper,代码行数:27,代码来源:LineDrawingVisual.cs
示例16: EnumerationSignature
public EnumerationSignature (string serviceName, string enumName, IList<EnumerationValueSignature> values, string documentation)
{
Name = enumName;
FullyQualifiedName = serviceName + "." + Name;
Values = values;
Documentation = DocumentationUtils.ResolveCrefs (documentation);
}
开发者ID:paperclip,项目名称:krpc,代码行数:7,代码来源:EnumerationSignature.cs
示例17: AddRoleClaims
public static void AddRoleClaims(IEnumerable<string> roles, IList<Claim> claims)
{
foreach (string role in roles)
{
claims.Add(new Claim(RoleClaimType, role, ClaimsIssuer));
}
}
开发者ID:Dyno1990,项目名称:TelerikAcademy-1,代码行数:7,代码来源:IdentityConfig.cs
示例18: Get
/// <summary>
/// Gets a list of variable binds.
/// </summary>
/// <param name="version">Protocol version.</param>
/// <param name="endpoint">Endpoint.</param>
/// <param name="community">Community name.</param>
/// <param name="variables">Variable binds.</param>
/// <param name="timeout">The time-out value, in milliseconds. The default value is 0, which indicates an infinite time-out period. Specifying -1 also indicates an infinite time-out period.</param>
/// <returns></returns>
public static IList<Variable> Get(VersionCode version, IPEndPoint endpoint, OctetString community, IList<Variable> variables, int timeout)
{
if (endpoint == null)
{
throw new ArgumentNullException("endpoint");
}
if (community == null)
{
throw new ArgumentNullException("community");
}
if (variables == null)
{
throw new ArgumentNullException("variables");
}
if (version == VersionCode.V3)
{
throw new NotSupportedException("SNMP v3 is not supported");
}
var message = new GetRequestMessage(RequestCounter.NextId, version, community, variables);
var response = message.GetResponse(timeout, endpoint);
var pdu = response.Pdu();
if (pdu.ErrorStatus.ToInt32() != 0)
{
throw ErrorException.Create(
"error in response",
endpoint.Address,
response);
}
return pdu.Variables;
}
开发者ID:yonglehou,项目名称:sharpsnmplib,代码行数:44,代码来源:Messenger.cs
示例19: AddEffectsInfo
public override void AddEffectsInfo(IList<string> list)
{
list.Add("25% Group power refresh.");
list.Add("");
list.Add("Target: Group");
list.Add("Casting time: instant");
}
开发者ID:mynew4,项目名称:DAoC,代码行数:7,代码来源:EpiphanyAbility.cs
示例20: CustomsOfficeBlock
//public IList<MergeField> AnnexMergeFields { get; private set; }
public CustomsOfficeBlock(IList<MergeField> mergeFields, TransportRoute transportRoute)
{
CorrespondingMergeFields = MergeFieldLocator.GetCorrespondingFieldsForBlock(mergeFields, TypeName);
data = new CustomsOfficeViewModel(transportRoute);
AnnexMergeFields = MergeFieldLocator.GetAnnexMergeFields(mergeFields, TypeName);
}
开发者ID:EnvironmentAgency,项目名称:prsd-iws,代码行数:9,代码来源:CustomsOfficeBlock.cs
注:本文中的IList类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论