示例#1
0
        /// <summary>
        /// Creates an empty mail merge message.
        /// </summary>
        public MailMergeMessage()
        {
            IgnoreEmptyRecipientAddr    = true;
            DeliveryNotificationOptions = DeliveryNotificationOptions.None;
            Priority               = MailPriority.Normal;
            Xmailer                = null;
            Headers                = new NameValueCollection();
            StringAttachments      = new List <StringAttachment>();
            FileAttachments        = new List <FileAttachment>();
            StreamAttachments      = new List <StreamAttachment>();
            BinaryTransferEncoding = TransferEncoding.Base64;
            TextTransferEncoding   = TransferEncoding.SevenBit;
            CharacterEncoding      = Encoding.Default;

            _textVariableManager = new TextVariableManager
            {
                CultureInfo = CultureInfo,
                ShowNullAs  = string.Empty,
                ShowEmptyAs = string.Empty
            };

            _textVariableManager.GetBindingSource().CurrentChanged     += RaiseDataChangedEvent;
            _textVariableManager.GetBindingSource().CurrentItemChanged += RaiseDataChangedEvent;
            _textVariableManager.GetBindingSource().PositionChanged    += RaiseDataChangedEvent;
            _textVariableManager.GetBindingSource().ListChanged        += RaiseDataChangedEvent;

            MailMergeMessage msg = this;

            MailMergeAddresses = new MailMergeAddressCollection(ref msg);

            FileBaseDir = Environment.CurrentDirectory;
        }
示例#2
0
 /// <summary>
 /// Returns the BindingSource object used internally.
 /// </summary>
 /// <returns>Returns the BindingSource object used internally.</returns>
 public BindingSource GetBindingSource()
 {
     return(_textVariableManager.GetBindingSource());
 }