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(); }