OSDN Git Service

Document.Stateプロパティを廃止した
[fooeditengine/FooEditEngine.git] / Windows / FooEditEngine / FooTextBox.cs
index 978a457..6f3d56a 100644 (file)
@@ -628,8 +628,6 @@ namespace FooEditEngine.Windows
         /// <param name="length">長さ</param>\r
         public void Select(int start, int length)\r
         {\r
-            if (this.Document.State == AsyncState.Loading)\r
-                throw new InvalidOperationException();\r
             this.Controller.Select(start, length);\r
             this.HScrollBar.Value = (int)this.View.Src.X;\r
             this.VScrollBar.Value = this.View.Src.Row;\r
@@ -640,8 +638,6 @@ namespace FooEditEngine.Windows
         /// </summary>\r
         public void SelectAll()\r
         {\r
-            if (this.Document.State == AsyncState.Loading)\r
-                throw new InvalidOperationException();\r
             this.Controller.Select(0, this.Document.Length - 1);\r
         }\r
 \r
@@ -650,8 +646,6 @@ namespace FooEditEngine.Windows
         /// </summary>\r
         public void DeSelectAll()\r
         {\r
-            if (this.Document.State == AsyncState.Loading)\r
-                throw new InvalidOperationException();\r
             this.Controller.DeSelectAll();\r
         }\r
 \r
@@ -660,8 +654,6 @@ namespace FooEditEngine.Windows
         /// </summary>\r
         public void Copy()\r
         {\r
-            if (this.Document.State == AsyncState.Loading)\r
-                throw new InvalidOperationException();\r
             string text = this.SelectedText;\r
             if(text != null && text != string.Empty)\r
                 Clipboard.SetText(text);\r
@@ -672,8 +664,6 @@ namespace FooEditEngine.Windows
         /// </summary>\r
         public void Cut()\r
         {\r
-            if (this.Document.State == AsyncState.Loading)\r
-                throw new InvalidOperationException();\r
             string text = this.SelectedText;\r
             if (text != null && text != string.Empty)\r
             {\r
@@ -687,8 +677,6 @@ namespace FooEditEngine.Windows
         /// </summary>\r
         public void Paste()\r
         {\r
-            if (this.Document.State == AsyncState.Loading)\r
-                throw new InvalidOperationException();\r
             if (Clipboard.ContainsText() == false)\r
                 return;\r
             this.Controller.SelectedText = Clipboard.GetText();\r
@@ -701,8 +689,6 @@ namespace FooEditEngine.Windows
         /// <remarks>このメソッドを呼び出すと選択状態は解除されます</remarks>\r
         public void JumpCaret(int index)\r
         {\r
-            if (this.Document.State == AsyncState.Loading)\r
-                throw new InvalidOperationException();\r
             this.Controller.JumpCaret(index);\r
         }\r
         /// <summary>\r
@@ -713,8 +699,6 @@ namespace FooEditEngine.Windows
         /// <remarks>このメソッドを呼び出すと選択状態は解除されます</remarks>\r
         public void JumpCaret(int row, int col)\r
         {\r
-            if (this.Document.State == AsyncState.Loading)\r
-                throw new InvalidOperationException();\r
             this.Controller.JumpCaret(row, col);\r
         }\r
 \r
@@ -723,8 +707,6 @@ namespace FooEditEngine.Windows
         /// </summary>\r
         public new void Refresh()\r
         {\r
-            if (this.Document.State == AsyncState.Loading)\r
-                return;\r
             if (this.Document.FireUpdateEvent == false)\r
                 throw new InvalidOperationException("");\r
             if(this.View.CaretBlink)\r
@@ -740,8 +722,6 @@ namespace FooEditEngine.Windows
         /// <returns>高さ</returns>\r
         public double GetLineHeight(int row)\r
         {\r
-            if (this.Document.State == AsyncState.Loading)\r
-                throw new InvalidOperationException();\r
             if (this.Document.FireUpdateEvent == false)\r
                 throw new InvalidOperationException("");\r
             return this.View.LayoutLines.GetLayout(row).Height;\r
@@ -755,8 +735,6 @@ namespace FooEditEngine.Windows
         /// <remarks>テキストポイントがクライアント領域の原点より外にある場合、返される値は原点に丸められます</remarks>\r
         public System.Drawing.Point GetPostionFromTextPoint(TextPoint tp)\r
         {\r
-            if (this.Document.State == AsyncState.Loading)\r
-                throw new InvalidOperationException();\r
             if (this.Document.FireUpdateEvent == false)\r
                 throw new InvalidOperationException("");\r
             return this.View.GetPostionFromTextPoint(tp);\r
@@ -769,8 +747,6 @@ namespace FooEditEngine.Windows
         /// <returns>テキストポイント</returns>\r
         public TextPoint GetTextPointFromPostion(System.Drawing.Point p)\r
         {\r
-            if (this.Document.State == AsyncState.Loading)\r
-                throw new InvalidOperationException();\r
             if (this.Document.FireUpdateEvent == false)\r
                 throw new InvalidOperationException("");\r
             return this.View.GetTextPointFromPostion(p);\r
@@ -783,8 +759,6 @@ namespace FooEditEngine.Windows
         /// <returns>座標を返す</returns>\r
         public System.Drawing.Point GetPostionFromIndex(int index)\r
         {\r
-            if (this.Document.State == AsyncState.Loading)\r
-                throw new InvalidOperationException();\r
             if (this.Document.FireUpdateEvent == false)\r
                 throw new InvalidOperationException("");\r
             TextPoint tp = this.View.GetLayoutLineFromIndex(index);\r
@@ -798,8 +772,6 @@ namespace FooEditEngine.Windows
         /// <returns>インデックスを返す</returns>\r
         public int GetIndexFromPostion(System.Drawing.Point p)\r
         {\r
-            if (this.Document.State == AsyncState.Loading)\r
-                throw new InvalidOperationException();\r
             if (this.Document.FireUpdateEvent == false)\r
                 throw new InvalidOperationException("");\r
             TextPoint tp = this.View.GetTextPointFromPostion(p);\r
@@ -863,8 +835,6 @@ namespace FooEditEngine.Windows
         /// <returns>文字がコントロールによって処理された場合は true。それ以外の場合は false。 </returns>\r
         protected override bool ProcessCmdKey(ref Message msg, Keys keyData)\r
         {\r
-            if (this.Document.State == AsyncState.Loading)\r
-                return false;\r
             const int WM_KEYDOWN = 0x100;\r
             if (msg.Msg != WM_KEYDOWN)\r
                 return base.ProcessCmdKey(ref msg, keyData);\r
@@ -985,9 +955,6 @@ namespace FooEditEngine.Windows
         /// <param name="e">インベントデータ</param>\r
         protected override void OnMouseDown(MouseEventArgs e)\r
         {\r
-            if (this.Document.State == AsyncState.Loading)\r
-                return;\r
-\r
             TextPoint tp = this.View.GetTextPointFromPostion(e.Location);\r
             if (tp == TextPoint.Null)\r
                 return;\r
@@ -1027,9 +994,6 @@ namespace FooEditEngine.Windows
         /// <param name="e">インベントデータ</param>\r
         protected override void OnMouseClick(MouseEventArgs e)\r
         {\r
-            if (this.Document.State == AsyncState.Loading)\r
-                return;\r
-\r
             int index = this.GetIndexFromPostion(e.Location);\r
 \r
             FooMouseEventArgs mouseEvent = new FooMouseEventArgs(index, e.Button, e.Clicks, e.X, e.Y, e.Delta);\r
@@ -1043,9 +1007,6 @@ namespace FooEditEngine.Windows
         /// <param name="e">インベントデータ</param>\r
         protected override void OnMouseDoubleClick(MouseEventArgs e)\r
         {\r
-            if (this.Document.State == AsyncState.Loading)\r
-                return;\r
-\r
             TextPoint tp = this.View.GetTextPointFromPostion(e.Location);\r
             if (tp == TextPoint.Null)\r
                 return;\r
@@ -1069,11 +1030,6 @@ namespace FooEditEngine.Windows
         /// <param name="e">インベントデータ</param>\r
         protected override void OnMouseMove(MouseEventArgs e)\r
         {\r
-            if (this.Document.State == AsyncState.Loading)\r
-            {\r
-                this.Cursor = Cursors.WaitCursor;\r
-                return;\r
-            }\r
             if (this.Focused == false)\r
                 return;\r
 \r
@@ -1105,9 +1061,6 @@ namespace FooEditEngine.Windows
         /// <param name="e">インベントデータ</param>\r
         protected override void OnMouseWheel(MouseEventArgs e)\r
         {\r
-            if (this.Document.State == AsyncState.Loading)\r
-                return;\r
-\r
             base.OnMouseWheel(e);\r
 \r
             ScrollDirection dir = e.Delta > 0 ? ScrollDirection.Up : ScrollDirection.Down;\r
@@ -1121,7 +1074,7 @@ namespace FooEditEngine.Windows
         /// <param name="e">インベントデータ</param>\r
         protected override void OnPaint(PaintEventArgs e)\r
         {\r
-            if (DesignMode || this.Document.State == AsyncState.Loading)\r
+            if (DesignMode)\r
             {\r
                 SolidBrush brush = new SolidBrush(this.BackColor);\r
                 e.Graphics.FillRectangle(brush, this.ClientRectangle);\r
@@ -1167,9 +1120,6 @@ namespace FooEditEngine.Windows
         /// <param name="e">インベントデータ</param>\r
         protected override void OnKeyDown(KeyEventArgs e)\r
         {\r
-            if (this.Document.State == AsyncState.Loading)\r
-                return;\r
-\r
             base.OnKeyDown(e);\r
             \r
             if (e.Handled)\r
@@ -1247,9 +1197,6 @@ namespace FooEditEngine.Windows
         /// <param name="e">インベントデータ</param>\r
         protected override void OnKeyPress(KeyPressEventArgs e)\r
         {\r
-            if (this.Document.State == AsyncState.Loading)\r
-                return;\r
-\r
             base.OnKeyPress(e);\r
 \r
             if (e.Handled)\r
@@ -1312,16 +1259,12 @@ namespace FooEditEngine.Windows
 \r
         void VScrollBar_Scroll(object sender, ScrollEventArgs e)\r
         {\r
-            if (this.Document.State == AsyncState.Loading)\r
-                return;\r
             this.View.TryScroll(this.View.Src.X, e.NewValue);\r
             this.Refresh();\r
         }\r
 \r
         void HScrollBar_Scroll(object sender, ScrollEventArgs e)\r
         {\r
-            if (this.Document.State == AsyncState.Loading)\r
-                return;\r
             int toX;\r
             if (this.RightToLeft == System.Windows.Forms.RightToLeft.Yes)\r
                 toX = -e.NewValue;\r
@@ -1333,8 +1276,6 @@ namespace FooEditEngine.Windows
 \r
         void Ime_StartCompstion(object sender, StartCompstionEventArgs e)\r
         {\r
-            if (this.Document.State == AsyncState.Loading)\r
-                return;\r
             this.Ime.Font = this.Font;\r
             this.Ime.Location = this.GetPostionFromIndex(this.Controller.SelectionStart);\r
             this.View.HideCaret = true;\r
@@ -1347,16 +1288,12 @@ namespace FooEditEngine.Windows
 \r
         void Ime_ImeCompstion(object sender, ImeCompstionEventArgs e)\r
         {\r
-            if (this.Document.State == AsyncState.Loading)\r
-                return;\r
             this.Controller.DoInputString(e.InputText);\r
             this.Refresh();\r
         }\r
 \r
         void Ime_ImeDocumentFeed(object sender, ImeDocumentFeedEventArgs e)\r
         {\r
-            if (this.Document.State == AsyncState.Loading)\r
-                return;\r
             TextPoint tp = this.CaretPostion;\r
             e.Pragraph = this.LayoutLines[tp.row];\r
             e.pos = tp.col;\r
@@ -1364,8 +1301,6 @@ namespace FooEditEngine.Windows
 \r
         void Ime_ImeReconvert(object sender, ImeReconvertStringEventArgs e)\r
         {\r
-            if (this.Document.State == AsyncState.Loading)\r
-                return;\r
             if (this.RectSelection)\r
                 return;\r
             if (this.Controller.SelectionLength == 0)\r
@@ -1385,9 +1320,6 @@ namespace FooEditEngine.Windows
 \r
         void Ime_ImeQueryReconvert(object sender, ImeQueryRecovertStringEventArgs e)\r
         {\r
-            if (this.Document.State == AsyncState.Loading)\r
-                return;\r
-\r
             TextPoint tp = this.LayoutLines.GetTextPointFromIndex(this.Controller.SelectionStart);\r
             tp.col = e.offset;\r
 \r
@@ -1403,8 +1335,6 @@ namespace FooEditEngine.Windows
 \r
         void Document_Progress(object sender, ProgressEventArgs e)\r
         {\r
-            if (this.Document.State == AsyncState.Saving)\r
-                return;\r
             if (e.state == ProgressState.Complete)\r
             {\r
                 this.initScrollBars();\r
@@ -1425,8 +1355,6 @@ namespace FooEditEngine.Windows
 \r
         void Timer_Tick(object sender,EventArgs e)\r
         {\r
-            if (this.Document.State == AsyncState.Loading)\r
-                return;\r
             if (this.View.CaretPostion.row >= this.View.LayoutLines.Count || DesignMode)\r
                 return;\r
 \r