OSDN Git Service

デバックレンダーを指定してもそのまま動くようにした
authorkonekoneko <test2214@hotmail.co.jp>
Tue, 4 Oct 2016 12:33:30 +0000 (18:03 +0530)
committerkonekoneko <test2214@hotmail.co.jp>
Tue, 4 Oct 2016 12:33:30 +0000 (18:03 +0530)
UWP/FooEditEngine.UWP/FooTextBox.cs

index 79ff9d2..c4172c1 100644 (file)
@@ -8,6 +8,7 @@
 
 You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
+
 using System;
 using System.Text;
 using System.ComponentModel;
@@ -39,7 +40,11 @@ namespace FooEditEngine.UWP
     {
         EditView View;
         Controller _Controller;
+#if !DUMMY_RENDER
         D2DRender Render;
+#else
+        DummyRender Render;
+#endif
         ScrollBar horizontalScrollBar, verticalScrollBar;
         Windows.UI.Xaml.Shapes.Rectangle rectangle;
         GestureRecognizer gestureRecongnizer = new GestureRecognizer();
@@ -62,7 +67,11 @@ namespace FooEditEngine.UWP
 
             this.rectangle = new Windows.UI.Xaml.Shapes.Rectangle();
             this.rectangle.Margin = this.Padding;
+#if !DUMMY_RENDER
             this.Render = new D2DRender(this,this.rectangle);
+#else
+            this.Render = new DummyRender();
+#endif
 
             this.Document = new Document();
 
@@ -1296,7 +1305,6 @@ namespace FooEditEngine.UWP
         /// <inheritdoc/>
         public static void OnPropertyChanged(object sender, DependencyPropertyChangedEventArgs e)
         {
-#if !DUMMY_RENDER
             FooTextBox source = (FooTextBox)sender;
             if(e.Property.Equals(SelectedTextProperty) && !source.nowCaretMove)
                 source._Controller.SelectedText = source.SelectedText;
@@ -1304,8 +1312,6 @@ namespace FooEditEngine.UWP
                 source.SetDocument(source.Document);
             if(e.Property.Equals(HilighterProperty))
                 source.View.Hilighter = source.Hilighter;
-            if (e.Property.Equals(TextAntialiasModeProperty))
-                source.Render.TextAntialiasMode = source.TextAntialiasMode;
             if (e.Property.Equals(FoldingStrategyProperty))
                 source.View.LayoutLines.FoldingStrategy = source.FoldingStrategy;
             if (e.Property.Equals(IndentModeProperty))
@@ -1326,6 +1332,26 @@ namespace FooEditEngine.UWP
                 source.View.HideLineMarker = !source.DrawCaretLine;
             if (e.Property.Equals(DrawLineNumberProperty))
                 source.Document.DrawLineNumber = source.DrawLineNumber;
+            if (e.Property.Equals(MarkURLProperty))
+                source.Document.UrlMark = source.MarkURL;
+            if (e.Property.Equals(LineBreakProperty))
+                source.Document.LineBreak = source.LineBreakMethod;
+            if (e.Property.Equals(LineBreakCharCountProperty))
+                source.Document.LineBreakCharCount = source.LineBreakCharCount;
+            if (e.Property.Equals(FlowDirectionProperty))
+            {
+                source.Document.RightToLeft = source.FlowDirection == Windows.UI.Xaml.FlowDirection.RightToLeft;
+                if (source.horizontalScrollBar != null)
+                    source.horizontalScrollBar.FlowDirection = source.FlowDirection;
+            }
+            if (e.Property.Equals(DrawRulerProperty))
+            {
+                source.Document.HideRuler = !source.DrawRuler;
+                source._Controller.JumpCaret(source.Document.CaretPostion.row, source.Document.CaretPostion.col);
+            }
+#if !DUMMY_RENDER
+            if (e.Property.Equals(TextAntialiasModeProperty))
+                source.Render.TextAntialiasMode = source.TextAntialiasMode;
             if(e.Property.Equals(MagnificationPowerPropertyKey))
                 source.Render.FontSize = source.FontSize * source.MagnificationPower;
             if (e.Property.Equals(FontFamilyProperty))
@@ -1362,8 +1388,6 @@ namespace FooEditEngine.UWP
                 source.View.Padding = new Padding((int)source.Padding.Left, (int)source.Padding.Top, (int)source.Padding.Right, (int)source.Padding.Bottom);
             if (e.Property.Equals(LineMarkerProperty))
                 source.Render.LineMarker = D2DRenderBase.ToColor4(source.LineMarker);
-            if (e.Property.Equals(MarkURLProperty))
-                source.Document.UrlMark = source.MarkURL;
             if (e.Property.Equals(ShowFullSpaceProperty))
                 source.Render.ShowFullSpace = source.ShowFullSpace;
             if (e.Property.Equals(ShowHalfSpaceProperty))
@@ -1372,30 +1396,15 @@ namespace FooEditEngine.UWP
                 source.Render.ShowTab = source.ShowTab;
             if (e.Property.Equals(ShowLineBreakProperty))
                 source.Render.ShowLineBreak = source.ShowLineBreak;
-            if (e.Property.Equals(LineBreakProperty))
-                source.Document.LineBreak = source.LineBreakMethod;
-            if (e.Property.Equals(LineBreakCharCountProperty))
-                source.Document.LineBreakCharCount = source.LineBreakCharCount;
             if (e.Property.Equals(UpdateAreaProperty))
                 source.Render.UpdateArea = D2DRenderBase.ToColor4(source.UpdateArea);
             if (e.Property.Equals(LineNumberProperty))
                 source.Render.LineNumber = D2DRenderBase.ToColor4(source.LineNumber);
-            if (e.Property.Equals(FlowDirectionProperty))
-            {
-                source.Document.RightToLeft = source.FlowDirection == Windows.UI.Xaml.FlowDirection.RightToLeft;
-                if(source.horizontalScrollBar != null)
-                    source.horizontalScrollBar.FlowDirection = source.FlowDirection;
-            }
-            if (e.Property.Equals(DrawRulerProperty))
-            {
-                source.Document.HideRuler = !source.DrawRuler;
-                source._Controller.JumpCaret(source.Document.CaretPostion.row, source.Document.CaretPostion.col);
-            }
 #endif
         }
-#endregion
+        #endregion
 
-#region event
+        #region event
 
         /// <summary>
         /// コンテキストメニューが表示されるときに呼び出されます