OSDN Git Service

MVVM対応に備えてシンボル系列のプロパティもDocumentに移行した
[fooeditengine/FooEditEngine.git] / Core / ViewBase.cs
index 010dc9f..e4752b2 100644 (file)
@@ -114,6 +114,26 @@ namespace FooEditEngine
             {
                 this.render.RightToLeft = this.Document.RightToLeft;
             };
+            this.Document.ShowFullSpaceChanged += (s, e) =>
+            {
+                this.render.ShowFullSpace = this.Document.ShowFullSpace;
+                this._LayoutLines.ClearLayoutCache();
+            };
+            this.Document.ShowHalfSpaceChanged += (s, e) =>
+            {
+                this.render.ShowHalfSpace = this.Document.ShowHalfSpace;
+                this._LayoutLines.ClearLayoutCache();
+            };
+            this.Document.ShowTabChanged += (s, e) =>
+            {
+                this.render.ShowTab = this.Document.ShowTab;
+                this._LayoutLines.ClearLayoutCache();
+            };
+            this.Document.ShowLineBreakChanged += (s, e) =>
+            {
+                this.render.ShowLineBreak = this.Document.ShowLineBreak;
+                this._LayoutLines.ClearLayoutCache();
+            };
         }
 
         protected LineToIndexTable _LayoutLines
@@ -131,26 +151,6 @@ namespace FooEditEngine
         public event EventHandler PageBoundChanged;
 
         /// <summary>
-        /// マーカーパターンセット
-        /// </summary>
-        public MarkerPatternSet MarkerPatternSet
-        {
-            get { return this.Document.MarkerPatternSet; }
-        }
-
-        /// <summary>
-        /// URLをハイパーリンクとして表示するなら真。そうでないなら偽
-        /// </summary>
-        public bool UrlMark
-        {
-            get { return this.Document.UrlMark; }
-            set
-            {
-                this.Document.UrlMark = value;
-            }
-        }
-
-        /// <summary>
         /// テキストレンダラ―
         /// </summary>
         public ITextRender render
@@ -193,39 +193,6 @@ namespace FooEditEngine
             get { return this._LongestWidth; }
         }
 
-        /// <summary>
-        /// 桁折り処理の方法を指定する
-        /// </summary>
-        /// <remarks>
-        /// 変更した場合、呼び出し側で再描写とレイアウトの再構築を行う必要があります
-        /// </remarks>
-        public LineBreakMethod LineBreak
-        {
-            get
-            {
-                return this.Document.LineBreak;
-            }
-            set
-            {
-                this.Document.LineBreak = value;
-            }
-        }
-
-        /// <summary>
-        /// 折り返し行う文字数。実際に折り返しが行われる幅はem単位×この値となります
-        /// </summary>
-        public int LineBreakCharCount
-        {
-            get
-            {
-                return this.Document.LineBreakCharCount;
-            }
-            set
-            {
-                this.Document.LineBreakCharCount = value;
-            }
-        }
-
         public double LineNumberMargin
         {
             get
@@ -244,16 +211,6 @@ namespace FooEditEngine
         }
 
         /// <summary>
-        /// タブの幅
-        /// </summary>
-        /// <remarks>変更した場合、呼び出し側で再描写する必要があります</remarks>
-        public int TabStops
-        {
-            get { return this.Document.TabStops; }
-            set { this.Document.TabStops = value; }
-        }
-
-        /// <summary>
         /// すべてのレイアウト行を破棄し、再度レイアウトをやり直す
         /// </summary>
         public virtual void PerfomLayouts()
@@ -310,18 +267,6 @@ namespace FooEditEngine
             set { this._Src = value; }
         }
 
-        /// <summary>
-        /// 行番号を表示するかどうか
-        /// </summary>
-        public bool DrawLineNumber
-        {
-            get { return this.Document.DrawLineNumber; }
-            set
-            {
-                this.Document.DrawLineNumber = value;
-            }
-        }
-
         public virtual void Draw(Rectangle updateRect)
         {
         }
@@ -414,12 +359,12 @@ namespace FooEditEngine
         IList<LineToIndexTableData> LayoutLines_SpilitStringByPixelbase(object sender, SpilitStringEventArgs e)
         {
             double WrapWidth;
-            if (this.LineBreak == LineBreakMethod.PageBound)
+            if (this.Document.LineBreak == LineBreakMethod.PageBound)
                 WrapWidth = this.render.TextArea.Width - LineBreakingMarginWidth;  //余白を残さないと欠ける
             else
-                WrapWidth = this.render.emSize.Width * this.LineBreakCharCount;
+                WrapWidth = this.render.emSize.Width * this.Document.LineBreakCharCount;
 
-            if (WrapWidth < 0 && this.LineBreak != LineBreakMethod.None)
+            if (WrapWidth < 0 && this.Document.LineBreak != LineBreakMethod.None)
                 throw new InvalidOperationException();
 
             int startIndex = e.index;