/// <summary>
        /// Initializes the configuration UI when a subscription is being added or edited.
        /// </summary>
        /// <param name="isSubscription">will always be <c>true</c> for <see cref="Subscription"/>s</param>
        /// <param name="dli">The <see cref="DestinationListItem"/> that the user selected</param>
        /// <param name="db">The <see cref="DestinationBase"/> of the item if it is being edited;<c>null</c> otherwise</param>
        /// <remarks>
        /// When an instance is being edited (<paramref name="dli"/> != null), make sure to repopulate any
        /// inputs with the current values.
        /// 
        /// By default, the 'Save' button is disabled and you must call <see cref="DestinationSettingsPanel.OnValidChanged"/>
        /// in order to enable it when appropriate.
        /// </remarks>
        public override void Initialize(bool isSubscription, DestinationListItem fdli, DestinationBase db)
        {
            this.doValidation = true;

            // set text box values
            this.textBoxUrl.Text = String.Empty;
            this.textBoxUrl.Enabled = true;
            this.textBoxName.Text = String.Empty;
            this.textBoxName.Enabled = true;

            this.comboBoxPoll.DataSource = PollInterval.GetList();
            this.comboBoxPoll.DisplayMember = "Display";
            this.comboBoxPoll.ValueMember = "Value";

            this.textBoxUsername.Text = String.Empty;
            this.textBoxUsername.Enabled = true;
            this.textBoxPassword.Text = String.Empty;
            this.textBoxPassword.Enabled = true;

            FeedSubscription fs = db as FeedSubscription;
            if (fs != null)
            {
                this.textBoxUrl.Text = fs.FeedUrl;
                this.textBoxName.Text = fs.Description;
                this.comboBoxPoll.SelectedValue = fs.PollInterval;
                this.textBoxUsername.Text = fs.Username;
                this.textBoxPassword.Text = fs.Password;
            }
            ValidateInputs();

            this.textBoxName.Focus();
        }
        /// <summary>
        /// Initializes the configuration UI when a webhook is being added or edited.
        /// </summary>
        /// <param name="isSubscription">will always be <c>false</c> for <see cref="ForwardDestination"/>s</param>
        /// <param name="dli">The <see cref="DestinationListItem"/> that the user selected</param>
        /// <param name="db">The <see cref="DestinationBase"/> of the item if it is being edited;<c>null</c> otherwise</param>
        public override void Initialize(bool isSubscription, DestinationListItem dli, DestinationBase db)
        {
            // set text box values
            this.textBoxName.Text = String.Empty;
            this.textBoxName.Enabled = true;
            this.textBoxUrl.Text = String.Empty;
            this.textBoxUrl.Enabled = true;
            this.textBox1.Text = String.Empty;
            this.textBox1.Enabled = true;

            WebhookDestination whd = db as WebhookDestination;
            if (whd != null)
            {
                this.textBoxName.Text = whd.Description;
                this.textBoxUrl.Text = whd.API;
                this.comboBox1.SelectedIndex = whd.Selected;
                this.comboBox2.SelectedIndex = whd.Sound;
                this.checkBox1.Checked = whd.Idle;
                this.textBox1.Text = whd.Device;
            }

            ValidateInputs();

            this.textBoxName.Focus();
        }
Exemplo n.º 3
0
        public override void Initialize(bool isSubscription, DestinationListItem fdli, DestinationBase fd)
        {
            this.doValidation = true;

            PrefPriority[] priorityChoices = PrefPriority.GetList(false);
            this.comboBoxMinimumPriority.Items.Add(Properties.Resources.AddProwl_AnyPriority);
            for (int i = 0; i < priorityChoices.Length; i++)
            {
                this.comboBoxMinimumPriority.Items.Add(priorityChoices[i]);
            }
            this.comboBoxMinimumPriority.SelectedIndex = 0;

            // set text box values
            this.textBoxDescription.Text = String.Empty;
            this.textBoxDescription.Enabled = true;
            this.textBoxAPIKey.Text = String.Empty;
            this.textBoxAPIKey.Enabled = true;
            this.comboBoxMinimumPriority.SelectedIndex = 0;
            this.comboBoxMinimumPriority.Enabled = true;

            ProwlForwardDestination pfd = fd as ProwlForwardDestination;
            if (pfd != null)
            {
                this.textBoxDescription.Text = pfd.Description;
                this.textBoxAPIKey.Text = pfd.APIKey;
                if (pfd.MinimumPriority != null && pfd.MinimumPriority.HasValue)
                    this.comboBoxMinimumPriority.SelectedItem = PrefPriority.GetByValue(pfd.MinimumPriority.Value);
                this.checkBoxOnlyWhenIdle.Checked = pfd.OnlyWhenIdle;
            }

            ValidateInputs();

            this.textBoxDescription.Focus();
        }
 public override void Initialize(bool isSubscription, DestinationListItem fdli, DestinationBase db)
 {
     FolderWatchSubscription sub = db as FolderWatchSubscription;
     if (sub != null)
     {
         this.textBoxPath.Text = sub.Path;
         this.checkBoxSubdirectories.Checked = sub.IncludeSubfolders;
     }
 }
        public override void Initialize(bool isSubscription, DestinationListItem fdli, DestinationBase fd)
        {
            this.doValidation = true;

            this.comboBoxMinimumPriority.Items.Add(new PriorityChoice(null));
            Array priorities = Enum.GetValues(typeof(Growl.Connector.Priority));
            Array.Sort(priorities, new PrioritySortComparer());
            foreach(Growl.Connector.Priority priority in priorities)
            {
                this.comboBoxMinimumPriority.Items.Add(new PriorityChoice(priority));
            }
            this.comboBoxQuietDays.Items.Add(ToastyForwardDestination.QuietHoursDayChoice.Everyday);
            this.comboBoxQuietDays.Items.Add(ToastyForwardDestination.QuietHoursDayChoice.Weekdays);
            this.comboBoxQuietDays.Items.Add(ToastyForwardDestination.QuietHoursDayChoice.Weekends);

            // set initial values
            this.textBoxDescription.Text = String.Empty;
            this.textBoxDescription.Enabled = true;
            this.textBoxDeviceID.Text = String.Empty;
            this.textBoxDeviceID.Enabled = true;
            this.comboBoxMinimumPriority.SelectedIndex = 0;
            this.comboBoxMinimumPriority.Enabled = true;
            this.comboBoxQuietDays.SelectedIndex = 0;

            ToastyForwardDestination tfd = fd as ToastyForwardDestination;
            if (tfd != null)
            {
                this.textBoxDescription.Text = tfd.Description;
                this.textBoxDeviceID.Text = tfd.DeviceID;
                if (tfd.MinimumPriority != null && tfd.MinimumPriority.HasValue)
                {
                    foreach (object item in this.comboBoxMinimumPriority.Items)
                    {
                        PriorityChoice pc = (PriorityChoice)item;
                        if(pc.Priority == tfd.MinimumPriority)
                        this.comboBoxMinimumPriority.SelectedItem = item;
                    }
                }
                this.checkBoxOnlyWhenIdle.Checked = tfd.OnlyWhenIdle;
                this.checkBoxQuietHours.Checked = tfd.EnableQuietHours;
                this.comboBoxQuietDays.SelectedItem = tfd.QuietHoursDaysChoice;
                this.dateTimePickerStart.Value = tfd.QuietHoursStart;
                this.dateTimePickerEnd.Value = tfd.QuietHoursEnd;
            }

            ValidateInputs();

            this.textBoxDescription.Focus();
        }
Exemplo n.º 6
0
        /// <summary>
        /// Initializes the configuration UI when a webhook is being added or edited.
        /// </summary>
        /// <param name="isSubscription">will always be <c>false</c> for <see cref="ForwardDestination"/>s</param>
        /// <param name="dli">The <see cref="DestinationListItem"/> that the user selected</param>
        /// <param name="db">The <see cref="DestinationBase"/> of the item if it is being edited;<c>null</c> otherwise</param>
        /// <remarks>
        /// When an instance is being edited (<paramref name="dli"/> != null), make sure to repopulate any
        /// inputs with the current values.
        /// 
        /// By default, the 'Save' button is disabled and you must call <see cref="DestinationSettingsPanel.OnValidChanged"/>
        /// in order to enable it when appropriate.
        /// </remarks>
        public override void Initialize(bool isSubscription, DestinationListItem dli, DestinationBase db)
        {
            // set text box values
            this.textBoxName.Text = String.Empty;
            this.textBoxName.Enabled = true;
            this.textBoxApi.Text = String.Empty;
            this.textBoxApi.Enabled = true;

            NotifoDestination whd = db as NotifoDestination;
            if (whd != null)
            {
                this.textBoxName.Text = whd.Username;
                this.textBoxApi.Text = whd.Apikey;
            }

            ValidateInputs();

            this.textBoxName.Focus();
        }
        public override void Initialize(bool isSubscription, DestinationListItem fdli, DestinationBase fd)
        {
            this.doValidation = true;

            // set text box values
            this.textBoxDescription.Text = String.Empty;
            this.textBoxDescription.Enabled = true;
            this.textBoxOutletUrl.Text = String.Empty;
            this.textBoxOutletUrl.Enabled = true;

            NotifyIOSubscription nios = fd as NotifyIOSubscription;
            if (nios != null)
            {
                this.textBoxDescription.Text = nios.Description;
                this.textBoxOutletUrl.Text = nios.OutletUrl;
            }

            ValidateInputs();

            this.textBoxDescription.Focus();
        }
Exemplo n.º 8
0
        public override void Initialize(bool isSubscription, DestinationListItem fdli, DestinationBase fd)
        {
            this.doValidation = true;

            this.panelSMTPSettings.Visible = false;

            PrefPriority[] priorityChoices = PrefPriority.GetList(false);
            this.comboBoxMinimumPriority.Items.Add(Properties.Resources.AddProwl_AnyPriority);
            for (int i = 0; i < priorityChoices.Length; i++)
            {
                this.comboBoxMinimumPriority.Items.Add(priorityChoices[i]);
            }
            this.comboBoxMinimumPriority.SelectedIndex = 0;

            // set text box values
            this.textBoxDescription.Text = String.Empty;
            this.textBoxDescription.Enabled = true;
            this.textBoxUsername.Text = String.Empty;
            this.textBoxUsername.Enabled = true;
            this.comboBoxMinimumPriority.SelectedIndex = 0;
            this.comboBoxMinimumPriority.Enabled = true;

            EmailForwardDestination efd = fd as EmailForwardDestination;
            if (efd != null)
            {
                this.textBoxDescription.Text = efd.Description;
                this.textBoxUsername.Text = efd.To;
                if (efd.MinimumPriority != null && efd.MinimumPriority.HasValue)
                    this.comboBoxMinimumPriority.SelectedItem = PrefPriority.GetByValue(efd.MinimumPriority.Value);
                this.checkBoxOnlyWhenIdle.Checked = efd.OnlyWhenIdle;
                this.smtp = efd.SMTPConfiguration;
            }
            this.labelSMTPValues.Text = String.Format("{0}", this.smtp.Host);

            ValidateInputs();

            this.textBoxDescription.Focus();
        }
        public override void Initialize(bool isSubscription, DestinationListItem fdli, DestinationBase fd)
        {
            this.doValidation = true;

            PrefPriority[] priorityChoices = PrefPriority.GetList(false);
            this.comboBoxMinimumPriority.Items.Add(Properties.Resources.AddProwl_AnyPriority);
            for (int i = 0; i < priorityChoices.Length; i++)
            {
                this.comboBoxMinimumPriority.Items.Add(priorityChoices[i]);
            }
            this.comboBoxMinimumPriority.SelectedIndex = 0;

            // set text box values
            this.textBoxUsername.Text = String.Empty;
            this.textBoxUsername.Enabled = true;
            this.textBoxPassword.Text = String.Empty;
            this.textBoxPassword.Enabled = true;
            this.textBoxFormat.Text = TwitterForwardDestination.DefaultFormat;
            this.textBoxFormat.Enabled = true;
            this.comboBoxMinimumPriority.SelectedIndex = 0;
            this.comboBoxMinimumPriority.Enabled = true;

            TwitterForwardDestination tfd = fd as TwitterForwardDestination;
            if(tfd != null)
            {
                this.textBoxUsername.Text = tfd.Username;
                this.textBoxPassword.Text = tfd.Password;
                this.textBoxFormat.Text = tfd.Format;
                this.checkBoxOnlyWhenIdle.Checked = tfd.OnlyWhenIdle;
                if (tfd.MinimumPriority != null && tfd.MinimumPriority.HasValue)
                    this.comboBoxMinimumPriority.SelectedItem = PrefPriority.GetByValue(tfd.MinimumPriority.Value);
            }

            ValidateInputs();

            this.textBoxUsername.Focus();
        }
        public override void Initialize(bool isSubscription, DestinationListItem fdli, DestinationBase fd)
        {
            this.doValidation = true;
            this.isSubscription = isSubscription;

            this.comboBoxFormat.Items.Add(Properties.Resources.Protocol_Type_GNTP);
            this.comboBoxFormat.Items.Add(Properties.Resources.Protocol_Type_UDP);

            // set text box values
            BonjourListItem bli = fdli as BonjourListItem;
            if (bli != null)
            {
                this.isBonjour = true;
                DetectedService ds = bli.DetectedService;
                this.selectedService = ds;

                string host = ds.Hostname;
                int port = ds.Service.Port;

                this.textBoxDescription.Text = ds.Service.Name;
                this.textBoxDescription.Enabled = false;
                this.textBoxAddress.Text = host;
                this.textBoxAddress.Enabled = false;
                this.textBoxPort.Text = port.ToString();
                this.textBoxPort.Enabled = false;
                this.comboBoxFormat.SelectedIndex = 0;
                this.comboBoxFormat.Enabled = false;
                this.textBoxPassword.Focus();
            }
            else
            {
                this.textBoxDescription.Text = String.Empty;
                this.textBoxDescription.Enabled = true;
                this.textBoxAddress.Text = String.Empty;
                this.textBoxAddress.Enabled = true;
                this.textBoxPort.Text = Growl.Connector.GrowlConnector.TCP_PORT.ToString();
                this.textBoxPort.Enabled = true;
                this.comboBoxFormat.SelectedIndex = 0;
                this.comboBoxFormat.Enabled = true;
                this.textBoxDescription.Focus();
            }

            // edits
            if (fd != null)
            {
                this.textBoxDescription.Text = fd.Description;
                this.comboBoxFormat.Enabled = false;
                GNTPSubscription subscription = fd as GNTPSubscription;
                if (subscription != null)
                {
                    this.textBoxAddress.Text = subscription.IPAddress;
                    this.textBoxPort.Text = subscription.Port.ToString();
                    this.textBoxPassword.Text = subscription.Password;
                    this.comboBoxFormat.SelectedItem = Properties.Resources.Protocol_Type_GNTP;
                    this.comboBoxFormat.Visible = false;
                }
                GNTPForwardDestination gntp = fd as GNTPForwardDestination;
                if (gntp != null)
                {
                    this.textBoxAddress.Text = gntp.IPAddress;
                    this.textBoxPort.Text = gntp.Port.ToString();
                    this.textBoxPassword.Text = gntp.Password;
                    this.comboBoxFormat.SelectedItem = Properties.Resources.Protocol_Type_GNTP;
                }
                BonjourForwardDestination bonjour = fd as BonjourForwardDestination;
                if (bonjour != null)
                {
                    this.textBoxAddress.Text = bonjour.IPAddress;
                    this.textBoxPort.Text = bonjour.Port.ToString();
                    this.textBoxPassword.Text = bonjour.Password;
                    this.comboBoxFormat.SelectedItem = Properties.Resources.Protocol_Type_GNTP;
                    this.textBoxDescription.Enabled = false;
                    this.textBoxAddress.Enabled = false;
                    this.textBoxPort.Enabled = false;
                    this.textBoxPassword.Focus();
                }
                UDPForwardDestination udp = fd as UDPForwardDestination;
                if (udp != null)
                {
                    this.textBoxAddress.Text = udp.IPAddress;
                    this.textBoxPort.Text = udp.Port.ToString();
                    this.textBoxPassword.Text = udp.Password;
                    this.comboBoxFormat.SelectedItem = Properties.Resources.Protocol_Type_UDP;
                }
            }

            if (isSubscription)
            {
                this.labelFormat.Visible = false;
                this.comboBoxFormat.Visible = false;
            }

            ValidateInputs();
        }
Exemplo n.º 11
0
 public DestinationSettingsPanel GetSettingsPanel(DestinationListItem dbli)
 {
     return new PhonyBalloonySettings();
 }
Exemplo n.º 12
0
        /// <summary>
        /// Initializes the configuration UI when a webhook is being added or edited.
        /// </summary>
        /// <param name="isSubscription">will always be <c>false</c> for <see cref="ForwardDestination"/>s</param>
        /// <param name="dli">The <see cref="DestinationListItem"/> that the user selected</param>
        /// <param name="db">The <see cref="DestinationBase"/> of the item if it is being edited;<c>null</c> otherwise</param>
        /// <remarks>
        /// When an instance is being edited (<paramref name="dli"/> != null), make sure to repopulate any
        /// inputs with the current values.
        /// 
        /// By default, the 'Save' button is disabled and you must call <see cref="DestinationSettingsPanel.OnValidChanged"/>
        /// in order to enable it when appropriate.
        /// </remarks>
        public override void Initialize(bool isSubscription, DestinationListItem dli, DestinationBase db)
        {
            // set text box values
            this.textBoxName.Text = String.Empty;
            this.textBoxName.Enabled = true;
            this.textBoxUrl.Text = String.Empty;
            this.textBoxUrl.Enabled = true;

            WebhookDestination whd = db as WebhookDestination;
            if (whd != null)
            {
                this.textBoxName.Text = whd.Description;
                this.textBoxUrl.Text = whd.Url;
            }

            ValidateInputs();

            this.textBoxName.Focus();
        }
 /// <summary>
 /// Gets the settings panel associated with this forwarder.
 /// </summary>
 /// <param name="dbli">The <see cref="DestinationListItem"/> as selected by the user</param>
 /// <returns><see cref="DestinationSettingsPanel"/></returns>
 /// <remarks>
 /// This is called when a user is adding a new forwarding destination.
 /// </remarks>
 public DestinationSettingsPanel GetSettingsPanel(DestinationListItem dbli)
 {
     return new WebhookInputs();
 }
 /// <summary>
 /// Initializes the settings UI panel.
 /// </summary>
 /// <param name="isSubscription"><c>true</c> if the destination is a <see cref="Subscription"/>;<c>false</c> if the destination is a <see cref="ForwardDestination"/></param>
 /// <param name="fdli">The <see cref="DestinationListItem"/> selected by the user.</param>
 /// <param name="db">The <see cref="DestinationBase"/> being edited if editing an existing instance;<c>null</c> otherwise</param>
 public virtual void Initialize(bool isSubscription, DestinationListItem fdli, DestinationBase db)
 {
     throw new NotImplementedException("DestinationSettingsPanel.Initialize() not implemented");
 }
 /// <summary>
 /// Gets the settings panel associated with this subscriber.
 /// </summary>
 /// <param name="dbli">The <see cref="DestinationListItem"/> as selected by the user</param>
 /// <returns><see cref="DestinationSettingsPanel"/></returns>
 /// <remarks>
 /// This is called when a user is adding a new subscription.
 /// </remarks>
 public DestinationSettingsPanel GetSettingsPanel(DestinationListItem fdli)
 {
     return new FeedSubscriptionSettings();
 }
        /// <summary>

        /// Initializes the settings UI panel.

        /// </summary>

        /// <param name="isSubscription"><c>true</c> if the destination is a <see cref="Subscription"/>;<c>false</c> if the destination is a <see cref="ForwardDestination"/></param>

        /// <param name="fdli">The <see cref="DestinationListItem"/> selected by the user.</param>

        /// <param name="db">The <see cref="DestinationBase"/> being edited if editing an existing instance;<c>null</c> otherwise</param>

        public virtual void Initialize(bool isSubscription, DestinationListItem fdli, DestinationBase db)

        {
            throw new NotImplementedException("DestinationSettingsPanel.Initialize() not implemented");
        }
Exemplo n.º 17
0
 public void AddItem(DestinationListItem item)
 {
     this.Items.Add(item);
 }
 public override void Initialize( bool isSubscription, DestinationListItem dli, DestinationBase db )
 {
 }
 /// <summary>
 /// Initializes the configuration UI when a subscription is being added or edited.
 /// </summary>
 /// <param name="isSubscription">will always be <c>true</c> for <see cref="Subscription"/>s</param>
 /// <param name="dli">The <see cref="DestinationListItem"/> that the user selected</param>
 /// <param name="db">The <see cref="DestinationBase"/> of the item if it is being edited;<c>null</c> otherwise</param>
 /// <remarks>
 /// When an instance is being edited (<paramref name="dli"/> != null), make sure to repopulate any
 /// inputs with the current values.
 /// 
 /// By default, the 'Save' button is disabled and you must call <see cref="DestinationSettingsPanel.OnValidChanged"/>
 /// in order to enable it when appropriate.
 /// </remarks>
 public override void Initialize(bool isSubscription, DestinationListItem fdli, DestinationBase db)
 {
     OnValidChanged(true);
 }
Exemplo n.º 20
0
 /// <summary>
 /// Gets the settings panel associated with this forwarder.
 /// </summary>
 /// <param name="dbli">The <see cref="DestinationListItem"/> as selected by the user</param>
 /// <returns><see cref="DestinationSettingsPanel"/></returns>
 /// <remarks>
 /// This is called when a user is adding a new forwarding destination.
 /// </remarks>
 public DestinationSettingsPanel GetSettingsPanel(DestinationListItem dbli)
 {
     return new NotifoInputs();
 }
Exemplo n.º 21
0
 public DestinationSettingsPanel GetSettingsPanel(DestinationListItem dbli)
 {
     return new FolderWatchSettings();
 }