Exemplo n.º 1
0
        public static void GetProjecttKeys(DTE2 app)
        {
            List <Project> pros = GetAllProjects(app);

            if (pros != null && pros.Count > 0)
            {
                for (int i = 0; i < pros.Count; i++)
                {
                    List <string> keyValueStrList = new List <string>();
                    keyValueStrList.Add("ProjectName:  " + pros[i].Name);
                    foreach (Property pro in pros[i].Properties)
                    {
                        try
                        {
                            string proName = pro.Name;
                            string value   = pro.Value.ToString();
                            keyValueStrList.Add(proName + ":     " + value);
                        }
                        catch
                        {
                        }
                    }
                    SaveText2Notepad.SaveContext(keyValueStrList, true);
                }
            }
        }
Exemplo n.º 2
0
 private void dataGridView1_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e)
 {
     if (e.ColumnIndex == 1 || e.ColumnIndex == 2 || e.ColumnIndex == 3)
     {
         object obj = this.dataGridView1[e.ColumnIndex, e.RowIndex].Value;
         if (obj != null)
         {
             string value = obj.ToString();
             if (string.IsNullOrEmpty(value) == false)
             {
                 SaveText2Notepad.SaveContext(value, true);
             }
         }
     }
 }
Exemplo n.º 3
0
        private void btnOK_Click(object sender, EventArgs e)
        {
            if (this.combSolutionPlatform.SelectedItem == null)
            {
                MsgBox.ShowTip("请选择解决方案配置");
                return;
            }
            string dllRootDir = this.txtLibRootDir.Text.Trim();

            if (string.IsNullOrEmpty(dllRootDir) || Directory.Exists(dllRootDir) == false)
            {
                MsgBox.ShowTip("请选择Lib根目录");
                return;
            }
            List <string> msgList = new List <string>();

            for (int i = 0; i < this.dataGridView1.Rows.Count; i++)
            {
                bool isSel = (bool)this.dataGridView1[0, i].Value;
                if (isSel == false)
                {
                    continue;
                }
                string        srcPath   = this.dataGridView1[2, i].Tag as string;
                List <string> destPaths = this.dataGridView1[3, i].Tag as List <string>;
                if (string.IsNullOrEmpty(srcPath) == false && File.Exists(srcPath) && destPaths != null && destPaths.Count > 0)
                {
                    for (int j = 0; j < destPaths.Count; j++)
                    {
                        string msg = string.Format("从 {0}  拷贝到  {1}  ", this.dataGridView1[2, i].Value.ToString(), destPaths[j].Substring(dllRootDir.Length));
                        try
                        {
                            File.Copy(srcPath, destPaths[j], true);
                            msg += "成功";
                        }
                        catch (Exception ex)
                        {
                            msg += "失败!,具体信息:" + ex.Message;
                        }
                        msgList.Add(msg);
                    }
                }
            }
            SaveText2Notepad.SaveContext(msgList, true);
        }
Exemplo n.º 4
0
        public static void GetConfigrationKeys(DTE2 app)
        {
            List <Project> pros = GetAllProjects(app);

            if (pros != null && pros.Count > 0)
            {
                for (int i = 0; i < pros.Count; i++)
                {
                    Configuration config          = pros[i].ConfigurationManager.ActiveConfiguration;
                    List <string> keyValueStrList = new List <string>();
                    keyValueStrList.Add("ConfigurationName:  " + config.ConfigurationName);
                    foreach (Property pro in config.Properties)
                    {
                        string proName = pro.Name;
                        string value   = pro.Value.ToString();
                        keyValueStrList.Add(proName + ":     " + value);
                    }
                    SaveText2Notepad.SaveContext(keyValueStrList, true);
                }
            }
        }