private void next_Click(object sender, System.EventArgs e) { if (currentIndex == (maxPages - 1)) { Cursor.Current = Cursors.WaitCursor; try { switch (subscription.SubscriptionState) { case SubscriptionStates.Received: subscription.Accept(store, acceptDeclinePage.Accept ? SubscriptionDispositions.Accepted : SubscriptionDispositions.Declined); if (poBox == null) { poBox = POBox.GetPOBox(store, subscription.DomainID); } break; case SubscriptionStates.Ready: subscription.CreateSlave(store); break; } poBox.Commit(subscription); } catch (SimiasException ex) { ex.LogFatal(); MessageBox.Show("An exception occurred while accepting the iFolder invitation. Please view the log file for additional information.", "Fatal Error", MessageBoxButtons.OK, MessageBoxIcon.Stop); } catch (Exception ex) { logger.Fatal(ex, "Accepting invitation"); MessageBox.Show("An exception occurred while accepting the iFolder invitation. Please view the log file for additional information.", "Fatal Error", MessageBoxButtons.OK, MessageBoxIcon.Stop); } Cursor.Current = Cursors.Default; Application.Exit(); return; } int nextIndex = this.pages[currentIndex].ValidatePage(currentIndex); if (nextIndex != currentIndex) { this.pages[currentIndex].DeactivatePage(); this.pages[nextIndex].ActivatePage(currentIndex); currentIndex = nextIndex; if (currentIndex == (maxPages - 1)) { this.next.Text = "Finish"; } } }
public string GetFormattedLine() { System.Text.StringBuilder sb = new System.Text.StringBuilder(); sb.Append("ADR;"); if (IsDomestic || IsHome || IsParcel || IsPostal || IsPrefered || IsWork) { sb.Append("TYPE="); } if (IsDomestic) { sb.Append("dom,"); } if (IsHome) { sb.Append("home,"); } if (IsParcel) { sb.Append("parcel,"); } if (IsPostal) { sb.Append("postal,"); } if (IsPrefered) { sb.Append("pref,"); } if (IsWork) { sb.Append("work,"); } sb.Remove(sb.Length - 1, 1); sb.Append(":"); if (POBox != -1) { sb.Append(POBox.ToString() + ";"); } else { sb.Append(";"); } if (ExtendedAddress != null) { sb.Append(Parser.Escape(ExtendedAddress) + ";"); } else { sb.Append(";"); } if (StreetAddress != null) { sb.Append(Parser.Escape(StreetAddress) + ";"); } else { sb.Append(";"); } if (Locality != null) { sb.Append(Parser.Escape(Locality) + ";"); } else { sb.Append(";"); } if (Region != null) { sb.Append(Parser.Escape(Region) + ";"); } else { sb.Append(";"); } if (PostalCode != null) { sb.Append(Parser.Escape(PostalCode) + ";"); } else { sb.Append(";"); } if (Country != null) { sb.Append(Parser.Escape(Country) + ";"); } else { sb.Append(";"); } sb.Remove(sb.Length - 1, 1); return(sb.ToString()); }
private void InvitationWizard_Load(object sender, System.EventArgs e) { store = Store.GetStore(); if (subscriptionMode) { poBox = POBox.GetPOBox(store, domainID); Node node = poBox.GetNodeByID(subscriptionID); subscription = new Subscription(node); } else if (this.invitationFile != "") { try { subscription = Subscription.GetSubscriptionFromSubscriptionInfo(store, invitationFile); if (store.GetCollectionByID(subscription.SubscriptionCollectionID) != null) { MessageBox.Show("The collection for the selected subscription already exists.", "Shared Collection Exists"); subscription = null; invitationFile = ""; } } catch (SimiasException ex) { ex.LogError(); MessageBox.Show("An invalid Collection Subscription Information file was specified on the command-line. Please see the log file for additional information.\n\n" + this.invitationFile, "Invalid File", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); invitationFile = ""; } catch (Exception ex) { logger.Debug(ex, "Invalid file"); MessageBox.Show("An invalid Collection Subscription Information file was specified on the command-line. Please see the log file for additional information.\n\n" + this.invitationFile, "Invalid File", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); invitationFile = ""; } } }