Esempio n. 1
0
        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;
        }
Esempio 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;
        }
Esempio 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);
        }
        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;
        }
 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)
 {
 }