/// <summary> 
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (_passwordControl != null)
            {
                _passwordControl.Dispose();
                _passwordControl = null;
            }

            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }
        private void InitializeControl(PropertyChangedEventHandler propertyChanged)
        {
            _expanderToolTip = Utils.CreateToolTip(new List<Control>() {pbExpander}, Constants.ViewAdvancedSettings);
            _actionToolTip = Utils.CreateToolTip(new List<Control>() { cbPerformAction, pnlHeader, pbImage, lblTitle }, Constants.CompressesAllFiles);

            Padding = new Padding(0, 1, 0, 0);

            _passwordControl = new PasswordControl(propertyChanged, PropertyNames.ZipPassword);
            _passwordControl.Dock = DockStyle.Top;

            cbPerformAction.CheckedChanged += (sender, args) =>
                                                  {
                                                      _passwordControl.EnableControls(cbPerformAction.Checked);
                                                      RaisePropertyChanged(PropertyNames.ZipAttachments,
                                                                           cbPerformAction.Checked);
                                                  };

          
            this.pnlContent.Controls.Add(_passwordControl);
        }
        private void InitializeControl(PropertyChangedEventHandler propertyChanged)
        {
            _passwordControl = new PasswordControl(propertyChanged, PropertyNames.PdfPassword);
            _passwordControl.Dock = DockStyle.Bottom;
            _passwordControl.Visible = true;

            rbPdfA.Checked = PolicyBridge.IsEnabled("PDFA");

            if (rbPdfA.Checked)
                SetSubControlsVisible(!rbPdfA.Checked);

            _expanderToolTip = Utils.CreateToolTip(new List<Control>() {pbExpander}, Constants.ViewAdvancedSettings);
            _actionToolTip = Utils.CreateToolTip(new List<Control>() { cbPerformAction, pnlHeader, pbImage, lblTitle }, Constants.ConvertsToPdf);

            Padding = new Padding(0, 1, 0, 0);

            pnlAttachments.Controls.Add(_passwordControl);

            cbAllowPrinting.CheckedChanged += (sender, args) =>
                                                RaisePropertyChanged(PropertyNames.PdfAllowPrinting,
                                                                     cbAllowPrinting.Checked);
            cbAllowEditing.CheckedChanged += (sender, args) =>
                                               RaisePropertyChanged(PropertyNames.PdfAllowEditing,
                                                                    cbAllowEditing.Checked);
            cbAllowCopy.CheckedChanged += (sender, args) =>
                                            RaisePropertyChanged(PropertyNames.PdfAllowCopying, cbAllowCopy.Checked);
            cbAllowComments.CheckedChanged += (sender, args) =>
                                                RaisePropertyChanged(PropertyNames.PdfAllowComments,
                                                                     cbAllowComments.Checked);

            cbSelectAll.CheckedChanged += (sender, args) =>
                                              {
                                                  if (cbAllowPrinting.Enabled)
                                                    cbAllowPrinting.Checked = cbSelectAll.Checked;

                                                  if (cbAllowEditing.Enabled)
                                                    cbAllowEditing.Checked = cbSelectAll.Checked;

                                                  if (cbAllowCopy.Enabled)
                                                    cbAllowCopy.Checked = cbSelectAll.Checked;

                                                  if (cbAllowComments.Enabled)
                                                    cbAllowComments.Checked = cbSelectAll.Checked;
                                              };

            cbPerformAction.CheckedChanged += OnPerformActionCheckChanged;

            rbPdf.CheckedChanged +=
                (sender, args) => RaiseRadioButtonChanged(rbPdf.Checked, PropertyNames.PdfFormat, PropertyValues.Pdf);
            rbPdfA.CheckedChanged +=
                (sender, args) =>
                    {
                        EnableSubControls(!rbPdfA.Checked);
                        ApplyConfigurationOptions();
                        SetSubControlsVisible(!rbPdfA.Checked);
                        RaiseRadioButtonChanged(rbPdfA.Checked, PropertyNames.PdfFormat, PropertyValues.PdfA);
                    };

            //cbPerformAction.Checked = OptionApi.GetBool("ExternalConvertToPdfOnEmail");

            rbPdfA.Enabled = IsUserAllowedToOverrideSettings();
            rbPdf.Enabled = IsUserAllowedToOverrideSettings();
        }