Subversion Repositories Code-Repo

Rev

Rev 57 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 57 Rev 59
Line 21... Line 21...
21
                if (File.Exists(logFileLocation))
21
                if (File.Exists(logFileLocation))
22
                {
22
                {
23
                    XElement Log = XElement.Load(logFileLocation);
23
                    XElement Log = XElement.Load(logFileLocation);
24
                    AccountsCreated = int.Parse(Log.Element("AccountsCreated").Value);
24
                    AccountsCreated = int.Parse(Log.Element("AccountsCreated").Value);
25
                    SharesCreated = int.Parse(Log.Element("SharesCreated").Value);
25
                    SharesCreated = int.Parse(Log.Element("SharesCreated").Value);
-
 
26
                    DebugText.appendText("Stats from " + logFileLocation + " has been imported");
26
                }
27
                }
27
                else
28
                else
28
                {
29
                {
29
                    DebugText.appendText("No existing stat logging file detected.");
30
                    DebugText.appendText("No existing stat logging file detected.");
30
                    WriteDefaultConfigFile();
31
                    WriteDefaultConfigFile();
Line 43... Line 44...
43
            {
44
            {
44
                XElement Log = XElement.Load(logFileLocation);
45
                XElement Log = XElement.Load(logFileLocation);
45
                Log.SetElementValue("AccountsCreated", AccountsCreated);
46
                Log.SetElementValue("AccountsCreated", AccountsCreated);
46
                Log.SetElementValue("SharesCreated", SharesCreated);
47
                Log.SetElementValue("SharesCreated", SharesCreated);
47
                Log.Save(logFileLocation);
48
                Log.Save(logFileLocation);
-
 
49
                DebugText.appendText("Stats has been exported to " + logFileLocation);
48
            }
50
            }
49
            catch (Exception e)
51
            catch (Exception e)
50
            {
52
            {
51
                //MessageBox.Show(e.ToString(), "Error");
53
                //MessageBox.Show(e.ToString(), "Error");
52
                DebugText.appendText(e.ToString());
54
                DebugText.appendText(e.ToString());
Line 60... Line 62...
60
                XElement Log = new XElement("StatLog",
62
                XElement Log = new XElement("StatLog",
61
                    new XElement("AccountsCreated", 0),
63
                    new XElement("AccountsCreated", 0),
62
                    new XElement("SharesCreated", 0)
64
                    new XElement("SharesCreated", 0)
63
                    );
65
                    );
64
                Log.Save(logFileLocation);
66
                Log.Save(logFileLocation);
-
 
67
                DebugText.appendText("A blank stat logging file has been created");
65
            }
68
            }
66
            catch (Exception e)
69
            catch (Exception e)
67
            {
70
            {
68
                //MessageBox.Show(e.ToString(), "Error");
71
                //MessageBox.Show(e.ToString(), "Error");
69
                DebugText.appendText(e.ToString());
72
                DebugText.appendText(e.ToString());