public Locator(int structureType, StructureDescriptor descriptor, params string[] path) { StructureType = structureType; this.descriptor = descriptor; Path = path; PersistKey = SentinelPersistKey.Instance; }
private static ILocator Create(int structType, KeyDescriptor keyDescriptor, RecordDescriptor recordDescriptor, params string[] path) { if (!STSdb4.Database.StructureType.IsValid(structType)) { throw new ArgumentException("Invalid structType"); } StructureDescriptor descriptor = new StructureDescriptor(keyDescriptor, recordDescriptor); descriptor.Encode(); return(new Locator(structType, descriptor, path)); }
public static Locator Deserialize(BinaryReader reader) { //StructureType int structureType = reader.ReadByte(); if (structureType == Locator.MIN.StructureType) { return(Locator.MIN); } //descriptor var descriptor = StructureDescriptor.Deserialize(reader); //Items string[] items = new string[CountCompression.Deserialize(reader)]; for (int i = 0; i < items.Length; i++) { items[i] = reader.ReadString(); } return(new Locator(structureType, descriptor, items)); }