Наследование: IStylerOptions
Пример #1
0
        public void TestAttributeSortingOptionHandling()
        {
            string testInput = MethodBase.GetCurrentMethod().Name + ".xaml";

            var stylerOptions = new StylerOptions
                                    {
                                        AttributeOrderClass = "x:Class",
                                        AttributeOrderWpfNamespace = "xmlns, xmlns:x",
                                        AttributeOrderKey = "Key, x:Key",
                                        AttributeOrderName = "Name, x:Name, Title",
                                        AttributeOrderAttachedLayout =
                                            "Grid.Column, Grid.ColumnSpan, Grid.Row, Grid.RowSpan, Canvas.Right, Canvas.Bottom, Canvas.Left, Canvas.Top",
                                        AttributeOrderCoreLayout =
                                            "MinWidth, MinHeight, Width, Height, MaxWidth, MaxHeight, Margin",
                                        AttributeOrderAlignmentLayout =
                                            "Panel.ZIndex, HorizontalAlignment, VerticalAlignment, HorizontalContentAlignment, VerticalContentAlignment",
                                        AttributeOrderOthers =
                                            "Offset, Color, TargetName, Property, Value, StartPoint, EndPoint, PageSource, PageIndex",
                                        AttributeOrderBlendRelated =
                                            "mc:Ignorable, d:IsDataSource, d:LayoutOverrides, d:IsStaticText"
                                    };
            var styler = StylerService.CreateInstance(stylerOptions);

            DoTest(testInput, styler);
        }
Пример #2
0
        public void TestxBindSplitting()
        {
            var stylerOptions = new StylerOptions
            {
                KeepxBindOnSameLine = true
            };

            DoTest(stylerOptions);
        }
Пример #3
0
        public void TestAttributeToleranceHandling()
        {
            var stylerOptions = new StylerOptions
            {
                AttributesTolerance = 3,
                RootElementLineBreakRule = LineBreakRule.Always,
            };

            DoTest(stylerOptions);
        }
Пример #4
0
        public void TestAttributeOrderRuleGroupsOnSeparateLinesHandling()
        {
            var stylerOptions = new StylerOptions
            {
                PutAttributeOrderRuleGroupsOnSeparateLines = true,
                MaxAttributesPerLine = 3,
            };

            DoTest(stylerOptions);
        }
Пример #5
0
        public void TestMarkupExtensionHandling()
        {
            string testInput = MethodBase.GetCurrentMethod().Name + ".xaml";

            var stylerOptions = new StylerOptions
                                    {
                                        FormatMarkupExtension = true
                                    };
            var styler = StylerService.CreateInstance(stylerOptions);

            DoTest(testInput, styler);
        }
Пример #6
0
        public void TestAttributeThresholdHandling()
        {
            var stylerOptions = new StylerOptions
            {
                AttributesTolerance = 0,
                MaxAttributeCharatersPerLine = 80,
                MaxAttributesPerLine = 3,
                PutEndingBracketOnNewLine = true
            };

            DoTest(stylerOptions);
        }
Пример #7
0
        public void TestAttributeThresholdHandling()
        {
            string testInput = MethodBase.GetCurrentMethod().Name + ".xaml";

            var stylerOptions = new StylerOptions
                                    {
                                        AttributesTolerance = 0,
                                        MaxAttributeCharatersPerLine = 80,
                                        MaxAttributesPerLine = 3,
                                        PutEndingBracketOnNewLine = true
                                    };

            var styler = StylerService.CreateInstance(stylerOptions);

            DoTest(testInput, styler);
        }
Пример #8
0
 private void DoTest(StylerOptions stylerOptions, [System.Runtime.CompilerServices.CallerMemberName] string callerMemberName = "")
 {
     // ReSharper disable once ExplicitCallerInfoArgument
     DoTest(StylerService.CreateInstance(stylerOptions), callerMemberName);
 }
Пример #9
0
        public void TestReorderSetterByTargetNameThenPropertyHandling()
        {
            var stylerOptions = new StylerOptions
            {
                ReorderSetters = ReorderSettersBy.TargetNameThenProperty,
            };

            DoTest(stylerOptions);
        }
Пример #10
0
        public void TestMarkupExtensionHandling()
        {
            var stylerOptions = new StylerOptions
            {
                FormatMarkupExtension = true
            };

            DoTest(stylerOptions);
        }
Пример #11
0
        public void TestBindingSplitting()
        {
            var stylerOptions = new StylerOptions
            {
                KeepBindingsOnSameLine = true
            };

            DoTest(stylerOptions);
        }
Пример #12
0
        public void TestClosingElementHandling(int testNumber, bool spaceBeforeClosingSlash)
        {
            var stylerOptions = new StylerOptions
            {
                SpaceBeforeClosingSlash = spaceBeforeClosingSlash
            };

            DoTest(stylerOptions, testNumber);
        }
Пример #13
0
        public void TestReorderSetterHandling(int testNumber, ReorderSettersBy reorderSettersBy)
        {
            var stylerOptions = new StylerOptions
            {
                ReorderSetters = reorderSettersBy,
            };

            DoTest(stylerOptions, testNumber);
        }
Пример #14
0
        public void TestMarkupWithAttributeNotOnFirstLine()
        {
            var stylerOptions = new StylerOptions
            {
                KeepFirstAttributeOnSameLine = false,
                AttributesTolerance = 1
            };

            DoTest(stylerOptions);
        }