Example #1
0
    public DetailsForm(SetupForm parent, int ID)
    {
      this.ID = ID;
      //this.form = form;
      isNew = false;
      //
      // The InitializeComponent() call is required for Windows Forms designer support.
      //
      InitializeComponent();

      if (ID > -1)
      {
        LoadSettings();
        isNew = false;
      }
      else //find the next ID that is blank
      {
        string tempText;
        for (int i = 0; i < 20; i++)
        {
          using (Settings xmlreader = new MPSettings())
          {
            tempText = xmlreader.GetValueAsString("rss", "siteName" + i, "");
            if (tempText == "")
            {
              this.ID = i;
              i = 20;
              isNew = true;
            }
          }
        }
        if (this.ID == -1)
        {
          Console.WriteLine("No more open slots!");
        }
        //TODO: Need message box popup here if no more slots left
      }


      //
      // TODO: Add constructor code after the InitializeComponent() call.
      //
    }