コード例 #1
0
        private void BindlistView()
        {
            DataSet ds = addin.GetAddInList();

            if (ds != null)
            {
                if (ds.Tables.Count > 0)
                {
                    DataTable dt = ds.Tables[0];
                    if (dt != null)
                    {
                        listView1.Items.Clear();
                        foreach (DataRow row in dt.Rows)
                        {
                            string Name       = row["Name"].ToString();
                            string Decription = row["Decription"].ToString();
                            string Assembly   = row["Assembly"].ToString();
                            string Classname  = row["Classname"].ToString();
                            string Version    = row["Version"].ToString();
                            string Guid       = row["Guid"].ToString();

                            ListViewItem item1 = new ListViewItem(Guid, 0);
                            //item1.ImageIndex = 4;
                            item1.SubItems.Add(Name);
                            item1.SubItems.Add(Version);
                            item1.SubItems.Add(Decription);
                            item1.SubItems.Add(Assembly);
                            //item1.SubItems.Add(Guid);

                            listView1.Items.AddRange(new ListViewItem[] { item1 });
                        }
                    }
                }
            }
        }
コード例 #2
0
 private void BindListbox()
 {
     try
     {
         AddIn addin = new AddIn();
         dsAddin = addin.GetAddInList();
         this.listBox1.Items.Clear();
         if (dsAddin != null)
         {
             if (dsAddin.Tables[0].Rows.Count > 0)
             {
                 foreach (DataRow dr in dsAddin.Tables[0].Rows)
                 {
                     string guid = dr["Guid"].ToString();
                     string name = dr["Name"].ToString();
                     string ver  = dr["Version"].ToString();
                     listBox1.Items.Add(name + "  " + ver + " " + guid);
                 }
             }
         }
     }
     catch (SystemException ex)
     {
         string err = ex.Message;
     }
 }
コード例 #3
0
        public DALTypeAddIn(string InterfaceName)
        {
            InitializeComponent();

            #region 加载插件
            AddIn   addin   = new AddIn();
            DataSet dsAddin = addin.GetAddInList(InterfaceName);
            if (dsAddin != null)
            {
                int c = dsAddin.Tables[0].Rows.Count;
                if (c > 0)
                {
                    cmbox_DALType.DataSource    = dsAddin.Tables[0].DefaultView;
                    cmbox_DALType.ValueMember   = "Guid";
                    cmbox_DALType.DisplayMember = "Name";
                }
                if (c == 1)
                {
                    _guid = dsAddin.Tables[0].Rows[0]["Guid"].ToString();
                    _name = dsAddin.Tables[0].Rows[0]["Name"].ToString();
                }
            }
            #endregion
        }