internal VersionedBulkField(BulkItem item, Guid id, string language, int version, string value,
                                    Func <Stream> blob = null, bool isBlob = false, string name = null)
            : base(item, id, language, value, blob, isBlob, name)
        {
            if (version <= 0)
            {
                throw new ArgumentException("Version should be greater than 0.", "version");
            }

            Version = version;
        }
Exemplo n.º 2
0
        internal UnversionedBulkField(BulkItem item, Guid id, string language, string value,
                                      Func <Stream> blob = null, bool isBlob = false, string name = null)
            : base(item, id, value, blob, isBlob, name)
        {
            if (language == null)
            {
                throw new ArgumentNullException("language");
            }

            this.Language = language;
        }
Exemplo n.º 3
0
        protected BulkItem(BulkItem toCopy)
        {
            if (toCopy == null)
            {
                throw new ArgumentNullException(nameof(toCopy));
            }

            this.Id         = toCopy.Id;
            this.TemplateId = toCopy.TemplateId;
            this.MasterId   = toCopy.MasterId;
            this.ParentId   = toCopy.ParentId;
            this.ItemPath   = toCopy.ItemPath;

            _fields = toCopy._fields.ToDictionary(x => x.Key, x => x.Value);
        }
Exemplo n.º 4
0
        protected BulkField(BulkItem item, Guid id, string value, Func <Stream> blob = null, bool isBlob = false, string name = null)
        {
            if (id == Guid.Empty)
            {
                throw new ArgumentException("Id of field should not be an empty Guid.", nameof(id));
            }
            if (blob != null && !isBlob)
            {
                throw new ArgumentException("You cannot provide a blob for a non-blob field.");
            }

            this.Item   = item;
            this.Id     = id;
            this.Name   = name;
            this.Value  = value;
            this.Blob   = blob;
            this.IsBlob = isBlob;
        }
Exemplo n.º 5
0
 internal SharedBulkField(BulkItem item, Guid id, string value,
                          Func <Stream> blob = null, bool isBlob = false, string name = null)
     : base(item, id, value, blob, isBlob, name)
 {
 }