Example #1
0
        public void DesignerOptions_GridSize_Set_GetReturnsExpected(Size value, Size expected)
        {
            var options = new DesignerOptions
            {
                GridSize = value
            };

            Assert.Equal(expected, options.GridSize);

            // Set same.
            options.GridSize = value;
            Assert.Equal(expected, options.GridSize);
        }
Example #2
0
        public void DesignerOptions_Ctor_Default()
        {
            var options = new DesignerOptions();

            Assert.True(options.EnableInSituEditing);
            Assert.Equal(new Size(8, 8), options.GridSize);
            Assert.True(options.ObjectBoundSmartTagAutoShow);
            Assert.True(options.ShowGrid);
            Assert.True(options.SnapToGrid);
            Assert.False(options.UseOptimizedCodeGeneration);
            Assert.False(options.UseSmartTags);
            Assert.False(options.UseSnapLines);
        }
Example #3
0
        protected override void PopulateOptionCollection(DesignerOptionCollection options)
        {
            if (options.Parent == null)
            {
                DesignerOptionCollection doc =
                    this.CreateOptionCollection(options, "WindowsFormsDesigner", null);

                DesignerOptions doptions = new DesignerOptions();

                doptions.UseSmartTags = true;
                doptions.UseSnapLines = true;
                this.CreateOptionCollection(doc, "General", doptions);
            }
        }
        public void WindowsFormsDesignerOptionService_Ctor_Default()
        {
            var             service = new WindowsFormsDesignerOptionService();
            DesignerOptions options = service.CompatibilityOptions;

            Assert.True(options.EnableInSituEditing);
            Assert.Equal(new Size(8, 8), options.GridSize);
            Assert.True(options.ObjectBoundSmartTagAutoShow);
            Assert.True(options.ShowGrid);
            Assert.True(options.SnapToGrid);
            Assert.False(options.UseSmartTags);
            Assert.False(options.UseSnapLines);
            Assert.False(options.UseOptimizedCodeGeneration);
            Assert.Same(options, service.CompatibilityOptions);
        }
Example #5
0
        protected override void PopulateOptionCollection(DesignerOptionCollection options)
        {
            if (null != options.Parent)
            {
                return;
            }

            DesignerOptions ops = new DesignerOptions();

            ops.UseSnapLines = true;
            ops.UseSmartTags = true;
            DesignerOptionCollection wfd = this.CreateOptionCollection(options, "WindowsFormsDesigner", null);

            this.CreateOptionCollection(wfd, "General", ops);
        }
Example #6
0
        public void DesignerOptions_ObjectBoundSmartTagAutoShow_Set_GetReturnsExpected(bool value)
        {
            var options = new DesignerOptions
            {
                ObjectBoundSmartTagAutoShow = value
            };

            Assert.Equal(value, options.ObjectBoundSmartTagAutoShow);

            // Set same.
            options.ObjectBoundSmartTagAutoShow = value;
            Assert.Equal(value, options.ObjectBoundSmartTagAutoShow);

            // Set different.
            options.ObjectBoundSmartTagAutoShow = !value;
            Assert.Equal(!value, options.ObjectBoundSmartTagAutoShow);
        }
Example #7
0
        public void DesignerOptions_EnableInSituEditing_Set_GetReturnsExpected(bool value)
        {
            var options = new DesignerOptions
            {
                EnableInSituEditing = value
            };

            Assert.Equal(value, options.EnableInSituEditing);

            // Set same.
            options.EnableInSituEditing = value;
            Assert.Equal(value, options.EnableInSituEditing);

            // Set different.
            options.EnableInSituEditing = !value;
            Assert.Equal(!value, options.EnableInSituEditing);
        }
Example #8
0
        public void DesignerOptions_UseSnapLines_Set_GetReturnsExpected(bool value)
        {
            var options = new DesignerOptions
            {
                UseSnapLines = value
            };

            Assert.Equal(value, options.UseSnapLines);

            // Set same.
            options.UseSnapLines = value;
            Assert.Equal(value, options.UseSnapLines);

            // Set different.
            options.UseSnapLines = !value;
            Assert.Equal(!value, options.UseSnapLines);
        }
Example #9
0
        public void DesignerOptions_UseOptimizedCodeGeneration_Set_GetReturnsExpected(bool value)
        {
            var options = new DesignerOptions
            {
                UseOptimizedCodeGeneration = value
            };

            Assert.Equal(value, options.UseOptimizedCodeGeneration);

            // Set same.
            options.UseOptimizedCodeGeneration = value;
            Assert.Equal(value, options.UseOptimizedCodeGeneration);

            // Set different.
            options.UseOptimizedCodeGeneration = !value;
            Assert.Equal(!value, options.UseOptimizedCodeGeneration);
        }
Example #10
0
        public void DesignerOptions_SnapToGrid_Set_GetReturnsExpected(bool value)
        {
            var options = new DesignerOptions
            {
                SnapToGrid = value
            };

            Assert.Equal(value, options.SnapToGrid);

            // Set same.
            options.SnapToGrid = value;
            Assert.Equal(value, options.SnapToGrid);

            // Set different.
            options.SnapToGrid = !value;
            Assert.Equal(!value, options.SnapToGrid);
        }
Example #11
0
        protected override void PopulateOptionCollection(DesignerOptionCollection options)
        {
            if (null != options.Parent)
            {
                return;
            }

            DesignerOptions ops = new DesignerOptions();

            ops.GridSize     = new System.Drawing.Size(8, 8);
            ops.SnapToGrid   = false;
            ops.ShowGrid     = false;
            ops.UseSnapLines = false;
            ops.UseSmartTags = true;
            DesignerOptionCollection wfd = this.CreateOptionCollection(options, "WindowsFormsDesigner", null);

            this.CreateOptionCollection(wfd, "General", ops);
        }