Exemplo n.º 1
0
        void ScanCommonInfoFiles()
        {
            var i = 0;

            _projects.ForEach(p =>
            {
                var commonInfoFile = p.GetCommonAssemblyInfoFilePath();
                if (commonInfoFile == null)
                {
                    i++;
                    return;
                }
                if (_fileToLink == null)
                {
                    _fileToLink = commonInfoFile;
                    _commonInfo = AssemblyInfoUtil.ReadCommonAssemblyInfo(_fileToLink);
                    BindCommonInfo();
                }
                if (_fileToLink == commonInfoFile)
                {
                    projectGrid.Rows[i].Cells[0].Value = true;
                }
                i++;
            });
        }
Exemplo n.º 2
0
        private void btnLink_Click(object sender, EventArgs e)
        {
            openAssemblyInfoFileDialog.DefaultExt       = DefaultExt;
            openAssemblyInfoFileDialog.InitialDirectory = _fileToLink != null?Path.GetDirectoryName(_fileToLink) : Path.GetDirectoryName(Host.Instance.DTE.Solution.FileName);

            if (openAssemblyInfoFileDialog.ShowDialog() != DialogResult.OK)
            {
                return;
            }
            _commonInfo = AssemblyInfoUtil.ReadCommonAssemblyInfo(openAssemblyInfoFileDialog.FileName);
            _fileToLink = openAssemblyInfoFileDialog.FileName;
            BindCommonInfo();
        }
Exemplo n.º 3
0
        private void btnNewOrChange_Click(object sender, EventArgs e)
        {
            saveAssemblyInfoFileDialog.DefaultExt       = DefaultExt;
            saveAssemblyInfoFileDialog.InitialDirectory = Path.GetDirectoryName(Host.Instance.DTE.Solution.FileName);
            saveAssemblyInfoFileDialog.FileName         = _fileToLink ?? typeof(CommonAssemblyInfo).Name;
            if (saveAssemblyInfoFileDialog.ShowDialog() != DialogResult.OK)
            {
                return;
            }
            var info = _projectOriginalInfos[0];

            _commonInfo = new CommonAssemblyInfo
            {
                Company   = info.Company,
                Copyright = info.Copyright,
                Product   = info.Product,
                Trademark = info.Trademark
            };
            _commonInfo.Save(saveAssemblyInfoFileDialog.FileName);
            _fileToLink = saveAssemblyInfoFileDialog.FileName;
            BindCommonInfo();
        }