public UncommittedSnapshot(Guid aggregateId, int aggregateVersion, ISnapshot snapshot, IMetadataCollection metadata) { AggregateId = aggregateId; AggregateVersion = aggregateVersion; Data = snapshot; Metadata = metadata; }
public CommittedEvent(Guid aggregateId, int version, IDomainEvent data, IMetadataCollection metadata) { AggregateId = aggregateId; Version = version; Data = data; Metadata = metadata; }
public InMemoryCommittedEvent(Guid aggregateId, int aggregateVersion, object data, IMetadataCollection metadata) { AggregateId = aggregateId; Version = aggregateVersion; Data = data; Metadata = metadata; }
public InMemoryCommittedSnapshot(Guid aggregateId, int aggregateVersion, ISnapshot serializedData, IMetadataCollection serializedMetadata) { AggregateId = aggregateId; AggregateVersion = aggregateVersion; Data = serializedData; Metadata = serializedMetadata; }
public MongoCommittedEvent(Guid aggregateId, int version, object data, IMetadataCollection metadata) { AggregateId = aggregateId; Version = version; Data = data; Metadata = metadata; }
/// <summary> /// Initializes a new instance of the <see cref="GraphEdge" /> class. /// </summary> /// <param name="source">The source vertex.</param> /// <param name="target">The target vertex.</param> /// <param name="metadata">The metadata.</param> public GraphEdge(IGeometryGraph graph, GraphVertex source, GraphVertex target, IDictionary <String, Object> metadata) { _graph = graph; _source = source; _target = target; _metadata = _graph.Factory.GetFactory <IMetadataFactory>().CreateCollection(metadata); }
/// <summary> /// Initializes a new instance of the <see cref="PeriodDuration" /> class. /// </summary> /// <param name="duration">The duration.</param> /// <param name="referenceSystem">The reference system.</param> /// <param name="metadata">The metadata.</param> /// <exception cref="System.ArgumentNullException">The reference system cannot be null.</exception> /// <exception cref="System.ArgumentException">The reference system does not specify the calendar and the clock.</exception> public PeriodDuration(Duration duration, IReferenceSystem referenceSystem, IMetadataCollection metadata) { if (referenceSystem == null) { throw new ArgumentNullException("referenceSystem", "The reference system is null."); } if (referenceSystem is Calendar) { _calendar = referenceSystem as Calendar; _clock = (referenceSystem as Calendar).TimeBasis; } if (referenceSystem is Clock) { _calendar = (referenceSystem as Clock).CalendarBasis; _clock = referenceSystem as Clock; } if (referenceSystem is CompoundTemporalReferenceSystem) { _calendar = (referenceSystem as CompoundTemporalReferenceSystem).Calendar; _clock = (referenceSystem as CompoundTemporalReferenceSystem).Clock; } if (_calendar == null) { throw new ArgumentException("The reference system does not specify the calendar and the clock.", "referenceSystem"); } }
public MongoCommittedSnapshot(Guid aggregateId, int version, ISnapshot data, IMetadataCollection metadata) { AggregateId = aggregateId; AggregateVersion = version; Data = data; Metadata = metadata; }
public SnapshotRestore(Guid aggregateId, int aggregateVersion, ISnapshot snapshot, IMetadataCollection metadata) { AggregateId = aggregateId; AggregateVersion = aggregateVersion; Snapshot = snapshot; Metadata = metadata; }
public TableInfo WriteIl2CppTypeDefinitions(IMetadataCollection metadataCollection) { base.Writer.AddCodeGenIncludes(); IDictionary <Il2CppTypeData, int> items = Il2CppTypeCollectorReader.Items; if (< > f__am$cache0 == null) {
internal GameRecord(PlatformId platform, Guid recordId, IMetadataCollection metadata) { this.PlatformId = platform; this.RecordId = recordId; this.Metadata = metadata; }
/// <summary> /// Initializes a new instance of the <see cref="Geometry" /> class. /// </summary> /// <param name="precisionModel">The precision model.</param> /// <param name="referenceSystem">The reference system.</param> /// <param name="metadata">The metadata.</param> protected Geometry(PrecisionModel precisionModel, IReferenceSystem referenceSystem, IDictionary <String, Object> metadata) { _factory = new GeometryFactory(precisionModel, referenceSystem); _metadata = _factory.GetFactory <IMetadataFactory>().CreateCollection(metadata); _envelope = null; _boundary = null; }
private UncommittedEvent(Guid aggregateId, IDomainEvent @event, int version, long ticks, IMetadataCollection metadata) { AggregateId = aggregateId; Data = @event; Version = version; Metadata = Metadata.Merge(metadata); _ticks = ticks; }
/// <summary> /// Initializes a new instance of the <see cref="TemporalPosition" /> class. /// </summary> /// <param name="referenceSystem">The reference system.</param> /// <param name="metadata">The metadata.</param> /// <exception cref="System.ArgumentNullException">The reference system is null.</exception> protected TemporalPosition(TemporalReferenceSystem referenceSystem, IMetadataCollection metadata) { if (referenceSystem == null) { throw new ArgumentNullException("referenceSystem", "The reference system is null."); } _referenceSystem = referenceSystem; _metadata = metadata; }
public static List <RecordMetadataModel> AsModel(this IMetadataCollection @this) { return((from metadata in @this.Values select new RecordMetadataModel() { RecordID = metadata.Record, RecordMetadataID = metadata.Guid, MetadataValue = metadata.Value, MetadataKey = metadata.Key }).ToList()); }
/// <summary> /// Writes out the properties of a geometry to TopoJSON file. /// </summary> /// <param name="metadata">The metadata of a geometry.</param> private void WriteProperties(IMetadataCollection metadata) { JsonSerializer serializer = new JsonSerializer(); foreach (KeyValuePair <string, object> k in metadata) { if (k.Key != "OBJECTID") { _jsonwriter.WritePropertyName(k.Key); serializer.Serialize(_jsonwriter, k.Value); } } }
public void WriteDefinition(GenericInstanceType type, IMetadataCollection metadataCollection) { if (GenericsUtilities.CheckForMaximumRecursion(type)) { object[] args = new object[] { MetadataWriter.Naming.ForGenericClass(type) }; base.Writer.WriteLine("Il2CppGenericClass {0} = {{ -1, {{ NULL, NULL }}, NULL }};", args); } else { base.Writer.WriteExternForIl2CppGenericInst(type.GenericArguments); object[] objArray2 = new object[] { MetadataWriter.Naming.ForGenericClass(type), metadataCollection.GetTypeInfoIndex(type.Resolve()), MetadataWriter.Naming.ForGenericInst(type.GenericArguments), MetadataWriter.Naming.Null, MetadataWriter.Naming.Null }; base.WriteLine("Il2CppGenericClass {0} = {{ {1}, {{ &{2}, {3} }}, {4} }};", objArray2); } }
/// <summary> /// Initializes a new instance of the <see cref="MetadataCollection" /> class. /// </summary> /// <param name="source">The <see cref="IMetadataCollection" /> whose elements are copied to the new <see cref="MetadataCollection" />.</param> /// <param name="factory">The factory of the collection.</param> /// <exception cref="System.ArgumentNullException">The factory is null.</exception> /// <exception cref="System.ArgumentException">The specified factory is invalid.</exception> public MetadataCollection(IMetadataCollection source, IMetadataFactory factory) : base(source) { if (factory == null) { throw new ArgumentNullException("factory", "The factory is null."); } if (!(factory is MetadataFactory)) { throw new ArgumentException("The specified factory is invalid.", "factory"); } _factory = factory; }
static int AddMetadataCommentsFromNotes(INoteCollection notes, IMetadataCollection metadata, NoteType requiredNoteType, ImportNotesBehavior importNotes) { if (importNotes == ImportNotesBehavior.Ignore) { return(0); } int count = 0; using (ListPool <Comment> .Get(out var comments)) { metadata.GetMetadatas <Comment>(comments); if (importNotes == ImportNotesBehavior.Replace) { foreach (var com in comments) { metadata.RemoveMetadata(com); } comments.Clear(); } for (int i = 0; i < notes.NoteCount; ++i) { var n = notes.GetNote(i); if (n.AppliesTo != requiredNoteType) { continue; } if (importNotes == ImportNotesBehavior.Merge) { // See if the note already exists if (comments.Any(c => c.CommentText == n.NoteText)) { continue; } } // Add a new note metadata.AddMetadata(new Comment { CommentText = n.NoteText }); count++; } } return(count); }
public uint GetOrCreateIndex(MethodReference method, IMetadataCollection metadataCollection) { if (method == null) { return(0); } if (method.IsGenericInstance || method.DeclaringType.IsGenericInstance) { Il2CppGenericMethodCollectorWrite.Add(method); if (Il2CppGenericMethodCollectorRead.HasIndex(method)) { return(Il2CppGenericMethodCollectorRead.GetIndex(method) | 0xc0000000); } return(0xc0000000); } return((uint)(metadataCollection.GetMethodIndex(method.Resolve()) | 0x60000000)); }
public uint GetOrCreateIndex(MethodReference method, IMetadataCollection metadataCollection) { if (method == null) { return 0; } if (method.IsGenericInstance || method.DeclaringType.IsGenericInstance) { Il2CppGenericMethodCollectorWrite.Add(method); if (Il2CppGenericMethodCollectorRead.HasIndex(method)) { return (Il2CppGenericMethodCollectorRead.GetIndex(method) | 0xc0000000); } return 0xc0000000; } return (uint) (metadataCollection.GetMethodIndex(method.Resolve()) | 0x60000000); }
//#endregion //#region IDisposable Members public void Dispose() { try { this.elementType = null; if (this.metadata != null) { this.metadata.Dispose(); this.metadata = null; } } finally { this.OnDisposed(); this.Disposed = null; GC.SuppressFinalize(this); } }
/// <summary> /// Initializes a new instance of the <see cref="Geometry" /> class. /// </summary> /// <param name="factory">The factory of the geometry.</param> /// <param name="metadata">The metadata.</param> /// <exception cref="System.ArgumentNullException">The factory is null.</exception> /// <exception cref="System.ArgumentException">The specified factory is invalid.</exception> protected Geometry(IGeometryFactory factory, IDictionary <String, Object> metadata) { if (factory == null) { throw new ArgumentNullException("factory", "The factory is null."); } if (!(factory is GeometryFactory)) { throw new ArgumentException("The specified factory is invalid.", "factory"); } _factory = factory; _metadata = _factory.GetFactory <IMetadataFactory>().CreateCollection(metadata); _envelope = null; _boundary = null; }
static void AddNotesFromMetadata(INoteCollection noteCollection, IMetadataCollection metadata, NoteType noteType) { // May be null if the entry is missing for the current row if (metadata == null) { return; } using (ListPool <Comment> .Get(out var comments)) { metadata.GetMetadatas <Comment>(comments); foreach (var com in comments) { var note = noteCollection.AddNewNote(); note.AppliesTo = noteType; note.NoteText = com.CommentText; } } }
/// <summary> /// Gets or sets the metadata value for a specified key. /// </summary> /// <param name="key">The key of the metadata.</param> /// <returns>The metadata value with the <paramref name="key" /> if it exists; otherwise, <c>null</c>.</returns> public Object this[String key] { get { Object value = null; if (_metadata != null) { _metadata.TryGetValue(key, out value); } return(value); } set { if (_metadata == null) { _metadata = _factory.GetFactory <IMetadataFactory>().CreateCollection(); } _metadata[key] = value; } }
//#endregion //#region IDisposable Members public void Dispose() { try { if (this.arrayCache != null) { this.arrayCache.Dispose(); this.arrayCache = null; } if (this.customAttributes != null) { this.customAttributes.Dispose(); this.customAttributes = null; } } finally { this.OnDisposed(); GC.SuppressFinalize(this); } }
/// <summary> /// Converts the specified coordinate list to an existing graph instance. /// </summary> /// <param name="coordinates">The coordinates.</param> /// <param name="metadata">The metadata.</param> /// <param name="graph">The graph.</param> /// <param name="isCircular">Indicates whether the source is circular.</param> /// <param name="isBidirectional">Indicates whether the conversion should be performed bidirectionally.</param> /// <param name="preserveMetadata">Indicates whether the metadata should be preserved.</param> private static void ConvertToGraph(IList <Coordinate> coordinates, IMetadataCollection metadata, IGeometryGraph graph, Boolean isCircular, Boolean isBidirectional, Boolean preserveMetadata) { if (graph == null || coordinates == null || coordinates.Count <= 0) { return; } IGraphVertex source = graph.AddVertex(coordinates[0], preserveMetadata ? metadata : null); IGraphVertex first = source; IGraphVertex target; for (Int32 i = 1; i < coordinates.Count - 1; ++i) { target = graph.AddVertex(coordinates[i], preserveMetadata ? metadata : null); graph.AddEdge(source, target, preserveMetadata ? metadata : null); if (isBidirectional) { graph.AddEdge(target, source, preserveMetadata ? metadata : null); } source = target; } if (isCircular) { graph.AddEdge(source, first, preserveMetadata ? metadata : null); if (isBidirectional) { graph.AddEdge(first, source, preserveMetadata ? metadata : null); } } else { target = graph.AddVertex(coordinates[coordinates.Count - 1], preserveMetadata ? metadata : null); graph.AddEdge(source, target, preserveMetadata ? metadata : null); if (isBidirectional) { graph.AddEdge(target, source, preserveMetadata ? metadata : null); } } }
public IMetadataCollection Merge(IMetadataCollection metadata) { var dict = this.ToDictionary(e => e.Key, e => e.Value); return(new MetadataCollection(metadata.Union(dict))); }
public Searchable(object instance, IMetadataCollection metadataCollection) : base(instance, metadataCollection) { }
public WebSocketChannel(WebSocketSession sock) { this.sock = sock; this.metadata = new SocketMetadata(sock.Cookies); }
/// <summary> /// Initializes a new instance of the <see cref="MetadataCollection" /> class. /// </summary> /// <param name="source">The <see cref="IMetadataCollection" /> whose elements are copied to the new <see cref="MetadataCollection" />.</param> public MetadataCollection(IMetadataCollection source) : this(source, new MetadataFactory()) { }
public TableInfo WriteIl2CppTypeDefinitions(IMetadataCollection metadataCollection) { base.Writer.AddCodeGenIncludes(); IDictionary<Il2CppTypeData, int> items = Il2CppTypeCollectorReader.Items; if (<>f__am$cache0 == null) {
private string WriteGenericInstanceTypeDataValue(GenericInstanceType genericInstanceType, IMetadataCollection metadataCollection) { new GenericClassWriter(base.Writer).WriteDefinition(genericInstanceType, metadataCollection); return ("&" + MetadataWriter.Naming.ForGenericClass(genericInstanceType)); }