private Package(IPackageMetadata metadata, ZipArchive archive, IInstructionCollection instructions) { this.Metadata = metadata; this.Instructions = instructions; this.archive = archive; }
public static async Task <IEnumerable <T> > Find <T>(this IDocumentCollection <T> self, IWorkContext context, IInstructionCollection instruction) { Verify.IsNotNull(nameof(self), self); Verify.IsNotNull(nameof(instruction), instruction); IInstructionCollection and = instruction as And; IInstructionCollection or = instruction as Or; IInstructionCollection andOr = and ?? or; if (andOr != null) { return(await self.Find(context, andOr.ToDocument())); } OrderBy orderBy = instruction.OfType <OrderBy>().SingleOrDefault(); Projection projection = instruction.OfType <Projection>().SingleOrDefault(); FindOptions <T, T> options = new FindOptions <T, T> { Sort = orderBy?.ToDocument(), Projection = projection?.ToDocument(), }; Query query = instruction.OfType <Query>().FirstOrDefault(); return(await self.Find(context, query?.ToDocument() ?? new BsonDocument(), options)); }
public static Package OpenPackage(IPackageMetadata metadata, ZipArchive archive) { ZipArchiveEntry installationInstructionsEntry = archive.Entries.First((archiveEntry) => { return(archiveEntry.FullName == "Installation.xml"); }); using (Stream installationInstructionsStream = installationInstructionsEntry.Open()) { using (XmlReader installationInstructionsReader = XmlReader.Create(installationInstructionsStream)) { IInstructionCollection instructionCollection = InstructionCollection.LoadFromXml(installationInstructionsReader); return(new Package(metadata, archive, instructionCollection)); } } }
public static int GetMethodBodySize(IMethodDeclaration value) { int size = 0; IMethodBody methodBody = value.Body as IMethodBody; if (methodBody != null) { IInstructionCollection instructions = methodBody.Instructions; if (instructions.Count != 0) { IInstruction lastInstruction = instructions[instructions.Count - 1]; size = size + lastInstruction.Offset + Helper.GetInstructionSize(lastInstruction); } } return(size); }
public static bool Compare(this IInstructionCollection source, IInstructionCollection n, Func<IInstruction, IInstruction, Action<string, string>, bool> checkitem, Action<string, string> errAct) { return Compare<IInstruction>(source,n,checkitem,errAct); }
public static bool Compare(this IInstructionCollection source, IInstructionCollection n, Func<IInstruction, IInstruction, bool> checkitem) { return Compare<IInstruction>(source,n,checkitem); }
public static bool Compare(this IInstructionCollection source, IInstructionCollection n) { return Compare<IInstruction>(source,n); }
public static bool Compare(this IInstructionCollection source, IInstructionCollection n, Func <IInstruction, IInstruction, Action <string, string>, bool> checkitem, Action <string, string> errAct) { return(Compare <IInstruction>(source, n, checkitem, errAct)); }
public static bool Compare(this IInstructionCollection source, IInstructionCollection n, Func <IInstruction, IInstruction, bool> checkitem) { return(Compare <IInstruction>(source, n, checkitem)); }
public static bool Compare(this IInstructionCollection source, IInstructionCollection n) { return(Compare <IInstruction>(source, n)); }
public virtual IInstructionCollection TransformInstructionCollection(IInstructionCollection value) { IInstruction[] array = new IInstruction[value.Count]; for (int i = 0; i < value.Count; i++) { array[i] = this.TransformInstruction(value[i]); } IInstructionCollection target = new InstructionCollection(); target.AddRange(array); return target; }
private void InsituTransformInstructionCollection(IInstructionCollection value) { for (int i = 0; i < value.Count; i++) { value[i] = this.TransformInstruction(value[i]); } }