public Stream OpenPropertyStream(Guid propertyGuid, int namedId, TnefPropertyType propertyType)
        {
            this.CheckDisposed("MsgStorageWriter::OpenPropertyStream(3)");
            MsgStorageRulesTable.ThrowOnInvalidPropertyType(propertyType);
            this.CheckFailure();
            TnefNameId      namedProperty = new TnefNameId(propertyGuid, namedId);
            TnefPropertyId  id            = this.NamedPropertyList.Add(namedProperty);
            TnefPropertyTag propertyTag   = new TnefPropertyTag(id, propertyType);

            return(this.CurrentWriter.OpenPropertyStream(propertyTag));
        }
        public void WriteProperty(Guid propertyGuid, int namedId, TnefPropertyType propertyType, object propertyValue)
        {
            this.CheckDisposed("MsgStorageWriter::WriteProperty(3)");
            MsgStorageRulesTable.ThrowOnInvalidPropertyType(propertyType);
            Util.ThrowOnNullArgument(propertyValue, "propertyValue");
            this.CheckFailure();
            TnefNameId      namedProperty = new TnefNameId(propertyGuid, namedId);
            TnefPropertyId  id            = this.NamedPropertyList.Add(namedProperty);
            TnefPropertyTag propertyTag   = new TnefPropertyTag(id, propertyType);

            this.CurrentWriter.WriteProperty(propertyTag, propertyValue);
        }
 public void WriteProperty(TnefPropertyTag propertyTag, object propertyValue)
 {
     this.CheckDisposed("MsgStorageWriter::WriteProperty(1)");
     if (propertyTag.IsNamed)
     {
         throw new ArgumentException(MsgStorageStrings.InvalidPropertyTag(propertyTag), "propertyTag");
     }
     MsgStorageRulesTable.ThrowOnInvalidPropertyType(propertyTag);
     Util.ThrowOnNullArgument(propertyValue, "propertyValue");
     this.CheckFailure();
     this.CurrentWriter.WriteProperty(propertyTag, propertyValue);
 }
 public Stream OpenPropertyStream(TnefPropertyTag propertyTag)
 {
     this.CheckDisposed("MsgStorageWriter::OpenPropertyStream(1)");
     if (propertyTag.IsNamed)
     {
         throw new ArgumentException(MsgStorageStrings.InvalidPropertyTag(propertyTag), "propertyTag");
     }
     MsgStorageRulesTable.ThrowOnInvalidPropertyType(propertyTag);
     this.CheckFailure();
     if (propertyTag == TnefPropertyTag.AttachDataObj)
     {
         return(this.CurrentWriter.OpenOleAttachmentStream());
     }
     return(this.CurrentWriter.OpenPropertyStream(propertyTag));
 }
 internal static void ThrowOnInvalidPropertyType(TnefPropertyTag tag)
 {
     MsgStorageRulesTable.ThrowOnInvalidPropertyType(tag.TnefType);
 }