/[RomCheater]/trunk/RomCheater.ScratchPad/ScratchPadDocument.cs
ViewVC logotype

Diff of /trunk/RomCheater.ScratchPad/ScratchPadDocument.cs

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

--- trunk/RomCheater.ScratchPad/ScratchPadDocument.cs	2013/06/21 04:27:21	784
+++ trunk/RomCheater.ScratchPad/ScratchPadDocument.cs	2013/06/21 04:50:33	785
@@ -87,21 +87,21 @@
             }
         }
 
-        public override Font Font
-        {
-            get
-            {
-                return base.Font;
-            }
-            set
-            {
-                base.Font = value;
-                txtEditor.Font = base.Font;
-                mnuItemClose.Font = base.Font;
-                mnuItemOpen.Font = base.Font;
-                mnuItemSave.Font = base.Font;
-            }
-        }
+        //public override Font Font
+        //{
+        //    get
+        //    {
+        //        return base.Font;
+        //    }
+        //    set
+        //    {
+        //        base.Font = new Font(value.FontFamily, value.SizeInPoints);
+        //        txtEditor.Font = base.Font;
+        //        mnuItemClose.Font = base.Font;
+        //        mnuItemOpen.Font = base.Font;
+        //        mnuItemSave.Font = base.Font;
+        //    }
+        //}
 
         private void mnuItemOpen_Click(object sender, EventArgs e)
         {
@@ -187,10 +187,19 @@
                         {
                             try
                             {
-                                foreach (var t in txtEditor.Lines)
+                                //foreach (var t in txtEditor.Lines)
+                                //{
+                                //    sw.WriteLine(t);
+                                //}
+                                string line =string.Empty;
+                                using (StringReader sr = new StringReader(txtEditor.Text))
                                 {
-                                    sw.WriteLine(t);
+                                    while ((line = sr.ReadLine()) != null)
+                                    {
+                                        sw.WriteLine(line);
+                                    }
                                 }
+
                                 sw.Flush();
                                 sw.Close();
                                 this.DocumentSaved = true;
@@ -242,5 +251,10 @@
                 this.LinkClicked.Invoke(sender, e);
             }
         }
+
+        private void ScratchPadDocument_Load(object sender, EventArgs e)
+        {
+            this.Font = new System.Drawing.Font(this.Font.FontFamily, this.Font.SizeInPoints);
+        }
     }
 }

 

  ViewVC Help
Powered by ViewVC 1.1.22