本文整理汇总了C#中ReadOnlyArray类的典型用法代码示例。如果您正苦于以下问题:C# ReadOnlyArray类的具体用法?C# ReadOnlyArray怎么用?C# ReadOnlyArray使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ReadOnlyArray类属于命名空间,在下文中一共展示了ReadOnlyArray类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: Z80
public Z80(ReadOnlyArray<byte> rom, IMemoryManagementUnit mmu)
{
InitOpcodes();
this.mmu = mmu;
this.rom = rom;
}
开发者ID:CRogers,项目名称:GbcEmulator,代码行数:7,代码来源:Z80.cs
示例2: Construct1
/// <summary>
/// Returns a constructed type given its instance type and type arguments.
/// </summary>
/// <param name="instanceType">the instance type to construct the result from</param>
/// <param name="typeArguments">the immediate type arguments to be replaced for type parameters in the instance type</param>
/// <returns></returns>
internal static NamedTypeSymbol Construct1(this NamedTypeSymbol instanceType, ReadOnlyArray<TypeSymbol> typeArguments)
{
Debug.Assert(instanceType.ConstructedFrom == instanceType);
var sequenceEqual = true;
var args = instanceType.TypeArguments;
if (args.Count != typeArguments.Count)
{
sequenceEqual = false;
}
else
{
for (int i = 0; i < args.Count; i++)
{
if (args[i] != typeArguments[i])
{
sequenceEqual = false;
break;
}
}
}
return sequenceEqual
? instanceType
: ConstructedNamedTypeSymbol.Make(instanceType, typeArguments);
}
开发者ID:modulexcite,项目名称:pattern-matching-csharp,代码行数:33,代码来源:NamedTypeSymbolExtensions.cs
示例3: GetProperties
public ReadOnlyArray<JsonProperty> GetProperties()
{
var builder = new ReadOnlyArray<JsonProperty>.Builder();
foreach (var assignment in _assignments)
{
if (assignment.Value.Mode == PropertyExpressionType.Data)
{
builder.Add(new JsonDataProperty(
assignment.Key,
assignment.Value.Expression
));
}
else
{
builder.Add(new JsonAccessorProperty(
assignment.Key,
assignment.Value.GetExpression,
assignment.Value.SetExpression
));
}
}
return builder.ToReadOnly();
}
开发者ID:pvginkel,项目名称:Jint2,代码行数:25,代码来源:JsonPropertyBuilder.cs
示例4: SpillExpressionsWithReceiver
/// <summary>
/// Spill an expression list with a receiver (e.g. array access, method call), where at least one of the
/// receiver or the arguments contains an await expression.
/// </summary>
private Tuple<BoundExpression, ReadOnlyArray<BoundExpression>> SpillExpressionsWithReceiver(
BoundExpression receiverOpt,
ReadOnlyArray<BoundExpression> expressions,
SpillBuilder spillBuilder,
ReadOnlyArray<RefKind> refKindsOpt)
{
if (receiverOpt == null)
{
return Tuple.Create(default(BoundExpression), SpillExpressionList(spillBuilder, expressions));
}
// We have a non-null receiver, and an expression of the form:
// receiver[index1, index2, ..., indexN]
// or:
// receiver(arg1, arg2, ... argN)
// Build a list containing the receiver and all expressions (in that order)
var allExpressions = ReadOnlyArray<BoundExpression>.CreateFrom(receiverOpt).Concat(expressions);
var allRefKinds = (refKindsOpt != null)
? ReadOnlyArray<RefKind>.CreateFrom(RefKind.None).Concat(refKindsOpt)
: ReadOnlyArray<RefKind>.Empty;
// Spill the expressions (and possibly the receiver):
var allSpilledExpressions = SpillExpressionList(spillBuilder, allExpressions, allRefKinds);
var spilledReceiver = allSpilledExpressions.First();
var spilledArguments = allSpilledExpressions.RemoveFirst();
return Tuple.Create(spilledReceiver, spilledArguments);
}
开发者ID:EkardNT,项目名称:Roslyn,代码行数:33,代码来源:AwaitLoweringRewriterPass1_ArgExpressions.cs
示例5: RomInfo
public RomInfo(byte[] rom)
{
Rom = new ReadOnlyArray<byte>(rom);
NintendoGraphic = new byte[48];
Array.Copy(rom, 0x0104, NintendoGraphic, 0, 48);
var name = new byte[14];
Array.Copy(rom, 0x0134, name, 0, 14);
RomName = new string(name.Where(b => b != 0).Select(b => (char) b).ToArray());
IsColor = rom[0x0143] == 0x80;
LicenseeCode = (ushort)((rom[0x0144] << 8) | rom[0x0145]);
IsSuperGb = rom[0x0146] == 3;
CartridgeInfo = new CartridgeInfo(rom[0x0147]);
RomSize = new RomSize(rom[0x0148]);
RamSize = new RamSize(rom[0x0149]);
Japanese = rom[0x014A] == 1;
OldLincenseeCode = rom[0x01B];
MaskRomVersionNumber = rom[0x014C];
ComplementCheck = rom[0x014D];
Checksum = (ushort)((rom[0x014E] << 8) | rom[0x014F]);
}
开发者ID:CRogers,项目名称:GbcEmulator,代码行数:26,代码来源:RomInfo.cs
示例6: Closure
public Closure(ReadOnlyArray<string> fields)
{
if (fields == null)
throw new ArgumentNullException("fields");
Fields = fields;
}
开发者ID:pvginkel,项目名称:Jint2,代码行数:7,代码来源:Closure.cs
示例7: CustomAttribute
public CustomAttribute(
IMethodReference constructor,
ITypeReference type,
ReadOnlyArray<MetadataConstant> positionalArguments) :
this(constructor, type, positionalArguments, ReadOnlyArray<IMetadataNamedArgument>.Empty)
{
}
开发者ID:EkardNT,项目名称:Roslyn,代码行数:7,代码来源:CustomAttribute.cs
示例8: Scope
public Scope(BodyType bodyType, Scope parent, ReadOnlyArray<string> parameters)
{
_bodyType = bodyType;
Parent = parent;
_parameters = parameters;
_rootScope = parent != null ? parent._rootScope : this;
}
开发者ID:pvginkel,项目名称:Jint2,代码行数:7,代码来源:AstBuilder.Scope.cs
示例9: AllocateFields
internal void AllocateFields(ReadOnlyArray<BoundSpillTemp> spills)
{
foreach (var spill in spills)
{
AllocateField(spill);
}
}
开发者ID:modulexcite,项目名称:pattern-matching-csharp,代码行数:7,代码来源:AwaitLoweringRewriterPass2_SpillFieldAllocator.cs
示例10: GuitarData
public GuitarData(Wiimote Owner)
: base(Owner)
{
_stick = new byte[2];
_stick_readonly = new ReadOnlyArray<byte>(_stick);
_frets = new bool[5];
_frets_readonly = new ReadOnlyArray<bool> (_frets);
}
开发者ID:CharcoalStyles,项目名称:Unity-Wiimote,代码行数:8,代码来源:GuitarData.cs
示例11: UnconfirmedCOVNotificationRequest
public UnconfirmedCOVNotificationRequest(uint subscriberProcessIdentifier, ObjectId initiatingDeviceIdentifier, ObjectId monitoredObjectIdentifier, uint timeRemaining, ReadOnlyArray<PropertyValue> listOfValues)
{
this.SubscriberProcessIdentifier = subscriberProcessIdentifier;
this.InitiatingDeviceIdentifier = initiatingDeviceIdentifier;
this.MonitoredObjectIdentifier = monitoredObjectIdentifier;
this.TimeRemaining = timeRemaining;
this.ListOfValues = listOfValues;
}
开发者ID:LorenVS,项目名称:bacstack,代码行数:8,代码来源:UnconfirmedCOVNotificationRequest.cs
示例12: ExecuteBlockStatements
public BodySyntax ExecuteBlockStatements(ReadOnlyArray<string> parameters)
{
_builder.EnterFunctionBody(parameters);
blockStatements();
return _builder.ExitBody();
}
开发者ID:pvginkel,项目名称:Jint2,代码行数:8,代码来源:EcmaScriptParser.cs
示例13: AsyncStruct
public AsyncStruct(MethodSymbol method, TypeCompilationState compilationState)
: base(method, GeneratedNames.MakeIteratorOrAsyncDisplayClassName(method.Name, compilationState.GenerateTempNumber()), TypeKind.Struct)
{
this.interfaces = ReadOnlyArray<NamedTypeSymbol>.CreateFrom(
compilationState.EmitModule.Compilation.GetWellKnownType(WellKnownType.System_Runtime_CompilerServices_IAsyncStateMachine));
this.constructor = new SynthesizedInstanceConstructor(this);
}
开发者ID:EkardNT,项目名称:Roslyn,代码行数:8,代码来源:AsyncStruct.cs
示例14: Construct
public static NamedTypeSymbol Construct(this NamedTypeSymbol type, ReadOnlyArray<TypeSymbol> arguments)
{
Debug.Assert(type != null);
Debug.Assert(arguments.IsNotNull);
TypeMap map = new TypeMap(ReadOnlyArray<TypeSymbol>.CreateFrom(type.ConstructedFrom.TypeParameters),
arguments);
return map.SubstituteNamedType(type.ConstructedFrom);
}
开发者ID:EkardNT,项目名称:Roslyn,代码行数:9,代码来源:NamedTypeSymbolExtensions.cs
示例15: WithPaths
public AssemblyResolver WithPaths(ReadOnlyArray<string> paths)
{
if (paths == this.searchPaths)
{
return this;
}
return new AssemblyResolver(paths, getFullPath, architectureFilter, preferredCulture);
}
开发者ID:modulexcite,项目名称:pattern-matching-csharp,代码行数:9,代码来源:AssemblyResolver.cs
示例16: NunchuckData
public NunchuckData(Wiimote Owner)
: base(Owner)
{
_accel = new int[3];
_accel_readonly = new ReadOnlyArray<int>(_accel);
_stick = new byte[2];
_stick_readonly = new ReadOnlyArray<byte>(_stick);
}
开发者ID:CharcoalStyles,项目名称:Unity-Wiimote,代码行数:9,代码来源:NunchuckData.cs
示例17: ListOfEventSummariesType
public ListOfEventSummariesType(ObjectId objectIdentifier, EventState eventState, EventTransitionBits acknowledgedTransitions, ReadOnlyArray<TimeStamp> eventTimeStamps, NotifyType notifyType, EventTransitionBits eventEnable, ReadOnlyArray<uint> eventPriorities)
{
this.ObjectIdentifier = objectIdentifier;
this.EventState = eventState;
this.AcknowledgedTransitions = acknowledgedTransitions;
this.EventTimeStamps = eventTimeStamps;
this.NotifyType = notifyType;
this.EventEnable = eventEnable;
this.EventPriorities = eventPriorities;
}
开发者ID:LorenVS,项目名称:bacstack,代码行数:10,代码来源:GetEventInformationAck.cs
示例18: ReadRangeAck
public ReadRangeAck(ObjectId objectIdentifier, PropertyIdentifier propertyIdentifier, Option<uint> propertyArrayIndex, ResultFlags resultFlags, uint itemCount, ReadOnlyArray<GenericValue> itemData, Option<uint> firstSequenceNumber)
{
this.ObjectIdentifier = objectIdentifier;
this.PropertyIdentifier = propertyIdentifier;
this.PropertyArrayIndex = propertyArrayIndex;
this.ResultFlags = resultFlags;
this.ItemCount = itemCount;
this.ItemData = itemData;
this.FirstSequenceNumber = firstSequenceNumber;
}
开发者ID:LorenVS,项目名称:bacstack,代码行数:10,代码来源:ReadRangeAck.cs
示例19: AchievementManager
// todo: UnlockedAchievements
public AchievementManager(string filePath, IEnumerable<Achievement> achievements)
: base(filePath)
{
Ensure.NotNull(achievements);
_achievements = new ReadOnlyArray<Achievement>(achievements.ToArray());
_achievementsByName = _achievements.ToDictionary(achivement => achivement.Name);
this.Load();
this.HookAchievementUnlockedEvents();
}
开发者ID:JaakkoLipsanen,项目名称:Flai.XNA,代码行数:12,代码来源:AchievementManager.cs
示例20: FullAndPublicKeyResults
internal FullAndPublicKeyResults(byte[] keyPair, ReadOnlyArray<byte> publicKey, string container, DiagnosticBag bag, string keyFileName)
{
m_KeyPair = keyPair;
m_PublicKey = publicKey;
m_KeyContainer = container;
m_Diagnostics = bag;
m_KeyFileName = keyFileName;
System.Diagnostics.Debug.Assert(m_KeyContainer == null || m_KeyPair == null, "Only one of keyContainer or keyPair can be non-null");
System.Diagnostics.Debug.Assert((m_KeyPair != null) ? (m_KeyFileName != null) : true, "if m_KeyPair is set, so must m_KeyFileName.");
}
开发者ID:EkardNT,项目名称:Roslyn,代码行数:10,代码来源:AssemblySymbolImpl.cs
注:本文中的ReadOnlyArray类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论