コード例 #1
0
        public void LoadAssemblies(bool refreshcache)
        {
            DataSet assemblyInfo = DynProvider.GetAssemblyInfo();

            DynProvider.MergeGAC(assemblyInfo, refreshcache, this.progress);
            if (refreshcache)
            {
                foreach (DataRow row in assemblyInfo.Tables[0].Select("IsGAC = 0"))
                {
                    DynProvider.MergeLocal(assemblyInfo, row["Path"].ToString(), this.progress);
                }
            }
            this.progress.Message = string.Empty;
            this.progress.Notify();
            DataView view = new DataView(assemblyInfo.Tables[0]);

            view.RowFilter = "HasProvider = 1";
            this.assemblyDataGridView.AutoGenerateColumns = false;
            this.assemblyDataGridView.DataSource          = view;
            DataGridViewCheckBoxColumn dataGridViewColumn = new DataGridViewCheckBoxColumn();

            dataGridViewColumn.DataPropertyName = "Load";
            dataGridViewColumn.HeaderText       = "Load";
            DataGridViewTextBoxColumn column2 = new DataGridViewTextBoxColumn();

            column2.DataPropertyName = "Name";
            column2.HeaderText       = "Name";
            column2.AutoSizeMode     = DataGridViewAutoSizeColumnMode.Fill;
            column2.ReadOnly         = false;
            this.assemblyDataGridView.AdvancedCellBorderStyle.All = DataGridViewAdvancedCellBorderStyle.None;
            this.assemblyDataGridView.Columns.Clear();
            this.assemblyDataGridView.Columns.Add(dataGridViewColumn);
            this.assemblyDataGridView.Columns.Add(column2);
            this.assemblyDataGridView.AllowUserToResizeRows = false;
        }
コード例 #2
0
 private void buttonOk_Click(object sender, EventArgs e)
 {
     try
     {
         if (((DataView)this.assemblyDataGridView.DataSource).Table.DataSet.HasChanges())
         {
             DynProvider.SaveAssemblyInfo(((DataView)this.assemblyDataGridView.DataSource).Table.DataSet);
         }
         base.DialogResult = DialogResult.OK;
         base.Close();
     }
     catch (Exception exception)
     {
         new ExceptionDialog(exception, "Error Generating CodeDom").ShowDialog();
     }
 }
コード例 #3
0
 private void LoadCodeDomAssemblies()
 {
     foreach (DataRow row in DynProvider.GetAssemblyInfo().Tables[0].Rows)
     {
         bool flag = (bool)row["Load"];
         if (((bool)row["HasProvider"]) && flag)
         {
             string path = (string)row["Path"];
             if ((bool)row["IsGAC"])
             {
                 Assembly.LoadWithPartialName(Path.GetFileNameWithoutExtension(path));
             }
             else
             {
                 Assembly.LoadFile(path);
             }
         }
     }
 }
コード例 #4
0
 private void toolStripButtonAssembly_Click(object sender, EventArgs e)
 {
     try
     {
         FileDialog dialog = new OpenFileDialog();
         dialog.DefaultExt = ".dll";
         dialog.Title      = "Open CodeDomProvider DLL";
         dialog.SupportMultiDottedExtensions = true;
         dialog.Filter = "CodeDomProvider DLL (*.dll)|*.dll|All files (*.*)|*.*";
         if (dialog.ShowDialog() == DialogResult.OK)
         {
             foreach (string str in dialog.FileNames)
             {
                 DynProvider.MergeLocal(((DataView)this.assemblyDataGridView.DataSource).Table.DataSet, str, null);
             }
         }
     }
     catch (Exception exception)
     {
         new ExceptionDialog(exception, "Error Generating CodeDom").ShowDialog();
     }
 }