Exemplo n.º 1
0
        public DigitalSendOutputFolderSettings()
        {
            InitializeComponent();

            foreach (var control in new Control[] { UncFolderComboBox, OutputFolderLabel })
            {
                fieldValidator.SetIconAlignment(control, ErrorIconAlignment.MiddleLeft);
            }

            fieldValidator.RequireValue(UncFolderComboBox, "UNC Folder", ValidationCondition.IfEnabled);

            var locations = new List <KeyValuePair <string, DigitalSendOutputLocation> >();

            try
            {
                foreach (string location in ConfigurationServices.EnvironmentConfiguration.GetOutputMonitorDestinations("OutputDirectory"))
                {
                    if (!location.Contains(":"))
                    {
                        var outputLocation = new DigitalSendOutputLocation(location);
                        locations.Add(new KeyValuePair <string, DigitalSendOutputLocation>(outputLocation.ToShortUncPath(), outputLocation));
                    }
                }
            }
            catch (Exception x)
            {
                _blockingErrorMessage = UncPathLookupFailedMessage + " " + x.ToString();
                // Put this validator on the label instead of the combobox to avoid overwriting the validator on the combobox.  User will not be able to fix this issue from this plugin.
                fieldValidator.RequireCustom(OutputFolderLabel, DigitalSendLocationBlockingError);
                fieldValidator.ValidateAll();
            }

            if (locations.Count == 0)
            {
                _blockingErrorMessage = NeedUncPathsForPluginMessage;
                // Put this validator on the label instead of the combobox to avoid overwriting the validator on the combobox.  User will not be able to fix this issue from this plugin.
                fieldValidator.RequireCustom(OutputFolderLabel, DigitalSendLocationBlockingError);
                fieldValidator.ValidateAll();
            }

            UncFolderComboBox.DataSource            = locations;
            UncFolderComboBox.DisplayMember         = "Key";
            UncFolderComboBox.ValueMember           = "Value";
            UncFolderComboBox.SelectedValueChanged += (s, e) => OnConfigurationChanged(s, e);
        }
Exemplo n.º 2
0
 public DigitalSendOutputFolderActivityData()
 {
     OutputFolder = null;
 }