Beispiel #1
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="apidc">API data contract</param>
 public ServerListConnector(APIDataContract apidc)
 {
     name = apidc.Name;
     if (!(Enum.TryParse(apidc.Type, out serverListType)))
     {
         serverListType = EServerListType.Error;
     }
     endpoint = apidc.Endpoint;
 }
Beispiel #2
0
 /// <summary>
 /// Default constructor
 /// </summary>
 /// <param name="api"></param>
 public APIForm(APIDataContract api)
 {
     InitializeComponent();
     Translator.LoadTranslation(this);
     Translator.EnumToComboBox(apiTypeComboBox, new EServerListType[] { EServerListType.Error });
     if (api != null)
     {
         Text = Translator.GetTranslation("EDIT_API_TITLE");
         apiNameSingleLineTextField.Text = api.Name;
         EServerListType type;
         if (!Enum.TryParse(api.Type, out type))
         {
             type = EServerListType.Favourites;
         }
         apiTypeComboBox.SelectedIndex       = (int)type;
         apiEndpointSingleLineTextField.Text = api.Endpoint;
     }
 }