/// <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();
        }
Exemplo n.º 2
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();
        }
        /// <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();
        }
 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 Update(DestinationBase db)
 {
     FolderWatchSubscription sub = db as FolderWatchSubscription;
     if (sub != null)
     {
         sub.Path = this.textBoxPath.Text;
         sub.IncludeSubfolders = this.checkBoxSubdirectories.Checked;
         sub.Subscribe();
     }
 }
 public override void Update(DestinationBase fd)
 {
     NotifyIOSubscription nios = fd as NotifyIOSubscription;
     if (nios != null)
     {
         nios.Description = this.textBoxDescription.Text;
         nios.OutletUrl = this.textBoxOutletUrl.Text;
         nios.Subscribe();
     }
 }
 public override void Update(DestinationBase fd)
 {
     TwitterForwardDestination tfd = fd as TwitterForwardDestination;
     if (tfd != null)
     {
         tfd.Username = this.textBoxUsername.Text;
         tfd.Password = this.textBoxPassword.Text;
         tfd.Format = this.textBoxFormat.Text;
         tfd.OnlyWhenIdle = this.checkBoxOnlyWhenIdle.Checked;
         PrefPriority prefPriority = this.comboBoxMinimumPriority.SelectedItem as PrefPriority;
         tfd.MinimumPriority = (prefPriority != null ? prefPriority.Priority : null);
     }
 }
        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.º 9
0
        public override void Update(DestinationBase fd)
        {
            ProwlForwardDestination pfd = fd as ProwlForwardDestination;
            if (pfd != null)
            {
                pfd.Description = this.textBoxDescription.Text;
                pfd.APIKey = this.textBoxAPIKey.Text;
                pfd.OnlyWhenIdle = this.checkBoxOnlyWhenIdle.Checked;

                PrefPriority prefPriority = this.comboBoxMinimumPriority.SelectedItem as PrefPriority;
                pfd.MinimumPriority = (prefPriority != null ? prefPriority.Priority : null);

                SendConfirmation(pfd);
            }
        }
Exemplo n.º 10
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.º 12
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();
        }
Exemplo n.º 14
0
 /// <summary>
 /// Updates the specified webhook instance.
 /// </summary>
 /// <param name="db">The <see cref="WebhookDestination"/> to update</param>
 /// <remarks>
 /// This is called when a user is editing an existing webhook and clicks the 'Save' button.
 /// </remarks>
 public override void Update(DestinationBase db)
 {
     WebhookDestination whd = db as WebhookDestination;
     whd.Description = this.textBoxName.Text;
     whd.Url = this.textBoxUrl.Text;
 }
Exemplo n.º 15
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="db">The <see cref="DestinationBase"/> of an exiting forwarder</param>
 /// <returns><see cref="DestinationSettingsPanel"/></returns>
 /// <remarks>
 /// This is called when a user is editing an existing forwarder.
 /// </remarks>
 public DestinationSettingsPanel GetSettingsPanel(DestinationBase db)
 {
     return new WebhookInputs();
 }
Exemplo n.º 17
0
 /// <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>
 /// Updates the specified destination instance.
 /// </summary>
 /// <param name="db">The <see cref="DestinationBase"/> to update</param>
 public virtual void Update(DestinationBase db)
 {
     throw new NotImplementedException("DestinationSettingsPanel.Update() not implemented");
 }
 /// <summary>
 /// Gets the settings panel associated with this subscriber.
 /// </summary>
 /// <param name="db">The <see cref="DestinationBase"/> of an exiting subscription</param>
 /// <returns><see cref="DestinationSettingsPanel"/></returns>
 /// <remarks>
 /// This is called when a user is editing an existing subscription.
 /// </remarks>
 public DestinationSettingsPanel GetSettingsPanel(DestinationBase fd)
 {
     return new FeedSubscriptionSettings();
 }
Exemplo n.º 20
0
 /// <summary>
 /// Updates the specified webhook instance.
 /// </summary>
 /// <param name="db">The <see cref="WebhookDestination"/> to update</param>
 /// <remarks>
 /// This is called when a user is editing an existing webhook and clicks the 'Save' button.
 /// </remarks>
 public override void Update(DestinationBase db)
 {
     NotifoDestination whd = db as NotifoDestination;
     whd.Username = this.textBoxName.Text;
     whd.Apikey = this.textBoxApi.Text;
 }
Exemplo n.º 21
0
 /// <summary>
 /// Updates the specified destination instance.
 /// </summary>
 /// <param name="db">The <see cref="DestinationBase"/> to update</param>
 public virtual void Update(DestinationBase db)
 {
     throw new NotImplementedException("DestinationSettingsPanel.Update() not implemented");
 }
 /// <summary>
 /// Updates the specified subscription instance.
 /// </summary>
 /// <param name="db">The <see cref="FeedSubscription"/> to update</param>
 /// <remarks>
 /// This is called when a user is editing an existing subscription and clicks the 'Save' button.
 /// </remarks>
 public override void Update(DestinationBase db)
 {
     FeedSubscription fs = db as FeedSubscription;
     if (fs != null)
     {
         fs.UpdateConfiguration(this.textBoxName.Text, this.textBoxUrl.Text, Convert.ToInt32(this.comboBoxPoll.SelectedValue), this.textBoxUsername.Text, this.textBoxPassword.Text);
     }
 }
Exemplo n.º 23
0
 /// <summary>
 /// Gets the settings panel associated with this forwarder.
 /// </summary>
 /// <param name="db">The <see cref="DestinationBase"/> of an exiting forwarder</param>
 /// <returns><see cref="DestinationSettingsPanel"/></returns>
 /// <remarks>
 /// This is called when a user is editing an existing forwarder.
 /// </remarks>
 public DestinationSettingsPanel GetSettingsPanel(DestinationBase db)
 {
     return new NotifoInputs();
 }
Exemplo n.º 24
0
 public DestinationSettingsPanel GetSettingsPanel(DestinationBase db)
 {
     return new FolderWatchSettings();
 }
 public override void Initialize( bool isSubscription, DestinationListItem dli, DestinationBase db )
 {
 }
Exemplo n.º 26
0
 public override void Update(DestinationBase fd)
 {
     EmailForwardDestination efd = fd as EmailForwardDestination;
     if (efd != null)
     {
         efd.Description = this.textBoxDescription.Text;
         efd.To = this.textBoxUsername.Text;
         efd.OnlyWhenIdle = this.checkBoxOnlyWhenIdle.Checked;
         PrefPriority prefPriority = this.comboBoxMinimumPriority.SelectedItem as PrefPriority;
         efd.MinimumPriority = (prefPriority != null ? prefPriority.Priority : null);
         efd.SMTPConfiguration = this.smtp;
     }
 }
 /// <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");
 }
 public override void Update( DestinationBase db )
 {
     NotificationCenterDestination whd = db as NotificationCenterDestination;
     whd.Description = this.textBoxName.Text;
 }
Exemplo n.º 29
0
 public DestinationSettingsPanel GetSettingsPanel(DestinationBase db)
 {
     return new PhonyBalloonySettings();
 }
 /// <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.º 31
0
        public override void Update(DestinationBase fd)
        {
            ToastyForwardDestination tfd = fd as ToastyForwardDestination;
            if (tfd != null)
            {
                tfd.Description = this.textBoxDescription.Text;
                tfd.DeviceID = this.textBoxDeviceID.Text;
                tfd.OnlyWhenIdle = this.checkBoxOnlyWhenIdle.Checked;
                tfd.EnableQuietHours = this.checkBoxQuietHours.Checked;
                tfd.QuietHoursStart = this.dateTimePickerStart.Value;
                tfd.QuietHoursEnd = this.dateTimePickerEnd.Value;
                tfd.QuietHoursDaysChoice = (ToastyForwardDestination.QuietHoursDayChoice)this.comboBoxQuietDays.SelectedItem;

                PriorityChoice pc = (PriorityChoice)this.comboBoxMinimumPriority.SelectedItem;
                Growl.Connector.Priority? priority = pc.Priority;
                tfd.MinimumPriority = priority;

                SendConfirmation(tfd);
            }
        }
 /// <summary>
 /// Updates the specified subscription instance.
 /// </summary>
 /// <param name="db">The <see cref="FeedSubscription"/> to update</param>
 /// <remarks>
 /// This is called when a user is editing an existing subscription and clicks the 'Save' button.
 /// </remarks>
 public override void Update(DestinationBase db)
 {
     // do nothing
 }