public void WindowsFormsDesignerOptionService_Options_Get_ReturnsExpected() { var service = new WindowsFormsDesignerOptionService(); Assert.Empty(service.Options.Name); DesignerOptionService.DesignerOptionCollection childCollection = Assert.IsType <DesignerOptionService.DesignerOptionCollection>(Assert.Single(service.Options)); Assert.Equal("DesignerOptions", childCollection.Name); Assert.Same(service.Options, childCollection.Parent); Assert.Equal(new string[] { "EnableInSituEditing", "GridSize", "ObjectBoundSmartTagAutoShow", "ShowGrid", "SnapToGrid", "UseOptimizedCodeGeneration", "UseSmartTags", "UseSnapLines" }, childCollection.Properties.Sort().Cast <PropertyDescriptor>().Select(p => p.Name)); Assert.Empty(childCollection); }
static WindowsFormsDesignerOptionService CreateDesignerOptions() { LoggingService.Debug("ReportDesigner: CreateDesignerOptions..."); var designerOptionService = new WindowsFormsDesignerOptionService(); designerOptionService.Options.Properties.Find("UseSmartTags", true).SetValue(designerOptionService, true); designerOptionService.Options.Properties.Find("ShowGrid", true).SetValue(designerOptionService, false); designerOptionService.Options.Properties.Find("UseSnapLines", true).SetValue(designerOptionService, true); return(designerOptionService); }
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); }