Skip to content
This repository has been archived by the owner on Feb 11, 2019. It is now read-only.

Commit

Permalink
Fixed #14
Browse files Browse the repository at this point in the history
  • Loading branch information
ConstKosyanov committed Mar 30, 2017
1 parent e9b633e commit 866f45c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions XLOC/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("XLOC")]
[assembly: AssemblyCopyright("")]
[assembly: AssemblyCopyright("k.kosyanov")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

Expand All @@ -32,5 +32,5 @@
// Можно задать все значения или принять номера сборки и редакции по умолчанию
// используя "*", как показано ниже:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.2.68")]
[assembly: AssemblyFileVersion("1.0.2.68")]
[assembly: AssemblyVersion("1.0.2.82")]
[assembly: AssemblyFileVersion("1.0.2.82")]
2 changes: 1 addition & 1 deletion XLOC/Utility/Map.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public Map(Dictionary<string, string> dictionary) : base()
//=================================================
static string[][] getClassCaptions(bool requiredOnly = false) => typeof(T).GetProperties()
.Where(x => Attribute.IsDefined(x, typeof(XlFieldAttribute)) && !(requiredOnly && (isNullable(x) || !isRequired(x))))
.Select(x => getAttribute<XlFieldAttribute>(x).Captions.Union(new string[] { x.Name }).ToArray()).ToArray();
.Select(x => getAttribute<XlFieldAttribute>(x).Captions.DefaultIfEmpty(x.Name).ToArray()).ToArray();
static IEnumerable<PropertyInfo> getProperties() => typeof(T).GetProperties().Where(x => Attribute.IsDefined(x, typeof(XlFieldAttribute)));
static AtttrType getAttribute<AtttrType>(PropertyInfo x) where AtttrType : Attribute => (AtttrType)Attribute.GetCustomAttribute(x, typeof(AtttrType));
static bool isRequired(PropertyInfo x) => getAttribute<XlFieldAttribute>(x).IsRequired;
Expand Down
2 changes: 1 addition & 1 deletion XLOC/Writer/xlArrayWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ IEnumerable<Cell> getCaptions()
foreach (PropertyInfo property in typeof(T).GetProperties().Where(x => Attribute.IsDefined(x, typeof(XlFieldAttribute))))
{
Cell cell = createCell(1, ColCounter++);
cell.CellValue = new CellValue(getSharedStringId(((XlFieldAttribute)Attribute.GetCustomAttribute(property, typeof(XlFieldAttribute))).Captions.First()).ToString());
cell.CellValue = new CellValue(getSharedStringId(((XlFieldAttribute)Attribute.GetCustomAttribute(property, typeof(XlFieldAttribute))).Captions.DefaultIfEmpty(property.Name).First()).ToString());
cell.DataType = new EnumValue<CellValues>(CellValues.SharedString);
yield return cell;
}
Expand Down

0 comments on commit 866f45c

Please sign in to comment.