ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/TS3.SkuReader/trunk/TS3.SkuReader/Form1.cs
Revision: 17
Committed: Fri Sep 23 01:48:15 2011 UTC (12 years, 2 months ago) by william
File size: 5399 byte(s)
Log Message:
*** full format: report LanguageCode/name

File Contents

# Content
1 using System;
2 using System.Collections.Generic;
3 using System.ComponentModel;
4 using System.Data;
5 using System.Drawing;
6 using System.Linq;
7 using System.Text;
8 using System.Windows.Forms;
9 using SimsGameData;
10 using SimsGameData.DataTypes;
11 using System.Diagnostics;
12
13 namespace TS3.SkuReader
14 {
15 public partial class Form1 : Form
16 {
17 private DebugConsoleControl.DebugConsoleControl ConsoleLogger;
18 private GameData GameInfo = new GameData(GameType.Sims3);
19 private string m_ApplicationName { get { return Application.ProductName; } }
20 private string m_ApplicationPath { get { return Application.StartupPath; } }
21 private string m_ApplicationLogPath { get { return this.m_ApplicationName + "_Logs"; ; } }
22
23 private bool MinimalInfo = false;
24
25 public Form1()
26 {
27 InitializeComponent();
28 this.ConsoleLogger = new DebugConsoleControl.DebugConsoleControl(this.m_ApplicationName);
29 this.ConsoleLogger.LogApplicationStartup(new StackTrace(true), false);
30 }
31
32 private void Form1_FormClosed(object sender, FormClosedEventArgs e)
33 {
34 this.ConsoleLogger.AutoWriteLogFile(this.m_ApplicationPath, this.m_ApplicationLogPath, this.m_ApplicationName);
35 }
36
37 private void mnuItemExit_Click(object sender, EventArgs e)
38 {
39 this.Close();
40 }
41
42 private void mnuItemRefresh_Click(object sender, EventArgs e)
43 {
44 this.ReloadSkuData();
45 }
46
47 private void ReloadSkuData()
48 {
49 txtVersionData.Text = "";
50 foreach (GameDataType Data in GameInfo.Sims3GameData)
51 {
52 StringBuilder builder2 = new StringBuilder();
53
54
55 builder2.AppendFormat("Game Product Code: {0}{1}", Data.ProductCodes[0].ProductCode, System.Environment.NewLine);
56 builder2.AppendFormat("Game Name: {0}{1}", Data.Name, System.Environment.NewLine);
57 builder2.AppendFormat("Game Key: {0}{1}", Data.EPKey.Key.ToString(), System.Environment.NewLine);
58 builder2.AppendFormat("Game Installed: {0}{1}", Data.GameMetrics.GameIsInstalled, System.Environment.NewLine);
59 builder2.AppendFormat("Game Path: {0}{1}", Data.GameMetrics.GamePath, System.Environment.NewLine);
60 builder2.AppendFormat("Game Language Code: {0}{1}", Data.GameMetrics.GameLanguageCode, System.Environment.NewLine);
61 builder2.AppendFormat("Game Language Name: {0}{1}", Data.GameMetrics.GameLanguageName, System.Environment.NewLine);
62 builder2.AppendFormat("{0}{1}{1}", Data.SKUVersionData.ToString(), System.Environment.NewLine);
63
64 if (!MinimalInfo)
65 {
66 if (Data.GameMetrics.GameIsInstalled)
67 {
68 Console.WriteLine(builder2.ToString());
69 this.ConsoleLogger.LogMessage(new StackTrace(true), builder2.ToString(), false);
70 txtVersionData.Text = txtVersionData.Text + builder2.ToString();
71 }
72 }
73 else
74 {
75 StringBuilder builder = new StringBuilder();
76 Console.WriteLine(builder2.ToString());
77 this.ConsoleLogger.LogMessage(new StackTrace(true), builder2.ToString(), false);
78
79 builder.AppendFormat("Game Name: {0} - {1}{2}", Data.Name, Data.EPKey.Key.ToString(), System.Environment.NewLine);
80 //builder.AppendFormat("{0}{1}{1}", Data.SKUVersionData.ToString(), System.Environment.NewLine);
81 builder.AppendFormat("\tGameVersion: {0}{1}", Data.SKUVersionData.GameVersion, System.Environment.NewLine);
82 builder.AppendFormat("\tCode: {0}{1}", Data.SKUVersionData.Code, System.Environment.NewLine);
83 builder.AppendFormat("\tAsset: {0}{1}", Data.SKUVersionData.Asset, System.Environment.NewLine);
84 builder.AppendFormat("\tThumbnails: {0}{1}", Data.SKUVersionData.Thumbnails, System.Environment.NewLine);
85 builder.AppendFormat("\tCiderVersion: {0}{1}", Data.SKUVersionData.CiderVersion == "" ? "/NA" : Data.SKUVersionData.CiderVersion, System.Environment.NewLine);
86 txtVersionData.Text = txtVersionData.Text + builder.ToString() + System.Environment.NewLine;
87 }
88 }
89 }
90
91 private void Form1_Shown(object sender, EventArgs e) { mnuItemReportMinimalInfo.PerformClick(); }
92 private void mnuItemReportFullInfo_Click(object sender, EventArgs e)
93 {
94 if (mnuItemReportMinimalInfo.Checked) { mnuItemReportMinimalInfo.Checked = false; }
95 mnuItemReportFullInfo.Checked = true;
96 MinimalInfo = mnuItemReportMinimalInfo.Checked;
97
98 this.ReloadSkuData();
99 }
100
101 private void mnuItemReportMinimalInfo_Click(object sender, EventArgs e)
102 {
103 if (mnuItemReportFullInfo.Checked) { mnuItemReportFullInfo.Checked = false; }
104 mnuItemReportMinimalInfo.Checked = true;
105 MinimalInfo = mnuItemReportMinimalInfo.Checked;
106
107 this.ReloadSkuData();
108 }
109
110
111 }
112 }