Skip to content

Commit

Permalink
statistics fix
Browse files Browse the repository at this point in the history
  • Loading branch information
bux committed Aug 10, 2014
1 parent 32a0e1d commit 08d4593
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 34 deletions.
14 changes: 14 additions & 0 deletions tabler/Classes/TranslationComponents.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Collections.Generic;
using System.Linq;

namespace tabler
{
Expand All @@ -21,5 +22,18 @@ public List<LanguageStatistics> Statistics
}
set { m_statistics = value; }
}

public int KeyCount
{
get
{
int count = 0;
if (AllModInfo != null)
{
count = AllModInfo.Sum(mi => mi.Values.Count);
}
return count;
}
}
}
}
13 changes: 4 additions & 9 deletions tabler/Helper/ConfigHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ public class ConfigHelper
{
private const string LASTPATHTODATAFILES = "LastPathToDataFiles";
private readonly FileInfo _fiConfig = new FileInfo(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, @"config\config.xml"));
private Configuration _config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);

private DirectoryInfo _lastPathToDataFiles;
private XDocument _xDocConfig;

public ConfigHelper()
Expand All @@ -39,15 +36,13 @@ public void CreateOrLoadConfig()
{
var path = new XElement(LASTPATHTODATAFILES);

//XElement config = new XElement("config",
// new XElement("lastSavePath",
// XmlConvert.EncodeLocalName(m_tbTargetLocation.Text)));

var lstElements = new List<XElement>();

lstElements.Add(path);

_xDocConfig = new XDocument(new XDeclaration("1.0", "utf-8", "yes"), new XComment("Config file"), new XElement("config", lstElements.ToArray()));
_xDocConfig = new XDocument(
new XDeclaration("1.0", "utf-8", "yes"),
new XComment("Config file"),
new XElement("config", lstElements.ToArray()));

_xDocConfig.Save(_fiConfig.FullName);
SaveConfigXML();
Expand Down
15 changes: 6 additions & 9 deletions tabler/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,12 @@
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("570ff6fa-19a8-48c1-b9da-f47a8ac91233")]

// Version information for an assembly consists of the following four values:
// http://semver.org/
// Version information for an assembly consists of the following values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.2.0")]
[assembly: AssemblyFileVersion("0.2.0")]
// Patch

[assembly: AssemblyVersion("0.3.1")]
[assembly: AssemblyFileVersion("0.3.1")]

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ private void copyDataToolStripMenuItem_Click(object sender, EventArgs e)
innterSb.AppendLine(String.Format("{0}{1}{2} missing stringtable entry/entries. ({3})", modInfoStatistics.LanguageName, spacer, missingTranslationCount.ToString().PadLeft(3), mods));
}

outerSb.AppendLine(String.Format("Total number of missing keys: {0}", total));
outerSb.AppendLine(String.Format("Total number of keys: {0}", _myParent.TranslationManager.TranslationComponents.KeyCount));
outerSb.AppendLine(String.Format("Total number of missing translations: {0}", total));
outerSb.AppendLine("");
outerSb.Append(innterSb);

Expand Down
File renamed without changes.
10 changes: 5 additions & 5 deletions tabler/tabler.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,11 @@
<Compile Include="Helper\XmlHelper.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Translation Statistics.cs">
<Compile Include="TranslationStatistics.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Translation Statistics.Designer.cs">
<DependentUpon>Translation Statistics.cs</DependentUpon>
<Compile Include="TranslationStatistics.Designer.cs">
<DependentUpon>TranslationStatistics.cs</DependentUpon>
</Compile>
<EmbeddedResource Include="AddLanguage.resx">
<DependentUpon>AddLanguage.cs</DependentUpon>
Expand All @@ -117,8 +117,8 @@
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<EmbeddedResource Include="Translation Statistics.resx">
<DependentUpon>Translation Statistics.cs</DependentUpon>
<EmbeddedResource Include="TranslationStatistics.resx">
<DependentUpon>TranslationStatistics.cs</DependentUpon>
</EmbeddedResource>
<None Include="packages.config" />
<None Include="Properties\Settings.settings">
Expand Down

0 comments on commit 08d4593

Please sign in to comment.