Beispiel #1
0
 public Document(T value, string contentHash, string id, MetadataContainer?metadata, GeneratorContext context) : base(id, metadata, contentHash, context)
 {
     this.Value = value;
 }
Beispiel #2
0
 public DocumentLazy(Func <T> valueCallback, string contentHash, string id, MetadataContainer?metadata, GeneratorContext context) : base(id, metadata, contentHash, context)
 {
     this.valueCallback = valueCallback;
 }
Beispiel #3
0
 internal GitFileDocument(string path, Blob blob, GeneratorContext context, MetadataContainer?metadata) : base(path, metadata, blob.Sha, context)
 {
     this.createStreamCallback = () => blob.GetContentStream();
 }
Beispiel #4
0
        protected DocumentBase(string id, MetadataContainer?metadata, string contetnHash, GeneratorContext context)
        {
            this.Id          = id ?? throw new ArgumentNullException(nameof(id));
            this.ContentHash = contetnHash ?? throw new ArgumentNullException(nameof(contetnHash));
            this.Context     = context ?? throw new ArgumentNullException(nameof(context));
            this.Metadata    = metadata ?? this.Context.EmptyMetadata;

            var toHash = $"<{System.Net.WebUtility.HtmlEncode(this.Id)}><{System.Net.WebUtility.HtmlEncode(this.Metadata.Hash)}><{System.Net.WebUtility.HtmlEncode(this.ContentHash)}>";

            this.Hash = this.Context.GetHashForString(toHash);
        }
Beispiel #5
0
 private GitFileDocument(string id, string contentHash, Func <Stream> createStreamCallback, MetadataContainer metadata, GeneratorContext context) : base(id, metadata, contentHash, context)
 {
     this.createStreamCallback = createStreamCallback;
 }