コード例 #1
0
ファイル: Form2.cs プロジェクト: nberglund/ssbadmin
 private void Form2_Closing(object sender, FormClosingEventArgs e)
 {
     string dbName = null;
       if (Processed != null) {
     if (dBase != null)
       dbName = dBase.Name;
     SsbEventsArgs evts = new SsbEventsArgs(dbServ.Name, dbName, ssbType, _state, updatedobj);
     Processed(this, evts);
       }
 }
コード例 #2
0
ファイル: Form2.cs プロジェクト: nberglund/ssbadmin
        void f2_Processed(object sender, SsbEventsArgs e)
        {
            if (e.state == SsbState.New && e.ssbType != SsbEnum.User) {
            switch (ssbType) {
              case SsbEnum.Contract :
            MessageType mt = (MessageType)e.updated;
            lbMsgTypes.Items.Add(mt.Name);
            dvMsgTypes.Rows.Add(new object[] { mt.Name });
            break;

              case SsbEnum.Service :
            if (e.ssbType == SsbEnum.Queu) {
              ServiceQueue sq = (ServiceQueue)e.updated;
              cboQueue.Items.Add(sq);
              cboQueue.SelectedItem = sq;

            }
            else if (e.ssbType == SsbEnum.Contract) {
              ServiceContract sc = (ServiceContract)e.updated;
              lbCtr.Items.Add(sc);
              lbChosenCtr.Items.Add(sc);
            }

            break;

              case SsbEnum.User :
            if (e.ssbType == SsbEnum.Login) {
              usr_cboLogin.Items.Add(((Login)e.updated).Name);
              usr_cboLogin.Text = ((Login)e.updated).Name;

            }

            if (e.ssbType == SsbEnum.Certificate) {
              usr_cboCerts.Items.Add(((Certificate)e.updated).Name);
              usr_cboCerts.Text = ((Certificate)e.updated).Name;

            }

            break;
              case SsbEnum.EndPoint :
            if (e.ssbType == SsbEnum.Certificate) {
              ep_cboCert.Items.Add(((Certificate)e.updated).Name);
              ep_cboCert.Text = ((Certificate)e.updated).Name;

            }

            break;

            }

              }

            else if (e.state == SsbState.New && e.ssbType == SsbEnum.User) {
              cboUser.Items.Add((User)e.updated);
              cboUser.SelectedItem = (User)e.updated;
            }
        }