diff --git a/Compiler/Compiler.cs b/Compiler/Compiler.cs index 8a01dc373..e595f8e5a 100644 --- a/Compiler/Compiler.cs +++ b/Compiler/Compiler.cs @@ -1923,13 +1923,18 @@ namespace PascalABCCompiler { cdo.Title = cds[0].directive; } + if (compilerDirectives.TryGetValue(TreeConverter.compiler_string_consts.description_string, out cds)) + { + cdo.Description = cds[0].directive; + } if (compilerDirectives.TryGetValue(TreeConverter.compiler_string_consts.main_resource_string, out cds)) { if (compilerDirectives.ContainsKey(TreeConverter.compiler_string_consts.product_string) || compilerDirectives.ContainsKey(TreeConverter.compiler_string_consts.version_string) || compilerDirectives.ContainsKey(TreeConverter.compiler_string_consts.company_string) || compilerDirectives.ContainsKey(TreeConverter.compiler_string_consts.trademark_string) || - compilerDirectives.ContainsKey(TreeConverter.compiler_string_consts.title_string)) + compilerDirectives.ContainsKey(TreeConverter.compiler_string_consts.title_string) || + compilerDirectives.ContainsKey(TreeConverter.compiler_string_consts.description_string)) { ErrorsList.Add(new MainResourceNotAllowed(cds[0].location)); } @@ -1985,6 +1990,8 @@ namespace PascalABCCompiler cdo.Copyright = project.copyright; if (!string.IsNullOrEmpty(project.title)) cdo.Title = project.title; + if (!string.IsNullOrEmpty(project.description)) + cdo.Description = project.description; if (!string.IsNullOrEmpty(project.app_icon) && false) { //cdo.MainResourceFileName = project.app_icon; @@ -2009,7 +2016,7 @@ namespace PascalABCCompiler sw.WriteLine("VALUE \"ProductName\"," + "\"" + cdo.Product + "\""); sw.WriteLine("VALUE \"FileVersion\"," + "\"" + ver + "\""); sw.WriteLine("VALUE \"ProductVersion\"," + "\"" + ver + "\""); - sw.WriteLine("VALUE \"FileDescription\"," + "\"" + "" + "\""); + sw.WriteLine("VALUE \"FileDescription\"," + "\"" + cdo.Description + "\""); sw.WriteLine("VALUE \"OriginalFileName\"," + "\"" + Path.GetFileName(CompilerOptions.OutputFileName) + "\""); sw.WriteLine("VALUE \"InternalName\"," + "\"" + Path.GetFileNameWithoutExtension(CompilerOptions.OutputFileName) + "\""); sw.WriteLine("VALUE \"CompanyName\"," + "\"" + cdo.Company + "\""); diff --git a/Compiler/IProjectInfo.cs b/Compiler/IProjectInfo.cs index 4ac261067..e4a4032eb 100644 --- a/Compiler/IProjectInfo.cs +++ b/Compiler/IProjectInfo.cs @@ -107,6 +107,12 @@ namespace PascalABCCompiler set; } + string Description + { + get; + set; + } + string CommandLineArguments { get; diff --git a/Compiler/ProjectInfo.cs b/Compiler/ProjectInfo.cs index 9c3697211..ece2de27d 100644 --- a/Compiler/ProjectInfo.cs +++ b/Compiler/ProjectInfo.cs @@ -30,7 +30,8 @@ namespace PascalABCCompiler private string _trademark; private string _copyright; private string _title; - private PascalABCCompiler.ProjectType _project_type; + private string _description; + private PascalABCCompiler.ProjectType _project_type; private List _source_files = new List(); private List _references = new List(); private List _resources = new List(); @@ -203,6 +204,18 @@ namespace PascalABCCompiler } } + public string description + { + get + { + return _description; + } + set + { + _description = value; + } + } + public string path { get @@ -481,6 +494,7 @@ namespace PascalABCCompiler writer.WriteAttributeString("Trademark", trademark); writer.WriteAttributeString("Copyright", copyright); writer.WriteAttributeString("Title", title); + writer.WriteAttributeString("Description", description); writer.WriteAttributeString("MajorVersion", Convert.ToString(major_version)); writer.WriteAttributeString("MinorVersion", Convert.ToString(minor_version)); writer.WriteAttributeString("BuildVersion", Convert.ToString(build_version)); @@ -547,7 +561,7 @@ namespace PascalABCCompiler trademark = reader.GetAttribute("Trademark"); copyright = reader.GetAttribute("Copyright"); title = reader.GetAttribute("Title"); - if (title == null) title = ""; //Проверка на null, так как раньше этого атрибута не было + description = reader.GetAttribute("Description"); major_version = Convert.ToInt32(reader.GetAttribute("MajorVersion")); minor_version = Convert.ToInt32(reader.GetAttribute("MinorVersion")); build_version = Convert.ToInt32(reader.GetAttribute("BuildVersion")); @@ -759,6 +773,18 @@ namespace PascalABCCompiler _title = value; } } + + public string Description + { + get + { + return _description; + } + set + { + _description = value; + } + } } public class SourceCodeFileInfo : PascalABCCompiler.IFileInfo diff --git a/NETGenerator/NETGenerator.cs b/NETGenerator/NETGenerator.cs index 6c067ad4a..8b62dd6b4 100644 --- a/NETGenerator/NETGenerator.cs +++ b/NETGenerator/NETGenerator.cs @@ -93,6 +93,13 @@ namespace PascalABCCompiler.NETGenerator get { return _Title; } set { _Title = value; NeedDefineVersionInfo = true; } } + private string _Description = ""; + + public string Description + { + get { return _Description; } + set { _Description = value; NeedDefineVersionInfo = true; } + } public string MainResourceFileName = null; @@ -905,6 +912,8 @@ namespace PascalABCCompiler.NETGenerator ab.SetCustomAttribute(new CustomAttributeBuilder(typeof(System.Reflection.AssemblyTitleAttribute).GetConstructor(new Type[] { typeof(string) }), new object[] { options.Title })); + ab.SetCustomAttribute(new CustomAttributeBuilder(typeof(System.Reflection.AssemblyDescriptionAttribute).GetConstructor(new Type[] { typeof(string) }), new object[] { options.Description })); + if (RunOnly) { object main_class = ab.CreateInstance(cur_unit + ".Program"); diff --git a/TreeConverter/TreeConversion/compiler_string_consts.cs b/TreeConverter/TreeConversion/compiler_string_consts.cs index 606887d55..add3687e0 100644 --- a/TreeConverter/TreeConversion/compiler_string_consts.cs +++ b/TreeConverter/TreeConversion/compiler_string_consts.cs @@ -339,6 +339,7 @@ namespace PascalABCCompiler.TreeConverter public static string trademark_string = "trademark"; public static string main_resource_string = "mainresource"; public static string title_string = "title"; + public static string description_string = "description"; public static string system_unit_marker = "__IS_SYSTEM_MODULE"; public static string system_unit_file_name = "PABCSystem"; diff --git a/VisualPascalABCNET/Projects/ProjectProperties.Designer.cs b/VisualPascalABCNET/Projects/ProjectProperties.Designer.cs index 13f113ccf..060c518b1 100644 --- a/VisualPascalABCNET/Projects/ProjectProperties.Designer.cs +++ b/VisualPascalABCNET/Projects/ProjectProperties.Designer.cs @@ -470,6 +470,7 @@ namespace VisualPascalABC private System.Windows.Forms.TextBox tbTradeMark; private System.Windows.Forms.TextBox tbCopyright; //private System.Windows.Forms.TextBox tbTitle; + //private System.Windows.Forms.TextBox tbDescription; private System.Windows.Forms.Label label12; private System.Windows.Forms.OpenFileDialog openFileDialog1; private System.Windows.Forms.FolderBrowserDialog folderBrowserDialog1; diff --git a/VisualPascalABCNET/Projects/ProjectProperties.cs b/VisualPascalABCNET/Projects/ProjectProperties.cs index f6bea3b57..1b98f8879 100644 --- a/VisualPascalABCNET/Projects/ProjectProperties.cs +++ b/VisualPascalABCNET/Projects/ProjectProperties.cs @@ -79,7 +79,8 @@ namespace VisualPascalABC prj.Company = this.tbCompany.Text; prj.Trademark = this.tbTradeMark.Text; prj.Copyright = this.tbCopyright.Text; - //prj.Title = this.tbTitle.Text; + //if (!string.IsNullOrEmpty(prj.Title)) prj.Title = this.tbTitle.Text; + //if (!string.IsNullOrEmpty(prj.Description)) prj.Description = this.tbDescription.Text; } private void ProjectProperties_FormClosing(object sender, FormClosingEventArgs e) diff --git a/bin/Lng/Eng/CompilerErrors.dat b/bin/Lng/Eng/CompilerErrors.dat index c5810a233..2cfb32a9b 100644 --- a/bin/Lng/Eng/CompilerErrors.dat +++ b/bin/Lng/Eng/CompilerErrors.dat @@ -12,7 +12,7 @@ CYCLIC_UNIT_REFERENCE_WITH_UNIT_{0}=Cyclic unit reference with unit '{0}' UNDEFINED_SEMANTIC_ERROR{0}=Undefined semantic error : {0} RESOURCEFILE_{0}_NOT_FOUND=Resource file '{0}' not found DUPLICATE_USES_UNIT{0}=Duplicate identifier '{0}' in uses section -MAINRESOURCE_NOT_ALLOWED=mainresource can not be used with the directives: product, version, company, trademark, title +MAINRESOURCE_NOT_ALLOWED=mainresource can not be used with the directives: product, version, company, trademark, title, description DUPLICATE_DIRECTIVE{0}=Duplicate directive {0} FILE_{0}_NOT_FOUND=File '{0}' not found diff --git a/bin/Lng/Rus/CompilerErrors.dat b/bin/Lng/Rus/CompilerErrors.dat index 4a9691414..8935c289b 100644 --- a/bin/Lng/Rus/CompilerErrors.dat +++ b/bin/Lng/Rus/CompilerErrors.dat @@ -12,7 +12,7 @@ CYCLIC_UNIT_REFERENCE_WITH_UNIT_{0}=Циклическая связь с мод UNDEFINED_SEMANTIC_ERROR{0}=Неопределенная семантическая ошибка : {0} RESOURCEFILE_{0}_NOT_FOUND=Файл '{0}' не найден DUPLICATE_USES_UNIT{0}=Повторное подключение модуля {0} в секции uses -MAINRESOURCE_NOT_ALLOWED=Недопустимо совместное использование директивы mainresource и директив product, version, company, trademark, title +MAINRESOURCE_NOT_ALLOWED=Недопустимо совместное использование директивы mainresource и директив product, version, company, trademark, title, description DUPLICATE_DIRECTIVE{0}=Повторное объявление директивы {0} FILE_{0}_NOT_FOUND=Файл '{0}' не найден diff --git a/bin/Lng/Ukr/CompilerErrors.dat b/bin/Lng/Ukr/CompilerErrors.dat index 4c1fc4193..ea3b397b9 100644 --- a/bin/Lng/Ukr/CompilerErrors.dat +++ b/bin/Lng/Ukr/CompilerErrors.dat @@ -12,7 +12,7 @@ CYCLIC_UNIT_REFERENCE_WITH_UNIT_{0}=Циклічний зв'язок з моду UNDEFINED_SEMANTIC_ERROR{0}=Невизначена семантична помилка : {0} RESOURCEFILE_{0}_NOT_FOUND=Файл '{0}' не знайдено DUPLICATE_USES_UNIT{0}=Повторне підключення модуля {0} в секції uses -MAINRESOURCE_NOT_ALLOWED=Неприпустимо сумісне використання директиви mainresource і директив product, version, company, trademark, title +MAINRESOURCE_NOT_ALLOWED=Неприпустимо сумісне використання директиви mainresource і директив product, version, company, trademark, title, description DUPLICATE_DIRECTIVE{0}=Повторное объявление директивы {0} FILE_{0}_NOT_FOUND=Файл '{0}' не знайдено