/// <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(); }
private void BonjourListBox_MouseClick(object sender, MouseEventArgs e) { /* we cant use any of the this.Selected* properites because we are using the MultiSimple selection mode * * instead, we have to determine which item was clicked on directly * * */ int i = 0; if (e.Y > 0) { i = e.Y / this.ItemHeight; i += this.TopIndex; if (this.Items.Count > i) { DestinationListItem fli = (DestinationListItem)this.Items[i]; fli.Select(); } } }
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(); }
/// <summary> /// Initializes the configuration UI when a forwarder 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 serverText.Text = ""; serverText.Enabled = true; XbmcDestination xbmc = db as XbmcDestination; if (xbmc != null) { serverText.Text = xbmc.Server; } ValidateInputs(); serverText.Focus(); }
void BonjourListBox_DrawItem(object sender, DrawItemEventArgs e) { if (e.Index < 0) { return; } if (this.Items != null && this.Items.Count > 0) { object obj = this.Items[e.Index]; // handle background if ((e.State & DrawItemState.Selected) != 0) { e.Graphics.FillRectangle(Brushes.LightGray, e.Bounds); //ControlPaint.DrawFocusRectangle(e.Graphics, e.Bounds); } else { e.DrawBackground(); } string text = obj.ToString(); int newX = e.Bounds.X; DestinationListItem item = obj as DestinationListItem; if (item != null) { if (item.Image != null) { e.Graphics.DrawImage(item.Image, e.Bounds.X + 1, e.Bounds.Y + 1, IMAGE_SIZE, IMAGE_SIZE); } newX = e.Bounds.Left + IMAGE_SIZE + this.Margin.Right; text = Utility.GetResourceString(item.Text); } // handle text Rectangle rect = new Rectangle(newX, e.Bounds.Y, e.Bounds.Right - newX, e.Bounds.Height); TextFormatFlags flags = TextFormatFlags.EndEllipsis | TextFormatFlags.NoClipping | TextFormatFlags.VerticalCenter; TextRenderer.DrawText(e.Graphics, text, e.Font, rect, this.foreColor, flags); } }
/// <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(); }
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; // 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(); }
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 Growl.Destinations.DestinationSettingsPanel GetSettingsPanel(DestinationListItem fdli) { return new Growl.UI.ForwardDestinationInputs(); }
private void ShowInputs(DestinationListItem dli) { ShowInputs(dli, dli.Handler); }
private void ShowInputs(DestinationListItem dli, IDestinationHandler handler) { this.panelBonjour.Visible = false; this.panelDetails.Visible = true; DestinationSettingsPanel panel = handler.GetSettingsPanel(this.dbEdit); this.settingsPanel = panel; panel.ValidChanged += new DestinationSettingsPanel.ValidChangedEventHandler(panel_ValidChanged); this.panelDetails.Controls.Add(panel); panel.Visible = true; panel.Initialize(this.isSubscription, dli, this.dbEdit); this.buttonSave.Visible = true; }
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(); }
public DestinationSettingsPanel GetSettingsPanel(DestinationListItem dbli) { return(new PhonyBalloonySettings()); }
public void AddItem(DestinationListItem item) { this.Items.Add(item); }
public DestinationSettingsPanel GetSettingsPanel(DestinationListItem dbli) { return new Growl.UI.ToastyForwardInputs(); }
/// <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()); }
public DestinationSettingsPanel GetSettingsPanel(DestinationListItem dbli) { return(new FolderWatchSettings()); }
public Growl.Destinations.DestinationSettingsPanel GetSettingsPanel(DestinationListItem fdli) { return new Growl.UI.NotifyIOSubscriptionInputs(); }
/// <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 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); }
public virtual void Initialize(bool isSubscription, DestinationListItem fdli, DestinationBase db) { throw new NotImplementedException(); }
ValidChanged(isValid); } } }