From 2af18c2d38d5a7206b92d28a75ca26d1829848cd Mon Sep 17 00:00:00 2001 From: "github-actions-dotnet-formatter[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 4 Dec 2020 15:12:55 +0000 Subject: [PATCH] Automated dotnet-format update --- .../HandyControlDemo_Code/DemoHelper.cs | 2 +- .../HandyControlDemo_Shared/App.xaml.cs | 26 +- .../HandyControlDemo_Shared/Data/AppConfig.cs | 2 +- .../Data/Enum/DemoType.cs | 2 +- .../Data/GlobalData.cs | 2 +- .../Data/MessageToken.cs | 6 +- .../Data/Model/AvatarModel.cs | 2 +- .../Data/Model/ChatInfoModel.cs | 2 +- .../Data/Model/CoverViewDemoModel.cs | 2 +- .../Data/Model/DemoDataModel.cs | 2 +- .../Data/Model/DemoInfoModel.cs | 2 +- .../Data/Model/GeometryItemModel.cs | 2 +- .../Data/Model/PropertyGridDemoModel.cs | 2 +- .../Data/Model/StepBarDemoModel.cs | 2 +- .../MainWindow.xaml.cs | 2 +- .../Properties/Langs/LangProvider.cs | 420 +++++++++--------- .../Resources/Registry.txt | Bin 688 -> 330 bytes .../Service/Data/DataService.cs | 14 +- .../Tools/Converter/String2BrushConverter.cs | 2 +- .../Tools/Converter/StringRepeatConverter.cs | 4 +- .../Tools/Helper/AssemblyHelper.cs | 2 +- .../Tools/Helper/VersionHelper.cs | 2 +- .../UserControl/Basic/Avatar.xaml.cs | 2 +- .../UserControl/Basic/GeometryItem.xaml.cs | 2 +- .../UserControl/Basic/IFull.cs | 4 +- .../Controls/ButtonGroupDemoCtl.xaml.cs | 2 +- .../UserControl/Controls/ClockDemoCtl.xaml.cs | 2 +- .../Controls/CoverFlowDemoCtl.xaml.cs | 2 +- .../UserControl/Controls/GridDemoCtl.xaml.cs | 2 +- .../Controls/NumericUpDownDemoCtl.xaml.cs | 4 +- .../Controls/RangeSliderDemoCtl.xaml.cs | 2 +- .../Controls/TimePickerDemoCtl.xaml.cs | 2 +- .../UserControl/Main/ContributorsView.xaml.cs | 2 +- .../UserControl/Main/LeftMainContent.xaml.cs | 2 +- .../UserControl/Main/MainContent.xaml.cs | 2 +- .../Main/MainWindowContent.xaml.cs | 2 +- .../UserControl/Main/NonClientAreaContent.cs | 2 +- .../UserControl/Styles/FrameDemoCtl.xaml.cs | 2 +- .../ViewModel/Basic/ChatBoxViewModel.cs | 2 +- .../Basic/InteractiveDialogViewModel.cs | 2 +- .../ViewModel/Common/ComboBoxDemoViewModel.cs | 2 +- .../ViewModel/Controls/CoverViewModel.cs | 2 +- .../ViewModel/Controls/DialogDemoViewModel.cs | 2 +- .../ViewModel/Controls/GrowlDemoViewModel.cs | 4 +- .../Controls/ImageBrowserDemoViewModel.cs | 2 +- .../Controls/NotificationDemoViewModel.cs | 4 +- .../Controls/NotifyIconDemoViewModel.cs | 4 +- .../Controls/PaginationDemoViewModel.cs | 2 +- .../Controls/SearchBarDemoViewModel.cs | 2 +- .../Controls/SideMenuDemoViewModel.cs | 4 +- .../Controls/SplitButtonDemoViewModel.cs | 2 +- .../ViewModel/Controls/SpriteDemoViewModel.cs | 6 +- .../Controls/StepBarDemoViewModel.cs | 2 +- .../Controls/TabControlDemoViewModel.cs | 4 +- .../ViewModel/Controls/TagDemoViewModel.cs | 2 +- .../ViewModel/Controls/WindowDemoViewModel.cs | 2 +- .../ViewModel/DemoViewModelBase!1.cs | 2 +- .../ViewModel/Main/ItemsDisplayViewModel.cs | 2 +- .../ViewModel/Main/MainViewModel.cs | 2 +- .../ViewModel/Main/NonClientAreaViewModel.cs | 2 +- .../ViewModel/ViewModelLocator.cs | 2 +- .../ManualObservableCollection!1.cs | 12 +- .../Attach/BackgroundSwitchElement.cs | 6 +- .../Controls/Attach/BorderElement.cs | 8 +- .../Controls/Attach/DataGridAttach.cs | 28 +- .../Controls/Attach/EdgeElement.cs | 2 +- .../Controls/Attach/IconElement.cs | 4 +- .../Controls/Attach/IconSwitchElement.cs | 4 +- .../Controls/Attach/InfoElement.cs | 10 +- .../Controls/Attach/MenuTopLineAttach.cs | 6 +- .../Controls/Attach/PanelElement.cs | 4 +- .../Controls/Attach/PasswordBoxAttach.cs | 6 +- .../Controls/Attach/RectangleAttach.cs | 2 +- .../Controls/Attach/StatusSwitchElement.cs | 2 +- .../Controls/Attach/TextBlockAttach.cs | 4 +- .../Controls/Attach/TipElement.cs | 2 +- .../Controls/Attach/TitleElement.cs | 4 +- .../Controls/Attach/VisualElement.cs | 2 +- .../Controls/Attach/WindowAttach.cs | 10 +- .../Controls/Base/AdornerElement.cs | 6 +- .../Controls/Base/HeaderedSelectableItem.cs | 2 +- .../Base/HeaderedSimpleItemsControl.cs | 2 +- .../Controls/Base/IGravatarGenerator.cs | 2 +- .../Controls/Base/ISelectable.cs | 2 +- .../Controls/Base/ISingleOpen.cs | 2 +- .../Controls/Base/RegularItemsControl.cs | 2 +- .../Controls/Base/SelectableItem.cs | 4 +- .../Controls/Base/SimpleItemsControl.cs | 4 +- .../Controls/Block/FloatingBlock.cs | 8 +- .../Block/RunningBlock/RunningBlock.cs | 20 +- .../Block/RunningBlock/RunningBorder.cs | 2 +- .../Controls/Block/ToggleBlock.cs | 4 +- .../Controls/Button/ButtonGroup.cs | 4 +- .../Controls/Button/ContextMenuButton.cs | 2 +- .../Button/ContextMenuToggleButton.cs | 2 +- .../Controls/Button/ProgressButton.cs | 2 +- .../Controls/Carousel/Carousel.cs | 18 +- .../Controls/ColorPicker/ColorDropper.cs | 4 +- .../Controls/ColorPicker/ColorPicker.cs | 48 +- .../Controls/Cover/CoverFlow/CoverFlow.cs | 16 +- .../Controls/Cover/CoverFlow/CoverFlowItem.cs | 2 +- .../Controls/Cover/CoverView/CoverView.cs | 14 +- .../Cover/CoverView/CoverViewContent.cs | 6 +- .../Controls/Cover/CoverView/CoverViewItem.cs | 4 +- .../Controls/Dialog/Dialog.cs | 10 +- .../Controls/Dialog/DialogContainer.cs | 4 +- .../Controls/Growl/Growl.cs | 24 +- .../Controls/Growl/GrowlWindow.cs | 2 +- .../Controls/Image/GifImage.cs | 14 +- .../Controls/Image/ImageBlock.cs | 16 +- .../Controls/Image/ImageViewer.cs | 32 +- .../Controls/Input/ComboBox.cs | 24 +- .../Controls/Input/DatePicker.cs | 10 +- .../Controls/Input/DateTimePicker.cs | 32 +- .../Controls/Input/IDataInput.cs | 2 +- .../Controls/Input/ImageSelector.cs | 4 +- .../Controls/Input/NumericUpDown.cs | 52 +-- .../Controls/Input/PasswordBox.cs | 36 +- .../Controls/Input/PinBox.cs | 16 +- .../Controls/Input/SearchBar.cs | 4 +- .../Controls/Input/TextBox.cs | 6 +- .../Controls/Input/TimePicker.cs | 58 +-- .../Controls/Input/WatermarkTextBox.cs | 2 +- .../Controls/Internal/InternalCanvas.cs | 2 +- .../Controls/Loading/LoadingBase.cs | 12 +- .../Controls/Loading/LoadingCircle.cs | 2 +- .../Controls/Loading/LoadingLine.cs | 8 +- .../Controls/Other/AnimationPath.cs | 16 +- .../Controls/Other/Badge.cs | 14 +- .../Controls/Other/BlendEffectBox.cs | 4 +- .../Controls/Other/ChatBubble.cs | 2 +- .../Controls/Other/DashedBorder.cs | 8 +- .../Controls/Other/Divider.cs | 2 +- .../Controls/Other/Drawer.cs | 6 +- .../Controls/Other/GotoTop.cs | 4 +- .../Controls/Other/Gravatar.cs | 6 +- .../Controls/Other/Magnifier.cs | 8 +- .../Controls/Other/Notification.cs | 2 +- .../Controls/Other/NotifyIcon.cs | 46 +- .../Controls/Other/Pagination.cs | 16 +- .../Controls/Other/Poptip.cs | 18 +- .../Controls/Other/ScrollViewer.cs | 4 +- .../Controls/Other/Shield.cs | 2 +- .../Controls/Other/Sprite.cs | 4 +- .../Controls/Other/Watermark.cs | 2 +- .../Controls/Panel/CirclePanel.cs | 10 +- .../Controls/Panel/FlexPanel.cs | 22 +- .../Controls/Panel/Grid/Col.cs | 6 +- .../Controls/Panel/Grid/Row.cs | 6 +- .../Controls/Panel/HoneycombPanel.cs | 4 +- .../Controls/Panel/RelativePanel.cs | 18 +- .../Controls/Panel/SimplePanel.cs | 2 +- .../Controls/Panel/WaterfallPanel.cs | 6 +- .../Controls/ProgressBar/CircleProgressBar.cs | 4 +- .../Controls/ProgressBar/WaveProgressBar.cs | 8 +- .../Editors/DatePropertyEditor.cs | 2 +- .../Editors/DateTimePropertyEditor.cs | 2 +- .../Editors/EnumPropertyEditor.cs | 2 +- .../HorizontalAlignmentPropertyEditor.cs | 2 +- .../Editors/ImagePropertyEditor.cs | 6 +- .../Editors/NumberPropertyEditor.cs | 4 +- .../Editors/PlainTextPropertyEditor.cs | 2 +- .../Editors/PropertyEditorBase.cs | 2 +- .../Editors/ReadOnlyTextPropertyEditor.cs | 2 +- .../Editors/SwitchPropertyEditor.cs | 2 +- .../Editors/TimePropertyEditor.cs | 2 +- .../VerticalAlignmentPropertyEditor.cs | 2 +- .../Controls/PropertyGrid/PropertyGrid.cs | 8 +- .../Controls/PropertyGrid/PropertyItem.cs | 20 +- .../PropertyGrid/PropertyItemsControl.cs | 2 +- .../Controls/PropertyGrid/PropertyResolver.cs | 8 +- .../HandyControl_Shared/Controls/Rate/Rate.cs | 6 +- .../Controls/Rate/RateItem.cs | 10 +- .../Controls/Screenshot/ScreenshotWindow.cs | 28 +- .../Controls/SideMenu/SideMenu.cs | 4 +- .../Controls/SideMenu/SideMenuItem.cs | 6 +- .../Slider/CompareSlider/CompareSlider.cs | 4 +- .../Slider/CompareSlider/CompareTrack.cs | 2 +- .../Controls/Slider/PreviewSlider.cs | 4 +- .../Slider/RangeSlider/RangeSlider.cs | 32 +- .../Controls/Slider/RangeSlider/RangeThumb.cs | 4 +- .../Controls/Slider/RangeSlider/RangeTrack.cs | 8 +- .../Slider/RangeSlider/TwoWayRangeBase.cs | 48 +- .../Controls/StepBar/StepBar.cs | 14 +- .../Controls/StepBar/StepBarItem.cs | 2 +- .../Controls/TabControl/TabControl.cs | 20 +- .../Controls/TabControl/TabItem.cs | 36 +- .../Controls/TabControl/TabPanel.cs | 12 +- .../HandyControl_Shared/Controls/Tag/Tag.cs | 4 +- .../Controls/Tag/TagContainer.cs | 2 +- .../Controls/Text/OutlineText.cs | 18 +- .../Controls/Text/SimpleText.cs | 24 +- .../Controls/Time/CalendarWithClock.cs | 18 +- .../Controls/Time/Clock/Clock.cs | 8 +- .../Controls/Time/Clock/ClockBase.cs | 14 +- .../Controls/Time/Clock/ClockRadioButton.cs | 2 +- .../Controls/Time/Clock/ListClock.cs | 2 +- .../Controls/Time/FlipClock/FlipClock.cs | 4 +- .../Controls/Time/FlipClock/FlipNumber.cs | 14 +- .../Controls/Time/TimeBar/SpeTextBlock.cs | 2 +- .../Controls/Time/TimeBar/TimeBar.cs | 22 +- .../Controls/Transfer/Transfer.cs | 4 +- .../Controls/Transfer/TransferGroup.cs | 2 +- .../Controls/Transfer/TransferItem.cs | 2 +- .../Controls/Window/BlurWindow.cs | 8 +- .../Controls/Window/GlowWindow.cs | 30 +- .../Controls/Window/ImageBrowser.cs | 4 +- .../Controls/Window/MessageBox.cs | 18 +- .../Controls/Window/PopupWindow.cs | 4 +- .../Controls/Window/Window.cs | 42 +- .../Data/Args/CancelRoutedEventArgs.cs | 2 +- .../Data/Args/FunctionEventArgs!1.cs | 2 +- .../Data/Args/KeyboardHookEventArgs.cs | 2 +- .../Data/Args/MouseHookEventArgs.cs | 2 +- .../Data/DisposableObject.cs | 2 +- .../Data/Enum/BadgeStatus.cs | 6 +- .../Data/Enum/ChatMessageType.cs | 2 +- .../Data/Enum/ChatRoleType.cs | 2 +- .../Data/Enum/ColLayoutStatus.cs | 2 +- .../Data/Enum/HatchStyle.cs | 2 +- .../Data/Enum/ImageCodecFlags.cs | 2 +- .../HandyControl_Shared/Data/Enum/InfoType.cs | 2 +- .../HandyControl_Shared/Data/Enum/IpType.cs | 2 +- .../Data/Enum/MouseHookMessageType.cs | 2 +- .../Data/Enum/PlacementType.cs | 16 +- .../Data/Enum/ResultType.cs | 2 +- .../Data/Enum/ShowAnimation.cs | 2 +- .../Data/Enum/SideMenuItemRole.cs | 2 +- .../HandyControl_Shared/Data/Enum/SkinType.cs | 2 +- .../Data/Enum/StepStatus.cs | 2 +- .../Data/Enum/StrokePosition.cs | 2 +- .../HandyControl_Shared/Data/Enum/TextType.cs | 2 +- .../Data/Enum/TitlePlacementType.cs | 2 +- .../Data/Flex/FlexContentAlignment.cs | 2 +- .../Data/Flex/FlexContentJustify.cs | 2 +- .../HandyControl_Shared/Data/Gif/GPStream.cs | 6 +- .../Data/Gif/GifFrameDimension.cs | 2 +- .../Data/Gif/GifImageInfo.cs | 2 +- .../Data/Gif/GifPropertyItem.cs | 2 +- .../Data/Gif/GifPropertyItemInternal.cs | 2 +- .../Data/GlowWindow/GlowBitmap.cs | 8 +- .../Data/GlowWindow/GlowDrawingContext.cs | 6 +- .../Data/GlowWindow/GlowEdge.cs | 38 +- .../Data/HandyControlConfig.cs | 2 +- .../HandyControl_Shared/Data/HwndWrapper.cs | 8 +- .../Data/Info/GrowlInfo.cs | 2 +- .../Data/Info/ImageCodecInfo.cs | 8 +- .../Data/Info/MessageBoxInfo.cs | 2 +- .../Data/Info/SystemVersionInfo.cs | 4 +- .../Data/Operation/OperationResult!1.cs | 2 +- .../Data/Operation/OperationResult.cs | 2 +- .../Data/Range/ColorRange.cs | 6 +- .../Data/Range/DateTimeRange.cs | 4 +- .../Data/Range/DoubleRange.cs | 2 +- .../HandyControl_Shared/Data/ResourceToken.cs | 2 +- .../HandyControl_Shared/Data/ValueBoxes.cs | 2 +- .../Drawing/BezierCurveFlattener.cs | 2 +- .../Expression/Drawing/CommonExtensions.cs | 2 +- .../Drawing/ExceptionStringTable.cs | 2 +- .../Expression/Drawing/GeometryHelper.cs | 2 +- .../Expression/Drawing/MarchLocation.cs | 2 +- .../Expression/Drawing/MarchStopReason.cs | 2 +- .../Expression/Drawing/MathHelper.cs | 2 +- .../Expression/Drawing/PathFigureHelper.cs | 2 +- .../Expression/Drawing/PathGeometryHelper.cs | 2 +- .../Expression/Drawing/PathSegmentData.cs | 2 +- .../Expression/Drawing/PathSegmentHelper.cs | 26 +- .../Expression/Drawing/PolylineData.cs | 2 +- .../Expression/Drawing/PolylineHelper.cs | 2 +- .../Expression/Drawing/RandomEngine.cs | 2 +- .../Expression/Drawing/SimpleSegment.cs | 8 +- .../Expression/Media/ArcGeometrySource.cs | 6 +- .../Media/DrawingPropertyChangedEventArgs.cs | 2 +- .../Media/DrawingPropertyMetadata.cs | 9 +- .../Media/DrawingPropertyMetadataOptions.cs | 2 +- .../Expression/Media/GeometryEffect.cs | 4 +- .../Media/GeometryEffectConverter.cs | 2 +- .../Expression/Media/GeometrySource!1.cs | 2 +- .../Media/IArcGeometrySourceParameters.cs | 2 +- .../Expression/Media/IGeometrySource.cs | 2 +- .../Media/IGeometrySourceExtensions.cs | 2 +- .../Media/IGeometrySourceParameters.cs | 2 +- .../Expression/Media/IShape.cs | 2 +- .../Media/InvalidateGeometryReasons.cs | 2 +- .../Expression/Media/SketchGeometryEffect.cs | 16 +- .../Expression/Media/UnitType.cs | 2 +- .../Expression/Shapes/Arc.cs | 2 +- .../Expression/Shapes/PrimitiveShape.cs | 2 +- .../Interactivity/AdornerContainer.cs | 2 +- .../Interactivity/AttachableCollection!1.cs | 2 +- .../Interactivity/Behavior/Behavior!1.cs | 4 +- .../Interactivity/Behavior/Behavior.cs | 4 +- .../Behavior/BehaviorCollection.cs | 2 +- .../Behavior/FluidMoveBehavior.cs | 4 +- .../Behavior/FluidMoveBehaviorBase.cs | 2 +- .../Behavior/MouseDragElementBehavior.cs | 4 +- .../Behavior/MouseDragElementBehaviorEx.cs | 18 +- .../Commands/CloseWindowCommand.cs | 2 +- .../Interactivity/Commands/ControlCommands.cs | 2 +- .../Interactivity/Commands/OpenLinkCommand.cs | 2 +- .../Commands/PushMainWindow2TopCommand.cs | 2 +- .../Commands/ShutdownAppCommand.cs | 2 +- .../Interactivity/DefaultTriggerAttribute.cs | 6 +- .../Interactivity/EventToCommand.cs | 2 +- .../Interactivity/EventTrigger.cs | 6 +- .../Interactivity/EventTriggerBase!1.cs | 4 +- .../Interactivity/EventTriggerBase.cs | 6 +- .../Interactivity/ExceptionStringTable.cs | 2 +- .../ExtendedVisualStateManager.cs | 4 +- .../Interactivity/FluidMoveScope.cs | 2 +- .../Interactivity/IAttachedObject.cs | 2 +- .../Interactivity/IEventArgsConverter.cs | 2 +- .../Interactivity/Interaction.cs | 2 +- .../Interactivity/InvokeCommandAction.cs | 8 +- .../Interactivity/NameResolvedEventArgs.cs | 2 +- .../Interactivity/NameResolver.cs | 2 +- .../Interactivity/PreviewInvokeEventArgs.cs | 2 +- .../Interactivity/RoutedEventTrigger.cs | 4 +- .../Interactivity/TagType.cs | 2 +- .../Interactivity/TransitionEffect.cs | 2 +- .../Interactivity/TriggerAction!1.cs | 4 +- .../Interactivity/TriggerAction.cs | 2 +- .../Interactivity/TriggerActionCollection.cs | 2 +- .../Interactivity/TriggerBase.cs | 2 +- .../Interactivity/TriggerCollection.cs | 2 +- .../Interactivity/TypeConstraintAttribute.cs | 2 +- .../Animation/DiscreteGeometryKeyFrame.cs | 2 +- .../Media/Animation/GeometryAnimation.cs | 20 +- .../Media/Animation/GeometryAnimationBase.cs | 6 +- .../GeometryAnimationUsingKeyFrames.cs | 24 +- .../Media/Animation/GeometryKeyFrame.cs | 6 +- .../Animation/GeometryKeyFrameCollection.cs | 42 +- .../Media/Animation/ResolvedKeyFrameEntry.cs | 4 +- .../Media/Effects/BrightnessEffect.cs | 2 +- .../Media/Effects/ColorMatrixEffect.cs | 42 +- .../Media/Effects/ContrastEffect.cs | 2 +- .../Media/Effects/EffectBase.cs | 2 +- .../Properties/AssemblyInfo.cs | 2 +- .../Properties/Langs/LangProvider.cs | 80 ++-- .../Converter/Boolean2BooleanReConverter.cs | 2 +- .../Tools/Converter/Boolean2StrConverter.cs | 2 +- .../Boolean2VisibilityReConverter.cs | 4 +- .../BooleanArr2VisibilityConverter.cs | 4 +- .../Converter/BorderCircularClipConverter.cs | 2 +- .../Converter/BorderCircularConverter.cs | 4 +- .../Tools/Converter/BorderClipConverter.cs | 2 +- .../Tools/Converter/ColLayoutConverter.cs | 8 +- .../Converter/Color2ChannelAConverter.cs | 2 +- .../Tools/Converter/Color2HexStrConverter.cs | 2 +- .../Tools/Converter/Int2StrConverter.cs | 2 +- .../Tools/Converter/Long2FileSizeConverter.cs | 2 +- .../Converter/Object2BooleanConverter.cs | 2 +- .../Converter/String2VisibilityConverter.cs | 6 +- .../Converter/String2VisibilityReConverter.cs | 6 +- .../Converter/TreeViewItemMarginConverter.cs | 6 +- .../Tools/Extension/ColLayout.cs | 4 +- .../Tools/Extension/ColorExtension.cs | 2 +- .../Tools/Extension/EnumerableExtension.cs | 2 +- .../Extension/FrameworkElementExtension.cs | 2 +- .../Tools/Extension/GeometryExtension.cs | 2 +- .../Tools/Extension/LangExtension.cs | 4 +- .../Tools/Extension/StringExtension.cs | 4 +- .../Tools/Extension/UIElementExtension.cs | 2 +- .../Tools/Extension/ValueExtension.cs | 2 +- .../Tools/Generator/ComparerGenerator.cs | 2 +- .../Generator/GithubGravatarGenerator.cs | 4 +- .../Tools/Generator/HatchBrushGenerator.cs | 2 +- .../Tools/GifImageAnimator.cs | 2 +- .../Tools/GlobalShortcut.cs | 4 +- .../Tools/Helper/AnimationHelper.cs | 2 +- .../Tools/Helper/ArithmeticHelper.cs | 2 +- .../Tools/Helper/ColorHelper.cs | 2 +- .../Tools/Helper/ConfigHelper.cs | 6 +- .../Tools/Helper/DesignerHelper.cs | 4 +- .../Tools/Helper/DpiHelper.cs | 4 +- .../Tools/Helper/IconHelper.cs | 18 +- .../Tools/Helper/InputClickHelper.cs | 12 +- .../Tools/Helper/ResourceHelper.cs | 4 +- .../Tools/Helper/ScreenHelper.cs | 16 +- .../Tools/Helper/SecurityHelper.cs | 2 +- .../Tools/Helper/SingleOpenHelper.cs | 2 +- .../Tools/Helper/TokenizerHelper.cs | 2 +- .../Tools/Helper/ValidateHelper.cs | 20 +- .../Tools/Helper/VisualHelper.cs | 2 +- .../Tools/Helper/WindowHelper.cs | 10 +- .../Tools/Hook/KeyboardHook.cs | 14 +- .../Tools/Hook/MouseHook.cs | 8 +- .../Tools/Interop/Handle/BitmapHandle.cs | 2 +- .../Tools/Interop/Handle/CommonHandles.cs | 2 +- .../Tools/Interop/Handle/HandleCollector.cs | 4 +- .../Tools/Interop/Handle/IconHandle.cs | 2 +- .../Interop/Handle/SafeFileMappingHandle.cs | 4 +- .../Tools/Interop/Handle/WpfSafeHandle.cs | 2 +- .../Tools/Interop/InteropMethods.cs | 24 +- .../Tools/Interop/InteropValues.cs | 18 +- .../Tools/Pool/SimplePool!1.cs | 2 +- .../Tools/Pool/SynchronizedPool!1.cs | 5 +- .../Tools/Queue/Deque!1.cs | 2 +- .../Tools/RegexJudgment.cs | 2 +- .../Tools/RegexPatterns.cs | 2 +- .../ButtonGroupItemStyleSelector.cs | 102 ++--- .../ComboBoxItemCapsuleStyleSelector.cs | 2 +- .../TabItemCapsuleStyleSelector.cs | 2 +- 403 files changed, 1569 insertions(+), 1567 deletions(-) diff --git a/src/Shared/HandyControlDemo_Code/DemoHelper.cs b/src/Shared/HandyControlDemo_Code/DemoHelper.cs index b45e370e..abf62933 100644 --- a/src/Shared/HandyControlDemo_Code/DemoHelper.cs +++ b/src/Shared/HandyControlDemo_Code/DemoHelper.cs @@ -22,4 +22,4 @@ public class DemoHelper return ""; } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControlDemo_Shared/App.xaml.cs b/src/Shared/HandyControlDemo_Shared/App.xaml.cs index 9d7954fa..71e393da 100644 --- a/src/Shared/HandyControlDemo_Shared/App.xaml.cs +++ b/src/Shared/HandyControlDemo_Shared/App.xaml.cs @@ -18,7 +18,7 @@ namespace HandyControlDemo public partial class App { #pragma warning disable IDE0052 - [SuppressMessage("ReSharper", "NotAccessedField.Local")] + [SuppressMessage("ReSharper", "NotAccessedField.Local")] private static Mutex AppMutex; #pragma warning restore IDE0052 @@ -92,18 +92,18 @@ namespace HandyControlDemo { var skins0 = Resources.MergedDictionaries[0]; skins0.MergedDictionaries.Clear(); - skins0.MergedDictionaries.Add(ResourceHelper.GetSkin(skin)); - skins0.MergedDictionaries.Add(ResourceHelper.GetSkin(typeof(App).Assembly, "Resources/Themes", skin)); - - var skins1 = Resources.MergedDictionaries[1]; - skins1.MergedDictionaries.Clear(); - skins1.MergedDictionaries.Add(new ResourceDictionary - { - Source = new Uri("pack://application:,,,/HandyControl;component/Themes/Theme.xaml") - }); - skins1.MergedDictionaries.Add(new ResourceDictionary - { - Source = new Uri("pack://application:,,,/HandyControlDemo;component/Resources/Themes/Theme.xaml") + skins0.MergedDictionaries.Add(ResourceHelper.GetSkin(skin)); + skins0.MergedDictionaries.Add(ResourceHelper.GetSkin(typeof(App).Assembly, "Resources/Themes", skin)); + + var skins1 = Resources.MergedDictionaries[1]; + skins1.MergedDictionaries.Clear(); + skins1.MergedDictionaries.Add(new ResourceDictionary + { + Source = new Uri("pack://application:,,,/HandyControl;component/Themes/Theme.xaml") + }); + skins1.MergedDictionaries.Add(new ResourceDictionary + { + Source = new Uri("pack://application:,,,/HandyControlDemo;component/Resources/Themes/Theme.xaml") }); Current.MainWindow?.OnApplyTemplate(); diff --git a/src/Shared/HandyControlDemo_Shared/Data/AppConfig.cs b/src/Shared/HandyControlDemo_Shared/Data/AppConfig.cs index 0084a625..5162608b 100644 --- a/src/Shared/HandyControlDemo_Shared/Data/AppConfig.cs +++ b/src/Shared/HandyControlDemo_Shared/Data/AppConfig.cs @@ -11,4 +11,4 @@ namespace HandyControlDemo.Data public SkinType Skin { get; set; } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControlDemo_Shared/Data/Enum/DemoType.cs b/src/Shared/HandyControlDemo_Shared/Data/Enum/DemoType.cs index 09c3039c..1bc162c7 100644 --- a/src/Shared/HandyControlDemo_Shared/Data/Enum/DemoType.cs +++ b/src/Shared/HandyControlDemo_Shared/Data/Enum/DemoType.cs @@ -10,4 +10,4 @@ namespace HandyControlDemo.Data Type5, Type6 } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControlDemo_Shared/Data/GlobalData.cs b/src/Shared/HandyControlDemo_Shared/Data/GlobalData.cs index d49cb4c8..d4c8af00 100644 --- a/src/Shared/HandyControlDemo_Shared/Data/GlobalData.cs +++ b/src/Shared/HandyControlDemo_Shared/Data/GlobalData.cs @@ -35,4 +35,4 @@ namespace HandyControlDemo.Data public static bool NotifyIconIsShow { get; set; } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControlDemo_Shared/Data/MessageToken.cs b/src/Shared/HandyControlDemo_Shared/Data/MessageToken.cs index 6fdfd99e..a3fbf50b 100644 --- a/src/Shared/HandyControlDemo_Shared/Data/MessageToken.cs +++ b/src/Shared/HandyControlDemo_Shared/Data/MessageToken.cs @@ -1,8 +1,8 @@ namespace HandyControlDemo.Data { - public class MessageToken + public class MessageToken { - public static readonly string LoadShowContent = nameof(LoadShowContent); + public static readonly string LoadShowContent = nameof(LoadShowContent); public static readonly string FullSwitch = nameof(FullSwitch); @@ -51,4 +51,4 @@ public static readonly string LangUpdated = nameof(LangUpdated); } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControlDemo_Shared/Data/Model/AvatarModel.cs b/src/Shared/HandyControlDemo_Shared/Data/Model/AvatarModel.cs index 8669090b..9168a52a 100644 --- a/src/Shared/HandyControlDemo_Shared/Data/Model/AvatarModel.cs +++ b/src/Shared/HandyControlDemo_Shared/Data/Model/AvatarModel.cs @@ -9,4 +9,4 @@ namespace HandyControlDemo.Data public string AvatarUri { get; set; } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControlDemo_Shared/Data/Model/ChatInfoModel.cs b/src/Shared/HandyControlDemo_Shared/Data/Model/ChatInfoModel.cs index 92b4e3a1..6f77fefc 100644 --- a/src/Shared/HandyControlDemo_Shared/Data/Model/ChatInfoModel.cs +++ b/src/Shared/HandyControlDemo_Shared/Data/Model/ChatInfoModel.cs @@ -14,4 +14,4 @@ namespace HandyControlDemo.Data public object Enclosure { get; set; } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControlDemo_Shared/Data/Model/CoverViewDemoModel.cs b/src/Shared/HandyControlDemo_Shared/Data/Model/CoverViewDemoModel.cs index 6113440b..23d5b341 100644 --- a/src/Shared/HandyControlDemo_Shared/Data/Model/CoverViewDemoModel.cs +++ b/src/Shared/HandyControlDemo_Shared/Data/Model/CoverViewDemoModel.cs @@ -6,4 +6,4 @@ public string BackgroundToken { get; set; } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControlDemo_Shared/Data/Model/DemoDataModel.cs b/src/Shared/HandyControlDemo_Shared/Data/Model/DemoDataModel.cs index 9be6e383..800a5f38 100644 --- a/src/Shared/HandyControlDemo_Shared/Data/Model/DemoDataModel.cs +++ b/src/Shared/HandyControlDemo_Shared/Data/Model/DemoDataModel.cs @@ -19,4 +19,4 @@ namespace HandyControlDemo.Data public List DataList { get; set; } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControlDemo_Shared/Data/Model/DemoInfoModel.cs b/src/Shared/HandyControlDemo_Shared/Data/Model/DemoInfoModel.cs index 4da6f859..45704931 100644 --- a/src/Shared/HandyControlDemo_Shared/Data/Model/DemoInfoModel.cs +++ b/src/Shared/HandyControlDemo_Shared/Data/Model/DemoInfoModel.cs @@ -33,4 +33,4 @@ namespace HandyControlDemo.Data public IList DemoItemList { get; set; } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControlDemo_Shared/Data/Model/GeometryItemModel.cs b/src/Shared/HandyControlDemo_Shared/Data/Model/GeometryItemModel.cs index dca49b44..6068897a 100644 --- a/src/Shared/HandyControlDemo_Shared/Data/Model/GeometryItemModel.cs +++ b/src/Shared/HandyControlDemo_Shared/Data/Model/GeometryItemModel.cs @@ -10,4 +10,4 @@ namespace HandyControlDemo.Data public bool Line { get; set; } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControlDemo_Shared/Data/Model/PropertyGridDemoModel.cs b/src/Shared/HandyControlDemo_Shared/Data/Model/PropertyGridDemoModel.cs index ebc634a5..a6c48a91 100644 --- a/src/Shared/HandyControlDemo_Shared/Data/Model/PropertyGridDemoModel.cs +++ b/src/Shared/HandyControlDemo_Shared/Data/Model/PropertyGridDemoModel.cs @@ -30,4 +30,4 @@ namespace HandyControlDemo.Data Male, Female } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControlDemo_Shared/Data/Model/StepBarDemoModel.cs b/src/Shared/HandyControlDemo_Shared/Data/Model/StepBarDemoModel.cs index 7cd77a20..317054a5 100644 --- a/src/Shared/HandyControlDemo_Shared/Data/Model/StepBarDemoModel.cs +++ b/src/Shared/HandyControlDemo_Shared/Data/Model/StepBarDemoModel.cs @@ -6,4 +6,4 @@ public string Content { get; set; } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControlDemo_Shared/MainWindow.xaml.cs b/src/Shared/HandyControlDemo_Shared/MainWindow.xaml.cs index 4fc8144c..f95e174a 100644 --- a/src/Shared/HandyControlDemo_Shared/MainWindow.xaml.cs +++ b/src/Shared/HandyControlDemo_Shared/MainWindow.xaml.cs @@ -51,4 +51,4 @@ namespace HandyControlDemo } } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControlDemo_Shared/Properties/Langs/LangProvider.cs b/src/Shared/HandyControlDemo_Shared/Properties/Langs/LangProvider.cs index 9aade061..0996d4f7 100644 --- a/src/Shared/HandyControlDemo_Shared/Properties/Langs/LangProvider.cs +++ b/src/Shared/HandyControlDemo_Shared/Properties/Langs/LangProvider.cs @@ -35,224 +35,224 @@ namespace HandyControlDemo.Properties.Langs Mode = BindingMode.OneWay }); - private void UpdateLangs() + private void UpdateLangs() { - OnPropertyChanged(nameof(About)); - OnPropertyChanged(nameof(AddItem)); - OnPropertyChanged(nameof(AnimationPath)); - OnPropertyChanged(nameof(AppClosingTip)); - OnPropertyChanged(nameof(Ask)); - OnPropertyChanged(nameof(Badge)); - OnPropertyChanged(nameof(BasicInfo)); - OnPropertyChanged(nameof(BasicLayout)); - OnPropertyChanged(nameof(Blink)); - OnPropertyChanged(nameof(Blog)); - OnPropertyChanged(nameof(Border)); - OnPropertyChanged(nameof(Brush)); - OnPropertyChanged(nameof(Button)); - OnPropertyChanged(nameof(ButtonCustom)); - OnPropertyChanged(nameof(ButtonGroup)); - OnPropertyChanged(nameof(Calendar)); - OnPropertyChanged(nameof(CalendarWithClock)); - OnPropertyChanged(nameof(Card)); - OnPropertyChanged(nameof(Carousel)); - OnPropertyChanged(nameof(ChangeLangAsk)); - OnPropertyChanged(nameof(ChatBubble)); - OnPropertyChanged(nameof(Chatroom)); - OnPropertyChanged(nameof(CheckBox)); + OnPropertyChanged(nameof(About)); + OnPropertyChanged(nameof(AddItem)); + OnPropertyChanged(nameof(AnimationPath)); + OnPropertyChanged(nameof(AppClosingTip)); + OnPropertyChanged(nameof(Ask)); + OnPropertyChanged(nameof(Badge)); + OnPropertyChanged(nameof(BasicInfo)); + OnPropertyChanged(nameof(BasicLayout)); + OnPropertyChanged(nameof(Blink)); + OnPropertyChanged(nameof(Blog)); + OnPropertyChanged(nameof(Border)); + OnPropertyChanged(nameof(Brush)); + OnPropertyChanged(nameof(Button)); + OnPropertyChanged(nameof(ButtonCustom)); + OnPropertyChanged(nameof(ButtonGroup)); + OnPropertyChanged(nameof(Calendar)); + OnPropertyChanged(nameof(CalendarWithClock)); + OnPropertyChanged(nameof(Card)); + OnPropertyChanged(nameof(Carousel)); + OnPropertyChanged(nameof(ChangeLangAsk)); + OnPropertyChanged(nameof(ChatBubble)); + OnPropertyChanged(nameof(Chatroom)); + OnPropertyChanged(nameof(CheckBox)); OnPropertyChanged(nameof(CheckComboBox)); OnPropertyChanged(nameof(CirclePanel)); - OnPropertyChanged(nameof(Clear)); - OnPropertyChanged(nameof(Click2Count)); - OnPropertyChanged(nameof(Clock)); - OnPropertyChanged(nameof(ColorPicker)); - OnPropertyChanged(nameof(ColumnOffset)); - OnPropertyChanged(nameof(ColumnSpacing)); - OnPropertyChanged(nameof(ComboBox)); - OnPropertyChanged(nameof(ComingSoon)); - OnPropertyChanged(nameof(Comment)); - OnPropertyChanged(nameof(Common)); - OnPropertyChanged(nameof(CompareSlider)); - OnPropertyChanged(nameof(Complete)); - OnPropertyChanged(nameof(ContentDemoStr)); - OnPropertyChanged(nameof(Contributors)); - OnPropertyChanged(nameof(Controls)); - OnPropertyChanged(nameof(CoverFlow)); - OnPropertyChanged(nameof(CoverView)); - OnPropertyChanged(nameof(Danger)); - OnPropertyChanged(nameof(DataGrid)); - OnPropertyChanged(nameof(DatePicker)); - OnPropertyChanged(nameof(DateTimePicker)); - OnPropertyChanged(nameof(Default)); - OnPropertyChanged(nameof(Demo)); - OnPropertyChanged(nameof(Dialog)); - OnPropertyChanged(nameof(DialogDemo)); - OnPropertyChanged(nameof(Divider)); - OnPropertyChanged(nameof(Doc_cn)); - OnPropertyChanged(nameof(Doc_en)); - OnPropertyChanged(nameof(Documentation)); - OnPropertyChanged(nameof(DragHere)); - OnPropertyChanged(nameof(Drawer)); - OnPropertyChanged(nameof(Effects)); - OnPropertyChanged(nameof(Email)); - OnPropertyChanged(nameof(Error)); - OnPropertyChanged(nameof(Exit)); - OnPropertyChanged(nameof(Expander)); - OnPropertyChanged(nameof(Fatal)); + OnPropertyChanged(nameof(Clear)); + OnPropertyChanged(nameof(Click2Count)); + OnPropertyChanged(nameof(Clock)); + OnPropertyChanged(nameof(ColorPicker)); + OnPropertyChanged(nameof(ColumnOffset)); + OnPropertyChanged(nameof(ColumnSpacing)); + OnPropertyChanged(nameof(ComboBox)); + OnPropertyChanged(nameof(ComingSoon)); + OnPropertyChanged(nameof(Comment)); + OnPropertyChanged(nameof(Common)); + OnPropertyChanged(nameof(CompareSlider)); + OnPropertyChanged(nameof(Complete)); + OnPropertyChanged(nameof(ContentDemoStr)); + OnPropertyChanged(nameof(Contributors)); + OnPropertyChanged(nameof(Controls)); + OnPropertyChanged(nameof(CoverFlow)); + OnPropertyChanged(nameof(CoverView)); + OnPropertyChanged(nameof(Danger)); + OnPropertyChanged(nameof(DataGrid)); + OnPropertyChanged(nameof(DatePicker)); + OnPropertyChanged(nameof(DateTimePicker)); + OnPropertyChanged(nameof(Default)); + OnPropertyChanged(nameof(Demo)); + OnPropertyChanged(nameof(Dialog)); + OnPropertyChanged(nameof(DialogDemo)); + OnPropertyChanged(nameof(Divider)); + OnPropertyChanged(nameof(Doc_cn)); + OnPropertyChanged(nameof(Doc_en)); + OnPropertyChanged(nameof(Documentation)); + OnPropertyChanged(nameof(DragHere)); + OnPropertyChanged(nameof(Drawer)); + OnPropertyChanged(nameof(Effects)); + OnPropertyChanged(nameof(Email)); + OnPropertyChanged(nameof(Error)); + OnPropertyChanged(nameof(Exit)); + OnPropertyChanged(nameof(Expander)); + OnPropertyChanged(nameof(Fatal)); OnPropertyChanged(nameof(FlexPanel)); OnPropertyChanged(nameof(FlipClock)); - OnPropertyChanged(nameof(FloatingBlock)); - OnPropertyChanged(nameof(FlowDocument)); - OnPropertyChanged(nameof(FlowDocumentPageViewer)); - OnPropertyChanged(nameof(FlowDocumentReader)); - OnPropertyChanged(nameof(FlowDocumentScrollViewer)); - OnPropertyChanged(nameof(Frame)); - OnPropertyChanged(nameof(Geometry)); - OnPropertyChanged(nameof(GifImage)); - OnPropertyChanged(nameof(GotoTop)); - OnPropertyChanged(nameof(Gravatar)); - OnPropertyChanged(nameof(Grid)); - OnPropertyChanged(nameof(GroupBox)); - OnPropertyChanged(nameof(Groups)); - OnPropertyChanged(nameof(Growl)); - OnPropertyChanged(nameof(GrowlAsk)); - OnPropertyChanged(nameof(GrowlDemo)); - OnPropertyChanged(nameof(GrowlError)); - OnPropertyChanged(nameof(GrowlFatal)); - OnPropertyChanged(nameof(GrowlInfo)); - OnPropertyChanged(nameof(GrowlSuccess)); - OnPropertyChanged(nameof(GrowlWarning)); - OnPropertyChanged(nameof(HatchBrushGenerator)); - OnPropertyChanged(nameof(HoneycombPanel)); - OnPropertyChanged(nameof(HybridLayout)); - OnPropertyChanged(nameof(Ignore)); - OnPropertyChanged(nameof(ImageBlock)); - OnPropertyChanged(nameof(ImageBrowser)); + OnPropertyChanged(nameof(FloatingBlock)); + OnPropertyChanged(nameof(FlowDocument)); + OnPropertyChanged(nameof(FlowDocumentPageViewer)); + OnPropertyChanged(nameof(FlowDocumentReader)); + OnPropertyChanged(nameof(FlowDocumentScrollViewer)); + OnPropertyChanged(nameof(Frame)); + OnPropertyChanged(nameof(Geometry)); + OnPropertyChanged(nameof(GifImage)); + OnPropertyChanged(nameof(GotoTop)); + OnPropertyChanged(nameof(Gravatar)); + OnPropertyChanged(nameof(Grid)); + OnPropertyChanged(nameof(GroupBox)); + OnPropertyChanged(nameof(Groups)); + OnPropertyChanged(nameof(Growl)); + OnPropertyChanged(nameof(GrowlAsk)); + OnPropertyChanged(nameof(GrowlDemo)); + OnPropertyChanged(nameof(GrowlError)); + OnPropertyChanged(nameof(GrowlFatal)); + OnPropertyChanged(nameof(GrowlInfo)); + OnPropertyChanged(nameof(GrowlSuccess)); + OnPropertyChanged(nameof(GrowlWarning)); + OnPropertyChanged(nameof(HatchBrushGenerator)); + OnPropertyChanged(nameof(HoneycombPanel)); + OnPropertyChanged(nameof(HybridLayout)); + OnPropertyChanged(nameof(Ignore)); + OnPropertyChanged(nameof(ImageBlock)); + OnPropertyChanged(nameof(ImageBrowser)); OnPropertyChanged(nameof(ImageSelector)); OnPropertyChanged(nameof(Index)); - OnPropertyChanged(nameof(Info)); - OnPropertyChanged(nameof(InteractiveDialog)); - OnPropertyChanged(nameof(IsNotPhone)); - OnPropertyChanged(nameof(Label)); - OnPropertyChanged(nameof(LangComment)); - OnPropertyChanged(nameof(ListBox)); - OnPropertyChanged(nameof(ListView)); - OnPropertyChanged(nameof(Loading)); - OnPropertyChanged(nameof(Magnifier)); - OnPropertyChanged(nameof(Menu)); - OnPropertyChanged(nameof(MessageBox)); - OnPropertyChanged(nameof(Morphing_Animation)); - OnPropertyChanged(nameof(Name)); - OnPropertyChanged(nameof(NewWindow)); - OnPropertyChanged(nameof(Next)); - OnPropertyChanged(nameof(Notification)); - OnPropertyChanged(nameof(NotifyIcon)); - OnPropertyChanged(nameof(NumericUpDown)); - OnPropertyChanged(nameof(Off)); - OnPropertyChanged(nameof(Ok)); - OnPropertyChanged(nameof(On)); - OnPropertyChanged(nameof(OpenBlurWindow)); - OnPropertyChanged(nameof(OpenCommonWindow)); - OnPropertyChanged(nameof(OpenCustomContentWindow)); - OnPropertyChanged(nameof(OpenCustomMessageWindow)); - OnPropertyChanged(nameof(OpenCustomNonClientAreaWindow)); - OnPropertyChanged(nameof(OpenGlowWindow)); - OnPropertyChanged(nameof(OpenImageBrowser)); - OnPropertyChanged(nameof(OpenMessageWindow)); - OnPropertyChanged(nameof(OpenMouseFollowWindow)); - OnPropertyChanged(nameof(OpenNativeCommonWindow)); - OnPropertyChanged(nameof(OpenNavigationWindow)); - OnPropertyChanged(nameof(OpenNoNonClientAreaDragableWindow)); - OnPropertyChanged(nameof(OpenPanel)); - OnPropertyChanged(nameof(OpenSprite)); - OnPropertyChanged(nameof(OutlineText)); - OnPropertyChanged(nameof(Pagination)); - OnPropertyChanged(nameof(PasswordBox)); - OnPropertyChanged(nameof(PinBox)); - OnPropertyChanged(nameof(PleaseInput)); - OnPropertyChanged(nameof(PleaseWait)); - OnPropertyChanged(nameof(PlsEnterContent)); - OnPropertyChanged(nameof(PlsEnterEmail)); - OnPropertyChanged(nameof(PlsEnterKey)); - OnPropertyChanged(nameof(Poptip)); - OnPropertyChanged(nameof(PoptipPositionStr)); - OnPropertyChanged(nameof(PracticalDemos)); - OnPropertyChanged(nameof(Prev)); - OnPropertyChanged(nameof(PreviewSlider)); - OnPropertyChanged(nameof(Primary)); - OnPropertyChanged(nameof(ProgressBar)); - OnPropertyChanged(nameof(ProgressButton)); - OnPropertyChanged(nameof(Project)); + OnPropertyChanged(nameof(Info)); + OnPropertyChanged(nameof(InteractiveDialog)); + OnPropertyChanged(nameof(IsNotPhone)); + OnPropertyChanged(nameof(Label)); + OnPropertyChanged(nameof(LangComment)); + OnPropertyChanged(nameof(ListBox)); + OnPropertyChanged(nameof(ListView)); + OnPropertyChanged(nameof(Loading)); + OnPropertyChanged(nameof(Magnifier)); + OnPropertyChanged(nameof(Menu)); + OnPropertyChanged(nameof(MessageBox)); + OnPropertyChanged(nameof(Morphing_Animation)); + OnPropertyChanged(nameof(Name)); + OnPropertyChanged(nameof(NewWindow)); + OnPropertyChanged(nameof(Next)); + OnPropertyChanged(nameof(Notification)); + OnPropertyChanged(nameof(NotifyIcon)); + OnPropertyChanged(nameof(NumericUpDown)); + OnPropertyChanged(nameof(Off)); + OnPropertyChanged(nameof(Ok)); + OnPropertyChanged(nameof(On)); + OnPropertyChanged(nameof(OpenBlurWindow)); + OnPropertyChanged(nameof(OpenCommonWindow)); + OnPropertyChanged(nameof(OpenCustomContentWindow)); + OnPropertyChanged(nameof(OpenCustomMessageWindow)); + OnPropertyChanged(nameof(OpenCustomNonClientAreaWindow)); + OnPropertyChanged(nameof(OpenGlowWindow)); + OnPropertyChanged(nameof(OpenImageBrowser)); + OnPropertyChanged(nameof(OpenMessageWindow)); + OnPropertyChanged(nameof(OpenMouseFollowWindow)); + OnPropertyChanged(nameof(OpenNativeCommonWindow)); + OnPropertyChanged(nameof(OpenNavigationWindow)); + OnPropertyChanged(nameof(OpenNoNonClientAreaDragableWindow)); + OnPropertyChanged(nameof(OpenPanel)); + OnPropertyChanged(nameof(OpenSprite)); + OnPropertyChanged(nameof(OutlineText)); + OnPropertyChanged(nameof(Pagination)); + OnPropertyChanged(nameof(PasswordBox)); + OnPropertyChanged(nameof(PinBox)); + OnPropertyChanged(nameof(PleaseInput)); + OnPropertyChanged(nameof(PleaseWait)); + OnPropertyChanged(nameof(PlsEnterContent)); + OnPropertyChanged(nameof(PlsEnterEmail)); + OnPropertyChanged(nameof(PlsEnterKey)); + OnPropertyChanged(nameof(Poptip)); + OnPropertyChanged(nameof(PoptipPositionStr)); + OnPropertyChanged(nameof(PracticalDemos)); + OnPropertyChanged(nameof(Prev)); + OnPropertyChanged(nameof(PreviewSlider)); + OnPropertyChanged(nameof(Primary)); + OnPropertyChanged(nameof(ProgressBar)); + OnPropertyChanged(nameof(ProgressButton)); + OnPropertyChanged(nameof(Project)); OnPropertyChanged(nameof(PropertyGrid)); OnPropertyChanged(nameof(PushToTalk)); - OnPropertyChanged(nameof(QQGroup)); - OnPropertyChanged(nameof(RadioButton)); - OnPropertyChanged(nameof(RangeSlider)); - OnPropertyChanged(nameof(Rate)); - OnPropertyChanged(nameof(Recommendation)); - OnPropertyChanged(nameof(Register)); - OnPropertyChanged(nameof(RelativePanel)); - OnPropertyChanged(nameof(Remark)); - OnPropertyChanged(nameof(RemoveItem)); - OnPropertyChanged(nameof(RepeatButton)); - OnPropertyChanged(nameof(Reply)); - OnPropertyChanged(nameof(Repository)); - OnPropertyChanged(nameof(ResponsiveLayout)); - OnPropertyChanged(nameof(RichTextBox)); - OnPropertyChanged(nameof(RightClickHere)); - OnPropertyChanged(nameof(RunningBlock)); - OnPropertyChanged(nameof(Screenshot)); - OnPropertyChanged(nameof(ScrollViewer)); - OnPropertyChanged(nameof(SearchBar)); - OnPropertyChanged(nameof(Second)); - OnPropertyChanged(nameof(Selected)); - OnPropertyChanged(nameof(SendNotification)); - OnPropertyChanged(nameof(Shield)); - OnPropertyChanged(nameof(ShowInCurrentWindow)); - OnPropertyChanged(nameof(ShowInMainWindow)); - OnPropertyChanged(nameof(ShowRowNumber)); - OnPropertyChanged(nameof(SideMenu)); - OnPropertyChanged(nameof(Slider)); - OnPropertyChanged(nameof(SplitButton)); - OnPropertyChanged(nameof(Sprite)); - OnPropertyChanged(nameof(StartScreenshot)); - OnPropertyChanged(nameof(StaysOpen)); - OnPropertyChanged(nameof(Step)); - OnPropertyChanged(nameof(StepBar)); - OnPropertyChanged(nameof(Styles)); - OnPropertyChanged(nameof(SubTitle)); - OnPropertyChanged(nameof(Success)); - OnPropertyChanged(nameof(TabControl)); - OnPropertyChanged(nameof(Tag)); - OnPropertyChanged(nameof(Text)); - OnPropertyChanged(nameof(TextBlock)); - OnPropertyChanged(nameof(TextBox)); - OnPropertyChanged(nameof(TextDialog)); - OnPropertyChanged(nameof(TextDialogInControl)); - OnPropertyChanged(nameof(TextDialogWithTimer)); - OnPropertyChanged(nameof(TimeBar)); - OnPropertyChanged(nameof(TimePicker)); - OnPropertyChanged(nameof(Tip)); - OnPropertyChanged(nameof(Title)); - OnPropertyChanged(nameof(TitleDemoStr1)); - OnPropertyChanged(nameof(TitleDemoStr2)); - OnPropertyChanged(nameof(TitleDemoStr3)); - OnPropertyChanged(nameof(ToggleButton)); - OnPropertyChanged(nameof(ToolBar)); - OnPropertyChanged(nameof(Tools)); - OnPropertyChanged(nameof(Transfer)); - OnPropertyChanged(nameof(TransitioningContentControl)); - OnPropertyChanged(nameof(TreeView)); - OnPropertyChanged(nameof(Try2CloseApp)); - OnPropertyChanged(nameof(Type)); - OnPropertyChanged(nameof(UploadFile)); - OnPropertyChanged(nameof(UploadStr)); - OnPropertyChanged(nameof(Visibility)); - OnPropertyChanged(nameof(Vsix)); - OnPropertyChanged(nameof(Warning)); - OnPropertyChanged(nameof(WaterfallPanel)); - OnPropertyChanged(nameof(Website)); - OnPropertyChanged(nameof(Window)); + OnPropertyChanged(nameof(QQGroup)); + OnPropertyChanged(nameof(RadioButton)); + OnPropertyChanged(nameof(RangeSlider)); + OnPropertyChanged(nameof(Rate)); + OnPropertyChanged(nameof(Recommendation)); + OnPropertyChanged(nameof(Register)); + OnPropertyChanged(nameof(RelativePanel)); + OnPropertyChanged(nameof(Remark)); + OnPropertyChanged(nameof(RemoveItem)); + OnPropertyChanged(nameof(RepeatButton)); + OnPropertyChanged(nameof(Reply)); + OnPropertyChanged(nameof(Repository)); + OnPropertyChanged(nameof(ResponsiveLayout)); + OnPropertyChanged(nameof(RichTextBox)); + OnPropertyChanged(nameof(RightClickHere)); + OnPropertyChanged(nameof(RunningBlock)); + OnPropertyChanged(nameof(Screenshot)); + OnPropertyChanged(nameof(ScrollViewer)); + OnPropertyChanged(nameof(SearchBar)); + OnPropertyChanged(nameof(Second)); + OnPropertyChanged(nameof(Selected)); + OnPropertyChanged(nameof(SendNotification)); + OnPropertyChanged(nameof(Shield)); + OnPropertyChanged(nameof(ShowInCurrentWindow)); + OnPropertyChanged(nameof(ShowInMainWindow)); + OnPropertyChanged(nameof(ShowRowNumber)); + OnPropertyChanged(nameof(SideMenu)); + OnPropertyChanged(nameof(Slider)); + OnPropertyChanged(nameof(SplitButton)); + OnPropertyChanged(nameof(Sprite)); + OnPropertyChanged(nameof(StartScreenshot)); + OnPropertyChanged(nameof(StaysOpen)); + OnPropertyChanged(nameof(Step)); + OnPropertyChanged(nameof(StepBar)); + OnPropertyChanged(nameof(Styles)); + OnPropertyChanged(nameof(SubTitle)); + OnPropertyChanged(nameof(Success)); + OnPropertyChanged(nameof(TabControl)); + OnPropertyChanged(nameof(Tag)); + OnPropertyChanged(nameof(Text)); + OnPropertyChanged(nameof(TextBlock)); + OnPropertyChanged(nameof(TextBox)); + OnPropertyChanged(nameof(TextDialog)); + OnPropertyChanged(nameof(TextDialogInControl)); + OnPropertyChanged(nameof(TextDialogWithTimer)); + OnPropertyChanged(nameof(TimeBar)); + OnPropertyChanged(nameof(TimePicker)); + OnPropertyChanged(nameof(Tip)); + OnPropertyChanged(nameof(Title)); + OnPropertyChanged(nameof(TitleDemoStr1)); + OnPropertyChanged(nameof(TitleDemoStr2)); + OnPropertyChanged(nameof(TitleDemoStr3)); + OnPropertyChanged(nameof(ToggleButton)); + OnPropertyChanged(nameof(ToolBar)); + OnPropertyChanged(nameof(Tools)); + OnPropertyChanged(nameof(Transfer)); + OnPropertyChanged(nameof(TransitioningContentControl)); + OnPropertyChanged(nameof(TreeView)); + OnPropertyChanged(nameof(Try2CloseApp)); + OnPropertyChanged(nameof(Type)); + OnPropertyChanged(nameof(UploadFile)); + OnPropertyChanged(nameof(UploadStr)); + OnPropertyChanged(nameof(Visibility)); + OnPropertyChanged(nameof(Vsix)); + OnPropertyChanged(nameof(Warning)); + OnPropertyChanged(nameof(WaterfallPanel)); + OnPropertyChanged(nameof(Website)); + OnPropertyChanged(nameof(Window)); } /// @@ -2425,4 +2425,4 @@ namespace HandyControlDemo.Properties.Langs public static string Window = nameof(Window); } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControlDemo_Shared/Resources/Registry.txt b/src/Shared/HandyControlDemo_Shared/Resources/Registry.txt index 70b4305057db31ce4af44457c43d34ee51be2d99..d1cb759300599f44a3873fa7babd9234a92dda33 100644 GIT binary patch literal 330 zcmaFAdw+OlUP^v>u|iO4dS-D+QKf=wN@huZkwRE%QE_H|o`R{KfdLm+w1>BAWW2MF zV{ou*aD0%ze@Ki+VqQw6bADb)QGSj~YHofkmxHYmx}Xx5QfQEmLO@Y|Nq%yEj*_jC z5>bZ5xTK~fmgbarCg9U5S+8%Ka_YEFCGO&3yKBBCt{?C&q5#4R-`|#PPT~k+udzJJmEQ#+>(NwUE-h*H&LCL#} z%5oHH(R$__cj`_t61MP1d4uZ9^+nV9D?RcVxkqJA^u^Y6?na)^JXN!3aWCN8=l`Pk H{zVtxxiWDV diff --git a/src/Shared/HandyControlDemo_Shared/Service/Data/DataService.cs b/src/Shared/HandyControlDemo_Shared/Service/Data/DataService.cs index 3df40270..9b77c1de 100644 --- a/src/Shared/HandyControlDemo_Shared/Service/Data/DataService.cs +++ b/src/Shared/HandyControlDemo_Shared/Service/Data/DataService.cs @@ -61,7 +61,7 @@ namespace HandyControlDemo.Service Index = j, IsSelected = j % 2 == 0, Name = $"SubName{j}", - Type = (DemoType)j + Type = (DemoType) j }); } var model = new DemoDataModel @@ -69,7 +69,7 @@ namespace HandyControlDemo.Service Index = i, IsSelected = i % 2 == 0, Name = $"Name{i}", - Type = (DemoType)i, + Type = (DemoType) i, DataList = dataList, ImgPath = $"/HandyControlDemo;component/Resources/Img/Avatar/avatar{i % 6 + 1}.png", Remark = new string(i.ToString()[0], 10) @@ -91,7 +91,7 @@ namespace HandyControlDemo.Service Index = i, IsSelected = i % 2 == 0, Name = $"Name{i}", - Type = (DemoType)index, + Type = (DemoType) index, ImgPath = $"/HandyControlDemo;component/Resources/Img/Avatar/avatar{index}.png", Remark = new string(i.ToString()[0], 10) }; @@ -129,7 +129,7 @@ namespace HandyControlDemo.Service Link = item.html_url })); } - catch(Exception e) + catch (Exception e) { HandyControl.Controls.MessageBox.Error(e.Message, Lang.Error); } @@ -396,10 +396,10 @@ namespace HandyControlDemo.Service foreach (var item in list) { - var name = (string)item[0]; + var name = (string) item[0]; string targetCtlName = item[1]; string imageName = item[2]; - var isNew = !string.IsNullOrEmpty((string)item[3]); + var isNew = !string.IsNullOrEmpty((string) item[3]); resultList.Add(new DemoItemModel { @@ -413,4 +413,4 @@ namespace HandyControlDemo.Service return resultList; } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControlDemo_Shared/Tools/Converter/String2BrushConverter.cs b/src/Shared/HandyControlDemo_Shared/Tools/Converter/String2BrushConverter.cs index e2fcc4cc..b301baaf 100644 --- a/src/Shared/HandyControlDemo_Shared/Tools/Converter/String2BrushConverter.cs +++ b/src/Shared/HandyControlDemo_Shared/Tools/Converter/String2BrushConverter.cs @@ -18,4 +18,4 @@ namespace HandyControlDemo.Tools.Converter throw new NotImplementedException(); } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControlDemo_Shared/Tools/Converter/StringRepeatConverter.cs b/src/Shared/HandyControlDemo_Shared/Tools/Converter/StringRepeatConverter.cs index ab297231..b12537e2 100644 --- a/src/Shared/HandyControlDemo_Shared/Tools/Converter/StringRepeatConverter.cs +++ b/src/Shared/HandyControlDemo_Shared/Tools/Converter/StringRepeatConverter.cs @@ -20,7 +20,7 @@ namespace HandyControlDemo.Tools.Converter return strValue; } } - else if(parameter is int intValue) + else if (parameter is int intValue) { num = intValue; } @@ -42,4 +42,4 @@ namespace HandyControlDemo.Tools.Converter throw new NotImplementedException(); } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControlDemo_Shared/Tools/Helper/AssemblyHelper.cs b/src/Shared/HandyControlDemo_Shared/Tools/Helper/AssemblyHelper.cs index 34d9a384..39b9cb34 100644 --- a/src/Shared/HandyControlDemo_Shared/Tools/Helper/AssemblyHelper.cs +++ b/src/Shared/HandyControlDemo_Shared/Tools/Helper/AssemblyHelper.cs @@ -34,4 +34,4 @@ namespace HandyControlDemo.Tools } } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControlDemo_Shared/Tools/Helper/VersionHelper.cs b/src/Shared/HandyControlDemo_Shared/Tools/Helper/VersionHelper.cs index 5d64565c..b957ece0 100644 --- a/src/Shared/HandyControlDemo_Shared/Tools/Helper/VersionHelper.cs +++ b/src/Shared/HandyControlDemo_Shared/Tools/Helper/VersionHelper.cs @@ -31,4 +31,4 @@ namespace HandyControlDemo.Tools internal static string GetCopyright() => FileVersionInfo.GetVersionInfo(Assembly.GetEntryAssembly().Location).LegalCopyright; } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControlDemo_Shared/UserControl/Basic/Avatar.xaml.cs b/src/Shared/HandyControlDemo_Shared/UserControl/Basic/Avatar.xaml.cs index ac57f0ab..3ee1da1e 100644 --- a/src/Shared/HandyControlDemo_Shared/UserControl/Basic/Avatar.xaml.cs +++ b/src/Shared/HandyControlDemo_Shared/UserControl/Basic/Avatar.xaml.cs @@ -37,4 +37,4 @@ namespace HandyControlDemo.UserControl set => SetValue(LinkProperty, value); } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControlDemo_Shared/UserControl/Basic/GeometryItem.xaml.cs b/src/Shared/HandyControlDemo_Shared/UserControl/Basic/GeometryItem.xaml.cs index 63eb3343..ae6da16c 100644 --- a/src/Shared/HandyControlDemo_Shared/UserControl/Basic/GeometryItem.xaml.cs +++ b/src/Shared/HandyControlDemo_Shared/UserControl/Basic/GeometryItem.xaml.cs @@ -16,4 +16,4 @@ namespace HandyControlDemo.UserControl set => SetValue(InfoProperty, value); } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControlDemo_Shared/UserControl/Basic/IFull.cs b/src/Shared/HandyControlDemo_Shared/UserControl/Basic/IFull.cs index dede1433..8d7e9aa4 100644 --- a/src/Shared/HandyControlDemo_Shared/UserControl/Basic/IFull.cs +++ b/src/Shared/HandyControlDemo_Shared/UserControl/Basic/IFull.cs @@ -2,6 +2,6 @@ { internal interface IFull { - + } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControlDemo_Shared/UserControl/Controls/ButtonGroupDemoCtl.xaml.cs b/src/Shared/HandyControlDemo_Shared/UserControl/Controls/ButtonGroupDemoCtl.xaml.cs index 833fc39d..eb922b4c 100644 --- a/src/Shared/HandyControlDemo_Shared/UserControl/Controls/ButtonGroupDemoCtl.xaml.cs +++ b/src/Shared/HandyControlDemo_Shared/UserControl/Controls/ButtonGroupDemoCtl.xaml.cs @@ -37,4 +37,4 @@ namespace HandyControlDemo.UserControl set => SetValue(LinkProperty, value); } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControlDemo_Shared/UserControl/Controls/ClockDemoCtl.xaml.cs b/src/Shared/HandyControlDemo_Shared/UserControl/Controls/ClockDemoCtl.xaml.cs index 2f4b2dcc..2603a663 100644 --- a/src/Shared/HandyControlDemo_Shared/UserControl/Controls/ClockDemoCtl.xaml.cs +++ b/src/Shared/HandyControlDemo_Shared/UserControl/Controls/ClockDemoCtl.xaml.cs @@ -8,4 +8,4 @@ namespace HandyControlDemo.UserControl InitializeComponent(); } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControlDemo_Shared/UserControl/Controls/CoverFlowDemoCtl.xaml.cs b/src/Shared/HandyControlDemo_Shared/UserControl/Controls/CoverFlowDemoCtl.xaml.cs index e003022b..c9cbf0bc 100644 --- a/src/Shared/HandyControlDemo_Shared/UserControl/Controls/CoverFlowDemoCtl.xaml.cs +++ b/src/Shared/HandyControlDemo_Shared/UserControl/Controls/CoverFlowDemoCtl.xaml.cs @@ -8,7 +8,7 @@ namespace HandyControlDemo.UserControl { InitializeComponent(); - CoverFlowMain.AddRange(new [] + CoverFlowMain.AddRange(new[] { new Uri(@"pack://application:,,,/Resources/Img/Album/1.jpg"), new Uri(@"pack://application:,,,/Resources/Img/Album/2.jpg"), diff --git a/src/Shared/HandyControlDemo_Shared/UserControl/Controls/GridDemoCtl.xaml.cs b/src/Shared/HandyControlDemo_Shared/UserControl/Controls/GridDemoCtl.xaml.cs index 2054b682..f8443e4e 100644 --- a/src/Shared/HandyControlDemo_Shared/UserControl/Controls/GridDemoCtl.xaml.cs +++ b/src/Shared/HandyControlDemo_Shared/UserControl/Controls/GridDemoCtl.xaml.cs @@ -7,4 +7,4 @@ InitializeComponent(); } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControlDemo_Shared/UserControl/Controls/NumericUpDownDemoCtl.xaml.cs b/src/Shared/HandyControlDemo_Shared/UserControl/Controls/NumericUpDownDemoCtl.xaml.cs index ae0e08bf..3fb6ea48 100644 --- a/src/Shared/HandyControlDemo_Shared/UserControl/Controls/NumericUpDownDemoCtl.xaml.cs +++ b/src/Shared/HandyControlDemo_Shared/UserControl/Controls/NumericUpDownDemoCtl.xaml.cs @@ -10,8 +10,8 @@ namespace HandyControlDemo.UserControl InitializeComponent(); NumericUpDownCustomVerify.VerifyFunc = str => double.TryParse(str, out var v) - ? v % 2 < 1e-06 - ? OperationResult.Failed(Properties.Langs.Lang.Error) + ? v % 2 < 1e-06 + ? OperationResult.Failed(Properties.Langs.Lang.Error) : OperationResult.Success() : OperationResult.Failed(Properties.Langs.Lang.Error); } diff --git a/src/Shared/HandyControlDemo_Shared/UserControl/Controls/RangeSliderDemoCtl.xaml.cs b/src/Shared/HandyControlDemo_Shared/UserControl/Controls/RangeSliderDemoCtl.xaml.cs index afa112c1..cf953706 100644 --- a/src/Shared/HandyControlDemo_Shared/UserControl/Controls/RangeSliderDemoCtl.xaml.cs +++ b/src/Shared/HandyControlDemo_Shared/UserControl/Controls/RangeSliderDemoCtl.xaml.cs @@ -7,4 +7,4 @@ InitializeComponent(); } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControlDemo_Shared/UserControl/Controls/TimePickerDemoCtl.xaml.cs b/src/Shared/HandyControlDemo_Shared/UserControl/Controls/TimePickerDemoCtl.xaml.cs index 235af412..9c4fcf0f 100644 --- a/src/Shared/HandyControlDemo_Shared/UserControl/Controls/TimePickerDemoCtl.xaml.cs +++ b/src/Shared/HandyControlDemo_Shared/UserControl/Controls/TimePickerDemoCtl.xaml.cs @@ -7,4 +7,4 @@ InitializeComponent(); } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControlDemo_Shared/UserControl/Main/ContributorsView.xaml.cs b/src/Shared/HandyControlDemo_Shared/UserControl/Main/ContributorsView.xaml.cs index 435b5770..3f213c1d 100644 --- a/src/Shared/HandyControlDemo_Shared/UserControl/Main/ContributorsView.xaml.cs +++ b/src/Shared/HandyControlDemo_Shared/UserControl/Main/ContributorsView.xaml.cs @@ -8,4 +8,4 @@ namespace HandyControlDemo.UserControl InitializeComponent(); } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControlDemo_Shared/UserControl/Main/LeftMainContent.xaml.cs b/src/Shared/HandyControlDemo_Shared/UserControl/Main/LeftMainContent.xaml.cs index f7102bec..e62af88d 100644 --- a/src/Shared/HandyControlDemo_Shared/UserControl/Main/LeftMainContent.xaml.cs +++ b/src/Shared/HandyControlDemo_Shared/UserControl/Main/LeftMainContent.xaml.cs @@ -93,4 +93,4 @@ namespace HandyControlDemo.UserControl } } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControlDemo_Shared/UserControl/Main/MainContent.xaml.cs b/src/Shared/HandyControlDemo_Shared/UserControl/Main/MainContent.xaml.cs index 4cbd7947..84d4eceb 100644 --- a/src/Shared/HandyControlDemo_Shared/UserControl/Main/MainContent.xaml.cs +++ b/src/Shared/HandyControlDemo_Shared/UserControl/Main/MainContent.xaml.cs @@ -130,4 +130,4 @@ namespace HandyControlDemo.UserControl } } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControlDemo_Shared/UserControl/Main/MainWindowContent.xaml.cs b/src/Shared/HandyControlDemo_Shared/UserControl/Main/MainWindowContent.xaml.cs index 3357b4dc..9efdba24 100644 --- a/src/Shared/HandyControlDemo_Shared/UserControl/Main/MainWindowContent.xaml.cs +++ b/src/Shared/HandyControlDemo_Shared/UserControl/Main/MainWindowContent.xaml.cs @@ -7,4 +7,4 @@ InitializeComponent(); } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControlDemo_Shared/UserControl/Main/NonClientAreaContent.cs b/src/Shared/HandyControlDemo_Shared/UserControl/Main/NonClientAreaContent.cs index 58b56ea0..1a48c2a2 100644 --- a/src/Shared/HandyControlDemo_Shared/UserControl/Main/NonClientAreaContent.cs +++ b/src/Shared/HandyControlDemo_Shared/UserControl/Main/NonClientAreaContent.cs @@ -43,7 +43,7 @@ namespace HandyControlDemo.UserControl if (tag.Equals(GlobalData.Config.Skin)) return; GlobalData.Config.Skin = tag; GlobalData.Save(); - ((App)Application.Current).UpdateSkin(tag); + ((App) Application.Current).UpdateSkin(tag); } } diff --git a/src/Shared/HandyControlDemo_Shared/UserControl/Styles/FrameDemoCtl.xaml.cs b/src/Shared/HandyControlDemo_Shared/UserControl/Styles/FrameDemoCtl.xaml.cs index 517cd71e..eaf46ef0 100644 --- a/src/Shared/HandyControlDemo_Shared/UserControl/Styles/FrameDemoCtl.xaml.cs +++ b/src/Shared/HandyControlDemo_Shared/UserControl/Styles/FrameDemoCtl.xaml.cs @@ -10,7 +10,7 @@ namespace HandyControlDemo.UserControl { private readonly List _pageList; - + public FrameDemoCtl() { InitializeComponent(); diff --git a/src/Shared/HandyControlDemo_Shared/ViewModel/Basic/ChatBoxViewModel.cs b/src/Shared/HandyControlDemo_Shared/ViewModel/Basic/ChatBoxViewModel.cs index 7543d5e4..218d2bc2 100644 --- a/src/Shared/HandyControlDemo_Shared/ViewModel/Basic/ChatBoxViewModel.cs +++ b/src/Shared/HandyControlDemo_Shared/ViewModel/Basic/ChatBoxViewModel.cs @@ -174,4 +174,4 @@ namespace HandyControlDemo.ViewModel } } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControlDemo_Shared/ViewModel/Basic/InteractiveDialogViewModel.cs b/src/Shared/HandyControlDemo_Shared/ViewModel/Basic/InteractiveDialogViewModel.cs index 55bf69eb..1c998867 100644 --- a/src/Shared/HandyControlDemo_Shared/ViewModel/Basic/InteractiveDialogViewModel.cs +++ b/src/Shared/HandyControlDemo_Shared/ViewModel/Basic/InteractiveDialogViewModel.cs @@ -17,7 +17,7 @@ namespace HandyControlDemo.ViewModel #if NET40 set => Set(nameof(Result), ref _result, value); #else - set => Set(ref _result, value); + set => Set(ref _result, value); #endif } diff --git a/src/Shared/HandyControlDemo_Shared/ViewModel/Common/ComboBoxDemoViewModel.cs b/src/Shared/HandyControlDemo_Shared/ViewModel/Common/ComboBoxDemoViewModel.cs index b2d3f056..4ae4e1f2 100644 --- a/src/Shared/HandyControlDemo_Shared/ViewModel/Common/ComboBoxDemoViewModel.cs +++ b/src/Shared/HandyControlDemo_Shared/ViewModel/Common/ComboBoxDemoViewModel.cs @@ -6,4 +6,4 @@ namespace HandyControlDemo.ViewModel { public ComboBoxDemoViewModel(DataService dataService) => DataList = dataService.GetComboBoxDemoDataList(); } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControlDemo_Shared/ViewModel/Controls/CoverViewModel.cs b/src/Shared/HandyControlDemo_Shared/ViewModel/Controls/CoverViewModel.cs index 6efbf35a..58060aab 100644 --- a/src/Shared/HandyControlDemo_Shared/ViewModel/Controls/CoverViewModel.cs +++ b/src/Shared/HandyControlDemo_Shared/ViewModel/Controls/CoverViewModel.cs @@ -7,4 +7,4 @@ namespace HandyControlDemo.ViewModel { public CoverViewModel(DataService dataService) => DataList = dataService.GetCoverViewDemoDataList(); } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControlDemo_Shared/ViewModel/Controls/DialogDemoViewModel.cs b/src/Shared/HandyControlDemo_Shared/ViewModel/Controls/DialogDemoViewModel.cs index c2999df9..6d446137 100644 --- a/src/Shared/HandyControlDemo_Shared/ViewModel/Controls/DialogDemoViewModel.cs +++ b/src/Shared/HandyControlDemo_Shared/ViewModel/Controls/DialogDemoViewModel.cs @@ -87,4 +87,4 @@ namespace HandyControlDemo.ViewModel public RelayCommand ShowWithTokenCmd => new Lazy>(() => new RelayCommand(token => Dialog.Show(new TextDialog(), token))).Value; } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControlDemo_Shared/ViewModel/Controls/GrowlDemoViewModel.cs b/src/Shared/HandyControlDemo_Shared/ViewModel/Controls/GrowlDemoViewModel.cs index dfda7028..90b6b967 100644 --- a/src/Shared/HandyControlDemo_Shared/ViewModel/Controls/GrowlDemoViewModel.cs +++ b/src/Shared/HandyControlDemo_Shared/ViewModel/Controls/GrowlDemoViewModel.cs @@ -13,7 +13,7 @@ namespace HandyControlDemo.ViewModel public GrowlDemoViewModel() { - + } public GrowlDemoViewModel(string token) @@ -113,4 +113,4 @@ namespace HandyControlDemo.ViewModel Owner = Application.Current.MainWindow }.Show())).Value; } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControlDemo_Shared/ViewModel/Controls/ImageBrowserDemoViewModel.cs b/src/Shared/HandyControlDemo_Shared/ViewModel/Controls/ImageBrowserDemoViewModel.cs index 2fa5120a..eccaeeb9 100644 --- a/src/Shared/HandyControlDemo_Shared/ViewModel/Controls/ImageBrowserDemoViewModel.cs +++ b/src/Shared/HandyControlDemo_Shared/ViewModel/Controls/ImageBrowserDemoViewModel.cs @@ -10,4 +10,4 @@ namespace HandyControlDemo.ViewModel new RelayCommand(() => new ImageBrowser(new Uri("pack://application:,,,/Resources/Img/1.jpg")).Show())).Value; } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControlDemo_Shared/ViewModel/Controls/NotificationDemoViewModel.cs b/src/Shared/HandyControlDemo_Shared/ViewModel/Controls/NotificationDemoViewModel.cs index 782fd4e2..807bd4cc 100644 --- a/src/Shared/HandyControlDemo_Shared/ViewModel/Controls/NotificationDemoViewModel.cs +++ b/src/Shared/HandyControlDemo_Shared/ViewModel/Controls/NotificationDemoViewModel.cs @@ -1,6 +1,6 @@ -using GalaSoft.MvvmLight.Command; -using System; +using System; using GalaSoft.MvvmLight; +using GalaSoft.MvvmLight.Command; using HandyControl.Controls; using HandyControl.Data; using HandyControlDemo.UserControl; diff --git a/src/Shared/HandyControlDemo_Shared/ViewModel/Controls/NotifyIconDemoViewModel.cs b/src/Shared/HandyControlDemo_Shared/ViewModel/Controls/NotifyIconDemoViewModel.cs index 89531105..1915f080 100644 --- a/src/Shared/HandyControlDemo_Shared/ViewModel/Controls/NotifyIconDemoViewModel.cs +++ b/src/Shared/HandyControlDemo_Shared/ViewModel/Controls/NotifyIconDemoViewModel.cs @@ -94,7 +94,7 @@ namespace HandyControlDemo.ViewModel } public RelayCommand MouseCmd => new Lazy>(() => - new RelayCommand(str=> Growl.Info(str.ToString()))).Value; + new RelayCommand(str => Growl.Info(str.ToString()))).Value; public RelayCommand SendNotificationCmd => new Lazy(() => new RelayCommand(SendNotification)).Value; @@ -117,4 +117,4 @@ namespace HandyControlDemo.ViewModel _isCleanup = false; } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControlDemo_Shared/ViewModel/Controls/PaginationDemoViewModel.cs b/src/Shared/HandyControlDemo_Shared/ViewModel/Controls/PaginationDemoViewModel.cs index c6c933bc..387e4621 100644 --- a/src/Shared/HandyControlDemo_Shared/ViewModel/Controls/PaginationDemoViewModel.cs +++ b/src/Shared/HandyControlDemo_Shared/ViewModel/Controls/PaginationDemoViewModel.cs @@ -54,4 +54,4 @@ namespace HandyControlDemo.ViewModel DataList = _totalDataList.Skip((info.Info - 1) * 10).Take(10).ToList(); } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControlDemo_Shared/ViewModel/Controls/SearchBarDemoViewModel.cs b/src/Shared/HandyControlDemo_Shared/ViewModel/Controls/SearchBarDemoViewModel.cs index 75dccd5f..a2c12765 100644 --- a/src/Shared/HandyControlDemo_Shared/ViewModel/Controls/SearchBarDemoViewModel.cs +++ b/src/Shared/HandyControlDemo_Shared/ViewModel/Controls/SearchBarDemoViewModel.cs @@ -15,4 +15,4 @@ namespace HandyControlDemo.ViewModel Growl.Info(key); } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControlDemo_Shared/ViewModel/Controls/SideMenuDemoViewModel.cs b/src/Shared/HandyControlDemo_Shared/ViewModel/Controls/SideMenuDemoViewModel.cs index f5636cd0..0190042f 100644 --- a/src/Shared/HandyControlDemo_Shared/ViewModel/Controls/SideMenuDemoViewModel.cs +++ b/src/Shared/HandyControlDemo_Shared/ViewModel/Controls/SideMenuDemoViewModel.cs @@ -1,8 +1,8 @@ using System; using GalaSoft.MvvmLight; +using GalaSoft.MvvmLight.Command; using HandyControl.Controls; using HandyControl.Data; -using GalaSoft.MvvmLight.Command; namespace HandyControlDemo.ViewModel { @@ -18,4 +18,4 @@ namespace HandyControlDemo.ViewModel private void Select(string header) => Growl.Success(header); } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControlDemo_Shared/ViewModel/Controls/SplitButtonDemoViewModel.cs b/src/Shared/HandyControlDemo_Shared/ViewModel/Controls/SplitButtonDemoViewModel.cs index 3469b16b..0645b1c3 100644 --- a/src/Shared/HandyControlDemo_Shared/ViewModel/Controls/SplitButtonDemoViewModel.cs +++ b/src/Shared/HandyControlDemo_Shared/ViewModel/Controls/SplitButtonDemoViewModel.cs @@ -1,7 +1,7 @@ using System; using GalaSoft.MvvmLight; -using HandyControl.Controls; using GalaSoft.MvvmLight.Command; +using HandyControl.Controls; namespace HandyControlDemo.ViewModel { diff --git a/src/Shared/HandyControlDemo_Shared/ViewModel/Controls/SpriteDemoViewModel.cs b/src/Shared/HandyControlDemo_Shared/ViewModel/Controls/SpriteDemoViewModel.cs index f6f83dd7..8ee307dd 100644 --- a/src/Shared/HandyControlDemo_Shared/ViewModel/Controls/SpriteDemoViewModel.cs +++ b/src/Shared/HandyControlDemo_Shared/ViewModel/Controls/SpriteDemoViewModel.cs @@ -1,13 +1,13 @@ using System; +using GalaSoft.MvvmLight.Command; using HandyControl.Controls; using HandyControlDemo.UserControl; -using GalaSoft.MvvmLight.Command; namespace HandyControlDemo.ViewModel { public class SpriteDemoViewModel { public RelayCommand OpenCmd => new Lazy(() => - new RelayCommand(()=> Sprite.Show(new AppSprite()))).Value; + new RelayCommand(() => Sprite.Show(new AppSprite()))).Value; } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControlDemo_Shared/ViewModel/Controls/StepBarDemoViewModel.cs b/src/Shared/HandyControlDemo_Shared/ViewModel/Controls/StepBarDemoViewModel.cs index d7bc9c5d..c5fbcd0c 100644 --- a/src/Shared/HandyControlDemo_Shared/ViewModel/Controls/StepBarDemoViewModel.cs +++ b/src/Shared/HandyControlDemo_Shared/ViewModel/Controls/StepBarDemoViewModel.cs @@ -50,4 +50,4 @@ namespace HandyControlDemo.ViewModel } } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControlDemo_Shared/ViewModel/Controls/TabControlDemoViewModel.cs b/src/Shared/HandyControlDemo_Shared/ViewModel/Controls/TabControlDemoViewModel.cs index 103d4fab..10fa00ed 100644 --- a/src/Shared/HandyControlDemo_Shared/ViewModel/Controls/TabControlDemoViewModel.cs +++ b/src/Shared/HandyControlDemo_Shared/ViewModel/Controls/TabControlDemoViewModel.cs @@ -1,10 +1,10 @@ using System; using System.Windows; +using GalaSoft.MvvmLight.Command; using HandyControl.Controls; using HandyControl.Data; using HandyControlDemo.Data; using HandyControlDemo.Service; -using GalaSoft.MvvmLight.Command; namespace HandyControlDemo.ViewModel { @@ -28,4 +28,4 @@ namespace HandyControlDemo.ViewModel Growl.Info($"{(args.OriginalSource as TabItem)?.Header} Closed"); } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControlDemo_Shared/ViewModel/Controls/TagDemoViewModel.cs b/src/Shared/HandyControlDemo_Shared/ViewModel/Controls/TagDemoViewModel.cs index 91f12591..be603164 100644 --- a/src/Shared/HandyControlDemo_Shared/ViewModel/Controls/TagDemoViewModel.cs +++ b/src/Shared/HandyControlDemo_Shared/ViewModel/Controls/TagDemoViewModel.cs @@ -47,4 +47,4 @@ namespace HandyControlDemo.ViewModel TagName = string.Empty; })).Value; } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControlDemo_Shared/ViewModel/Controls/WindowDemoViewModel.cs b/src/Shared/HandyControlDemo_Shared/ViewModel/Controls/WindowDemoViewModel.cs index 6acc5fe4..3527383d 100644 --- a/src/Shared/HandyControlDemo_Shared/ViewModel/Controls/WindowDemoViewModel.cs +++ b/src/Shared/HandyControlDemo_Shared/ViewModel/Controls/WindowDemoViewModel.cs @@ -18,4 +18,4 @@ namespace HandyControlDemo.ViewModel } } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControlDemo_Shared/ViewModel/DemoViewModelBase!1.cs b/src/Shared/HandyControlDemo_Shared/ViewModel/DemoViewModelBase!1.cs index 4b959131..d20b6d65 100644 --- a/src/Shared/HandyControlDemo_Shared/ViewModel/DemoViewModelBase!1.cs +++ b/src/Shared/HandyControlDemo_Shared/ViewModel/DemoViewModelBase!1.cs @@ -23,4 +23,4 @@ namespace HandyControlDemo.ViewModel #endif } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControlDemo_Shared/ViewModel/Main/ItemsDisplayViewModel.cs b/src/Shared/HandyControlDemo_Shared/ViewModel/Main/ItemsDisplayViewModel.cs index 82f22239..85d1e5c9 100644 --- a/src/Shared/HandyControlDemo_Shared/ViewModel/Main/ItemsDisplayViewModel.cs +++ b/src/Shared/HandyControlDemo_Shared/ViewModel/Main/ItemsDisplayViewModel.cs @@ -28,4 +28,4 @@ namespace HandyControlDemo.ViewModel #endif } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControlDemo_Shared/ViewModel/Main/MainViewModel.cs b/src/Shared/HandyControlDemo_Shared/ViewModel/Main/MainViewModel.cs index d0e69953..86522b21 100644 --- a/src/Shared/HandyControlDemo_Shared/ViewModel/Main/MainViewModel.cs +++ b/src/Shared/HandyControlDemo_Shared/ViewModel/Main/MainViewModel.cs @@ -182,4 +182,4 @@ namespace HandyControlDemo.ViewModel #endregion } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControlDemo_Shared/ViewModel/Main/NonClientAreaViewModel.cs b/src/Shared/HandyControlDemo_Shared/ViewModel/Main/NonClientAreaViewModel.cs index 6bce0358..82c81c4f 100644 --- a/src/Shared/HandyControlDemo_Shared/ViewModel/Main/NonClientAreaViewModel.cs +++ b/src/Shared/HandyControlDemo_Shared/ViewModel/Main/NonClientAreaViewModel.cs @@ -36,4 +36,4 @@ namespace HandyControlDemo.ViewModel #endif } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControlDemo_Shared/ViewModel/ViewModelLocator.cs b/src/Shared/HandyControlDemo_Shared/ViewModel/ViewModelLocator.cs index 834f34e9..7ad74961 100644 --- a/src/Shared/HandyControlDemo_Shared/ViewModel/ViewModelLocator.cs +++ b/src/Shared/HandyControlDemo_Shared/ViewModel/ViewModelLocator.cs @@ -102,4 +102,4 @@ namespace HandyControlDemo.ViewModel #endregion } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Collections/ManualObservableCollection!1.cs b/src/Shared/HandyControl_Shared/Collections/ManualObservableCollection!1.cs index c4daa2c3..d83e8a07 100644 --- a/src/Shared/HandyControl_Shared/Collections/ManualObservableCollection!1.cs +++ b/src/Shared/HandyControl_Shared/Collections/ManualObservableCollection!1.cs @@ -44,12 +44,12 @@ namespace HandyControl.Collections private int _oldCount; public event NotifyCollectionChangedEventHandler CollectionChanged; - + public event PropertyChangedEventHandler PropertyChanged; public ManualObservableCollection() { - + } // ReSharper disable once AssignNullToNotNullAttribute @@ -140,7 +140,7 @@ namespace HandyControl.Collections protected virtual void OnCollectionChanged(NotifyCollectionChangedEventArgs e) { if (!CanNotify || CollectionChanged == null) return; - + using (BlockReentrancy()) { // ReSharper disable once PossibleNullReferenceException @@ -162,16 +162,16 @@ namespace HandyControl.Collections } } - private void OnPropertyChanged(string propertyName) => + private void OnPropertyChanged(string propertyName) => OnPropertyChanged(new PropertyChangedEventArgs(propertyName)); - private void OnCollectionChanged(NotifyCollectionChangedAction action, object item, int index) => + private void OnCollectionChanged(NotifyCollectionChangedAction action, object item, int index) => OnCollectionChanged(new NotifyCollectionChangedEventArgs(action, item, index)); private void OnCollectionChanged(NotifyCollectionChangedAction action, object item, int index, int oldIndex) => OnCollectionChanged(new NotifyCollectionChangedEventArgs(action, item, index, oldIndex)); - private void OnCollectionChanged(NotifyCollectionChangedAction action, object oldItem, object newItem, int index) => + private void OnCollectionChanged(NotifyCollectionChangedAction action, object oldItem, object newItem, int index) => OnCollectionChanged(new NotifyCollectionChangedEventArgs(action, newItem, oldItem, index)); private void OnCollectionReset() => diff --git a/src/Shared/HandyControl_Shared/Controls/Attach/BackgroundSwitchElement.cs b/src/Shared/HandyControl_Shared/Controls/Attach/BackgroundSwitchElement.cs index c305f080..4da28b36 100644 --- a/src/Shared/HandyControl_Shared/Controls/Attach/BackgroundSwitchElement.cs +++ b/src/Shared/HandyControl_Shared/Controls/Attach/BackgroundSwitchElement.cs @@ -10,13 +10,13 @@ namespace HandyControl.Controls public static void SetMouseHoverBackground(DependencyObject element, Brush value) => element.SetValue(MouseHoverBackgroundProperty, value); - public static Brush GetMouseHoverBackground(DependencyObject element) => (Brush)element.GetValue(MouseHoverBackgroundProperty); + public static Brush GetMouseHoverBackground(DependencyObject element) => (Brush) element.GetValue(MouseHoverBackgroundProperty); public static readonly DependencyProperty MouseDownBackgroundProperty = DependencyProperty.RegisterAttached( "MouseDownBackground", typeof(Brush), typeof(BackgroundSwitchElement), new FrameworkPropertyMetadata(Brushes.Transparent, FrameworkPropertyMetadataOptions.Inherits)); public static void SetMouseDownBackground(DependencyObject element, Brush value) => element.SetValue(MouseDownBackgroundProperty, value); - public static Brush GetMouseDownBackground(DependencyObject element) => (Brush)element.GetValue(MouseDownBackgroundProperty); + public static Brush GetMouseDownBackground(DependencyObject element) => (Brush) element.GetValue(MouseDownBackgroundProperty); } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Controls/Attach/BorderElement.cs b/src/Shared/HandyControl_Shared/Controls/Attach/BorderElement.cs index 6ccad89c..f4ff6451 100644 --- a/src/Shared/HandyControl_Shared/Controls/Attach/BorderElement.cs +++ b/src/Shared/HandyControl_Shared/Controls/Attach/BorderElement.cs @@ -13,7 +13,7 @@ namespace HandyControl.Controls public static void SetCornerRadius(DependencyObject element, CornerRadius value) => element.SetValue(CornerRadiusProperty, value); - public static CornerRadius GetCornerRadius(DependencyObject element) => (CornerRadius)element.GetValue(CornerRadiusProperty); + public static CornerRadius GetCornerRadius(DependencyObject element) => (CornerRadius) element.GetValue(CornerRadiusProperty); public static readonly DependencyProperty CircularProperty = DependencyProperty.RegisterAttached( "Circular", typeof(bool), typeof(BorderElement), new PropertyMetadata(ValueBoxes.FalseBox, OnCircularChanged)); @@ -22,13 +22,13 @@ namespace HandyControl.Controls { if (d is Border border) { - if ((bool)e.NewValue) + if ((bool) e.NewValue) { var binding = new MultiBinding { Converter = new BorderCircularConverter() }; - binding.Bindings.Add(new Binding(FrameworkElement.ActualWidthProperty.Name) {Source = border}); + binding.Bindings.Add(new Binding(FrameworkElement.ActualWidthProperty.Name) { Source = border }); binding.Bindings.Add(new Binding(FrameworkElement.ActualHeightProperty.Name) { Source = border }); border.SetBinding(Border.CornerRadiusProperty, binding); } @@ -47,4 +47,4 @@ namespace HandyControl.Controls public static bool GetCircular(DependencyObject element) => (bool) element.GetValue(CircularProperty); } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Controls/Attach/DataGridAttach.cs b/src/Shared/HandyControl_Shared/Controls/Attach/DataGridAttach.cs index 42ac2354..c46040a3 100644 --- a/src/Shared/HandyControl_Shared/Controls/Attach/DataGridAttach.cs +++ b/src/Shared/HandyControl_Shared/Controls/Attach/DataGridAttach.cs @@ -1,4 +1,4 @@ -using System.Linq; +using System.Linq; using System.Windows; using System.Windows.Controls; using System.Windows.Controls.Primitives; @@ -14,8 +14,8 @@ namespace HandyControl.Controls private static void OnApplyDefaultStyleChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { - var grid = (DataGrid)d; - if ((bool)e.NewValue) + var grid = (DataGrid) d; + if ((bool) e.NewValue) { if (grid.AutoGenerateColumns) { @@ -35,7 +35,7 @@ namespace HandyControl.Controls private static void Grid_AutoGeneratedColumns(object sender, System.EventArgs e) { - var grid = (DataGrid)sender; + var grid = (DataGrid) sender; UpdateTextColumnStyles(grid); UpdateComboBoxColumnStyles(grid); UpdateCheckBoxColumnStyles(grid); @@ -52,7 +52,7 @@ namespace HandyControl.Controls private static void OnTextColumnStyleChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { - var grid = (DataGrid)d; + var grid = (DataGrid) d; if (e.OldValue == null && e.NewValue != null) { UpdateTextColumnStyles(grid); @@ -61,7 +61,7 @@ namespace HandyControl.Controls public static void SetTextColumnStyle(DependencyObject element, Style value) => element.SetValue(TextColumnStyleProperty, value); - public static Style GetTextColumnStyle(DependencyObject element) => (Style)element.GetValue(TextColumnStyleProperty); + public static Style GetTextColumnStyle(DependencyObject element) => (Style) element.GetValue(TextColumnStyleProperty); public static readonly DependencyProperty EditingTextColumnStyleProperty = DependencyProperty.RegisterAttached( "EditingTextColumnStyle", typeof(Style), typeof(DataGridAttach), new PropertyMetadata(default(Style), OnTextColumnStyleChanged)); @@ -119,7 +119,7 @@ namespace HandyControl.Controls private static void OnComboBoxColumnStyleChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { - var grid = (DataGrid)d; + var grid = (DataGrid) d; if (e.OldValue == null && e.NewValue != null) { UpdateComboBoxColumnStyles(grid); @@ -186,7 +186,7 @@ namespace HandyControl.Controls private static void OnCheckBoxColumnStyleChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { - var grid = (DataGrid)d; + var grid = (DataGrid) d; if (e.OldValue == null && e.NewValue != null) { UpdateCheckBoxColumnStyles(grid); @@ -195,7 +195,7 @@ namespace HandyControl.Controls public static void SetCheckBoxColumnStyle(DependencyObject element, Style value) => element.SetValue(CheckBoxColumnStyleProperty, value); - public static Style GetCheckBoxColumnStyle(DependencyObject element) => (Style)element.GetValue(CheckBoxColumnStyleProperty); + public static Style GetCheckBoxColumnStyle(DependencyObject element) => (Style) element.GetValue(CheckBoxColumnStyleProperty); public static readonly DependencyProperty EditingCheckBoxColumnStyleProperty = DependencyProperty.RegisterAttached( "EditingCheckBoxColumnStyle", typeof(Style), typeof(DataGridAttach), new PropertyMetadata(default(Style), OnCheckBoxColumnStyleChanged)); @@ -252,14 +252,14 @@ namespace HandyControl.Controls typeof(bool), typeof(DataGridAttach), new FrameworkPropertyMetadata(ValueBoxes.FalseBox, FrameworkPropertyMetadataOptions.Inherits, OnShowRowNumberChanged)); - public static bool GetShowRowNumber(DependencyObject target) => (bool)target.GetValue(ShowRowNumberProperty); + public static bool GetShowRowNumber(DependencyObject target) => (bool) target.GetValue(ShowRowNumberProperty); public static void SetShowRowNumber(DependencyObject target, bool value) => target.SetValue(ShowRowNumberProperty, ValueBoxes.BooleanBox(value)); private static void OnShowRowNumberChanged(DependencyObject target, DependencyPropertyChangedEventArgs e) { if (!(target is DataGrid dataGrid)) return; - var show = (bool)e.NewValue; + var show = (bool) e.NewValue; if (show) { @@ -287,7 +287,7 @@ namespace HandyControl.Controls { for (var i = 0; i < itemsCount; i++) { - var row = (DataGridRow)generator.ContainerFromIndex(i); + var row = (DataGridRow) generator.ContainerFromIndex(i); if (row != null) { row.Header = (i + 1).ToString(); @@ -298,7 +298,7 @@ namespace HandyControl.Controls { for (var i = 0; i < itemsCount; i++) { - var row = (DataGridRow)generator.ContainerFromIndex(i); + var row = (DataGridRow) generator.ContainerFromIndex(i); if (row != null) { row.Header = null; @@ -316,7 +316,7 @@ namespace HandyControl.Controls { if (d is DataGrid dataGrid) { - if ((bool)e.NewValue) + if ((bool) e.NewValue) { dataGrid.PreviewMouseDown += DataGrid_PreviewMouseDown; } diff --git a/src/Shared/HandyControl_Shared/Controls/Attach/EdgeElement.cs b/src/Shared/HandyControl_Shared/Controls/Attach/EdgeElement.cs index 4c6d33d1..87df83c2 100644 --- a/src/Shared/HandyControl_Shared/Controls/Attach/EdgeElement.cs +++ b/src/Shared/HandyControl_Shared/Controls/Attach/EdgeElement.cs @@ -44,4 +44,4 @@ namespace HandyControl.Controls SetShowEdgeContent(d, !(GetLeftContent(d) == null && GetTopContent(d) == null && GetRightContent(d) == null && GetBottomContent(d) == null)); } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Controls/Attach/IconElement.cs b/src/Shared/HandyControl_Shared/Controls/Attach/IconElement.cs index 5548883f..c700fad9 100644 --- a/src/Shared/HandyControl_Shared/Controls/Attach/IconElement.cs +++ b/src/Shared/HandyControl_Shared/Controls/Attach/IconElement.cs @@ -11,7 +11,7 @@ namespace HandyControl.Controls public static void SetGeometry(DependencyObject element, Geometry value) => element.SetValue(GeometryProperty, value); - public static Geometry GetGeometry(DependencyObject element) + public static Geometry GetGeometry(DependencyObject element) => (Geometry) element.GetValue(GeometryProperty); public static readonly DependencyProperty WidthProperty = DependencyProperty.RegisterAttached( @@ -32,4 +32,4 @@ namespace HandyControl.Controls public static double GetHeight(DependencyObject element) => (double) element.GetValue(HeightProperty); } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Controls/Attach/IconSwitchElement.cs b/src/Shared/HandyControl_Shared/Controls/Attach/IconSwitchElement.cs index 714b2036..913cbd40 100644 --- a/src/Shared/HandyControl_Shared/Controls/Attach/IconSwitchElement.cs +++ b/src/Shared/HandyControl_Shared/Controls/Attach/IconSwitchElement.cs @@ -15,7 +15,7 @@ namespace HandyControl.Controls public static Geometry GetGeometrySelected(DependencyObject element) { - return (Geometry)element.GetValue(GeometrySelectedProperty); + return (Geometry) element.GetValue(GeometrySelectedProperty); } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Controls/Attach/InfoElement.cs b/src/Shared/HandyControl_Shared/Controls/Attach/InfoElement.cs index ad7ff710..3573f75b 100644 --- a/src/Shared/HandyControl_Shared/Controls/Attach/InfoElement.cs +++ b/src/Shared/HandyControl_Shared/Controls/Attach/InfoElement.cs @@ -13,7 +13,7 @@ namespace HandyControl.Controls public static void SetPlaceholder(DependencyObject element, string value) => element.SetValue(PlaceholderProperty, value); - public static string GetPlaceholder(DependencyObject element) => (string)element.GetValue(PlaceholderProperty); + public static string GetPlaceholder(DependencyObject element) => (string) element.GetValue(PlaceholderProperty); /// /// 是否必填 @@ -23,7 +23,7 @@ namespace HandyControl.Controls public static void SetNecessary(DependencyObject element, bool value) => element.SetValue(NecessaryProperty, ValueBoxes.BooleanBox(value)); - public static bool GetNecessary(DependencyObject element) => (bool)element.GetValue(NecessaryProperty); + public static bool GetNecessary(DependencyObject element) => (bool) element.GetValue(NecessaryProperty); /// /// 标记 @@ -33,7 +33,7 @@ namespace HandyControl.Controls public static void SetSymbol(DependencyObject element, string value) => element.SetValue(SymbolProperty, value); - public static string GetSymbol(DependencyObject element) => (string)element.GetValue(SymbolProperty); + public static string GetSymbol(DependencyObject element) => (string) element.GetValue(SymbolProperty); /// /// 内容高度 @@ -43,7 +43,7 @@ namespace HandyControl.Controls public static void SetContentHeight(DependencyObject element, double value) => element.SetValue(ContentHeightProperty, value); - public static double GetContentHeight(DependencyObject element) => (double)element.GetValue(ContentHeightProperty); + public static double GetContentHeight(DependencyObject element) => (double) element.GetValue(ContentHeightProperty); /// /// 最小内容高度 @@ -81,4 +81,4 @@ namespace HandyControl.Controls public static string GetRegexPattern(DependencyObject element) => (string) element.GetValue(RegexPatternProperty); } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Controls/Attach/MenuTopLineAttach.cs b/src/Shared/HandyControl_Shared/Controls/Attach/MenuTopLineAttach.cs index 5d6cd18f..4762fafd 100644 --- a/src/Shared/HandyControl_Shared/Controls/Attach/MenuTopLineAttach.cs +++ b/src/Shared/HandyControl_Shared/Controls/Attach/MenuTopLineAttach.cs @@ -28,7 +28,7 @@ namespace HandyControl.Controls private static void MenuItem_Loaded(object sender, RoutedEventArgs e) { - var menuItem = (FrameworkElement)sender; + var menuItem = (FrameworkElement) sender; menuItem.Unloaded += MenuItem_Unloaded; var topLine = GetTopLine(menuItem); var popup = GetPopup(topLine); @@ -40,7 +40,7 @@ namespace HandyControl.Controls private static void MenuItem_Unloaded(object sender, RoutedEventArgs e) { - var menuItem = (FrameworkElement)sender; + var menuItem = (FrameworkElement) sender; menuItem.Unloaded -= MenuItem_Unloaded; var topLine = GetTopLine(menuItem); var popup = GetPopup(topLine); @@ -69,7 +69,7 @@ namespace HandyControl.Controls if (positionLeftTop.X < 0) { - + topLine.Margin = new Thickness(positionLeftTop.X - panel.Margin.Left, 0, 0, 0); } else if (positionLeftTop.X + panel.ActualWidth > workAreaRect.Right) diff --git a/src/Shared/HandyControl_Shared/Controls/Attach/PanelElement.cs b/src/Shared/HandyControl_Shared/Controls/Attach/PanelElement.cs index 05578452..c69b5cf1 100644 --- a/src/Shared/HandyControl_Shared/Controls/Attach/PanelElement.cs +++ b/src/Shared/HandyControl_Shared/Controls/Attach/PanelElement.cs @@ -12,7 +12,7 @@ namespace HandyControl.Controls private static void OnFluidMoveBehaviorChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { if (d is Panel panel) - { + { var collection = Interaction.GetBehaviors(panel); var oldBehavior = GetTempFluidMoveBehavior(panel); collection.ItemRemoved(oldBehavior); @@ -41,4 +41,4 @@ namespace HandyControl.Controls private static FluidMoveBehavior GetTempFluidMoveBehavior(DependencyObject element) => (FluidMoveBehavior) element.GetValue(TempFluidMoveBehaviorProperty); } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Controls/Attach/PasswordBoxAttach.cs b/src/Shared/HandyControl_Shared/Controls/Attach/PasswordBoxAttach.cs index 203cd162..7141df7c 100644 --- a/src/Shared/HandyControl_Shared/Controls/Attach/PasswordBoxAttach.cs +++ b/src/Shared/HandyControl_Shared/Controls/Attach/PasswordBoxAttach.cs @@ -13,7 +13,7 @@ namespace HandyControl.Controls public static void SetPasswordLength(DependencyObject element, int value) => element.SetValue(PasswordLengthProperty, value); - public static int GetPasswordLength(DependencyObject element) => (int)element.GetValue(PasswordLengthProperty); + public static int GetPasswordLength(DependencyObject element) => (int) element.GetValue(PasswordLengthProperty); /// /// 是否监测 @@ -41,7 +41,7 @@ namespace HandyControl.Controls public static void SetIsMonitoring(DependencyObject element, bool value) => element.SetValue(IsMonitoringProperty, ValueBoxes.BooleanBox(value)); - public static bool GetIsMonitoring(DependencyObject element) => (bool)element.GetValue(IsMonitoringProperty); + public static bool GetIsMonitoring(DependencyObject element) => (bool) element.GetValue(IsMonitoringProperty); private static void PasswordChanged(object sender, RoutedEventArgs e) { @@ -51,4 +51,4 @@ namespace HandyControl.Controls } } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Controls/Attach/RectangleAttach.cs b/src/Shared/HandyControl_Shared/Controls/Attach/RectangleAttach.cs index 4e8e1620..9030953f 100644 --- a/src/Shared/HandyControl_Shared/Controls/Attach/RectangleAttach.cs +++ b/src/Shared/HandyControl_Shared/Controls/Attach/RectangleAttach.cs @@ -15,7 +15,7 @@ namespace HandyControl.Controls { if (d is Rectangle rectangle) { - if ((bool)e.NewValue) + if ((bool) e.NewValue) { var binding = new MultiBinding { diff --git a/src/Shared/HandyControl_Shared/Controls/Attach/StatusSwitchElement.cs b/src/Shared/HandyControl_Shared/Controls/Attach/StatusSwitchElement.cs index 1b82a46a..e47f90f9 100644 --- a/src/Shared/HandyControl_Shared/Controls/Attach/StatusSwitchElement.cs +++ b/src/Shared/HandyControl_Shared/Controls/Attach/StatusSwitchElement.cs @@ -25,4 +25,4 @@ namespace HandyControl.Controls public static bool GetHideUncheckedElement(DependencyObject element) => (bool) element.GetValue(HideUncheckedElementProperty); } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Controls/Attach/TextBlockAttach.cs b/src/Shared/HandyControl_Shared/Controls/Attach/TextBlockAttach.cs index ca5caf7d..4941a4c5 100644 --- a/src/Shared/HandyControl_Shared/Controls/Attach/TextBlockAttach.cs +++ b/src/Shared/HandyControl_Shared/Controls/Attach/TextBlockAttach.cs @@ -13,7 +13,7 @@ namespace HandyControl.Controls { if (d is TextBlock ctl) { - if ((bool)e.NewValue) + if ((bool) e.NewValue) { ctl.TextTrimming = TextTrimming.WordEllipsis; UpdateTooltip(ctl); @@ -50,4 +50,4 @@ namespace HandyControl.Controls textBlock.RenderSize.Width > width || textBlock.ActualWidth < width ? textBlock.Text : null); } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Controls/Attach/TipElement.cs b/src/Shared/HandyControl_Shared/Controls/Attach/TipElement.cs index 62f12396..734357b9 100644 --- a/src/Shared/HandyControl_Shared/Controls/Attach/TipElement.cs +++ b/src/Shared/HandyControl_Shared/Controls/Attach/TipElement.cs @@ -28,4 +28,4 @@ namespace HandyControl.Controls public static string GetStringFormat(DependencyObject element) => (string) element.GetValue(StringFormatProperty); } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Controls/Attach/TitleElement.cs b/src/Shared/HandyControl_Shared/Controls/Attach/TitleElement.cs index 88f31e5d..963ef67d 100644 --- a/src/Shared/HandyControl_Shared/Controls/Attach/TitleElement.cs +++ b/src/Shared/HandyControl_Shared/Controls/Attach/TitleElement.cs @@ -56,7 +56,7 @@ namespace HandyControl.Controls public static void SetTitleWidth(DependencyObject element, GridLength value) => element.SetValue(TitleWidthProperty, value); - public static GridLength GetTitleWidth(DependencyObject element) => (GridLength)element.GetValue(TitleWidthProperty); + public static GridLength GetTitleWidth(DependencyObject element) => (GridLength) element.GetValue(TitleWidthProperty); public static readonly DependencyProperty HorizontalAlignmentProperty = DependencyProperty.RegisterAttached( "HorizontalAlignment", typeof(HorizontalAlignment), typeof(TitleElement), new FrameworkPropertyMetadata(default(HorizontalAlignment), FrameworkPropertyMetadataOptions.Inherits)); @@ -76,4 +76,4 @@ namespace HandyControl.Controls public static VerticalAlignment GetVerticalAlignment(DependencyObject element) => (VerticalAlignment) element.GetValue(VerticalAlignmentProperty); } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Controls/Attach/VisualElement.cs b/src/Shared/HandyControl_Shared/Controls/Attach/VisualElement.cs index 334a45ff..9e7f9e1a 100644 --- a/src/Shared/HandyControl_Shared/Controls/Attach/VisualElement.cs +++ b/src/Shared/HandyControl_Shared/Controls/Attach/VisualElement.cs @@ -50,4 +50,4 @@ namespace HandyControl.Controls public static string GetText(DependencyObject element) => (string) element.GetValue(TextProperty); } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Controls/Attach/WindowAttach.cs b/src/Shared/HandyControl_Shared/Controls/Attach/WindowAttach.cs index f992ea0a..f6b2e193 100644 --- a/src/Shared/HandyControl_Shared/Controls/Attach/WindowAttach.cs +++ b/src/Shared/HandyControl_Shared/Controls/Attach/WindowAttach.cs @@ -23,7 +23,7 @@ namespace HandyControl.Controls { if (d is UIElement ctl) { - if ((bool)e.NewValue) + if ((bool) e.NewValue) { ctl.MouseLeftButtonDown += DragElement_MouseLeftButtonDown; } @@ -49,7 +49,7 @@ namespace HandyControl.Controls { if (d is System.Windows.Window window) { - if ((bool)e.NewValue) + if ((bool) e.NewValue) { window.PreviewKeyDown += Window_PreviewKeyDown; } @@ -110,7 +110,7 @@ namespace HandyControl.Controls => element.SetValue(ShowInTaskManagerProperty, ValueBoxes.BooleanBox(value)); public static bool GetShowInTaskManager(DependencyObject element) - => (bool)element.GetValue(ShowInTaskManagerProperty); + => (bool) element.GetValue(ShowInTaskManagerProperty); public static readonly DependencyProperty HideWhenClosingProperty = DependencyProperty.RegisterAttached( "HideWhenClosing", typeof(bool), typeof(WindowAttach), new PropertyMetadata(ValueBoxes.FalseBox, OnHideWhenClosingChanged)); @@ -119,7 +119,7 @@ namespace HandyControl.Controls { if (d is System.Windows.Window window) { - var v = (bool)e.NewValue; + var v = (bool) e.NewValue; if (v) { window.Closing += Window_Closing; @@ -146,4 +146,4 @@ namespace HandyControl.Controls public static bool GetHideWhenClosing(DependencyObject element) => (bool) element.GetValue(HideWhenClosingProperty); } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Controls/Base/AdornerElement.cs b/src/Shared/HandyControl_Shared/Controls/Base/AdornerElement.cs index ffadcf9d..fb505fe8 100644 --- a/src/Shared/HandyControl_Shared/Controls/Base/AdornerElement.cs +++ b/src/Shared/HandyControl_Shared/Controls/Base/AdornerElement.cs @@ -15,9 +15,9 @@ namespace HandyControl.Controls private static void OnTargetChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { - var ctl = (AdornerElement)d; + var ctl = (AdornerElement) d; ctl.OnTargetChanged(ctl.ElementTarget, false); - ctl.OnTargetChanged((FrameworkElement)e.NewValue, true); + ctl.OnTargetChanged((FrameworkElement) e.NewValue, true); } [Bindable(true), Category("Layout")] @@ -34,7 +34,7 @@ namespace HandyControl.Controls private static void OnInstanceChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { if (!(d is FrameworkElement target)) return; - var element = (AdornerElement)e.NewValue; + var element = (AdornerElement) e.NewValue; element.OnInstanceChanged(target); } diff --git a/src/Shared/HandyControl_Shared/Controls/Base/HeaderedSelectableItem.cs b/src/Shared/HandyControl_Shared/Controls/Base/HeaderedSelectableItem.cs index 95d0865c..fa3e178e 100644 --- a/src/Shared/HandyControl_Shared/Controls/Base/HeaderedSelectableItem.cs +++ b/src/Shared/HandyControl_Shared/Controls/Base/HeaderedSelectableItem.cs @@ -22,4 +22,4 @@ namespace HandyControl.Controls set => SetValue(HeaderTemplateProperty, value); } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Controls/Base/HeaderedSimpleItemsControl.cs b/src/Shared/HandyControl_Shared/Controls/Base/HeaderedSimpleItemsControl.cs index cd5750bb..70ff6f00 100644 --- a/src/Shared/HandyControl_Shared/Controls/Base/HeaderedSimpleItemsControl.cs +++ b/src/Shared/HandyControl_Shared/Controls/Base/HeaderedSimpleItemsControl.cs @@ -13,4 +13,4 @@ namespace HandyControl.Controls set => SetValue(HeaderProperty, value); } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Controls/Base/IGravatarGenerator.cs b/src/Shared/HandyControl_Shared/Controls/Base/IGravatarGenerator.cs index 37ddca34..bd760ce0 100644 --- a/src/Shared/HandyControl_Shared/Controls/Base/IGravatarGenerator.cs +++ b/src/Shared/HandyControl_Shared/Controls/Base/IGravatarGenerator.cs @@ -4,4 +4,4 @@ { object GetGravatar(string id); } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Controls/Base/ISelectable.cs b/src/Shared/HandyControl_Shared/Controls/Base/ISelectable.cs index ce254ea3..cfc33a1a 100644 --- a/src/Shared/HandyControl_Shared/Controls/Base/ISelectable.cs +++ b/src/Shared/HandyControl_Shared/Controls/Base/ISelectable.cs @@ -8,4 +8,4 @@ namespace HandyControl.Controls bool IsSelected { get; set; } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Controls/Base/ISingleOpen.cs b/src/Shared/HandyControl_Shared/Controls/Base/ISingleOpen.cs index d6b688f8..300188ab 100644 --- a/src/Shared/HandyControl_Shared/Controls/Base/ISingleOpen.cs +++ b/src/Shared/HandyControl_Shared/Controls/Base/ISingleOpen.cs @@ -6,4 +6,4 @@ namespace HandyControl.Controls { bool CanDispose { get; } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Controls/Base/RegularItemsControl.cs b/src/Shared/HandyControl_Shared/Controls/Base/RegularItemsControl.cs index 4faca069..fd4fced0 100644 --- a/src/Shared/HandyControl_Shared/Controls/Base/RegularItemsControl.cs +++ b/src/Shared/HandyControl_Shared/Controls/Base/RegularItemsControl.cs @@ -38,4 +38,4 @@ namespace HandyControl.Controls set => SetValue(ItemMarginProperty, value); } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Controls/Base/SelectableItem.cs b/src/Shared/HandyControl_Shared/Controls/Base/SelectableItem.cs index accaf979..c9d2603f 100644 --- a/src/Shared/HandyControl_Shared/Controls/Base/SelectableItem.cs +++ b/src/Shared/HandyControl_Shared/Controls/Base/SelectableItem.cs @@ -66,7 +66,7 @@ namespace HandyControl.Controls public bool IsSelected { - get => (bool)GetValue(IsSelectedProperty); + get => (bool) GetValue(IsSelectedProperty); set => SetValue(IsSelectedProperty, ValueBoxes.BooleanBox(value)); } @@ -108,4 +108,4 @@ namespace HandyControl.Controls remove => RemoveHandler(DeselectedEvent, value); } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Controls/Base/SimpleItemsControl.cs b/src/Shared/HandyControl_Shared/Controls/Base/SimpleItemsControl.cs index 20e2df51..d7339959 100644 --- a/src/Shared/HandyControl_Shared/Controls/Base/SimpleItemsControl.cs +++ b/src/Shared/HandyControl_Shared/Controls/Base/SimpleItemsControl.cs @@ -116,7 +116,7 @@ namespace HandyControl.Controls } } - private static void OnItemTemplateChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) + private static void OnItemTemplateChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) => (d as SimpleItemsControl)?.OnItemTemplateChanged(e); protected virtual void OnItemTemplateChanged(DependencyPropertyChangedEventArgs e) => Refresh(); @@ -164,4 +164,4 @@ namespace HandyControl.Controls { } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Controls/Block/FloatingBlock.cs b/src/Shared/HandyControl_Shared/Controls/Block/FloatingBlock.cs index 1b3cfd94..5d47ddc4 100644 --- a/src/Shared/HandyControl_Shared/Controls/Block/FloatingBlock.cs +++ b/src/Shared/HandyControl_Shared/Controls/Block/FloatingBlock.cs @@ -29,7 +29,7 @@ namespace HandyControl.Controls => element.SetValue(ToYProperty, value); public static double GetToY(DependencyObject element) - => (double)element.GetValue(ToYProperty); + => (double) element.GetValue(ToYProperty); public static readonly DependencyProperty DurationProperty = DependencyProperty.RegisterAttached( "Duration", typeof(Duration), typeof(FloatingBlock), new PropertyMetadata(new Duration(TimeSpan.FromSeconds(2)))); @@ -57,7 +57,7 @@ namespace HandyControl.Controls public static double GetVerticalOffset(DependencyObject element) => (double) element.GetValue(VerticalOffsetProperty); - + public static readonly DependencyProperty ContentTemplateProperty = DependencyProperty.RegisterAttached( "ContentTemplate", typeof(DataTemplate), typeof(FloatingBlock), new PropertyMetadata(default(DataTemplate), OnDataChanged)); @@ -69,7 +69,7 @@ namespace HandyControl.Controls public DataTemplate ContentTemplate { - get => (DataTemplate)GetValue(ContentTemplateProperty); + get => (DataTemplate) GetValue(ContentTemplateProperty); set => SetValue(ContentTemplateProperty, value); } @@ -80,7 +80,7 @@ namespace HandyControl.Controls => element.SetValue(ReadyToFloatProperty, ValueBoxes.BooleanBox(value)); private static bool GetReadyToFloat(DependencyObject element) - => (bool)element.GetValue(ReadyToFloatProperty); + => (bool) element.GetValue(ReadyToFloatProperty); public static readonly DependencyProperty ContentProperty = DependencyProperty.RegisterAttached( "Content", typeof(object), typeof(FloatingBlock), new PropertyMetadata(default, OnDataChanged)); diff --git a/src/Shared/HandyControl_Shared/Controls/Block/RunningBlock/RunningBlock.cs b/src/Shared/HandyControl_Shared/Controls/Block/RunningBlock/RunningBlock.cs index fc7e905c..c7e3008f 100644 --- a/src/Shared/HandyControl_Shared/Controls/Block/RunningBlock/RunningBlock.cs +++ b/src/Shared/HandyControl_Shared/Controls/Block/RunningBlock/RunningBlock.cs @@ -48,7 +48,7 @@ namespace HandyControl.Controls public bool Runaway { - get => (bool)GetValue(RunawayProperty); + get => (bool) GetValue(RunawayProperty); set => SetValue(RunawayProperty, ValueBoxes.BooleanBox(value)); } @@ -57,7 +57,7 @@ namespace HandyControl.Controls public bool AutoRun { - get => (bool)GetValue(AutoRunProperty); + get => (bool) GetValue(AutoRunProperty); set => SetValue(AutoRunProperty, ValueBoxes.BooleanBox(value)); } @@ -66,7 +66,7 @@ namespace HandyControl.Controls public Orientation Orientation { - get => (Orientation)GetValue(OrientationProperty); + get => (Orientation) GetValue(OrientationProperty); set => SetValue(OrientationProperty, value); } @@ -75,7 +75,7 @@ namespace HandyControl.Controls public Duration Duration { - get => (Duration)GetValue(DurationProperty); + get => (Duration) GetValue(DurationProperty); set => SetValue(DurationProperty, value); } @@ -84,15 +84,15 @@ namespace HandyControl.Controls public double Speed { - get => (double)GetValue(SpeedProperty); + get => (double) GetValue(SpeedProperty); set => SetValue(SpeedProperty, value); } public static readonly DependencyProperty IsRunningProperty = DependencyProperty.Register( "IsRunning", typeof(bool), typeof(RunningBlock), new PropertyMetadata(ValueBoxes.TrueBox, (o, args) => { - var ctl = (RunningBlock)o; - var v = (bool)args.NewValue; + var ctl = (RunningBlock) o; + var v = (bool) args.NewValue; if (v) { ctl._storyboard?.Resume(); @@ -105,7 +105,7 @@ namespace HandyControl.Controls public bool IsRunning { - get => (bool)GetValue(IsRunningProperty); + get => (bool) GetValue(IsRunningProperty); set => SetValue(IsRunningProperty, ValueBoxes.BooleanBox(value)); } @@ -114,7 +114,7 @@ namespace HandyControl.Controls public bool AutoReverse { - get => (bool)GetValue(AutoReverseProperty); + get => (bool) GetValue(AutoReverseProperty); set => SetValue(AutoReverseProperty, ValueBoxes.BooleanBox(value)); } @@ -190,4 +190,4 @@ namespace HandyControl.Controls _storyboard.Begin(); } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Controls/Block/RunningBlock/RunningBorder.cs b/src/Shared/HandyControl_Shared/Controls/Block/RunningBlock/RunningBorder.cs index 5966ad75..652c4c93 100644 --- a/src/Shared/HandyControl_Shared/Controls/Block/RunningBlock/RunningBorder.cs +++ b/src/Shared/HandyControl_Shared/Controls/Block/RunningBlock/RunningBorder.cs @@ -62,4 +62,4 @@ namespace HandyControl.Controls private static Size ConvertThickness2Size(Thickness th) => new Size(th.Left + th.Right, th.Top + th.Bottom); } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Controls/Block/ToggleBlock.cs b/src/Shared/HandyControl_Shared/Controls/Block/ToggleBlock.cs index e6e85b50..53facd3e 100644 --- a/src/Shared/HandyControl_Shared/Controls/Block/ToggleBlock.cs +++ b/src/Shared/HandyControl_Shared/Controls/Block/ToggleBlock.cs @@ -24,7 +24,7 @@ namespace HandyControl.Controls // Because Nullable unboxing is very slow (uses reflection) first we cast to bool var value = GetValue(IsCheckedProperty); // ReSharper disable once RedundantExplicitNullableCreation - return value == null ? new bool?() : new bool?((bool)value); + return value == null ? new bool?() : new bool?((bool) value); } set => SetValue(IsCheckedProperty, value.HasValue ? ValueBoxes.BooleanBox(value.Value) : null); } @@ -56,4 +56,4 @@ namespace HandyControl.Controls set => SetValue(IndeterminateContentProperty, value); } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Controls/Button/ButtonGroup.cs b/src/Shared/HandyControl_Shared/Controls/Button/ButtonGroup.cs index 7a69582c..14ab530d 100644 --- a/src/Shared/HandyControl_Shared/Controls/Button/ButtonGroup.cs +++ b/src/Shared/HandyControl_Shared/Controls/Button/ButtonGroup.cs @@ -13,7 +13,7 @@ namespace HandyControl.Controls public Orientation Orientation { - get => (Orientation)GetValue(OrientationProperty); + get => (Orientation) GetValue(OrientationProperty); set => SetValue(OrientationProperty, value); } @@ -24,7 +24,7 @@ namespace HandyControl.Controls var count = Items.Count; for (var i = 0; i < count; i++) { - var item = (ButtonBase)Items[i]; + var item = (ButtonBase) Items[i]; item.Style = ItemContainerStyleSelector?.SelectStyle(item, this); } } diff --git a/src/Shared/HandyControl_Shared/Controls/Button/ContextMenuButton.cs b/src/Shared/HandyControl_Shared/Controls/Button/ContextMenuButton.cs index e4d9a84d..8d362a41 100644 --- a/src/Shared/HandyControl_Shared/Controls/Button/ContextMenuButton.cs +++ b/src/Shared/HandyControl_Shared/Controls/Button/ContextMenuButton.cs @@ -20,4 +20,4 @@ namespace HandyControl.Controls } } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Controls/Button/ContextMenuToggleButton.cs b/src/Shared/HandyControl_Shared/Controls/Button/ContextMenuToggleButton.cs index 47116649..bf822d9c 100644 --- a/src/Shared/HandyControl_Shared/Controls/Button/ContextMenuToggleButton.cs +++ b/src/Shared/HandyControl_Shared/Controls/Button/ContextMenuToggleButton.cs @@ -28,4 +28,4 @@ namespace HandyControl.Controls } } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Controls/Button/ProgressButton.cs b/src/Shared/HandyControl_Shared/Controls/Button/ProgressButton.cs index 87038921..142d0bcd 100644 --- a/src/Shared/HandyControl_Shared/Controls/Button/ProgressButton.cs +++ b/src/Shared/HandyControl_Shared/Controls/Button/ProgressButton.cs @@ -24,4 +24,4 @@ namespace HandyControl.Controls set => SetValue(ProgressProperty, value); } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Controls/Carousel/Carousel.cs b/src/Shared/HandyControl_Shared/Controls/Carousel/Carousel.cs index 9d136228..61632f47 100644 --- a/src/Shared/HandyControl_Shared/Controls/Carousel/Carousel.cs +++ b/src/Shared/HandyControl_Shared/Controls/Carousel/Carousel.cs @@ -82,8 +82,8 @@ namespace HandyControl.Controls public static readonly DependencyProperty AutoRunProperty = DependencyProperty.Register( "AutoRun", typeof(bool), typeof(Carousel), new PropertyMetadata(ValueBoxes.FalseBox, (o, args) => { - var ctl = (Carousel)o; - ctl.TimerSwitch((bool)args.NewValue); + var ctl = (Carousel) o; + ctl.TimerSwitch((bool) args.NewValue); })); public static readonly DependencyProperty IntervalProperty = DependencyProperty.Register( @@ -94,7 +94,7 @@ namespace HandyControl.Controls public double ExtendWidth { - get => (double)GetValue(ExtendWidthProperty); + get => (double) GetValue(ExtendWidthProperty); set => SetValue(ExtendWidthProperty, value); } @@ -103,7 +103,7 @@ namespace HandyControl.Controls public bool IsCenter { - get => (bool)GetValue(IsCenterProperty); + get => (bool) GetValue(IsCenterProperty); set => SetValue(IsCenterProperty, ValueBoxes.BooleanBox(value)); } @@ -160,7 +160,7 @@ namespace HandyControl.Controls /// public bool AutoRun { - get => (bool)GetValue(AutoRunProperty); + get => (bool) GetValue(AutoRunProperty); set => SetValue(AutoRunProperty, ValueBoxes.BooleanBox(value)); } @@ -169,7 +169,7 @@ namespace HandyControl.Controls /// public TimeSpan Interval { - get => (TimeSpan)GetValue(IntervalProperty); + get => (TimeSpan) GetValue(IntervalProperty); set => SetValue(IntervalProperty, value); } @@ -278,7 +278,7 @@ namespace HandyControl.Controls } else { - var ctl = (FrameworkElement)ItemsHost.Children[PageIndex]; + var ctl = (FrameworkElement) ItemsHost.Children[PageIndex]; var ctlWidth = ctl.DesiredSize.Width; ItemsHost.BeginAnimation(MarginProperty, AnimationHelper.CreateAnimation( @@ -297,7 +297,7 @@ namespace HandyControl.Controls if (!CheckNull()) return; _selectedButton = e.OriginalSource as RadioButton; - + var index = _panelPage.Children.IndexOf(_selectedButton); if (index != -1) { @@ -453,4 +453,4 @@ namespace HandyControl.Controls } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Controls/ColorPicker/ColorDropper.cs b/src/Shared/HandyControl_Shared/Controls/ColorPicker/ColorDropper.cs index 96d9c355..50bc8bef 100644 --- a/src/Shared/HandyControl_Shared/Controls/ColorPicker/ColorDropper.cs +++ b/src/Shared/HandyControl_Shared/Controls/ColorPicker/ColorDropper.cs @@ -98,9 +98,9 @@ namespace HandyControl.Controls { var desk = InteropMethods.GetDesktopWindow(); var dc = InteropMethods.GetWindowDC(desk); - var a = (int)InteropMethods.GetPixel(dc, x, y); + var a = (int) InteropMethods.GetPixel(dc, x, y); InteropMethods.ReleaseDC(desk, dc); return Color.FromArgb(255, (byte) ((a >> 0) & 0xff), (byte) ((a >> 8) & 0xff), (byte) ((a >> 16) & 0xff)); } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Controls/ColorPicker/ColorPicker.cs b/src/Shared/HandyControl_Shared/Controls/ColorPicker/ColorPicker.cs index 7761ea81..f8348369 100644 --- a/src/Shared/HandyControl_Shared/Controls/ColorPicker/ColorPicker.cs +++ b/src/Shared/HandyControl_Shared/Controls/ColorPicker/ColorPicker.cs @@ -219,7 +219,7 @@ namespace HandyControl.Controls internal int ChannelA { - get => (int)GetValue(ChannelAProperty); + get => (int) GetValue(ChannelAProperty); set => SetValue(ChannelAProperty, value); } @@ -228,7 +228,7 @@ namespace HandyControl.Controls internal int ChannelR { - get => (int)GetValue(ChannelRProperty); + get => (int) GetValue(ChannelRProperty); set => SetValue(ChannelRProperty, value); } @@ -237,7 +237,7 @@ namespace HandyControl.Controls internal int ChannelG { - get => (int)GetValue(ChannelGProperty); + get => (int) GetValue(ChannelGProperty); set => SetValue(ChannelGProperty, value); } @@ -246,7 +246,7 @@ namespace HandyControl.Controls internal int ChannelB { - get => (int)GetValue(ChannelBProperty); + get => (int) GetValue(ChannelBProperty); set => SetValue(ChannelBProperty, value); } @@ -254,8 +254,8 @@ namespace HandyControl.Controls "SelectedBrush", typeof(SolidColorBrush), typeof(ColorPicker), new PropertyMetadata(Brushes.White, (o, args) => { - var ctl = (ColorPicker)o; - var v = (SolidColorBrush)args.NewValue; + var ctl = (ColorPicker) o; + var v = (SolidColorBrush) args.NewValue; if (ctl.IsNeedUpdateInfo) { @@ -275,7 +275,7 @@ namespace HandyControl.Controls /// public SolidColorBrush SelectedBrush { - get => (SolidColorBrush)GetValue(SelectedBrushProperty); + get => (SolidColorBrush) GetValue(SelectedBrushProperty); set => SetValue(SelectedBrushProperty, value); } @@ -284,7 +284,7 @@ namespace HandyControl.Controls internal SolidColorBrush SelectedBrushWithoutOpacity { - get => (SolidColorBrush)GetValue(SelectedBrushWithoutOpacityProperty); + get => (SolidColorBrush) GetValue(SelectedBrushWithoutOpacityProperty); set => SetValue(SelectedBrushWithoutOpacityProperty, value); } @@ -293,7 +293,7 @@ namespace HandyControl.Controls internal SolidColorBrush BackColor { - get => (SolidColorBrush)GetValue(BackColorProperty); + get => (SolidColorBrush) GetValue(BackColorProperty); set => SetValue(BackColorProperty, value); } @@ -305,7 +305,7 @@ namespace HandyControl.Controls internal List ShowList { - get => (List)GetValue(ShowListProperty); + get => (List) GetValue(ShowListProperty); set => SetValue(ShowListProperty, value); } @@ -450,7 +450,7 @@ namespace HandyControl.Controls private Button CreateColorButton(string colorStr) { var color = ColorConverter.ConvertFromString(colorStr) ?? default(Color); - var brush = new SolidColorBrush((Color)color); + var brush = new SolidColorBrush((Color) color); var button = new Button { @@ -527,7 +527,7 @@ namespace HandyControl.Controls var common = list[commonIndex]; list[maxIndex] = 255; list[minIndex] = 0; - common = (byte)(255 * (min - common) / (double)(min - max)); + common = (byte) (255 * (min - common) / (double) (min - max)); list[commonIndex] = common; BackColor = new SolidColorBrush(Color.FromRgb(list[0], list[1], list[2])); @@ -575,7 +575,7 @@ namespace HandyControl.Controls } var matrix = _borderPicker.RenderTransform.Value; - var x = max == 0 ? 0 : (1 - min / (double)max) * ColorPanelWidth; + var x = max == 0 ? 0 : (1 - min / (double) max) * ColorPanelWidth; var y = (1 - max / 255.0) * ColorPanelHeight; if (_isNeedUpdatePicker) { @@ -586,7 +586,7 @@ namespace HandyControl.Controls private void SliderColor_OnValueChanged(object sender, RoutedPropertyChangedEventArgs e) { if (!_appliedTemplate || !IsNeedUpdateInfo) return; - var index = Math.Min(5, (int)Math.Floor(e.NewValue)); + var index = Math.Min(5, (int) Math.Floor(e.NewValue)); var sub = e.NewValue - index; var range = _colorRangeList[index]; @@ -602,7 +602,7 @@ namespace HandyControl.Controls { if (!_appliedTemplate || !IsNeedUpdateInfo) return; var color = SelectedBrush.Color; - SelectedBrush = new SolidColorBrush(Color.FromArgb((byte)_sliderOpacity.Value, color.R, color.G, color.B)); + SelectedBrush = new SolidColorBrush(Color.FromArgb((byte) _sliderOpacity.Value, color.R, color.G, color.B)); } private void MouseDragElementBehavior_OnDragging(object sender, MouseEventArgs e) @@ -646,15 +646,15 @@ namespace HandyControl.Controls var scaleX = p.X / ColorPanelWidth; var scaleY = 1 - p.Y / ColorPanelHeight; - var colorYLeft = Color.FromRgb((byte)(255 * scaleY), (byte)(255 * scaleY), (byte)(255 * scaleY)); - var colorYRight = Color.FromRgb((byte)(BackColor.Color.R * scaleY), (byte)(BackColor.Color.G * scaleY), (byte)(BackColor.Color.B * scaleY)); + var colorYLeft = Color.FromRgb((byte) (255 * scaleY), (byte) (255 * scaleY), (byte) (255 * scaleY)); + var colorYRight = Color.FromRgb((byte) (BackColor.Color.R * scaleY), (byte) (BackColor.Color.G * scaleY), (byte) (BackColor.Color.B * scaleY)); var subR = colorYLeft.R - colorYRight.R; var subG = colorYLeft.G - colorYRight.G; var subB = colorYLeft.B - colorYRight.B; - var color = Color.FromArgb((byte)_sliderOpacity.Value, (byte)(colorYLeft.R - subR * scaleX), - (byte)(colorYLeft.G - subG * scaleX), (byte)(colorYLeft.B - subB * scaleX)); + var color = Color.FromArgb((byte) _sliderOpacity.Value, (byte) (colorYLeft.R - subR * scaleX), + (byte) (colorYLeft.G - subG * scaleX), (byte) (colorYLeft.B - subB * scaleX)); SelectedBrush = new SolidColorBrush(color); } @@ -675,17 +675,17 @@ namespace HandyControl.Controls { case "R": { - SelectedBrush = new SolidColorBrush(Color.FromArgb(color.A, (byte)e.Info, color.G, color.B)); + SelectedBrush = new SolidColorBrush(Color.FromArgb(color.A, (byte) e.Info, color.G, color.B)); break; } case "G": { - SelectedBrush = new SolidColorBrush(Color.FromArgb(color.A, color.R, (byte)e.Info, color.B)); + SelectedBrush = new SolidColorBrush(Color.FromArgb(color.A, color.R, (byte) e.Info, color.B)); break; } case "B": { - SelectedBrush = new SolidColorBrush(Color.FromArgb(color.A, color.R, color.G, (byte)e.Info)); + SelectedBrush = new SolidColorBrush(Color.FromArgb(color.A, color.R, color.G, (byte) e.Info)); break; } } @@ -731,6 +731,6 @@ namespace HandyControl.Controls } public bool CanDispose { get; } = true; - + } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Controls/Cover/CoverFlow/CoverFlow.cs b/src/Shared/HandyControl_Shared/Controls/Cover/CoverFlow/CoverFlow.cs index eb9d98f6..2905bb5e 100644 --- a/src/Shared/HandyControl_Shared/Controls/Cover/CoverFlow/CoverFlow.cs +++ b/src/Shared/HandyControl_Shared/Controls/Cover/CoverFlow/CoverFlow.cs @@ -40,8 +40,8 @@ namespace HandyControl.Controls private static object CoercePageIndex(DependencyObject d, object baseValue) { - var ctl = (CoverFlow)d; - var v = (int)baseValue; + var ctl = (CoverFlow) d; + var v = (int) baseValue; if (v < 0) { @@ -56,8 +56,8 @@ namespace HandyControl.Controls private static void OnPageIndexChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { - var ctl = (CoverFlow)d; - ctl.UpdateIndex((int)e.NewValue); + var ctl = (CoverFlow) d; + ctl.UpdateIndex((int) e.NewValue); } /// @@ -113,7 +113,7 @@ namespace HandyControl.Controls /// public int PageIndex { - get => (int)GetValue(PageIndexProperty); + get => (int) GetValue(PageIndexProperty); internal set => SetValue(PageIndexProperty, value); } @@ -122,7 +122,7 @@ namespace HandyControl.Controls /// public bool Loop { - get => (bool)GetValue(LoopProperty); + get => (bool) GetValue(LoopProperty); set => SetValue(LoopProperty, ValueBoxes.BooleanBox(value)); } @@ -217,7 +217,7 @@ namespace HandyControl.Controls private void Viewport3D_MouseLeftButtonDown(object sender, MouseButtonEventArgs e) { - var result = (RayMeshGeometry3DHitTestResult)VisualTreeHelper.HitTest(_viewport3D, e.GetPosition(_viewport3D)); + var result = (RayMeshGeometry3DHitTestResult) VisualTreeHelper.HitTest(_viewport3D, e.GetPosition(_viewport3D)); if (result != null) { foreach (var item in _itemShowDic.Values) @@ -301,4 +301,4 @@ namespace HandyControl.Controls }); } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Controls/Cover/CoverFlow/CoverFlowItem.cs b/src/Shared/HandyControl_Shared/Controls/Cover/CoverFlow/CoverFlowItem.cs index 485a17be..c540ad33 100644 --- a/src/Shared/HandyControl_Shared/Controls/Cover/CoverFlow/CoverFlowItem.cs +++ b/src/Shared/HandyControl_Shared/Controls/Cover/CoverFlow/CoverFlowItem.cs @@ -154,4 +154,4 @@ namespace HandyControl.Controls return false; } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Controls/Cover/CoverView/CoverView.cs b/src/Shared/HandyControl_Shared/Controls/Cover/CoverView/CoverView.cs index 7ce10f51..dc48a79d 100644 --- a/src/Shared/HandyControl_Shared/Controls/Cover/CoverView/CoverView.cs +++ b/src/Shared/HandyControl_Shared/Controls/Cover/CoverView/CoverView.cs @@ -101,7 +101,7 @@ namespace HandyControl.Controls public Style CoverViewContentStyle { - get => (Style)GetValue(CoverViewContentStyleProperty); + get => (Style) GetValue(CoverViewContentStyleProperty); set => SetValue(CoverViewContentStyleProperty, value); } @@ -120,13 +120,13 @@ namespace HandyControl.Controls private static bool IsGroupsValid(object value) { - var v = (int)value; + var v = (int) value; return v >= 1; } public int Groups { - get => (int)GetValue(GroupsProperty); + get => (int) GetValue(GroupsProperty); set => SetValue(GroupsProperty, value); } @@ -136,7 +136,7 @@ namespace HandyControl.Controls public double ItemContentHeight { - get => (double)GetValue(ItemContentHeightProperty); + get => (double) GetValue(ItemContentHeightProperty); set => SetValue(ItemContentHeightProperty, value); } @@ -145,7 +145,7 @@ namespace HandyControl.Controls public bool ItemContentHeightFixed { - get => (bool)GetValue(ItemContentHeightFixedProperty); + get => (bool) GetValue(ItemContentHeightFixedProperty); set => SetValue(ItemContentHeightFixedProperty, ValueBoxes.BooleanBox(value)); } @@ -162,7 +162,7 @@ namespace HandyControl.Controls { base.OnRenderSizeChanged(sizeInfo); - Groups = (int)(sizeInfo.NewSize.Width / (ItemWidth + ItemMargin.Left + ItemMargin.Right)); + Groups = (int) (sizeInfo.NewSize.Width / (ItemWidth + ItemMargin.Left + ItemMargin.Right)); } protected override void Refresh() @@ -415,4 +415,4 @@ namespace HandyControl.Controls } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Controls/Cover/CoverView/CoverViewContent.cs b/src/Shared/HandyControl_Shared/Controls/Cover/CoverView/CoverViewContent.cs index 9cb74208..689d9b00 100644 --- a/src/Shared/HandyControl_Shared/Controls/Cover/CoverView/CoverViewContent.cs +++ b/src/Shared/HandyControl_Shared/Controls/Cover/CoverView/CoverViewContent.cs @@ -47,7 +47,7 @@ namespace HandyControl.Controls internal double ManualHeight { - get => (double)GetValue(ManualHeightProperty); + get => (double) GetValue(ManualHeightProperty); set => SetValue(ManualHeightProperty, value); } @@ -57,7 +57,7 @@ namespace HandyControl.Controls public double ContentHeight { - get => (double)GetValue(ContentHeightProperty); + get => (double) GetValue(ContentHeightProperty); set => SetValue(ContentHeightProperty, value); } @@ -119,4 +119,4 @@ namespace HandyControl.Controls _content.BeginAnimation(HeightProperty, animation); } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Controls/Cover/CoverView/CoverViewItem.cs b/src/Shared/HandyControl_Shared/Controls/Cover/CoverView/CoverViewItem.cs index f3ae61a5..51f8d397 100644 --- a/src/Shared/HandyControl_Shared/Controls/Cover/CoverView/CoverViewItem.cs +++ b/src/Shared/HandyControl_Shared/Controls/Cover/CoverView/CoverViewItem.cs @@ -1,7 +1,7 @@ namespace HandyControl.Controls { public class CoverViewItem : HeaderedSelectableItem - { + { internal int Index { get; set; } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Controls/Dialog/Dialog.cs b/src/Shared/HandyControl_Shared/Controls/Dialog/Dialog.cs index dc3e9119..c6f03d2b 100644 --- a/src/Shared/HandyControl_Shared/Controls/Dialog/Dialog.cs +++ b/src/Shared/HandyControl_Shared/Controls/Dialog/Dialog.cs @@ -23,7 +23,7 @@ namespace HandyControl.Controls public bool IsClosed { - get => (bool)GetValue(IsClosedProperty); + get => (bool) GetValue(IsClosedProperty); internal set => SetValue(IsClosedProperty, ValueBoxes.BooleanBox(value)); } @@ -49,7 +49,7 @@ namespace HandyControl.Controls => element.SetValue(TokenProperty, value); public static string GetToken(DependencyObject element) - => (string)element.GetValue(TokenProperty); + => (string) element.GetValue(TokenProperty); public Dialog() { @@ -116,8 +116,8 @@ namespace HandyControl.Controls else { ContainerDic.TryGetValue(token, out element); - decorator = element is System.Windows.Window ? - VisualHelper.GetChild(element) : + decorator = element is System.Windows.Window ? + VisualHelper.GetChild(element) : VisualHelper.GetChild(element); } @@ -173,4 +173,4 @@ namespace HandyControl.Controls } } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Controls/Dialog/DialogContainer.cs b/src/Shared/HandyControl_Shared/Controls/Dialog/DialogContainer.cs index 539bf07f..58f365f6 100644 --- a/src/Shared/HandyControl_Shared/Controls/Dialog/DialogContainer.cs +++ b/src/Shared/HandyControl_Shared/Controls/Dialog/DialogContainer.cs @@ -4,6 +4,6 @@ namespace HandyControl.Controls { public class DialogContainer : AdornerDecorator { - + } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Controls/Growl/Growl.cs b/src/Shared/HandyControl_Shared/Controls/Growl/Growl.cs index 337ad319..61aac3dc 100644 --- a/src/Shared/HandyControl_Shared/Controls/Growl/Growl.cs +++ b/src/Shared/HandyControl_Shared/Controls/Growl/Growl.cs @@ -179,7 +179,7 @@ namespace HandyControl.Controls public static readonly DependencyProperty GrowlParentProperty = DependencyProperty.RegisterAttached( "GrowlParent", typeof(bool), typeof(Growl), new PropertyMetadata(ValueBoxes.FalseBox, (o, args) => { - if ((bool)args.NewValue && o is Panel panel) + if ((bool) args.NewValue && o is Panel panel) { SetGrowlPanel(panel); } @@ -207,57 +207,57 @@ namespace HandyControl.Controls => element.SetValue(TokenProperty, value); public static string GetToken(DependencyObject element) - => (string)element.GetValue(TokenProperty); + => (string) element.GetValue(TokenProperty); public static void SetGrowlParent(DependencyObject element, bool value) => element.SetValue(GrowlParentProperty, ValueBoxes.BooleanBox(value)); - public static bool GetGrowlParent(DependencyObject element) => (bool)element.GetValue(GrowlParentProperty); + public static bool GetGrowlParent(DependencyObject element) => (bool) element.GetValue(GrowlParentProperty); public InfoType Type { - get => (InfoType)GetValue(TypeProperty); + get => (InfoType) GetValue(TypeProperty); set => SetValue(TypeProperty, value); } internal string CancelStr { - get => (string)GetValue(CancelStrProperty); + get => (string) GetValue(CancelStrProperty); set => SetValue(CancelStrProperty, value); } internal string ConfirmStr { - get => (string)GetValue(ConfirmStrProperty); + get => (string) GetValue(ConfirmStrProperty); set => SetValue(ConfirmStrProperty, value); } public bool ShowDateTime { - get => (bool)GetValue(ShowDateTimeProperty); + get => (bool) GetValue(ShowDateTimeProperty); set => SetValue(ShowDateTimeProperty, ValueBoxes.BooleanBox(value)); } public string Message { - get => (string)GetValue(MessageProperty); + get => (string) GetValue(MessageProperty); set => SetValue(MessageProperty, value); } public DateTime Time { - get => (DateTime)GetValue(TimeProperty); + get => (DateTime) GetValue(TimeProperty); set => SetValue(TimeProperty, value); } public Geometry Icon { - get => (Geometry)GetValue(IconProperty); + get => (Geometry) GetValue(IconProperty); set => SetValue(IconProperty, value); } public Brush IconBrush { - get => (Brush)GetValue(IconBrushProperty); + get => (Brush) GetValue(IconBrushProperty); set => SetValue(IconBrushProperty, value); } @@ -848,4 +848,4 @@ namespace HandyControl.Controls private void ButtonOk_OnClick(object sender, RoutedEventArgs e) => Close(true); } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Controls/Growl/GrowlWindow.cs b/src/Shared/HandyControl_Shared/Controls/Growl/GrowlWindow.cs index 59e1214d..0e2646cb 100644 --- a/src/Shared/HandyControl_Shared/Controls/Growl/GrowlWindow.cs +++ b/src/Shared/HandyControl_Shared/Controls/Growl/GrowlWindow.cs @@ -34,4 +34,4 @@ namespace HandyControl.Controls Top = 0; } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Controls/Image/GifImage.cs b/src/Shared/HandyControl_Shared/Controls/Image/GifImage.cs index 78e52ee0..b70aa77e 100644 --- a/src/Shared/HandyControl_Shared/Controls/Image/GifImage.cs +++ b/src/Shared/HandyControl_Shared/Controls/Image/GifImage.cs @@ -44,7 +44,7 @@ namespace HandyControl.Controls if (e.NewValue != null) { - var v = (Uri)e.NewValue; + var v = (Uri) e.NewValue; ctl.GetGifStreamFromPack(v); ctl.StartAnimate(); } @@ -62,8 +62,8 @@ namespace HandyControl.Controls private static void OnVisibilityChanged(DependencyObject s, DependencyPropertyChangedEventArgs e) { - var ctl = (GifImage)s; - var v = (Visibility)e.NewValue; + var ctl = (GifImage) s; + var v = (Visibility) e.NewValue; if (v != Visibility.Visible) { ctl.StopAnimate(); @@ -244,8 +244,8 @@ namespace HandyControl.Controls created = dataStream = File.OpenRead(filename); } - image._rawData = new byte[(int)dataStream.Length]; - dataStream.Read(image._rawData, 0, (int)dataStream.Length); + image._rawData = new byte[(int) dataStream.Length]; + dataStream.Read(image._rawData, 0, (int) dataStream.Length); } finally { @@ -356,7 +356,7 @@ namespace HandyControl.Controls { for (var i = 0; i < count; i++) { - guids[i] = (Guid)InteropMethods.PtrToStructure((IntPtr)((long)buffer + size * i), typeof(Guid)); + guids[i] = (Guid) InteropMethods.PtrToStructure((IntPtr) ((long) buffer + size * i), typeof(Guid)); } } finally @@ -491,4 +491,4 @@ namespace HandyControl.Controls })); } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Controls/Image/ImageBlock.cs b/src/Shared/HandyControl_Shared/Controls/Image/ImageBlock.cs index 2c06d782..d4cb462d 100644 --- a/src/Shared/HandyControl_Shared/Controls/Image/ImageBlock.cs +++ b/src/Shared/HandyControl_Shared/Controls/Image/ImageBlock.cs @@ -52,7 +52,7 @@ namespace HandyControl.Controls private void ImageBlock_IsVisibleChanged(object sender, DependencyPropertyChangedEventArgs e) { - if(IsVisible) + if (IsVisible) { _dispatcherTimer.Tick += DispatcherTimer_Tick; if (IsPlaying) @@ -80,11 +80,11 @@ namespace HandyControl.Controls private static void OnPositionsChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { - var ctl = (ImageBlock)d; + var ctl = (ImageBlock) d; if (e.Property == ColumnsProperty) { - ctl._columns = (int)e.NewValue; + ctl._columns = (int) e.NewValue; } ctl.UpdateDatas(); @@ -138,7 +138,7 @@ namespace HandyControl.Controls private static void OnIsPlayingChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { - var ctl = (ImageBlock)d; + var ctl = (ImageBlock) d; if ((bool) e.NewValue) { ctl._dispatcherTimer.Start(); @@ -157,7 +157,7 @@ namespace HandyControl.Controls public static readonly DependencyProperty ColumnsProperty = DependencyProperty.Register( "Columns", typeof(int), typeof(ImageBlock), new FrameworkPropertyMetadata(ValueBoxes.Int1Box, - FrameworkPropertyMetadataOptions.AffectsMeasure | FrameworkPropertyMetadataOptions.AffectsRender, OnPositionsChanged), obj => (int)obj >= 1); + FrameworkPropertyMetadataOptions.AffectsMeasure | FrameworkPropertyMetadataOptions.AffectsRender, OnPositionsChanged), obj => (int) obj >= 1); public int Columns { @@ -167,7 +167,7 @@ namespace HandyControl.Controls public static readonly DependencyProperty RowsProperty = DependencyProperty.Register( "Rows", typeof(int), typeof(ImageBlock), new FrameworkPropertyMetadata(ValueBoxes.Int1Box, - FrameworkPropertyMetadataOptions.AffectsMeasure | FrameworkPropertyMetadataOptions.AffectsRender, OnPositionsChanged), obj => (int)obj >= 1); + FrameworkPropertyMetadataOptions.AffectsMeasure | FrameworkPropertyMetadataOptions.AffectsRender, OnPositionsChanged), obj => (int) obj >= 1); public int Rows { @@ -196,14 +196,14 @@ namespace HandyControl.Controls private static void OnSourceChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { - var ctl = (ImageBlock)d; + var ctl = (ImageBlock) d; ctl._source = e.NewValue as BitmapSource; ctl.UpdateDatas(); } public ImageSource Source { - get => (ImageSource)GetValue(SourceProperty); + get => (ImageSource) GetValue(SourceProperty); set => SetValue(SourceProperty, value); } diff --git a/src/Shared/HandyControl_Shared/Controls/Image/ImageViewer.cs b/src/Shared/HandyControl_Shared/Controls/Image/ImageViewer.cs index dedf47c0..a90b8337 100644 --- a/src/Shared/HandyControl_Shared/Controls/Image/ImageViewer.cs +++ b/src/Shared/HandyControl_Shared/Controls/Image/ImageViewer.cs @@ -270,19 +270,19 @@ namespace HandyControl.Controls public bool IsFullScreen { - get => (bool)GetValue(IsFullScreenProperty); + get => (bool) GetValue(IsFullScreenProperty); set => SetValue(IsFullScreenProperty, ValueBoxes.BooleanBox(value)); } public bool ShowImgMap { - get => (bool)GetValue(ShowImgMapProperty); + get => (bool) GetValue(ShowImgMapProperty); set => SetValue(ShowImgMapProperty, ValueBoxes.BooleanBox(value)); } public BitmapFrame ImageSource { - get => (BitmapFrame)GetValue(ImageSourceProperty); + get => (BitmapFrame) GetValue(ImageSourceProperty); set => SetValue(ImageSourceProperty, value); } @@ -294,13 +294,13 @@ namespace HandyControl.Controls internal string ImgPath { - get => (string)GetValue(ImgPathProperty); + get => (string) GetValue(ImgPathProperty); set => SetValue(ImgPathProperty, value); } internal long ImgSize { - get => (long)GetValue(ImgSizeProperty); + get => (long) GetValue(ImgSizeProperty); set => SetValue(ImgSizeProperty, value); } @@ -309,49 +309,49 @@ namespace HandyControl.Controls /// internal bool ShowFullScreenButton { - get => (bool)GetValue(ShowFullScreenButtonProperty); + get => (bool) GetValue(ShowFullScreenButtonProperty); set => SetValue(ShowFullScreenButtonProperty, ValueBoxes.BooleanBox(value)); } internal Thickness ImageMargin { - get => (Thickness)GetValue(ImageMarginProperty); + get => (Thickness) GetValue(ImageMarginProperty); set => SetValue(ImageMarginProperty, value); } internal double ImageWidth { - get => (double)GetValue(ImageWidthProperty); + get => (double) GetValue(ImageWidthProperty); set => SetValue(ImageWidthProperty, value); } internal double ImageHeight { - get => (double)GetValue(ImageHeightProperty); + get => (double) GetValue(ImageHeightProperty); set => SetValue(ImageHeightProperty, value); } internal double ImageScale { - get => (double)GetValue(ImageScaleProperty); + get => (double) GetValue(ImageScaleProperty); set => SetValue(ImageScaleProperty, value); } internal string ScaleStr { - get => (string)GetValue(ScaleStrProperty); + get => (string) GetValue(ScaleStrProperty); set => SetValue(ScaleStrProperty, value); } internal double ImageRotate { - get => (double)GetValue(ImageRotateProperty); + get => (double) GetValue(ImageRotateProperty); set => SetValue(ImageRotateProperty, value); } internal bool ShowSmallImgInternal { - get => (bool)GetValue(ShowSmallImgInternalProperty); + get => (bool) GetValue(ShowSmallImgInternalProperty); set => SetValue(ShowSmallImgInternalProperty, ValueBoxes.BooleanBox(value)); } @@ -370,7 +370,7 @@ namespace HandyControl.Controls /// internal bool ShowCloseButton { - get => (bool)GetValue(ShowCloseButtonProperty); + get => (bool) GetValue(ShowCloseButtonProperty); set => SetValue(ShowCloseButtonProperty, ValueBoxes.BooleanBox(value)); } @@ -811,7 +811,7 @@ namespace HandyControl.Controls { _imgActualRotate = rotate; - _isOblique = ((int)_imgActualRotate - 90) % 180 == 0; + _isOblique = ((int) _imgActualRotate - 90) % 180 == 0; ShowSmallImgInternal = false; Init(); InitBorderSmall(); @@ -918,4 +918,4 @@ namespace HandyControl.Controls private void CanvasSmallImg_OnMouseLeave(object sender, MouseEventArgs e) => _imgSmallIsMouseLeftButtonDown = false; } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Controls/Input/ComboBox.cs b/src/Shared/HandyControl_Shared/Controls/Input/ComboBox.cs index 354bb1b7..6cd44d2e 100644 --- a/src/Shared/HandyControl_Shared/Controls/Input/ComboBox.cs +++ b/src/Shared/HandyControl_Shared/Controls/Input/ComboBox.cs @@ -176,7 +176,7 @@ namespace HandyControl.Controls /// public bool IsError { - get => (bool)GetValue(IsErrorProperty); + get => (bool) GetValue(IsErrorProperty); set => SetValue(IsErrorProperty, ValueBoxes.BooleanBox(value)); } @@ -191,7 +191,7 @@ namespace HandyControl.Controls /// public string ErrorStr { - get => (string)GetValue(ErrorStrProperty); + get => (string) GetValue(ErrorStrProperty); set => SetValue(ErrorStrProperty, value); } @@ -212,7 +212,7 @@ namespace HandyControl.Controls /// public TextType TextType { - get => (TextType)GetValue(TextTypeProperty); + get => (TextType) GetValue(TextTypeProperty); set => SetValue(TextTypeProperty, value); } @@ -227,7 +227,7 @@ namespace HandyControl.Controls /// public bool ShowClearButton { - get => (bool)GetValue(ShowClearButtonProperty); + get => (bool) GetValue(ShowClearButtonProperty); set => SetValue(ShowClearButtonProperty, ValueBoxes.BooleanBox(value)); } @@ -239,7 +239,7 @@ namespace HandyControl.Controls private static void OnAutoCompleteChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { - var ctl = (ComboBox)d; + var ctl = (ComboBox) d; if (ctl._editableTextBox != null) { ctl.UpdateSearchItems(ctl._editableTextBox.Text); @@ -251,7 +251,7 @@ namespace HandyControl.Controls /// public bool AutoComplete { - get => (bool)GetValue(AutoCompleteProperty); + get => (bool) GetValue(AutoCompleteProperty); set => SetValue(AutoCompleteProperty, ValueBoxes.BooleanBox(value)); } @@ -263,7 +263,7 @@ namespace HandyControl.Controls private static void OnSearchTextChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { - var ctl = (ComboBox)d; + var ctl = (ComboBox) d; if (ctl._isAutoCompleteAction) { #if NET40 @@ -283,7 +283,7 @@ namespace HandyControl.Controls /// internal string SearchText { - get => (string)GetValue(SearchTextProperty); + get => (string) GetValue(SearchTextProperty); set => SetValue(SearchTextProperty, value); } @@ -303,7 +303,7 @@ namespace HandyControl.Controls public Brush SelectionTextBrush { - get => (Brush)GetValue(SelectionTextBrushProperty); + get => (Brush) GetValue(SelectionTextBrushProperty); set => SetValue(SelectionTextBrushProperty, value); } @@ -314,7 +314,7 @@ namespace HandyControl.Controls public double SelectionOpacity { - get => (double)GetValue(SelectionOpacityProperty); + get => (double) GetValue(SelectionOpacityProperty); set => SetValue(SelectionOpacityProperty, value); } @@ -323,7 +323,7 @@ namespace HandyControl.Controls public Brush CaretBrush { - get => (Brush)GetValue(CaretBrushProperty); + get => (Brush) GetValue(CaretBrushProperty); set => SetValue(CaretBrushProperty, value); } @@ -425,4 +425,4 @@ namespace HandyControl.Controls } } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Controls/Input/DatePicker.cs b/src/Shared/HandyControl_Shared/Controls/Input/DatePicker.cs index 61f670ed..1abfda75 100644 --- a/src/Shared/HandyControl_Shared/Controls/Input/DatePicker.cs +++ b/src/Shared/HandyControl_Shared/Controls/Input/DatePicker.cs @@ -94,7 +94,7 @@ namespace HandyControl.Controls public Brush SelectionBrush { - get => (Brush)GetValue(SelectionBrushProperty); + get => (Brush) GetValue(SelectionBrushProperty); set => SetValue(SelectionBrushProperty, value); } @@ -105,7 +105,7 @@ namespace HandyControl.Controls public Brush SelectionTextBrush { - get => (Brush)GetValue(SelectionTextBrushProperty); + get => (Brush) GetValue(SelectionTextBrushProperty); set => SetValue(SelectionTextBrushProperty, value); } @@ -116,7 +116,7 @@ namespace HandyControl.Controls public double SelectionOpacity { - get => (double)GetValue(SelectionOpacityProperty); + get => (double) GetValue(SelectionOpacityProperty); set => SetValue(SelectionOpacityProperty, value); } @@ -125,7 +125,7 @@ namespace HandyControl.Controls public Brush CaretBrush { - get => (Brush)GetValue(CaretBrushProperty); + get => (Brush) GetValue(CaretBrushProperty); set => SetValue(CaretBrushProperty, value); } @@ -158,4 +158,4 @@ namespace HandyControl.Controls return result.Data; } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Controls/Input/DateTimePicker.cs b/src/Shared/HandyControl_Shared/Controls/Input/DateTimePicker.cs index 2b902401..027d7e88 100644 --- a/src/Shared/HandyControl_Shared/Controls/Input/DateTimePicker.cs +++ b/src/Shared/HandyControl_Shared/Controls/Input/DateTimePicker.cs @@ -115,8 +115,8 @@ namespace HandyControl.Controls private static object CoerceDisplayDateTime(DependencyObject d, object value) { - var dp = (DateTimePicker)d; - dp._calendarWithClock.DisplayDateTime = (DateTime)value; + var dp = (DateTimePicker) d; + dp._calendarWithClock.DisplayDateTime = (DateTime) value; return dp._calendarWithClock.DisplayDateTime; } @@ -136,7 +136,7 @@ namespace HandyControl.Controls { var dp = d as DateTimePicker; - var newValue = (bool)e.NewValue; + var newValue = (bool) e.NewValue; if (dp?._popup != null && dp._popup.IsOpen != newValue) { dp._popup.IsOpen = newValue; @@ -144,10 +144,10 @@ namespace HandyControl.Controls { dp._originalSelectedDateTime = dp.SelectedDateTime; - dp.Dispatcher.BeginInvoke(DispatcherPriority.Input, (Action)delegate - { - dp._calendarWithClock.Focus(); - }); + dp.Dispatcher.BeginInvoke(DispatcherPriority.Input, (Action) delegate + { + dp._calendarWithClock.Focus(); + }); } } } @@ -163,8 +163,8 @@ namespace HandyControl.Controls private static object CoerceSelectedDateTime(DependencyObject d, object value) { - var dp = (DateTimePicker)d; - dp._calendarWithClock.SelectedDateTime = (DateTime?)value; + var dp = (DateTimePicker) d; + dp._calendarWithClock.SelectedDateTime = (DateTime?) value; return dp._calendarWithClock.SelectedDateTime; } @@ -275,7 +275,7 @@ namespace HandyControl.Controls public Brush SelectionBrush { - get => (Brush)GetValue(SelectionBrushProperty); + get => (Brush) GetValue(SelectionBrushProperty); set => SetValue(SelectionBrushProperty, value); } @@ -286,7 +286,7 @@ namespace HandyControl.Controls public Brush SelectionTextBrush { - get => (Brush)GetValue(SelectionTextBrushProperty); + get => (Brush) GetValue(SelectionTextBrushProperty); set => SetValue(SelectionTextBrushProperty, value); } @@ -297,7 +297,7 @@ namespace HandyControl.Controls public double SelectionOpacity { - get => (double)GetValue(SelectionOpacityProperty); + get => (double) GetValue(SelectionOpacityProperty); set => SetValue(SelectionOpacityProperty, value); } @@ -306,7 +306,7 @@ namespace HandyControl.Controls public Brush CaretBrush { - get => (Brush)GetValue(CaretBrushProperty); + get => (Brush) GetValue(CaretBrushProperty); set => SetValue(CaretBrushProperty, value); } @@ -645,7 +645,7 @@ namespace HandyControl.Controls if (d != null) { - SafeSetText(DateTimeToString((DateTime)d)); + SafeSetText(DateTimeToString((DateTime) d)); return d; } @@ -711,7 +711,7 @@ namespace HandyControl.Controls private static void OnGotFocus(object sender, RoutedEventArgs e) { - var picker = (DateTimePicker)sender; + var picker = (DateTimePicker) sender; if (!e.Handled && picker._textBox != null) { if (Equals(e.OriginalSource, picker)) @@ -729,4 +729,4 @@ namespace HandyControl.Controls #endregion } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Controls/Input/IDataInput.cs b/src/Shared/HandyControl_Shared/Controls/Input/IDataInput.cs index 697a6b91..1f71e29c 100644 --- a/src/Shared/HandyControl_Shared/Controls/Input/IDataInput.cs +++ b/src/Shared/HandyControl_Shared/Controls/Input/IDataInput.cs @@ -40,4 +40,4 @@ namespace HandyControl.Controls /// bool ShowClearButton { get; set; } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Controls/Input/ImageSelector.cs b/src/Shared/HandyControl_Shared/Controls/Input/ImageSelector.cs index fcc605b5..f49d841f 100644 --- a/src/Shared/HandyControl_Shared/Controls/Input/ImageSelector.cs +++ b/src/Shared/HandyControl_Shared/Controls/Input/ImageSelector.cs @@ -32,7 +32,7 @@ namespace HandyControl.Controls { Stretch = Stretch }); - SetValue(HasValuePropertyKey, ValueBoxes.TrueBox); + SetValue(HasValuePropertyKey, ValueBoxes.TrueBox); SetCurrentValue(ToolTipProperty, dialog.FileName); } } @@ -123,4 +123,4 @@ namespace HandyControl.Controls set => SetValue(HasValueProperty, ValueBoxes.BooleanBox(value)); } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Controls/Input/NumericUpDown.cs b/src/Shared/HandyControl_Shared/Controls/Input/NumericUpDown.cs index cc544656..ac9310e4 100644 --- a/src/Shared/HandyControl_Shared/Controls/Input/NumericUpDown.cs +++ b/src/Shared/HandyControl_Shared/Controls/Input/NumericUpDown.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Windows; using System.Windows.Controls; using System.Windows.Controls.Primitives; @@ -187,8 +187,8 @@ namespace HandyControl.Controls private static void OnValueChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { - var ctl = (NumericUpDown)d; - var v = (double)e.NewValue; + var ctl = (NumericUpDown) d; + var v = (double) e.NewValue; ctl.SetText(); ctl.OnValueChanged(new FunctionEventArgs(ValueChangedEvent, ctl) @@ -208,9 +208,9 @@ namespace HandyControl.Controls private static object CoerceValue(DependencyObject d, object basevalue) { - var ctl = (NumericUpDown)d; + var ctl = (NumericUpDown) d; var minimum = ctl.Minimum; - var num = (double)basevalue; + var num = (double) basevalue; if (num < minimum) { ctl.Value = minimum; @@ -230,7 +230,7 @@ namespace HandyControl.Controls /// public double Value { - get => (double)GetValue(ValueProperty); + get => (double) GetValue(ValueProperty); set => SetValue(ValueProperty, value); } @@ -242,15 +242,15 @@ namespace HandyControl.Controls private static void OnMaximumChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { - var ctl = (NumericUpDown)d; + var ctl = (NumericUpDown) d; ctl.CoerceValue(MinimumProperty); ctl.CoerceValue(ValueProperty); } private static object CoerceMaximum(DependencyObject d, object basevalue) { - var minimum = ((NumericUpDown)d).Minimum; - return (double)basevalue < minimum ? minimum : basevalue; + var minimum = ((NumericUpDown) d).Minimum; + return (double) basevalue < minimum ? minimum : basevalue; } /// @@ -258,7 +258,7 @@ namespace HandyControl.Controls /// public double Maximum { - get => (double)GetValue(MaximumProperty); + get => (double) GetValue(MaximumProperty); set => SetValue(MaximumProperty, value); } @@ -270,15 +270,15 @@ namespace HandyControl.Controls private static void OnMinimumChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { - var ctl = (NumericUpDown)d; + var ctl = (NumericUpDown) d; ctl.CoerceValue(MaximumProperty); ctl.CoerceValue(ValueProperty); } private static object CoerceMinimum(DependencyObject d, object basevalue) { - var maximum = ((NumericUpDown)d).Maximum; - return (double)basevalue > maximum ? maximum : basevalue; + var maximum = ((NumericUpDown) d).Maximum; + return (double) basevalue > maximum ? maximum : basevalue; } /// @@ -286,7 +286,7 @@ namespace HandyControl.Controls /// public double Minimum { - get => (double)GetValue(MinimumProperty); + get => (double) GetValue(MinimumProperty); set => SetValue(MinimumProperty, value); } @@ -301,7 +301,7 @@ namespace HandyControl.Controls /// public double Increment { - get => (double)GetValue(IncrementProperty); + get => (double) GetValue(IncrementProperty); set => SetValue(IncrementProperty, value); } @@ -316,7 +316,7 @@ namespace HandyControl.Controls /// public int? DecimalPlaces { - get => (int?)GetValue(DecimalPlacesProperty); + get => (int?) GetValue(DecimalPlacesProperty); set => SetValue(DecimalPlacesProperty, value); } @@ -346,7 +346,7 @@ namespace HandyControl.Controls /// internal bool ShowUpDownButton { - get => (bool)GetValue(ShowUpDownButtonProperty); + get => (bool) GetValue(ShowUpDownButtonProperty); set => SetValue(ShowUpDownButtonProperty, ValueBoxes.BooleanBox(value)); } @@ -358,7 +358,7 @@ namespace HandyControl.Controls public bool IsError { - get => (bool)GetValue(IsErrorProperty); + get => (bool) GetValue(IsErrorProperty); set => SetValue(IsErrorProperty, ValueBoxes.BooleanBox(value)); } @@ -370,7 +370,7 @@ namespace HandyControl.Controls public string ErrorStr { - get => (string)GetValue(ErrorStrProperty); + get => (string) GetValue(ErrorStrProperty); set => SetValue(ErrorStrProperty, value); } @@ -385,7 +385,7 @@ namespace HandyControl.Controls public TextType TextType { - get => (TextType)GetValue(TextTypeProperty); + get => (TextType) GetValue(TextTypeProperty); set => SetValue(TextTypeProperty, value); } @@ -397,7 +397,7 @@ namespace HandyControl.Controls public bool ShowClearButton { - get => (bool)GetValue(ShowClearButtonProperty); + get => (bool) GetValue(ShowClearButtonProperty); set => SetValue(ShowClearButtonProperty, ValueBoxes.BooleanBox(value)); } @@ -412,7 +412,7 @@ namespace HandyControl.Controls /// public bool IsReadOnly { - get => (bool)GetValue(IsReadOnlyProperty); + get => (bool) GetValue(IsReadOnlyProperty); set => SetValue(IsReadOnlyProperty, ValueBoxes.BooleanBox(value)); } @@ -421,7 +421,7 @@ namespace HandyControl.Controls public Brush SelectionBrush { - get => (Brush)GetValue(SelectionBrushProperty); + get => (Brush) GetValue(SelectionBrushProperty); set => SetValue(SelectionBrushProperty, value); } @@ -432,7 +432,7 @@ namespace HandyControl.Controls public Brush SelectionTextBrush { - get => (Brush)GetValue(SelectionTextBrushProperty); + get => (Brush) GetValue(SelectionTextBrushProperty); set => SetValue(SelectionTextBrushProperty, value); } @@ -443,7 +443,7 @@ namespace HandyControl.Controls public double SelectionOpacity { - get => (double)GetValue(SelectionOpacityProperty); + get => (double) GetValue(SelectionOpacityProperty); set => SetValue(SelectionOpacityProperty, value); } @@ -452,7 +452,7 @@ namespace HandyControl.Controls public Brush CaretBrush { - get => (Brush)GetValue(CaretBrushProperty); + get => (Brush) GetValue(CaretBrushProperty); set => SetValue(CaretBrushProperty, value); } diff --git a/src/Shared/HandyControl_Shared/Controls/Input/PasswordBox.cs b/src/Shared/HandyControl_Shared/Controls/Input/PasswordBox.cs index 507053da..fead3455 100644 --- a/src/Shared/HandyControl_Shared/Controls/Input/PasswordBox.cs +++ b/src/Shared/HandyControl_Shared/Controls/Input/PasswordBox.cs @@ -35,7 +35,7 @@ namespace HandyControl.Controls public char PasswordChar { - get => (char)GetValue(PasswordCharProperty); + get => (char) GetValue(PasswordCharProperty); set => SetValue(PasswordCharProperty, value); } @@ -47,7 +47,7 @@ namespace HandyControl.Controls public bool IsError { - get => (bool)GetValue(IsErrorProperty); + get => (bool) GetValue(IsErrorProperty); set => SetValue(IsErrorProperty, ValueBoxes.BooleanBox(value)); } @@ -59,7 +59,7 @@ namespace HandyControl.Controls public string ErrorStr { - get => (string)GetValue(ErrorStrProperty); + get => (string) GetValue(ErrorStrProperty); set => SetValue(ErrorStrProperty, value); } @@ -71,7 +71,7 @@ namespace HandyControl.Controls public TextType TextType { - get => (TextType)GetValue(TextTypeProperty); + get => (TextType) GetValue(TextTypeProperty); set => SetValue(TextTypeProperty, value); } @@ -83,7 +83,7 @@ namespace HandyControl.Controls public bool ShowClearButton { - get => (bool)GetValue(ShowClearButtonProperty); + get => (bool) GetValue(ShowClearButtonProperty); set => SetValue(ShowClearButtonProperty, ValueBoxes.BooleanBox(value)); } @@ -92,7 +92,7 @@ namespace HandyControl.Controls public bool ShowEyeButton { - get => (bool)GetValue(ShowEyeButtonProperty); + get => (bool) GetValue(ShowEyeButtonProperty); set => SetValue(ShowEyeButtonProperty, ValueBoxes.BooleanBox(value)); } @@ -102,7 +102,7 @@ namespace HandyControl.Controls public bool ShowPassword { - get => (bool)GetValue(ShowPasswordProperty); + get => (bool) GetValue(ShowPasswordProperty); set => SetValue(ShowPasswordProperty, ValueBoxes.BooleanBox(value)); } @@ -111,8 +111,8 @@ namespace HandyControl.Controls private static void OnIsSafeEnabledChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { - var p = (PasswordBox)d; - p.SetCurrentValue(UnsafePasswordProperty, !(bool)e.NewValue ? p.Password : string.Empty); + var p = (PasswordBox) d; + p.SetCurrentValue(UnsafePasswordProperty, !(bool) e.NewValue ? p.Password : string.Empty); } public bool IsSafeEnabled @@ -122,7 +122,7 @@ namespace HandyControl.Controls } public static readonly DependencyProperty UnsafePasswordProperty = DependencyProperty.Register( - "UnsafePassword", typeof(string), typeof(PasswordBox), new FrameworkPropertyMetadata(default(string), + "UnsafePassword", typeof(string), typeof(PasswordBox), new FrameworkPropertyMetadata(default(string), FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnUnsafePasswordChanged)); private static void OnUnsafePasswordChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) @@ -145,7 +145,7 @@ namespace HandyControl.Controls public int MaxLength { - get => (int)GetValue(MaxLengthProperty); + get => (int) GetValue(MaxLengthProperty); set => SetValue(MaxLengthProperty, value); } @@ -154,7 +154,7 @@ namespace HandyControl.Controls public Brush SelectionBrush { - get => (Brush)GetValue(SelectionBrushProperty); + get => (Brush) GetValue(SelectionBrushProperty); set => SetValue(SelectionBrushProperty, value); } @@ -165,7 +165,7 @@ namespace HandyControl.Controls public Brush SelectionTextBrush { - get => (Brush)GetValue(SelectionTextBrushProperty); + get => (Brush) GetValue(SelectionTextBrushProperty); set => SetValue(SelectionTextBrushProperty, value); } @@ -176,7 +176,7 @@ namespace HandyControl.Controls public double SelectionOpacity { - get => (double)GetValue(SelectionOpacityProperty); + get => (double) GetValue(SelectionOpacityProperty); set => SetValue(SelectionOpacityProperty, value); } @@ -185,7 +185,7 @@ namespace HandyControl.Controls public Brush CaretBrush { - get => (Brush)GetValue(CaretBrushProperty); + get => (Brush) GetValue(CaretBrushProperty); set => SetValue(CaretBrushProperty, value); } @@ -265,9 +265,9 @@ namespace HandyControl.Controls private static void OnShowPasswordChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { - var ctl = (PasswordBox)d; + var ctl = (PasswordBox) d; if (!ctl.ShowEyeButton) return; - if ((bool)e.NewValue) + if ((bool) e.NewValue) { ctl._textBox.Text = ctl.ActualPasswordBox.Password; ctl._textBox.Select(string.IsNullOrEmpty(ctl._textBox.Text) ? 0 : ctl._textBox.Text.Length, 0); @@ -370,4 +370,4 @@ namespace HandyControl.Controls } } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Controls/Input/PinBox.cs b/src/Shared/HandyControl_Shared/Controls/Input/PinBox.cs index 028d822a..2a7006b0 100644 --- a/src/Shared/HandyControl_Shared/Controls/Input/PinBox.cs +++ b/src/Shared/HandyControl_Shared/Controls/Input/PinBox.cs @@ -46,7 +46,7 @@ namespace HandyControl.Controls { RemoveHandler(System.Windows.Controls.PasswordBox.PasswordChangedEvent, _passwordBoxsPasswordChangedEventHandler); RemoveHandler(GotFocusEvent, _passwordBoxsGotFocusEventHandler); - + Loaded -= PinBox_Loaded; Unloaded -= PinBox_Unloaded; } @@ -55,7 +55,7 @@ namespace HandyControl.Controls { _passwordBoxsPasswordChangedEventHandler = PasswordBoxsPasswordChanged; AddHandler(System.Windows.Controls.PasswordBox.PasswordChangedEvent, _passwordBoxsPasswordChangedEventHandler); - + _passwordBoxsGotFocusEventHandler = PasswordBoxsGotFocus; AddHandler(GotFocusEvent, _passwordBoxsGotFocusEventHandler); } @@ -211,7 +211,7 @@ namespace HandyControl.Controls public char PasswordChar { - get => (char)GetValue(PasswordCharProperty); + get => (char) GetValue(PasswordCharProperty); set => SetValue(PasswordCharProperty, value); } @@ -224,7 +224,7 @@ namespace HandyControl.Controls ctl.UpdateItems(); } - private static object CoerceLength(DependencyObject d, object basevalue) => (int)basevalue < 4 ? MinLength : basevalue; + private static object CoerceLength(DependencyObject d, object basevalue) => (int) basevalue < 4 ? MinLength : basevalue; public int Length { @@ -264,7 +264,7 @@ namespace HandyControl.Controls public Brush SelectionBrush { - get => (Brush)GetValue(SelectionBrushProperty); + get => (Brush) GetValue(SelectionBrushProperty); set => SetValue(SelectionBrushProperty, value); } @@ -275,7 +275,7 @@ namespace HandyControl.Controls public Brush SelectionTextBrush { - get => (Brush)GetValue(SelectionTextBrushProperty); + get => (Brush) GetValue(SelectionTextBrushProperty); set => SetValue(SelectionTextBrushProperty, value); } @@ -286,7 +286,7 @@ namespace HandyControl.Controls public double SelectionOpacity { - get => (double)GetValue(SelectionOpacityProperty); + get => (double) GetValue(SelectionOpacityProperty); set => SetValue(SelectionOpacityProperty, value); } @@ -295,7 +295,7 @@ namespace HandyControl.Controls public Brush CaretBrush { - get => (Brush)GetValue(CaretBrushProperty); + get => (Brush) GetValue(CaretBrushProperty); set => SetValue(CaretBrushProperty, value); } diff --git a/src/Shared/HandyControl_Shared/Controls/Input/SearchBar.cs b/src/Shared/HandyControl_Shared/Controls/Input/SearchBar.cs index b2713f18..16d7a68a 100644 --- a/src/Shared/HandyControl_Shared/Controls/Input/SearchBar.cs +++ b/src/Shared/HandyControl_Shared/Controls/Input/SearchBar.cs @@ -76,7 +76,7 @@ namespace HandyControl.Controls /// public bool IsRealTime { - get => (bool)GetValue(IsRealTimeProperty); + get => (bool) GetValue(IsRealTimeProperty); set => SetValue(IsRealTimeProperty, ValueBoxes.BooleanBox(value)); } @@ -85,7 +85,7 @@ namespace HandyControl.Controls private static void OnCommandChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { - var ctl = (SearchBar)d; + var ctl = (SearchBar) d; if (e.OldValue is ICommand oldCommand) { oldCommand.CanExecuteChanged -= ctl.CanExecuteChanged; diff --git a/src/Shared/HandyControl_Shared/Controls/Input/TextBox.cs b/src/Shared/HandyControl_Shared/Controls/Input/TextBox.cs index 59e2940c..2ec53460 100644 --- a/src/Shared/HandyControl_Shared/Controls/Input/TextBox.cs +++ b/src/Shared/HandyControl_Shared/Controls/Input/TextBox.cs @@ -46,7 +46,7 @@ namespace HandyControl.Controls public string ErrorStr { - get => (string)GetValue(ErrorStrProperty); + get => (string) GetValue(ErrorStrProperty); set => SetValue(ErrorStrProperty, value); } @@ -58,7 +58,7 @@ namespace HandyControl.Controls public TextType TextType { - get => (TextType)GetValue(TextTypeProperty); + get => (TextType) GetValue(TextTypeProperty); set => SetValue(TextTypeProperty, value); } @@ -117,4 +117,4 @@ namespace HandyControl.Controls return result.Data; } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Controls/Input/TimePicker.cs b/src/Shared/HandyControl_Shared/Controls/Input/TimePicker.cs index b3019325..ee44d0e4 100644 --- a/src/Shared/HandyControl_Shared/Controls/Input/TimePicker.cs +++ b/src/Shared/HandyControl_Shared/Controls/Input/TimePicker.cs @@ -97,7 +97,7 @@ namespace HandyControl.Controls public string TimeFormat { - get => (string)GetValue(TimeFormatProperty); + get => (string) GetValue(TimeFormatProperty); set => SetValue(TimeFormatProperty, value); } @@ -107,7 +107,7 @@ namespace HandyControl.Controls public DateTime DisplayTime { - get => (DateTime)GetValue(DisplayTimeProperty); + get => (DateTime) GetValue(DisplayTimeProperty); set => SetValue(DisplayTimeProperty, value); } @@ -120,8 +120,8 @@ namespace HandyControl.Controls private static object CoerceDisplayTime(DependencyObject d, object value) { - var dp = (TimePicker)d; - dp.Clock.DisplayTime = (DateTime)value; + var dp = (TimePicker) d; + dp.Clock.DisplayTime = (DateTime) value; return dp.Clock.DisplayTime; } @@ -131,7 +131,7 @@ namespace HandyControl.Controls public bool IsDropDownOpen { - get => (bool)GetValue(IsDropDownOpenProperty); + get => (bool) GetValue(IsDropDownOpenProperty); set => SetValue(IsDropDownOpenProperty, ValueBoxes.BooleanBox(value)); } @@ -148,7 +148,7 @@ namespace HandyControl.Controls { var dp = d as TimePicker; - var newValue = (bool)e.NewValue; + var newValue = (bool) e.NewValue; if (dp?._popup != null && dp._popup.IsOpen != newValue) { dp._popup.IsOpen = newValue; @@ -156,10 +156,10 @@ namespace HandyControl.Controls { dp._originalSelectedTime = dp.SelectedTime; - dp.Dispatcher.BeginInvoke(DispatcherPriority.Input, (Action)delegate - { - dp.Clock.Focus(); - }); + dp.Dispatcher.BeginInvoke(DispatcherPriority.Input, (Action) delegate + { + dp.Clock.Focus(); + }); } } } @@ -170,7 +170,7 @@ namespace HandyControl.Controls public DateTime? SelectedTime { - get => (DateTime?)GetValue(SelectedTimeProperty); + get => (DateTime?) GetValue(SelectedTimeProperty); set => SetValue(SelectedTimeProperty, value); } @@ -199,8 +199,8 @@ namespace HandyControl.Controls private static object CoerceSelectedTime(DependencyObject d, object value) { - var dp = (TimePicker)d; - dp.Clock.SelectedTime = (DateTime?)value; + var dp = (TimePicker) d; + dp.Clock.SelectedTime = (DateTime?) value; return dp.Clock.SelectedTime; } @@ -210,7 +210,7 @@ namespace HandyControl.Controls public string Text { - get => (string)GetValue(TextProperty); + get => (string) GetValue(TextProperty); set => SetValue(TextProperty, value); } @@ -263,7 +263,7 @@ namespace HandyControl.Controls public bool IsError { - get => (bool)GetValue(IsErrorProperty); + get => (bool) GetValue(IsErrorProperty); set => SetValue(IsErrorProperty, ValueBoxes.BooleanBox(value)); } @@ -272,7 +272,7 @@ namespace HandyControl.Controls public string ErrorStr { - get => (string)GetValue(ErrorStrProperty); + get => (string) GetValue(ErrorStrProperty); set => SetValue(ErrorStrProperty, value); } @@ -281,7 +281,7 @@ namespace HandyControl.Controls public TextType TextType { - get => (TextType)GetValue(TextTypeProperty); + get => (TextType) GetValue(TextTypeProperty); set => SetValue(TextTypeProperty, value); } @@ -290,7 +290,7 @@ namespace HandyControl.Controls public bool ShowClearButton { - get => (bool)GetValue(ShowClearButtonProperty); + get => (bool) GetValue(ShowClearButtonProperty); set => SetValue(ShowClearButtonProperty, ValueBoxes.BooleanBox(value)); } @@ -299,7 +299,7 @@ namespace HandyControl.Controls public Brush SelectionBrush { - get => (Brush)GetValue(SelectionBrushProperty); + get => (Brush) GetValue(SelectionBrushProperty); set => SetValue(SelectionBrushProperty, value); } @@ -310,7 +310,7 @@ namespace HandyControl.Controls public Brush SelectionTextBrush { - get => (Brush)GetValue(SelectionTextBrushProperty); + get => (Brush) GetValue(SelectionTextBrushProperty); set => SetValue(SelectionTextBrushProperty, value); } @@ -321,7 +321,7 @@ namespace HandyControl.Controls public double SelectionOpacity { - get => (double)GetValue(SelectionOpacityProperty); + get => (double) GetValue(SelectionOpacityProperty); set => SetValue(SelectionOpacityProperty, value); } @@ -330,7 +330,7 @@ namespace HandyControl.Controls public Brush CaretBrush { - get => (Brush)GetValue(CaretBrushProperty); + get => (Brush) GetValue(CaretBrushProperty); set => SetValue(CaretBrushProperty, value); } @@ -339,7 +339,7 @@ namespace HandyControl.Controls private static void OnClockChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { - var ctl = (TimePicker)d; + var ctl = (TimePicker) d; var oldClock = e.OldValue as ClockBase; var newClock = e.NewValue as ClockBase; @@ -359,7 +359,7 @@ namespace HandyControl.Controls public ClockBase Clock { - get => (ClockBase)GetValue(ClockProperty); + get => (ClockBase) GetValue(ClockProperty); set => SetValue(ClockProperty, value); } @@ -469,7 +469,7 @@ namespace HandyControl.Controls } else { - _textBox.Text = DateTimeToString((DateTime)SelectedTime); + _textBox.Text = DateTimeToString((DateTime) SelectedTime); } } @@ -685,13 +685,13 @@ namespace HandyControl.Controls if (d != null) { - SafeSetText(DateTimeToString((DateTime)d)); + SafeSetText(DateTimeToString((DateTime) d)); return d; } if (SelectedTime != null) { - var newtext = DateTimeToString((DateTime)SelectedTime); + var newtext = DateTimeToString((DateTime) SelectedTime); SafeSetText(newtext); return SelectedTime; } @@ -746,7 +746,7 @@ namespace HandyControl.Controls private static void OnGotFocus(object sender, RoutedEventArgs e) { - var picker = (TimePicker)sender; + var picker = (TimePicker) sender; if (!e.Handled && picker._textBox != null) { if (Equals(e.OriginalSource, picker)) @@ -764,4 +764,4 @@ namespace HandyControl.Controls #endregion Private Methods } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Controls/Input/WatermarkTextBox.cs b/src/Shared/HandyControl_Shared/Controls/Input/WatermarkTextBox.cs index a3f1885d..814238f7 100644 --- a/src/Shared/HandyControl_Shared/Controls/Input/WatermarkTextBox.cs +++ b/src/Shared/HandyControl_Shared/Controls/Input/WatermarkTextBox.cs @@ -33,4 +33,4 @@ namespace HandyControl.Controls } } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Controls/Internal/InternalCanvas.cs b/src/Shared/HandyControl_Shared/Controls/Internal/InternalCanvas.cs index b406724c..a7200d2a 100644 --- a/src/Shared/HandyControl_Shared/Controls/Internal/InternalCanvas.cs +++ b/src/Shared/HandyControl_Shared/Controls/Internal/InternalCanvas.cs @@ -61,4 +61,4 @@ namespace HandyControl.Controls return arrangeSize; } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Controls/Loading/LoadingBase.cs b/src/Shared/HandyControl_Shared/Controls/Loading/LoadingBase.cs index 620a676f..c9ab7611 100644 --- a/src/Shared/HandyControl_Shared/Controls/Loading/LoadingBase.cs +++ b/src/Shared/HandyControl_Shared/Controls/Loading/LoadingBase.cs @@ -125,12 +125,12 @@ namespace HandyControl.Controls protected virtual Ellipse CreateEllipse(int index) { var ellipse = new Ellipse(); - ellipse.SetBinding(WidthProperty, new Binding(DotDiameterProperty.Name) {Source = this}); - ellipse.SetBinding(HeightProperty, new Binding(DotDiameterProperty.Name) {Source = this}); - ellipse.SetBinding(Shape.FillProperty, new Binding(ForegroundProperty.Name) {Source = this}); - ellipse.SetBinding(Shape.StrokeThicknessProperty, new Binding(DotBorderThicknessProperty.Name) {Source = this}); - ellipse.SetBinding(Shape.StrokeProperty, new Binding(DotBorderBrushProperty.Name) {Source = this}); + ellipse.SetBinding(WidthProperty, new Binding(DotDiameterProperty.Name) { Source = this }); + ellipse.SetBinding(HeightProperty, new Binding(DotDiameterProperty.Name) { Source = this }); + ellipse.SetBinding(Shape.FillProperty, new Binding(ForegroundProperty.Name) { Source = this }); + ellipse.SetBinding(Shape.StrokeThicknessProperty, new Binding(DotBorderThicknessProperty.Name) { Source = this }); + ellipse.SetBinding(Shape.StrokeProperty, new Binding(DotBorderBrushProperty.Name) { Source = this }); return ellipse; } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Controls/Loading/LoadingCircle.cs b/src/Shared/HandyControl_Shared/Controls/Loading/LoadingCircle.cs index ab88a388..e6dacdac 100644 --- a/src/Shared/HandyControl_Shared/Controls/Loading/LoadingCircle.cs +++ b/src/Shared/HandyControl_Shared/Controls/Loading/LoadingCircle.cs @@ -206,4 +206,4 @@ namespace HandyControl.Controls return border; } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Controls/Loading/LoadingLine.cs b/src/Shared/HandyControl_Shared/Controls/Loading/LoadingLine.cs index 167d0f83..49bca631 100644 --- a/src/Shared/HandyControl_Shared/Controls/Loading/LoadingLine.cs +++ b/src/Shared/HandyControl_Shared/Controls/Loading/LoadingLine.cs @@ -12,11 +12,11 @@ namespace HandyControl.Controls private const double MoveLength = 80; private const double UniformScale = .6; - + public LoadingLine() { SetBinding(HeightProperty, new Binding("DotDiameter") { Source = this }); - } + } protected sealed override void UpdateDots() { @@ -64,7 +64,7 @@ namespace HandyControl.Controls EasingMode = EasingMode.EaseOut }, Value = new Thickness(speedDownLength + ellipse.Margin.Left, 0, 0, 0), - KeyTime = KeyTime.FromTimeSpan(TimeSpan.FromSeconds(dotSpeed * (1 - UniformScale)/2)) + KeyTime = KeyTime.FromTimeSpan(TimeSpan.FromSeconds(dotSpeed * (1 - UniformScale) / 2)) }; //匀速开始到匀速结束 @@ -109,4 +109,4 @@ namespace HandyControl.Controls return ellipse; } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Controls/Other/AnimationPath.cs b/src/Shared/HandyControl_Shared/Controls/Other/AnimationPath.cs index b8580bde..d55395d3 100644 --- a/src/Shared/HandyControl_Shared/Controls/Other/AnimationPath.cs +++ b/src/Shared/HandyControl_Shared/Controls/Other/AnimationPath.cs @@ -42,7 +42,7 @@ namespace HandyControl.Controls /// public Geometry Data { - get => (Geometry)GetValue(DataProperty); + get => (Geometry) GetValue(DataProperty); set => SetValue(DataProperty, value); } @@ -59,7 +59,7 @@ namespace HandyControl.Controls /// public double PathLength { - get => (double)GetValue(PathLengthProperty); + get => (double) GetValue(PathLengthProperty); set => SetValue(PathLengthProperty, value); } @@ -75,15 +75,15 @@ namespace HandyControl.Controls /// public Duration Duration { - get => (Duration)GetValue(DurationProperty); + get => (Duration) GetValue(DurationProperty); set => SetValue(DurationProperty, value); } public static readonly DependencyProperty IsPlayingProperty = DependencyProperty.Register( "IsPlaying", typeof(bool), typeof(AnimationPath), new FrameworkPropertyMetadata(ValueBoxes.TrueBox, (o, args) => { - var ctl = (AnimationPath)o; - var v = (bool)args.NewValue; + var ctl = (AnimationPath) o; + var v = (bool) args.NewValue; if (v) { ctl.UpdatePath(); @@ -99,7 +99,7 @@ namespace HandyControl.Controls /// public bool IsPlaying { - get => (bool)GetValue(IsPlayingProperty); + get => (bool) GetValue(IsPlayingProperty); set => SetValue(IsPlayingProperty, ValueBoxes.BooleanBox(value)); } @@ -111,7 +111,7 @@ namespace HandyControl.Controls /// public RepeatBehavior RepeatBehavior { - get => (RepeatBehavior)GetValue(RepeatBehaviorProperty); + get => (RepeatBehavior) GetValue(RepeatBehaviorProperty); set => SetValue(RepeatBehaviorProperty, value); } @@ -197,4 +197,4 @@ namespace HandyControl.Controls private void Storyboard_Completed(object sender, EventArgs e) => RaiseEvent(new RoutedEventArgs(CompletedEvent)); } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Controls/Other/Badge.cs b/src/Shared/HandyControl_Shared/Controls/Other/Badge.cs index 15ffe2f2..12eeb596 100644 --- a/src/Shared/HandyControl_Shared/Controls/Other/Badge.cs +++ b/src/Shared/HandyControl_Shared/Controls/Other/Badge.cs @@ -35,8 +35,8 @@ namespace HandyControl.Controls private static void OnValueChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { - var ctl = (Badge)d; - var v = (int)e.NewValue; + var ctl = (Badge) d; + var v = (int) e.NewValue; ctl.Text = v <= ctl.Maximum ? v.ToString() : $"{ctl.Maximum}+"; if (ctl.IsInitialized) { @@ -49,7 +49,7 @@ namespace HandyControl.Controls public int Value { - get => (int)GetValue(ValueProperty); + get => (int) GetValue(ValueProperty); set => SetValue(ValueProperty, value); } @@ -58,7 +58,7 @@ namespace HandyControl.Controls public BadgeStatus Status { - get => (BadgeStatus)GetValue(StatusProperty); + get => (BadgeStatus) GetValue(StatusProperty); set => SetValue(StatusProperty, value); } @@ -67,7 +67,7 @@ namespace HandyControl.Controls public int Maximum { - get => (int)GetValue(MaximumProperty); + get => (int) GetValue(MaximumProperty); set => SetValue(MaximumProperty, value); } @@ -76,7 +76,7 @@ namespace HandyControl.Controls public Thickness BadgeMargin { - get => (Thickness)GetValue(BadgeMarginProperty); + get => (Thickness) GetValue(BadgeMarginProperty); set => SetValue(BadgeMarginProperty, value); } @@ -91,4 +91,4 @@ namespace HandyControl.Controls protected override Geometry GetLayoutClip(Size layoutSlotSize) => null; } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Controls/Other/BlendEffectBox.cs b/src/Shared/HandyControl_Shared/Controls/Other/BlendEffectBox.cs index 4c9a45e1..abb17f7c 100644 --- a/src/Shared/HandyControl_Shared/Controls/Other/BlendEffectBox.cs +++ b/src/Shared/HandyControl_Shared/Controls/Other/BlendEffectBox.cs @@ -100,7 +100,7 @@ namespace HandyControl.Controls public FrameworkElement Content { - get => (FrameworkElement)GetValue(ContentProperty); + get => (FrameworkElement) GetValue(ContentProperty); set => SetValue(ContentProperty, value); } @@ -113,4 +113,4 @@ namespace HandyControl.Controls set => SetValue(ActualContentProperty, value); } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Controls/Other/ChatBubble.cs b/src/Shared/HandyControl_Shared/Controls/Other/ChatBubble.cs index d70635b0..dbb903eb 100644 --- a/src/Shared/HandyControl_Shared/Controls/Other/ChatBubble.cs +++ b/src/Shared/HandyControl_Shared/Controls/Other/ChatBubble.cs @@ -43,4 +43,4 @@ namespace HandyControl.Controls ReadAction?.Invoke(Content); } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Controls/Other/DashedBorder.cs b/src/Shared/HandyControl_Shared/Controls/Other/DashedBorder.cs index 58bf7532..66bc34cd 100644 --- a/src/Shared/HandyControl_Shared/Controls/Other/DashedBorder.cs +++ b/src/Shared/HandyControl_Shared/Controls/Other/DashedBorder.cs @@ -29,7 +29,7 @@ namespace HandyControl.Controls private static void OnClearPenCache(DependencyObject d, DependencyPropertyChangedEventArgs e) { - var border = (DashedBorder)d; + var border = (DashedBorder) d; border.LeftPenCache = null; border.RightPenCache = null; border.TopPenCache = null; @@ -302,9 +302,9 @@ namespace HandyControl.Controls var dpiScaleY = DpiHelper.DeviceDpiY; borderThickness = new Thickness( - DpiHelper.RoundLayoutValue(borderThickness.Left, dpiScaleX), + DpiHelper.RoundLayoutValue(borderThickness.Left, dpiScaleX), DpiHelper.RoundLayoutValue(borderThickness.Top, dpiScaleY), - DpiHelper.RoundLayoutValue(borderThickness.Right, dpiScaleX), + DpiHelper.RoundLayoutValue(borderThickness.Right, dpiScaleX), DpiHelper.RoundLayoutValue(borderThickness.Bottom, dpiScaleY)); } @@ -667,4 +667,4 @@ namespace HandyControl.Controls internal readonly double LeftBottom; } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Controls/Other/Divider.cs b/src/Shared/HandyControl_Shared/Controls/Other/Divider.cs index 5d15f7d1..ae8725f9 100644 --- a/src/Shared/HandyControl_Shared/Controls/Other/Divider.cs +++ b/src/Shared/HandyControl_Shared/Controls/Other/Divider.cs @@ -79,4 +79,4 @@ namespace HandyControl.Controls set => SetValue(LineStrokeDashArrayProperty, value); } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Controls/Other/Drawer.cs b/src/Shared/HandyControl_Shared/Controls/Other/Drawer.cs index a4b6a072..9f45732d 100644 --- a/src/Shared/HandyControl_Shared/Controls/Other/Drawer.cs +++ b/src/Shared/HandyControl_Shared/Controls/Other/Drawer.cs @@ -60,7 +60,7 @@ namespace HandyControl.Controls private void Drawer_Unloaded(object sender, RoutedEventArgs e) { Loaded -= Drawer_Loaded; - + if (_maskElement != null) { _maskElement.PreviewMouseLeftButtonDown -= MaskElement_PreviewMouseLeftButtonDown; @@ -73,7 +73,7 @@ namespace HandyControl.Controls } private static void DataContextPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) => - ((Drawer)d).OnDataContextPropertyChanged(e); + ((Drawer) d).OnDataContextPropertyChanged(e); private void OnDataContextPropertyChanged(DependencyPropertyChangedEventArgs e) => UpdateDataContext(_animationControl, e.OldValue, e.NewValue); @@ -103,7 +103,7 @@ namespace HandyControl.Controls private static void OnIsOpenChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { var ctl = (Drawer) d; - ctl.OnIsOpenChanged((bool)e.NewValue); + ctl.OnIsOpenChanged((bool) e.NewValue); } public bool IsOpen diff --git a/src/Shared/HandyControl_Shared/Controls/Other/GotoTop.cs b/src/Shared/HandyControl_Shared/Controls/Other/GotoTop.cs index bc70ea28..7ab0c0c3 100644 --- a/src/Shared/HandyControl_Shared/Controls/Other/GotoTop.cs +++ b/src/Shared/HandyControl_Shared/Controls/Other/GotoTop.cs @@ -18,7 +18,7 @@ namespace HandyControl.Controls public DependencyObject Target { - get => (DependencyObject)GetValue(TargetProperty); + get => (DependencyObject) GetValue(TargetProperty); set => SetValue(TargetProperty, value); } @@ -97,4 +97,4 @@ namespace HandyControl.Controls _gotoTopAction?.Invoke(); } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Controls/Other/Gravatar.cs b/src/Shared/HandyControl_Shared/Controls/Other/Gravatar.cs index e0ce3497..89d2dbe8 100644 --- a/src/Shared/HandyControl_Shared/Controls/Other/Gravatar.cs +++ b/src/Shared/HandyControl_Shared/Controls/Other/Gravatar.cs @@ -23,7 +23,7 @@ namespace HandyControl.Controls { var ctl = (Gravatar) d; if (ctl.Source != null) return; - ctl.Content = ctl.Generator.GetGravatar((string)e.NewValue); + ctl.Content = ctl.Generator.GetGravatar((string) e.NewValue); } public string Id @@ -37,7 +37,7 @@ namespace HandyControl.Controls private static void OnSourceChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { - var ctl = (Gravatar)d; + var ctl = (Gravatar) d; var v = (ImageSource) e.NewValue; ctl.Background = v != null @@ -54,4 +54,4 @@ namespace HandyControl.Controls set => SetValue(SourceProperty, value); } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Controls/Other/Magnifier.cs b/src/Shared/HandyControl_Shared/Controls/Other/Magnifier.cs index 56271dff..9d83f7f5 100644 --- a/src/Shared/HandyControl_Shared/Controls/Other/Magnifier.cs +++ b/src/Shared/HandyControl_Shared/Controls/Other/Magnifier.cs @@ -45,11 +45,11 @@ namespace HandyControl.Controls public static readonly DependencyProperty ScaleProperty = DependencyProperty.Register( "Scale", typeof(double), typeof(Magnifier), new PropertyMetadata(5.0, OnScaleChanged), ValidateHelper.IsInRangeOfPosDouble); - private static void OnScaleChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) => ((Magnifier)d).UpdateViewboxSize(); + private static void OnScaleChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) => ((Magnifier) d).UpdateViewboxSize(); public double Scale { - get => (double)GetValue(ScaleProperty); + get => (double) GetValue(ScaleProperty); set => SetValue(ScaleProperty, value); } @@ -76,7 +76,7 @@ namespace HandyControl.Controls private void UpdateViewboxSize() => _viewboxSize = new Size(ActualWidth / Scale, ActualHeight / Scale); - protected sealed override void OnTargetChanged(FrameworkElement element , bool isNew) + protected sealed override void OnTargetChanged(FrameworkElement element, bool isNew) { base.OnTargetChanged(element, isNew); @@ -129,7 +129,7 @@ namespace HandyControl.Controls { layer.Remove(_adornerContainer); } - else if(_adornerContainer != null && _adornerContainer.Parent is AdornerLayer parent) + else if (_adornerContainer != null && _adornerContainer.Parent is AdornerLayer parent) { parent.Remove(_adornerContainer); } diff --git a/src/Shared/HandyControl_Shared/Controls/Other/Notification.cs b/src/Shared/HandyControl_Shared/Controls/Other/Notification.cs index 9b911b21..d7f411e2 100644 --- a/src/Shared/HandyControl_Shared/Controls/Other/Notification.cs +++ b/src/Shared/HandyControl_Shared/Controls/Other/Notification.cs @@ -151,4 +151,4 @@ namespace HandyControl.Controls _timerClose.Start(); } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Controls/Other/NotifyIcon.cs b/src/Shared/HandyControl_Shared/Controls/Other/NotifyIcon.cs index 8b55c343..0b472959 100644 --- a/src/Shared/HandyControl_Shared/Controls/Other/NotifyIcon.cs +++ b/src/Shared/HandyControl_Shared/Controls/Other/NotifyIcon.cs @@ -69,8 +69,8 @@ namespace HandyControl.Controls private static void OnVisibilityChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { - var ctl = (NotifyIcon)d; - var v = (Visibility)e.NewValue; + var ctl = (NotifyIcon) d; + var v = (Visibility) e.NewValue; if (v == Visibility.Visible) { @@ -97,7 +97,7 @@ namespace HandyControl.Controls private static void ContextMenuPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { - var ctl = (NotifyIcon)d; + var ctl = (NotifyIcon) d; ctl.OnContextMenuPropertyChanged(e); } @@ -249,7 +249,7 @@ namespace HandyControl.Controls public string Token { - get => (string)GetValue(TokenProperty); + get => (string) GetValue(TokenProperty); set => SetValue(TokenProperty, value); } @@ -258,7 +258,7 @@ namespace HandyControl.Controls public string Text { - get => (string)GetValue(TextProperty); + get => (string) GetValue(TextProperty); set => SetValue(TextProperty, value); } @@ -267,8 +267,8 @@ namespace HandyControl.Controls private static void OnIconChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { - var ctl = (NotifyIcon)d; - ctl._icon = (ImageSource)e.NewValue; + var ctl = (NotifyIcon) d; + ctl._icon = (ImageSource) e.NewValue; ctl.OnIconChanged(); if (!string.IsNullOrEmpty(ctl._windowClassName) && !ctl.IsBlink && ctl.Visibility == Visibility.Visible) @@ -279,7 +279,7 @@ namespace HandyControl.Controls public ImageSource Icon { - get => (ImageSource)GetValue(IconProperty); + get => (ImageSource) GetValue(IconProperty); set => SetValue(IconProperty, value); } @@ -297,16 +297,16 @@ namespace HandyControl.Controls private static void OnBlinkIntervalChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { - var ctl = (NotifyIcon)d; + var ctl = (NotifyIcon) d; if (ctl._dispatcherTimerBlink != null) { - ctl._dispatcherTimerBlink.Interval = (TimeSpan)e.NewValue; + ctl._dispatcherTimerBlink.Interval = (TimeSpan) e.NewValue; } } public TimeSpan BlinkInterval { - get => (TimeSpan)GetValue(BlinkIntervalProperty); + get => (TimeSpan) GetValue(BlinkIntervalProperty); set => SetValue(BlinkIntervalProperty, value); } @@ -315,9 +315,9 @@ namespace HandyControl.Controls private static void OnIsBlinkChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { - var ctl = (NotifyIcon)d; + var ctl = (NotifyIcon) d; if (ctl.Visibility != Visibility.Visible) return; - if ((bool)e.NewValue) + if ((bool) e.NewValue) { if (ctl._dispatcherTimerBlink == null) { @@ -339,7 +339,7 @@ namespace HandyControl.Controls public bool IsBlink { - get => (bool)GetValue(IsBlinkProperty); + get => (bool) GetValue(IsBlinkProperty); set => SetValue(IsBlinkProperty, ValueBoxes.BooleanBox(value)); } @@ -355,10 +355,10 @@ namespace HandyControl.Controls if (!isTrue) return false; InteropMethods.GetCursorPos(out var point); - return rectNotifyList.Any(rectNotify => - point.X >= rectNotify.Left && - point.X <= rectNotify.Right && - point.Y >= rectNotify.Top && + return rectNotifyList.Any(rectNotify => + point.X >= rectNotify.Left && + point.X <= rectNotify.Right && + point.Y >= rectNotify.Top && point.Y <= rectNotify.Bottom); } @@ -436,7 +436,7 @@ namespace HandyControl.Controls private bool FindNotifyIcon(IntPtr hTrayWnd, ref List rectNotifyList) { InteropMethods.GetWindowRect(hTrayWnd, out var rectTray); - var count = (int)InteropMethods.SendMessage(hTrayWnd, InteropValues.TB_BUTTONCOUNT, 0, IntPtr.Zero); + var count = (int) InteropMethods.SendMessage(hTrayWnd, InteropValues.TB_BUTTONCOUNT, 0, IntPtr.Zero); var isFind = false; if (count > 0) @@ -454,20 +454,20 @@ namespace HandyControl.Controls InteropMethods.SendMessage(hTrayWnd, InteropValues.TB_GETBUTTON, i, address); var isTrue = InteropMethods.ReadProcessMemory(hProcess, address, out btnData, Marshal.SizeOf(btnData), out _); if (!isTrue) continue; - + if (btnData.dwData == IntPtr.Zero) { btnData.dwData = btnData.iString; } - + InteropMethods.ReadProcessMemory(hProcess, btnData.dwData, out trayData, Marshal.SizeOf(trayData), out _); InteropMethods.GetWindowThreadProcessId(trayData.hwnd, out var dwProcessId); - if (dwProcessId == (uint)handle) + if (dwProcessId == (uint) handle) { var rect = new InteropValues.RECT(); var lngRect = InteropMethods.VirtualAllocEx(hProcess, IntPtr.Zero, Marshal.SizeOf(typeof(Rect)), InteropValues.AllocationType.Commit, InteropValues.MemoryProtection.ReadWrite); - + InteropMethods.SendMessage(hTrayWnd, InteropValues.TB_GETITEMRECT, i, lngRect); InteropMethods.ReadProcessMemory(hProcess, lngRect, out rect, Marshal.SizeOf(rect), out _); diff --git a/src/Shared/HandyControl_Shared/Controls/Other/Pagination.cs b/src/Shared/HandyControl_Shared/Controls/Other/Pagination.cs index e02f0133..0c295d3f 100644 --- a/src/Shared/HandyControl_Shared/Controls/Other/Pagination.cs +++ b/src/Shared/HandyControl_Shared/Controls/Other/Pagination.cs @@ -102,7 +102,7 @@ namespace HandyControl.Controls }, (o, value) => { if (!(o is Pagination)) return 1; - var intValue = (int)value; + var intValue = (int) value; if (intValue < 1) { return 1; @@ -115,7 +115,7 @@ namespace HandyControl.Controls /// public int MaxPageCount { - get => (int)GetValue(MaxPageCountProperty); + get => (int) GetValue(MaxPageCountProperty); set => SetValue(MaxPageCountProperty, value); } @@ -136,7 +136,7 @@ namespace HandyControl.Controls }, (o, value) => { if (!(o is Pagination)) return 1; - var intValue = (int)value; + var intValue = (int) value; if (intValue < 1) { return 1; @@ -149,7 +149,7 @@ namespace HandyControl.Controls /// public int DataCountPerPage { - get => (int)GetValue(DataCountPerPageProperty); + get => (int) GetValue(DataCountPerPageProperty); set => SetValue(DataCountPerPageProperty, value); } @@ -174,7 +174,7 @@ namespace HandyControl.Controls }, (o, value) => { if (!(o is Pagination pagination)) return 1; - var intValue = (int)value; + var intValue = (int) value; if (intValue < 0) { return 0; @@ -188,7 +188,7 @@ namespace HandyControl.Controls /// public int PageIndex { - get => (int)GetValue(PageIndexProperty); + get => (int) GetValue(PageIndexProperty); set => SetValue(PageIndexProperty, value); } @@ -208,7 +208,7 @@ namespace HandyControl.Controls } }), value => { - var intValue = (int)value; + var intValue = (int) value; return intValue >= 0; }); @@ -217,7 +217,7 @@ namespace HandyControl.Controls /// public int MaxPageInterval { - get => (int)GetValue(MaxPageIntervalProperty); + get => (int) GetValue(MaxPageIntervalProperty); set => SetValue(MaxPageIntervalProperty, value); } diff --git a/src/Shared/HandyControl_Shared/Controls/Other/Poptip.cs b/src/Shared/HandyControl_Shared/Controls/Other/Poptip.cs index 86152cc0..6ebd4a74 100644 --- a/src/Shared/HandyControl_Shared/Controls/Other/Poptip.cs +++ b/src/Shared/HandyControl_Shared/Controls/Other/Poptip.cs @@ -21,7 +21,7 @@ namespace HandyControl.Controls Child = this }; - _popup.SetBinding(DataContextProperty, new Binding(DataContextProperty.Name) {Source = this}); + _popup.SetBinding(DataContextProperty, new Binding(DataContextProperty.Name) { Source = this }); } public static readonly DependencyProperty HitModeProperty = DependencyProperty.RegisterAttached( @@ -35,7 +35,7 @@ namespace HandyControl.Controls public HitMode HitMode { - get => (HitMode)GetValue(HitModeProperty); + get => (HitMode) GetValue(HitModeProperty); set => SetValue(HitModeProperty, value); } @@ -69,7 +69,7 @@ namespace HandyControl.Controls public DataTemplate ContentTemplate { - get => (DataTemplate)GetValue(ContentTemplateProperty); + get => (DataTemplate) GetValue(ContentTemplateProperty); set => SetValue(ContentTemplateProperty, value); } @@ -78,7 +78,7 @@ namespace HandyControl.Controls public string ContentStringFormat { - get => (string)GetValue(ContentStringFormatProperty); + get => (string) GetValue(ContentStringFormatProperty); set => SetValue(ContentStringFormatProperty, value); } @@ -87,7 +87,7 @@ namespace HandyControl.Controls public DataTemplateSelector ContentTemplateSelector { - get => (DataTemplateSelector)GetValue(ContentTemplateSelectorProperty); + get => (DataTemplateSelector) GetValue(ContentTemplateSelectorProperty); set => SetValue(ContentTemplateSelectorProperty, value); } @@ -102,7 +102,7 @@ namespace HandyControl.Controls public double Offset { - get => (double)GetValue(OffsetProperty); + get => (double) GetValue(OffsetProperty); set => SetValue(OffsetProperty, value); } @@ -117,7 +117,7 @@ namespace HandyControl.Controls public PlacementType PlacementType { - get => (PlacementType)GetValue(PlacementTypeProperty); + get => (PlacementType) GetValue(PlacementTypeProperty); set => SetValue(PlacementTypeProperty, value); } @@ -132,7 +132,7 @@ namespace HandyControl.Controls } else { - ((Poptip)GetInstance(d))?.SwitchPoptip((bool)e.NewValue); + ((Poptip) GetInstance(d))?.SwitchPoptip((bool) e.NewValue); } } @@ -191,7 +191,7 @@ namespace HandyControl.Controls var offsetX = .0; var offsetY = .0; - var poptip = (Poptip)GetInstance(Target); + var poptip = (Poptip) GetInstance(Target); var popupPlacement = poptip.PlacementType; var popupOffset = poptip.Offset; diff --git a/src/Shared/HandyControl_Shared/Controls/Other/ScrollViewer.cs b/src/Shared/HandyControl_Shared/Controls/Other/ScrollViewer.cs index eea2bd25..6cc7cf4e 100644 --- a/src/Shared/HandyControl_Shared/Controls/Other/ScrollViewer.cs +++ b/src/Shared/HandyControl_Shared/Controls/Other/ScrollViewer.cs @@ -147,7 +147,7 @@ namespace HandyControl.Controls public static void SetIsInertiaEnabled(DependencyObject element, bool value) => element.SetValue(IsInertiaEnabledProperty, ValueBoxes.BooleanBox(value)); - public static bool GetIsInertiaEnabled(DependencyObject element) => (bool)element.GetValue(IsInertiaEnabledProperty); + public static bool GetIsInertiaEnabled(DependencyObject element) => (bool) element.GetValue(IsInertiaEnabledProperty); /// /// 是否支持惯性 @@ -224,4 +224,4 @@ namespace HandyControl.Controls set => SetValue(CurrentHorizontalOffsetProperty, value); } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Controls/Other/Shield.cs b/src/Shared/HandyControl_Shared/Controls/Other/Shield.cs index 28a5284a..e6e400c9 100644 --- a/src/Shared/HandyControl_Shared/Controls/Other/Shield.cs +++ b/src/Shared/HandyControl_Shared/Controls/Other/Shield.cs @@ -35,4 +35,4 @@ namespace HandyControl.Controls set => SetValue(ColorProperty, value); } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Controls/Other/Sprite.cs b/src/Shared/HandyControl_Shared/Controls/Other/Sprite.cs index 0d1bea88..5783fd68 100644 --- a/src/Shared/HandyControl_Shared/Controls/Other/Sprite.cs +++ b/src/Shared/HandyControl_Shared/Controls/Other/Sprite.cs @@ -24,7 +24,7 @@ namespace HandyControl.Controls { _isLeftButtonPressed = true; } - else if(_isLeftButtonPressed) + else if (_isLeftButtonPressed) { if (Left < 0) { @@ -61,4 +61,4 @@ namespace HandyControl.Controls return sprite; } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Controls/Other/Watermark.cs b/src/Shared/HandyControl_Shared/Controls/Other/Watermark.cs index c51fc582..e5a7a048 100644 --- a/src/Shared/HandyControl_Shared/Controls/Other/Watermark.cs +++ b/src/Shared/HandyControl_Shared/Controls/Other/Watermark.cs @@ -144,7 +144,7 @@ namespace HandyControl.Controls Background = Brushes.Transparent, Padding = MarkMargin, Child = presenter - }), + }), Geometry = new RectangleGeometry(new Rect(markSize)) }, Viewport = new Rect(markSize) diff --git a/src/Shared/HandyControl_Shared/Controls/Panel/CirclePanel.cs b/src/Shared/HandyControl_Shared/Controls/Panel/CirclePanel.cs index f28cc64b..49548511 100644 --- a/src/Shared/HandyControl_Shared/Controls/Panel/CirclePanel.cs +++ b/src/Shared/HandyControl_Shared/Controls/Panel/CirclePanel.cs @@ -65,7 +65,7 @@ namespace HandyControl.Controls var centerX = element.DesiredSize.Width / 2.0; var centerY = element.DesiredSize.Height / 2.0; var angle = perDeg * i++ + offsetAngle; - + var transform = new RotateTransform { CenterX = centerX, @@ -73,18 +73,18 @@ namespace HandyControl.Controls Angle = keepVertical ? 0 : angle }; element.RenderTransform = transform; - + var r = Math.PI * angle / 180.0; var x = radius * Math.Cos(r); var y = radius * Math.Sin(r); - + var rectX = x + finalSize.Width / 2 - centerX; var rectY = y + finalSize.Height / 2 - centerY; - + element.Arrange(new Rect(rectX, rectY, element.DesiredSize.Width, element.DesiredSize.Height)); } return finalSize; } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Controls/Panel/FlexPanel.cs b/src/Shared/HandyControl_Shared/Controls/Panel/FlexPanel.cs index b3212296..04b04524 100644 --- a/src/Shared/HandyControl_Shared/Controls/Panel/FlexPanel.cs +++ b/src/Shared/HandyControl_Shared/Controls/Panel/FlexPanel.cs @@ -28,7 +28,7 @@ namespace HandyControl.Controls => element.SetValue(OrderProperty, value); public static int GetOrder(DependencyObject element) - => (int)element.GetValue(OrderProperty); + => (int) element.GetValue(OrderProperty); public static readonly DependencyProperty FlexGrowProperty = DependencyProperty.RegisterAttached( "FlexGrow", typeof(double), typeof(FlexPanel), @@ -39,7 +39,7 @@ namespace HandyControl.Controls => element.SetValue(FlexGrowProperty, value); public static double GetFlexGrow(DependencyObject element) - => (double)element.GetValue(FlexGrowProperty); + => (double) element.GetValue(FlexGrowProperty); public static readonly DependencyProperty FlexShrinkProperty = DependencyProperty.RegisterAttached( "FlexShrink", typeof(double), typeof(FlexPanel), @@ -50,7 +50,7 @@ namespace HandyControl.Controls => element.SetValue(FlexShrinkProperty, value); public static double GetFlexShrink(DependencyObject element) - => (double)element.GetValue(FlexShrinkProperty); + => (double) element.GetValue(FlexShrinkProperty); public static readonly DependencyProperty FlexBasisProperty = DependencyProperty.RegisterAttached( "FlexBasis", typeof(double), typeof(FlexPanel), @@ -60,7 +60,7 @@ namespace HandyControl.Controls => element.SetValue(FlexBasisProperty, value); public static double GetFlexBasis(DependencyObject element) - => (double)element.GetValue(FlexBasisProperty); + => (double) element.GetValue(FlexBasisProperty); public static readonly DependencyProperty AlignSelfProperty = DependencyProperty.RegisterAttached( "AlignSelf", typeof(FlexItemAlignment), typeof(FlexPanel), @@ -74,7 +74,7 @@ namespace HandyControl.Controls #region Panel public static FlexItemAlignment GetAlignSelf(DependencyObject element) - => (FlexItemAlignment)element.GetValue(AlignSelfProperty); + => (FlexItemAlignment) element.GetValue(AlignSelfProperty); public static readonly DependencyProperty FlexDirectionProperty = DependencyProperty.Register( "FlexDirection", typeof(FlexDirection), typeof(FlexPanel), @@ -82,7 +82,7 @@ namespace HandyControl.Controls public FlexDirection FlexDirection { - get => (FlexDirection)GetValue(FlexDirectionProperty); + get => (FlexDirection) GetValue(FlexDirectionProperty); set => SetValue(FlexDirectionProperty, value); } @@ -92,7 +92,7 @@ namespace HandyControl.Controls public FlexWrap FlexWrap { - get => (FlexWrap)GetValue(FlexWrapProperty); + get => (FlexWrap) GetValue(FlexWrapProperty); set => SetValue(FlexWrapProperty, value); } @@ -103,7 +103,7 @@ namespace HandyControl.Controls public FlexContentJustify JustifyContent { - get => (FlexContentJustify)GetValue(JustifyContentProperty); + get => (FlexContentJustify) GetValue(JustifyContentProperty); set => SetValue(JustifyContentProperty, value); } @@ -114,7 +114,7 @@ namespace HandyControl.Controls public FlexItemsAlignment AlignItems { - get => (FlexItemsAlignment)GetValue(AlignItemsProperty); + get => (FlexItemsAlignment) GetValue(AlignItemsProperty); set => SetValue(AlignItemsProperty, value); } @@ -125,7 +125,7 @@ namespace HandyControl.Controls public FlexContentAlignment AlignContent { - get => (FlexContentAlignment)GetValue(AlignContentProperty); + get => (FlexContentAlignment) GetValue(AlignContentProperty); set => SetValue(AlignContentProperty, value); } @@ -604,7 +604,7 @@ namespace HandyControl.Controls var v = lineInfo.OffsetV; var alignSelf = GetAlignSelf(child); - var alignment = alignSelf == FlexItemAlignment.Auto ? alignItems : (FlexItemsAlignment)alignSelf; + var alignment = alignSelf == FlexItemAlignment.Auto ? alignItems : (FlexItemsAlignment) alignSelf; switch (alignment) { diff --git a/src/Shared/HandyControl_Shared/Controls/Panel/Grid/Col.cs b/src/Shared/HandyControl_Shared/Controls/Panel/Grid/Col.cs index 8196b514..ea34d91b 100644 --- a/src/Shared/HandyControl_Shared/Controls/Panel/Grid/Col.cs +++ b/src/Shared/HandyControl_Shared/Controls/Panel/Grid/Col.cs @@ -13,7 +13,7 @@ namespace HandyControl.Controls public ColLayout Layout { - get => (ColLayout)GetValue(LayoutProperty); + get => (ColLayout) GetValue(LayoutProperty); set => SetValue(LayoutProperty, value); } @@ -22,7 +22,7 @@ namespace HandyControl.Controls public int Offset { - get => (int)GetValue(OffsetProperty); + get => (int) GetValue(OffsetProperty); set => SetValue(OffsetProperty, value); } @@ -31,7 +31,7 @@ namespace HandyControl.Controls private static bool OnSpanValidate(object value) { - var v = (int)value; + var v = (int) value; return v >= 1 && v <= 24; } diff --git a/src/Shared/HandyControl_Shared/Controls/Panel/Grid/Row.cs b/src/Shared/HandyControl_Shared/Controls/Panel/Grid/Row.cs index 043c2887..fa9ee4d1 100644 --- a/src/Shared/HandyControl_Shared/Controls/Panel/Grid/Row.cs +++ b/src/Shared/HandyControl_Shared/Controls/Panel/Grid/Row.cs @@ -1,9 +1,9 @@ -using HandyControl.Tools.Extension; -using System.Linq; +using System.Linq; using System.Windows; using System.Windows.Controls; using HandyControl.Data; using HandyControl.Tools; +using HandyControl.Tools.Extension; namespace HandyControl.Controls { @@ -22,7 +22,7 @@ namespace HandyControl.Controls public double Gutter { - get => (double)GetValue(GutterProperty); + get => (double) GetValue(GutterProperty); set => SetValue(GutterProperty, value); } diff --git a/src/Shared/HandyControl_Shared/Controls/Panel/HoneycombPanel.cs b/src/Shared/HandyControl_Shared/Controls/Panel/HoneycombPanel.cs index 1b3c3045..8f6f17ee 100644 --- a/src/Shared/HandyControl_Shared/Controls/Panel/HoneycombPanel.cs +++ b/src/Shared/HandyControl_Shared/Controls/Panel/HoneycombPanel.cs @@ -33,7 +33,7 @@ namespace HandyControl.Controls count -= 1; - var index = (int)Math.Floor(Math.Pow(count / 3.0 + 0.25, 0.5) - 0.5); + var index = (int) Math.Floor(Math.Pow(count / 3.0 + 0.25, 0.5) - 0.5); var valeIndex = 3 * index * index + 3 * index; return count > valeIndex @@ -163,4 +163,4 @@ namespace HandyControl.Controls } } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Controls/Panel/RelativePanel.cs b/src/Shared/HandyControl_Shared/Controls/Panel/RelativePanel.cs index 7d14f03f..6b84450a 100644 --- a/src/Shared/HandyControl_Shared/Controls/Panel/RelativePanel.cs +++ b/src/Shared/HandyControl_Shared/Controls/Panel/RelativePanel.cs @@ -112,7 +112,7 @@ namespace HandyControl.Controls [TypeConverter(typeof(NameReferenceConverter))] public static UIElement GetLeftOf(DependencyObject element) - => (UIElement)element.GetValue(LeftOfProperty); + => (UIElement) element.GetValue(LeftOfProperty); public static readonly DependencyProperty AboveProperty = DependencyProperty.RegisterAttached( "Above", typeof(UIElement), typeof(RelativePanel), new FrameworkPropertyMetadata(default(UIElement), FrameworkPropertyMetadataOptions.AffectsRender)); @@ -122,7 +122,7 @@ namespace HandyControl.Controls [TypeConverter(typeof(NameReferenceConverter))] public static UIElement GetAbove(DependencyObject element) - => (UIElement)element.GetValue(AboveProperty); + => (UIElement) element.GetValue(AboveProperty); public static readonly DependencyProperty RightOfProperty = DependencyProperty.RegisterAttached( "RightOf", typeof(UIElement), typeof(RelativePanel), new FrameworkPropertyMetadata(default(UIElement), FrameworkPropertyMetadataOptions.AffectsRender)); @@ -132,7 +132,7 @@ namespace HandyControl.Controls [TypeConverter(typeof(NameReferenceConverter))] public static UIElement GetRightOf(DependencyObject element) - => (UIElement)element.GetValue(RightOfProperty); + => (UIElement) element.GetValue(RightOfProperty); public static readonly DependencyProperty BelowProperty = DependencyProperty.RegisterAttached( "Below", typeof(UIElement), typeof(RelativePanel), new FrameworkPropertyMetadata(default(UIElement), FrameworkPropertyMetadataOptions.AffectsRender)); @@ -155,7 +155,7 @@ namespace HandyControl.Controls => element.SetValue(AlignHorizontalCenterWithPanelProperty, ValueBoxes.BooleanBox(value)); public static bool GetAlignHorizontalCenterWithPanel(DependencyObject element) - => (bool)element.GetValue(AlignHorizontalCenterWithPanelProperty); + => (bool) element.GetValue(AlignHorizontalCenterWithPanelProperty); public static readonly DependencyProperty AlignVerticalCenterWithPanelProperty = DependencyProperty.RegisterAttached( "AlignVerticalCenterWithPanel", typeof(bool), typeof(RelativePanel), new FrameworkPropertyMetadata(ValueBoxes.FalseBox, FrameworkPropertyMetadataOptions.AffectsRender)); @@ -164,7 +164,7 @@ namespace HandyControl.Controls => element.SetValue(AlignVerticalCenterWithPanelProperty, ValueBoxes.BooleanBox(value)); public static bool GetAlignVerticalCenterWithPanel(DependencyObject element) - => (bool)element.GetValue(AlignVerticalCenterWithPanelProperty); + => (bool) element.GetValue(AlignVerticalCenterWithPanelProperty); public static readonly DependencyProperty AlignHorizontalCenterWithProperty = DependencyProperty.RegisterAttached( "AlignHorizontalCenterWith", typeof(UIElement), typeof(RelativePanel), new FrameworkPropertyMetadata(default(UIElement), FrameworkPropertyMetadataOptions.AffectsRender)); @@ -174,7 +174,7 @@ namespace HandyControl.Controls [TypeConverter(typeof(NameReferenceConverter))] public static UIElement GetAlignHorizontalCenterWith(DependencyObject element) - => (UIElement)element.GetValue(AlignHorizontalCenterWithProperty); + => (UIElement) element.GetValue(AlignHorizontalCenterWithProperty); public static readonly DependencyProperty AlignVerticalCenterWithProperty = DependencyProperty.RegisterAttached( "AlignVerticalCenterWith", typeof(UIElement), typeof(RelativePanel), new FrameworkPropertyMetadata(default(UIElement), FrameworkPropertyMetadataOptions.AffectsRender)); @@ -184,7 +184,7 @@ namespace HandyControl.Controls [TypeConverter(typeof(NameReferenceConverter))] public static UIElement GetAlignVerticalCenterWith(DependencyObject element) - => (UIElement)element.GetValue(AlignVerticalCenterWithProperty); + => (UIElement) element.GetValue(AlignVerticalCenterWithProperty); #endregion @@ -321,7 +321,7 @@ namespace HandyControl.Controls { if (node.Measured || !node.OutgoingNodes.Any()) { - if (prevNode.LeftOfNode != null && prevNode.LeftOfNode == node || + if (prevNode.LeftOfNode != null && prevNode.LeftOfNode == node || prevNode.RightOfNode != null && prevNode.RightOfNode == node) { prevSize.Width += node.BoundingSize.Width; @@ -681,4 +681,4 @@ namespace HandyControl.Controls } } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Controls/Panel/SimplePanel.cs b/src/Shared/HandyControl_Shared/Controls/Panel/SimplePanel.cs index 7cd99696..7d29289e 100644 --- a/src/Shared/HandyControl_Shared/Controls/Panel/SimplePanel.cs +++ b/src/Shared/HandyControl_Shared/Controls/Panel/SimplePanel.cs @@ -39,4 +39,4 @@ namespace HandyControl.Controls return arrangeSize; } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Controls/Panel/WaterfallPanel.cs b/src/Shared/HandyControl_Shared/Controls/Panel/WaterfallPanel.cs index 0c4a88b8..6ba34088 100644 --- a/src/Shared/HandyControl_Shared/Controls/Panel/WaterfallPanel.cs +++ b/src/Shared/HandyControl_Shared/Controls/Panel/WaterfallPanel.cs @@ -17,7 +17,7 @@ namespace HandyControl.Controls set => SetValue(GroupsProperty, value); } - private static bool IsGroupsValid(object value) => (int)value >= 1; + private static bool IsGroupsValid(object value) => (int) value >= 1; public static readonly DependencyProperty OrientationProperty = DependencyProperty.Register( "Orientation", typeof(Orientation), typeof(WaterfallPanel), new FrameworkPropertyMetadata( @@ -27,7 +27,7 @@ namespace HandyControl.Controls { get => (Orientation) GetValue(OrientationProperty); set => SetValue(OrientationProperty, value); - } + } protected override Size MeasureOverride(Size constraint) { @@ -81,4 +81,4 @@ namespace HandyControl.Controls return panelSize; } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Controls/ProgressBar/CircleProgressBar.cs b/src/Shared/HandyControl_Shared/Controls/ProgressBar/CircleProgressBar.cs index 4aa11cc9..704d146c 100644 --- a/src/Shared/HandyControl_Shared/Controls/ProgressBar/CircleProgressBar.cs +++ b/src/Shared/HandyControl_Shared/Controls/ProgressBar/CircleProgressBar.cs @@ -54,7 +54,7 @@ namespace HandyControl.Controls public bool IsIndeterminate { - get => (bool)GetValue(IsIndeterminateProperty); + get => (bool) GetValue(IsIndeterminateProperty); set => SetValue(IsIndeterminateProperty, value); } @@ -99,4 +99,4 @@ namespace HandyControl.Controls SetProgressBarIndicatorAngle(); } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Controls/ProgressBar/WaveProgressBar.cs b/src/Shared/HandyControl_Shared/Controls/ProgressBar/WaveProgressBar.cs index 3d6ac4c1..3c8c4721 100644 --- a/src/Shared/HandyControl_Shared/Controls/ProgressBar/WaveProgressBar.cs +++ b/src/Shared/HandyControl_Shared/Controls/ProgressBar/WaveProgressBar.cs @@ -66,7 +66,7 @@ namespace HandyControl.Controls _translateTransformYRange = clipElement.Height - TranslateTransformMinY; _waveElement.RenderTransform = new TransformGroup { - Children = {_translateTransform} + Children = { _translateTransform } }; } } @@ -76,7 +76,7 @@ namespace HandyControl.Controls public string Text { - get => (string)GetValue(TextProperty); + get => (string) GetValue(TextProperty); set => SetValue(TextProperty, value); } @@ -85,7 +85,7 @@ namespace HandyControl.Controls public bool ShowText { - get => (bool)GetValue(ShowTextProperty); + get => (bool) GetValue(ShowTextProperty); set => SetValue(ShowTextProperty, ValueBoxes.BooleanBox(value)); } @@ -116,4 +116,4 @@ namespace HandyControl.Controls set => SetValue(WaveStrokeProperty, value); } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Controls/PropertyGrid/Editors/DatePropertyEditor.cs b/src/Shared/HandyControl_Shared/Controls/PropertyGrid/Editors/DatePropertyEditor.cs index 50005ce5..e7c478a0 100644 --- a/src/Shared/HandyControl_Shared/Controls/PropertyGrid/Editors/DatePropertyEditor.cs +++ b/src/Shared/HandyControl_Shared/Controls/PropertyGrid/Editors/DatePropertyEditor.cs @@ -11,4 +11,4 @@ namespace HandyControl.Controls public override DependencyProperty GetDependencyProperty() => System.Windows.Controls.DatePicker.SelectedDateProperty; } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Controls/PropertyGrid/Editors/DateTimePropertyEditor.cs b/src/Shared/HandyControl_Shared/Controls/PropertyGrid/Editors/DateTimePropertyEditor.cs index 34e32e6b..6f6946db 100644 --- a/src/Shared/HandyControl_Shared/Controls/PropertyGrid/Editors/DateTimePropertyEditor.cs +++ b/src/Shared/HandyControl_Shared/Controls/PropertyGrid/Editors/DateTimePropertyEditor.cs @@ -11,4 +11,4 @@ namespace HandyControl.Controls public override DependencyProperty GetDependencyProperty() => DateTimePicker.SelectedDateTimeProperty; } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Controls/PropertyGrid/Editors/EnumPropertyEditor.cs b/src/Shared/HandyControl_Shared/Controls/PropertyGrid/Editors/EnumPropertyEditor.cs index bb5ec065..3187a0fd 100644 --- a/src/Shared/HandyControl_Shared/Controls/PropertyGrid/Editors/EnumPropertyEditor.cs +++ b/src/Shared/HandyControl_Shared/Controls/PropertyGrid/Editors/EnumPropertyEditor.cs @@ -14,4 +14,4 @@ namespace HandyControl.Controls public override DependencyProperty GetDependencyProperty() => Selector.SelectedValueProperty; } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Controls/PropertyGrid/Editors/HorizontalAlignmentPropertyEditor.cs b/src/Shared/HandyControl_Shared/Controls/PropertyGrid/Editors/HorizontalAlignmentPropertyEditor.cs index 89d7750f..b532a173 100644 --- a/src/Shared/HandyControl_Shared/Controls/PropertyGrid/Editors/HorizontalAlignmentPropertyEditor.cs +++ b/src/Shared/HandyControl_Shared/Controls/PropertyGrid/Editors/HorizontalAlignmentPropertyEditor.cs @@ -68,4 +68,4 @@ namespace HandyControl.Controls return null; } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Controls/PropertyGrid/Editors/ImagePropertyEditor.cs b/src/Shared/HandyControl_Shared/Controls/PropertyGrid/Editors/ImagePropertyEditor.cs index bf463959..2b4e44e7 100644 --- a/src/Shared/HandyControl_Shared/Controls/PropertyGrid/Editors/ImagePropertyEditor.cs +++ b/src/Shared/HandyControl_Shared/Controls/PropertyGrid/Editors/ImagePropertyEditor.cs @@ -30,8 +30,8 @@ namespace HandyControl.Controls internal static readonly DependencyProperty UriProperty = DependencyProperty.Register( "Uri", typeof(Uri), typeof(ImagePropertyEditor), new PropertyMetadata(default(Uri), OnUriChangedCallback)); - private static void OnUriChangedCallback(DependencyObject d, DependencyPropertyChangedEventArgs e) => - ((ImagePropertyEditor)d).Source = e.NewValue is Uri uri ? BitmapFrame.Create(uri) : null; + private static void OnUriChangedCallback(DependencyObject d, DependencyPropertyChangedEventArgs e) => + ((ImagePropertyEditor) d).Source = e.NewValue is Uri uri ? BitmapFrame.Create(uri) : null; internal Uri Uri { @@ -60,4 +60,4 @@ namespace HandyControl.Controls public override DependencyProperty GetDependencyProperty() => SourceProperty; } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Controls/PropertyGrid/Editors/NumberPropertyEditor.cs b/src/Shared/HandyControl_Shared/Controls/PropertyGrid/Editors/NumberPropertyEditor.cs index bde1fd84..0d84738c 100644 --- a/src/Shared/HandyControl_Shared/Controls/PropertyGrid/Editors/NumberPropertyEditor.cs +++ b/src/Shared/HandyControl_Shared/Controls/PropertyGrid/Editors/NumberPropertyEditor.cs @@ -6,7 +6,7 @@ namespace HandyControl.Controls { public NumberPropertyEditor() { - + } public NumberPropertyEditor(double minimum, double maximum) @@ -28,4 +28,4 @@ namespace HandyControl.Controls public override DependencyProperty GetDependencyProperty() => NumericUpDown.ValueProperty; } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Controls/PropertyGrid/Editors/PlainTextPropertyEditor.cs b/src/Shared/HandyControl_Shared/Controls/PropertyGrid/Editors/PlainTextPropertyEditor.cs index 7782e114..8e31e055 100644 --- a/src/Shared/HandyControl_Shared/Controls/PropertyGrid/Editors/PlainTextPropertyEditor.cs +++ b/src/Shared/HandyControl_Shared/Controls/PropertyGrid/Editors/PlainTextPropertyEditor.cs @@ -11,4 +11,4 @@ namespace HandyControl.Controls public override DependencyProperty GetDependencyProperty() => System.Windows.Controls.TextBox.TextProperty; } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Controls/PropertyGrid/Editors/PropertyEditorBase.cs b/src/Shared/HandyControl_Shared/Controls/PropertyGrid/Editors/PropertyEditorBase.cs index 983e25de..9c2a6442 100644 --- a/src/Shared/HandyControl_Shared/Controls/PropertyGrid/Editors/PropertyEditorBase.cs +++ b/src/Shared/HandyControl_Shared/Controls/PropertyGrid/Editors/PropertyEditorBase.cs @@ -25,4 +25,4 @@ namespace HandyControl.Controls protected virtual IValueConverter GetConverter(PropertyItem propertyItem) => null; } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Controls/PropertyGrid/Editors/ReadOnlyTextPropertyEditor.cs b/src/Shared/HandyControl_Shared/Controls/PropertyGrid/Editors/ReadOnlyTextPropertyEditor.cs index e88f10d5..e5003d53 100644 --- a/src/Shared/HandyControl_Shared/Controls/PropertyGrid/Editors/ReadOnlyTextPropertyEditor.cs +++ b/src/Shared/HandyControl_Shared/Controls/PropertyGrid/Editors/ReadOnlyTextPropertyEditor.cs @@ -17,4 +17,4 @@ namespace HandyControl.Controls protected override IValueConverter GetConverter(PropertyItem propertyItem) => ResourceHelper.GetResource("Object2StringConverter"); } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Controls/PropertyGrid/Editors/SwitchPropertyEditor.cs b/src/Shared/HandyControl_Shared/Controls/PropertyGrid/Editors/SwitchPropertyEditor.cs index fbfb1c4a..aaa22e7e 100644 --- a/src/Shared/HandyControl_Shared/Controls/PropertyGrid/Editors/SwitchPropertyEditor.cs +++ b/src/Shared/HandyControl_Shared/Controls/PropertyGrid/Editors/SwitchPropertyEditor.cs @@ -15,4 +15,4 @@ namespace HandyControl.Controls public override DependencyProperty GetDependencyProperty() => ToggleButton.IsCheckedProperty; } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Controls/PropertyGrid/Editors/TimePropertyEditor.cs b/src/Shared/HandyControl_Shared/Controls/PropertyGrid/Editors/TimePropertyEditor.cs index e113da39..dbddc1f9 100644 --- a/src/Shared/HandyControl_Shared/Controls/PropertyGrid/Editors/TimePropertyEditor.cs +++ b/src/Shared/HandyControl_Shared/Controls/PropertyGrid/Editors/TimePropertyEditor.cs @@ -11,4 +11,4 @@ namespace HandyControl.Controls public override DependencyProperty GetDependencyProperty() => TimePicker.SelectedTimeProperty; } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Controls/PropertyGrid/Editors/VerticalAlignmentPropertyEditor.cs b/src/Shared/HandyControl_Shared/Controls/PropertyGrid/Editors/VerticalAlignmentPropertyEditor.cs index 6311c926..9c1e2512 100644 --- a/src/Shared/HandyControl_Shared/Controls/PropertyGrid/Editors/VerticalAlignmentPropertyEditor.cs +++ b/src/Shared/HandyControl_Shared/Controls/PropertyGrid/Editors/VerticalAlignmentPropertyEditor.cs @@ -68,4 +68,4 @@ namespace HandyControl.Controls return null; } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Controls/PropertyGrid/PropertyGrid.cs b/src/Shared/HandyControl_Shared/Controls/PropertyGrid/PropertyGrid.cs index b31509c0..2c885403 100644 --- a/src/Shared/HandyControl_Shared/Controls/PropertyGrid/PropertyGrid.cs +++ b/src/Shared/HandyControl_Shared/Controls/PropertyGrid/PropertyGrid.cs @@ -30,7 +30,7 @@ namespace HandyControl.Controls public PropertyGrid() { CommandBindings.Add(new CommandBinding(ControlCommands.SortByCategory, SortByCategory, (s, e) => e.CanExecute = ShowSortButton)); - CommandBindings.Add(new CommandBinding(ControlCommands.SortByName, SortByName, (s, e)=> e.CanExecute = ShowSortButton)); + CommandBindings.Add(new CommandBinding(ControlCommands.SortByName, SortByName, (s, e) => e.CanExecute = ShowSortButton)); } public virtual PropertyResolver PropertyResolver { get; } = new PropertyResolver(); @@ -50,7 +50,7 @@ namespace HandyControl.Controls private static void OnSelectedObjectChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { - var ctl = (PropertyGrid)d; + var ctl = (PropertyGrid) d; ctl.OnSelectedObjectChanged(e.OldValue, e.NewValue); } @@ -71,7 +71,7 @@ namespace HandyControl.Controls public string Description { - get => (string)GetValue(DescriptionProperty); + get => (string) GetValue(DescriptionProperty); set => SetValue(DescriptionProperty, value); } @@ -195,4 +195,4 @@ namespace HandyControl.Controls TitleElement.SetTitleWidth(this, new GridLength(Math.Max(MinTitleWidth, Math.Min(MaxTitleWidth, ActualWidth / 3)))); } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Controls/PropertyGrid/PropertyItem.cs b/src/Shared/HandyControl_Shared/Controls/PropertyGrid/PropertyItem.cs index de3fba4d..b749992c 100644 --- a/src/Shared/HandyControl_Shared/Controls/PropertyGrid/PropertyItem.cs +++ b/src/Shared/HandyControl_Shared/Controls/PropertyGrid/PropertyItem.cs @@ -22,7 +22,7 @@ namespace HandyControl.Controls public string DisplayName { - get => (string)GetValue(DisplayNameProperty); + get => (string) GetValue(DisplayNameProperty); set => SetValue(DisplayNameProperty, value); } @@ -31,7 +31,7 @@ namespace HandyControl.Controls public string PropertyName { - get => (string)GetValue(PropertyNameProperty); + get => (string) GetValue(PropertyNameProperty); set => SetValue(PropertyNameProperty, value); } @@ -49,7 +49,7 @@ namespace HandyControl.Controls public string PropertyTypeName { - get => (string)GetValue(PropertyTypeNameProperty); + get => (string) GetValue(PropertyTypeNameProperty); set => SetValue(PropertyTypeNameProperty, value); } @@ -58,7 +58,7 @@ namespace HandyControl.Controls public string Description { - get => (string)GetValue(DescriptionProperty); + get => (string) GetValue(DescriptionProperty); set => SetValue(DescriptionProperty, value); } @@ -67,7 +67,7 @@ namespace HandyControl.Controls public bool IsReadOnly { - get => (bool)GetValue(IsReadOnlyProperty); + get => (bool) GetValue(IsReadOnlyProperty); set => SetValue(IsReadOnlyProperty, ValueBoxes.BooleanBox(value)); } @@ -85,7 +85,7 @@ namespace HandyControl.Controls public string Category { - get => (string)GetValue(CategoryProperty); + get => (string) GetValue(CategoryProperty); set => SetValue(CategoryProperty, value); } @@ -94,7 +94,7 @@ namespace HandyControl.Controls public PropertyEditorBase Editor { - get => (PropertyEditorBase)GetValue(EditorProperty); + get => (PropertyEditorBase) GetValue(EditorProperty); set => SetValue(EditorProperty, value); } @@ -103,7 +103,7 @@ namespace HandyControl.Controls public FrameworkElement EditorElement { - get => (FrameworkElement)GetValue(EditorElementProperty); + get => (FrameworkElement) GetValue(EditorElementProperty); set => SetValue(EditorElementProperty, value); } @@ -112,7 +112,7 @@ namespace HandyControl.Controls public bool IsExpandedEnabled { - get => (bool)GetValue(IsExpandedEnabledProperty); + get => (bool) GetValue(IsExpandedEnabledProperty); set => SetValue(IsExpandedEnabledProperty, ValueBoxes.BooleanBox(value)); } @@ -125,4 +125,4 @@ namespace HandyControl.Controls Editor.CreateBinding(this, EditorElement); } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Controls/PropertyGrid/PropertyItemsControl.cs b/src/Shared/HandyControl_Shared/Controls/PropertyGrid/PropertyItemsControl.cs index aa1219db..9016b74a 100644 --- a/src/Shared/HandyControl_Shared/Controls/PropertyGrid/PropertyItemsControl.cs +++ b/src/Shared/HandyControl_Shared/Controls/PropertyGrid/PropertyItemsControl.cs @@ -14,4 +14,4 @@ namespace HandyControl.Controls #endif } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Controls/PropertyGrid/PropertyResolver.cs b/src/Shared/HandyControl_Shared/Controls/PropertyGrid/PropertyResolver.cs index f456bcf8..d28031fb 100644 --- a/src/Shared/HandyControl_Shared/Controls/PropertyGrid/PropertyResolver.cs +++ b/src/Shared/HandyControl_Shared/Controls/PropertyGrid/PropertyResolver.cs @@ -34,10 +34,10 @@ namespace HandyControl.Controls { var categoryAttribute = propertyDescriptor.Attributes.OfType().FirstOrDefault(); - return categoryAttribute == null ? + return categoryAttribute == null ? Lang.Miscellaneous : - string.IsNullOrEmpty(categoryAttribute.Category) ? - Lang.Miscellaneous : + string.IsNullOrEmpty(categoryAttribute.Category) ? + Lang.Miscellaneous : categoryAttribute.Category; } @@ -124,4 +124,4 @@ namespace HandyControl.Controls ImageSource } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Controls/Rate/Rate.cs b/src/Shared/HandyControl_Shared/Controls/Rate/Rate.cs index beefd903..158f732f 100644 --- a/src/Shared/HandyControl_Shared/Controls/Rate/Rate.cs +++ b/src/Shared/HandyControl_Shared/Controls/Rate/Rate.cs @@ -37,7 +37,7 @@ namespace HandyControl.Controls private static void OnValueChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) => ((Rate) d).OnValueChanged(new FunctionEventArgs(ValueChangedEvent, d) { - Info = (double)e.NewValue + Info = (double) e.NewValue }); protected virtual void OnValueChanged(FunctionEventArgs e) @@ -154,7 +154,7 @@ namespace HandyControl.Controls public bool IsReadOnly { - get => (bool)GetValue(IsReadOnlyProperty); + get => (bool) GetValue(IsReadOnlyProperty); set => SetValue(IsReadOnlyProperty, ValueBoxes.BooleanBox(value)); } @@ -260,4 +260,4 @@ namespace HandyControl.Controls public void Reset() => Value = DefaultValue; } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Controls/Rate/RateItem.cs b/src/Shared/HandyControl_Shared/Controls/Rate/RateItem.cs index 23e88377..17cc4051 100644 --- a/src/Shared/HandyControl_Shared/Controls/Rate/RateItem.cs +++ b/src/Shared/HandyControl_Shared/Controls/Rate/RateItem.cs @@ -81,7 +81,7 @@ namespace HandyControl.Controls public bool IsReadOnly { - get => (bool)GetValue(IsReadOnlyProperty); + get => (bool) GetValue(IsReadOnlyProperty); set => SetValue(IsReadOnlyProperty, ValueBoxes.BooleanBox(value)); } @@ -163,7 +163,7 @@ namespace HandyControl.Controls if (IsReadOnly) return; _isSentValue = false; IsSelected = true; - RaiseEvent(new RoutedEventArgs(SelectedChangedEvent) {Source = this}); + RaiseEvent(new RoutedEventArgs(SelectedChangedEvent) { Source = this }); } protected override void OnMouseLeftButtonDown(MouseButtonEventArgs e) @@ -192,7 +192,7 @@ namespace HandyControl.Controls { if (!_isSentValue) { - RaiseEvent(new RoutedEventArgs(ValueChangedEvent) {Source = this}); + RaiseEvent(new RoutedEventArgs(ValueChangedEvent) { Source = this }); _isMouseLeftButtonDown = false; _isSentValue = true; return; @@ -213,9 +213,9 @@ namespace HandyControl.Controls } } - RaiseEvent(new RoutedEventArgs(ValueChangedEvent) {Source = this}); + RaiseEvent(new RoutedEventArgs(ValueChangedEvent) { Source = this }); _isMouseLeftButtonDown = false; } } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Controls/Screenshot/ScreenshotWindow.cs b/src/Shared/HandyControl_Shared/Controls/Screenshot/ScreenshotWindow.cs index 6f8e85d4..2eff9434 100644 --- a/src/Shared/HandyControl_Shared/Controls/Screenshot/ScreenshotWindow.cs +++ b/src/Shared/HandyControl_Shared/Controls/Screenshot/ScreenshotWindow.cs @@ -124,7 +124,7 @@ namespace HandyControl.Controls public bool IsDrawing { - get => (bool)GetValue(IsDrawingProperty); + get => (bool) GetValue(IsDrawingProperty); internal set => SetValue(IsDrawingProperty, ValueBoxes.BooleanBox(value)); } @@ -133,7 +133,7 @@ namespace HandyControl.Controls public bool IsSelecting { - get => (bool)GetValue(IsSelectingProperty); + get => (bool) GetValue(IsSelectingProperty); internal set => SetValue(IsSelectingProperty, ValueBoxes.BooleanBox(value)); } @@ -279,14 +279,14 @@ namespace HandyControl.Controls } var newPoint = Mouse.GetPosition(this); - var offsetX = (int)(newPoint.X - _mousePointOld.X); - var offsetY = (int)(newPoint.Y - _mousePointOld.Y); - + var offsetX = (int) (newPoint.X - _mousePointOld.X); + var offsetY = (int) (newPoint.Y - _mousePointOld.Y); + if (IsDrawing) { if (_isOut) return; var rect = _targetWindowRect; - + if (_canDrag) { rect.Left += offsetX; @@ -320,10 +320,10 @@ namespace HandyControl.Controls magnifierPos.Y = _pointFloating.Y - 1; } - rect.Left = (int)Math.Min(_pointFixed.X, _pointFloating.X); - rect.Top = (int)Math.Min(_pointFixed.Y, _pointFloating.Y); - rect.Right = (int)Math.Max(_pointFixed.X, _pointFloating.X); - rect.Bottom = (int)Math.Max(_pointFixed.Y, _pointFloating.Y); + rect.Left = (int) Math.Min(_pointFixed.X, _pointFloating.X); + rect.Top = (int) Math.Min(_pointFixed.Y, _pointFloating.Y); + rect.Right = (int) Math.Max(_pointFixed.X, _pointFloating.X); + rect.Bottom = (int) Math.Max(_pointFixed.Y, _pointFloating.Y); _magnifier.Show(); MoveMagnifier(magnifierPos); @@ -334,10 +334,10 @@ namespace HandyControl.Controls } else if (IsSelecting) { - var minX = (int)Math.Min(_mousePointOld.X, newPoint.X); - var maxX = (int)Math.Max(_mousePointOld.X, newPoint.X); - var minY = (int)Math.Min(_mousePointOld.Y, newPoint.Y); - var maxY = (int)Math.Max(_mousePointOld.Y, newPoint.Y); + var minX = (int) Math.Min(_mousePointOld.X, newPoint.X); + var maxX = (int) Math.Max(_mousePointOld.X, newPoint.X); + var minY = (int) Math.Min(_mousePointOld.Y, newPoint.Y); + var maxY = (int) Math.Max(_mousePointOld.Y, newPoint.Y); MoveTargetArea(new InteropValues.RECT(minX, minY, maxX, maxY)); } diff --git a/src/Shared/HandyControl_Shared/Controls/SideMenu/SideMenu.cs b/src/Shared/HandyControl_Shared/Controls/SideMenu/SideMenu.cs index b808c481..a296ea52 100644 --- a/src/Shared/HandyControl_Shared/Controls/SideMenu/SideMenu.cs +++ b/src/Shared/HandyControl_Shared/Controls/SideMenu/SideMenu.cs @@ -91,7 +91,7 @@ namespace HandyControl.Controls { _isItemSelected = false; } - else if(_selectedHeader != null) + else if (_selectedHeader != null) { if (AutoSelect) { @@ -196,7 +196,7 @@ namespace HandyControl.Controls _selectedItem = sideMenuSubItem; } } - } + } } } } diff --git a/src/Shared/HandyControl_Shared/Controls/SideMenu/SideMenuItem.cs b/src/Shared/HandyControl_Shared/Controls/SideMenu/SideMenuItem.cs index 2b6a8002..6d6316ff 100644 --- a/src/Shared/HandyControl_Shared/Controls/SideMenu/SideMenuItem.cs +++ b/src/Shared/HandyControl_Shared/Controls/SideMenu/SideMenuItem.cs @@ -170,7 +170,7 @@ namespace HandyControl.Controls private static void OnCommandChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { - var ctl = (SideMenuItem)d; + var ctl = (SideMenuItem) d; if (e.OldValue is ICommand oldCommand) { oldCommand.CanExecuteChanged -= ctl.CanExecuteChanged; @@ -195,7 +195,7 @@ namespace HandyControl.Controls get => GetValue(CommandParameterProperty); set => SetValue(CommandParameterProperty, value); } - + public static readonly DependencyProperty CommandTargetProperty = DependencyProperty.Register( "CommandTarget", typeof(IInputElement), typeof(SideMenuItem), new PropertyMetadata(default(IInputElement))); @@ -214,4 +214,4 @@ namespace HandyControl.Controls : Command.CanExecute(CommandParameter); } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Controls/Slider/CompareSlider/CompareSlider.cs b/src/Shared/HandyControl_Shared/Controls/Slider/CompareSlider/CompareSlider.cs index dc2ac997..cb900692 100644 --- a/src/Shared/HandyControl_Shared/Controls/Slider/CompareSlider/CompareSlider.cs +++ b/src/Shared/HandyControl_Shared/Controls/Slider/CompareSlider/CompareSlider.cs @@ -21,6 +21,6 @@ namespace HandyControl.Controls { get => GetValue(SourceContentProperty); set => SetValue(SourceContentProperty, value); - } + } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Controls/Slider/CompareSlider/CompareTrack.cs b/src/Shared/HandyControl_Shared/Controls/Slider/CompareSlider/CompareTrack.cs index ec98f390..af178977 100644 --- a/src/Shared/HandyControl_Shared/Controls/Slider/CompareSlider/CompareTrack.cs +++ b/src/Shared/HandyControl_Shared/Controls/Slider/CompareSlider/CompareTrack.cs @@ -114,4 +114,4 @@ namespace HandyControl.Controls componentLength = trackLength; } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Controls/Slider/PreviewSlider.cs b/src/Shared/HandyControl_Shared/Controls/Slider/PreviewSlider.cs index 96909766..d0e1d042 100644 --- a/src/Shared/HandyControl_Shared/Controls/Slider/PreviewSlider.cs +++ b/src/Shared/HandyControl_Shared/Controls/Slider/PreviewSlider.cs @@ -99,7 +99,7 @@ namespace HandyControl.Controls if (_thumb.IsMouseCaptureWithin) { PreviewPosition = Value; - } + } return; } @@ -192,4 +192,4 @@ namespace HandyControl.Controls } } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Controls/Slider/RangeSlider/RangeSlider.cs b/src/Shared/HandyControl_Shared/Controls/Slider/RangeSlider/RangeSlider.cs index aa9c0bd1..f4d31598 100644 --- a/src/Shared/HandyControl_Shared/Controls/Slider/RangeSlider/RangeSlider.cs +++ b/src/Shared/HandyControl_Shared/Controls/Slider/RangeSlider/RangeSlider.cs @@ -18,7 +18,7 @@ namespace HandyControl.Controls [TemplatePart(Name = ElementTrack, Type = typeof(Track))] public class RangeSlider : TwoWayRangeBase { - private const string ElementTrack= "PART_Track"; + private const string ElementTrack = "PART_Track"; private RangeTrack _track; @@ -136,7 +136,7 @@ namespace HandyControl.Controls public Orientation Orientation { - get => (Orientation)GetValue(OrientationProperty); + get => (Orientation) GetValue(OrientationProperty); set => SetValue(OrientationProperty, value); } @@ -145,7 +145,7 @@ namespace HandyControl.Controls public bool IsDirectionReversed { - get => (bool)GetValue(IsDirectionReversedProperty); + get => (bool) GetValue(IsDirectionReversedProperty); set => SetValue(IsDirectionReversedProperty, ValueBoxes.BooleanBox(value)); } @@ -153,7 +153,7 @@ namespace HandyControl.Controls public int Delay { - get => (int)GetValue(DelayProperty); + get => (int) GetValue(DelayProperty); set => SetValue(DelayProperty, value); } @@ -169,7 +169,7 @@ namespace HandyControl.Controls public int Interval { - get => (int)GetValue(IntervalProperty); + get => (int) GetValue(IntervalProperty); set => SetValue(IntervalProperty, value); } @@ -186,7 +186,7 @@ namespace HandyControl.Controls public AutoToolTipPlacement AutoToolTipPlacement { - get => (AutoToolTipPlacement)GetValue(AutoToolTipPlacementProperty); + get => (AutoToolTipPlacement) GetValue(AutoToolTipPlacementProperty); set => SetValue(AutoToolTipPlacementProperty, value); } @@ -196,7 +196,7 @@ namespace HandyControl.Controls public int AutoToolTipPrecision { - get => (int)GetValue(AutoToolTipPrecisionProperty); + get => (int) GetValue(AutoToolTipPrecisionProperty); set => SetValue(AutoToolTipPrecisionProperty, value); } @@ -205,7 +205,7 @@ namespace HandyControl.Controls public bool IsSnapToTickEnabled { - get => (bool)GetValue(IsSnapToTickEnabledProperty); + get => (bool) GetValue(IsSnapToTickEnabledProperty); set => SetValue(IsSnapToTickEnabledProperty, ValueBoxes.BooleanBox(value)); } @@ -214,7 +214,7 @@ namespace HandyControl.Controls public TickPlacement TickPlacement { - get => (TickPlacement)GetValue(TickPlacementProperty); + get => (TickPlacement) GetValue(TickPlacementProperty); set => SetValue(TickPlacementProperty, value); } @@ -224,7 +224,7 @@ namespace HandyControl.Controls public double TickFrequency { - get => (double)GetValue(TickFrequencyProperty); + get => (double) GetValue(TickFrequencyProperty); set => SetValue(TickFrequencyProperty, value); } @@ -233,7 +233,7 @@ namespace HandyControl.Controls public DoubleCollection Ticks { - get => (DoubleCollection)GetValue(TicksProperty); + get => (DoubleCollection) GetValue(TicksProperty); set => SetValue(TicksProperty, value); } @@ -242,7 +242,7 @@ namespace HandyControl.Controls public bool IsMoveToPointEnabled { - get => (bool)GetValue(IsMoveToPointEnabledProperty); + get => (bool) GetValue(IsMoveToPointEnabledProperty); set => SetValue(IsMoveToPointEnabledProperty, ValueBoxes.BooleanBox(value)); } @@ -295,7 +295,7 @@ namespace HandyControl.Controls var greaterThan = direction > 0; // If the snapping brought us back to value, find the next tick point - if (MathHelper.AreClose(next, value) && + if (MathHelper.AreClose(next, value) && !(greaterThan && MathHelper.AreClose(value, Maximum)) && !(!greaterThan && MathHelper.AreClose(value, Minimum))) { @@ -522,7 +522,7 @@ namespace HandyControl.Controls private string GetAutoToolTipNumber(bool isStart) { - var format = (NumberFormatInfo)NumberFormatInfo.CurrentInfo.Clone(); + var format = (NumberFormatInfo) NumberFormatInfo.CurrentInfo.Clone(); format.NumberDecimalDigits = AutoToolTipPrecision; return isStart ? ValueStart.ToString("N", format) : ValueEnd.ToString("N", format); } @@ -603,7 +603,7 @@ namespace HandyControl.Controls { if (e.ChangedButton != MouseButton.Left) return; - var slider = (RangeSlider)sender; + var slider = (RangeSlider) sender; // When someone click on the Slider's part, and it's not focusable // Slider need to take the focus in order to process keyboard correctly @@ -648,4 +648,4 @@ namespace HandyControl.Controls _thumbCurrent = null; } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Controls/Slider/RangeSlider/RangeThumb.cs b/src/Shared/HandyControl_Shared/Controls/Slider/RangeSlider/RangeThumb.cs index fee42007..f0c60ec2 100644 --- a/src/Shared/HandyControl_Shared/Controls/Slider/RangeSlider/RangeThumb.cs +++ b/src/Shared/HandyControl_Shared/Controls/Slider/RangeSlider/RangeThumb.cs @@ -18,7 +18,7 @@ namespace HandyControl.Controls protected override void OnMouseMove(MouseEventArgs e) { - + } public void StartDrag() @@ -43,4 +43,4 @@ namespace HandyControl.Controls }); } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Controls/Slider/RangeSlider/RangeTrack.cs b/src/Shared/HandyControl_Shared/Controls/Slider/RangeSlider/RangeTrack.cs index ca89d612..6118a0aa 100644 --- a/src/Shared/HandyControl_Shared/Controls/Slider/RangeSlider/RangeTrack.cs +++ b/src/Shared/HandyControl_Shared/Controls/Slider/RangeSlider/RangeTrack.cs @@ -153,7 +153,7 @@ namespace HandyControl.Controls } public static readonly DependencyProperty ValueEndProperty = DependencyProperty.Register( - "ValueEnd", typeof(double), typeof(RangeTrack), + "ValueEnd", typeof(double), typeof(RangeTrack), new FrameworkPropertyMetadata(ValueBoxes.Double0Box, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault | FrameworkPropertyMetadataOptions.AffectsArrange)); @@ -310,7 +310,7 @@ namespace HandyControl.Controls out double thumbEndLength) { var min = Minimum; - var range = Math.Max(0.0, Maximum - min); + var range = Math.Max(0.0, Maximum - min); var offsetStart = Math.Min(range, ValueStart - min); var offsetEnd = Math.Min(range, ValueEnd - min); @@ -364,7 +364,7 @@ namespace HandyControl.Controls private static void OnIsEnabledChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { - if ((bool)e.NewValue) + if ((bool) e.NewValue) { Mouse.Synchronize(); } @@ -441,4 +441,4 @@ namespace HandyControl.Controls } } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Controls/Slider/RangeSlider/TwoWayRangeBase.cs b/src/Shared/HandyControl_Shared/Controls/Slider/RangeSlider/TwoWayRangeBase.cs index 287f98c6..03ce0fed 100644 --- a/src/Shared/HandyControl_Shared/Controls/Slider/RangeSlider/TwoWayRangeBase.cs +++ b/src/Shared/HandyControl_Shared/Controls/Slider/RangeSlider/TwoWayRangeBase.cs @@ -1,9 +1,9 @@ // Adapted from https://referencesource.microsoft.com/#PresentationFramework/src/Framework/System/Windows/Controls/Primitives/RangeBase.cs -using HandyControl.Data; -using HandyControl.Tools; using System.Windows; using System.Windows.Controls; +using HandyControl.Data; +using HandyControl.Tools; namespace HandyControl.Controls { @@ -15,12 +15,12 @@ namespace HandyControl.Controls private static void OnMinimumChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { - var ctrl = (TwoWayRangeBase)d; + var ctrl = (TwoWayRangeBase) d; ctrl.CoerceValue(MaximumProperty); ctrl.CoerceValue(ValueStartProperty); ctrl.CoerceValue(ValueEndProperty); - ctrl.OnMinimumChanged((double)e.OldValue, (double)e.NewValue); + ctrl.OnMinimumChanged((double) e.OldValue, (double) e.NewValue); } protected virtual void OnMinimumChanged(double oldMinimum, double newMinimum) @@ -29,7 +29,7 @@ namespace HandyControl.Controls public double Minimum { - get => (double)GetValue(MinimumProperty); + get => (double) GetValue(MinimumProperty); set => SetValue(MinimumProperty, value); } @@ -40,9 +40,9 @@ namespace HandyControl.Controls private static object CoerceMaximum(DependencyObject d, object basevalue) { - var ctrl = (TwoWayRangeBase)d; + var ctrl = (TwoWayRangeBase) d; var min = ctrl.Minimum; - if ((double)basevalue < min) + if ((double) basevalue < min) { return min; } @@ -51,11 +51,11 @@ namespace HandyControl.Controls private static void OnMaximumChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { - var ctrl = (TwoWayRangeBase)d; + var ctrl = (TwoWayRangeBase) d; ctrl.CoerceValue(ValueStartProperty); ctrl.CoerceValue(ValueEndProperty); - ctrl.OnMaximumChanged((double)e.OldValue, (double)e.NewValue); + ctrl.OnMaximumChanged((double) e.OldValue, (double) e.NewValue); } protected virtual void OnMaximumChanged(double oldMaximum, double newMaximum) @@ -64,7 +64,7 @@ namespace HandyControl.Controls public double Maximum { - get => (double)GetValue(MaximumProperty); + get => (double) GetValue(MaximumProperty); set => SetValue(MaximumProperty, value); } @@ -76,24 +76,24 @@ namespace HandyControl.Controls private static void OnValueStartChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { - var ctrl = (TwoWayRangeBase)d; + var ctrl = (TwoWayRangeBase) d; ctrl.OnValueChanged(new DoubleRange { - Start = (double)e.OldValue, + Start = (double) e.OldValue, End = ctrl.ValueEnd }, new DoubleRange { - Start = (double)e.NewValue, + Start = (double) e.NewValue, End = ctrl.ValueEnd }); } protected virtual void OnValueChanged(DoubleRange oldValue, DoubleRange newValue) => RaiseEvent( - new RoutedPropertyChangedEventArgs(oldValue, newValue) {RoutedEvent = ValueChangedEvent}); + new RoutedPropertyChangedEventArgs(oldValue, newValue) { RoutedEvent = ValueChangedEvent }); public double ValueStart { - get => (double)GetValue(ValueStartProperty); + get => (double) GetValue(ValueStartProperty); set => SetValue(ValueStartProperty, value); } @@ -105,29 +105,29 @@ namespace HandyControl.Controls private static void OnValueEndChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { - var ctrl = (TwoWayRangeBase)d; + var ctrl = (TwoWayRangeBase) d; ctrl.OnValueChanged(new DoubleRange { Start = ctrl.ValueStart, - End = (double)e.OldValue + End = (double) e.OldValue }, new DoubleRange { Start = ctrl.ValueStart, - End = (double)e.NewValue + End = (double) e.NewValue }); } public double ValueEnd { - get => (double)GetValue(ValueEndProperty); + get => (double) GetValue(ValueEndProperty); set => SetValue(ValueEndProperty, value); } internal static object ConstrainToRange(DependencyObject d, object value) { - var ctrl = (TwoWayRangeBase)d; + var ctrl = (TwoWayRangeBase) d; var min = ctrl.Minimum; - var v = (double)value; + var v = (double) value; if (v < min) { return min; @@ -148,7 +148,7 @@ namespace HandyControl.Controls public double LargeChange { - get => (double)GetValue(LargeChangeProperty); + get => (double) GetValue(LargeChangeProperty); set => SetValue(LargeChangeProperty, value); } @@ -158,7 +158,7 @@ namespace HandyControl.Controls public double SmallChange { - get => (double)GetValue(SmallChangeProperty); + get => (double) GetValue(SmallChangeProperty); set => SetValue(SmallChangeProperty, value); } @@ -171,4 +171,4 @@ namespace HandyControl.Controls remove => RemoveHandler(ValueChangedEvent, value); } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Controls/StepBar/StepBar.cs b/src/Shared/HandyControl_Shared/Controls/StepBar/StepBar.cs index e4f7396c..9d4acf2f 100644 --- a/src/Shared/HandyControl_Shared/Controls/StepBar/StepBar.cs +++ b/src/Shared/HandyControl_Shared/Controls/StepBar/StepBar.cs @@ -82,12 +82,12 @@ namespace HandyControl.Controls } public static readonly DependencyProperty StepIndexProperty = DependencyProperty.Register( - "StepIndex", typeof(int), typeof(StepBar), new FrameworkPropertyMetadata(ValueBoxes.Int0Box, + "StepIndex", typeof(int), typeof(StepBar), new FrameworkPropertyMetadata(ValueBoxes.Int0Box, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnStepIndexChanged, CoerceStepIndex)); private static object CoerceStepIndex(DependencyObject d, object basevalue) { - var ctl = (StepBar)d; + var ctl = (StepBar) d; var stepIndex = (int) basevalue; if (ctl.Items.Count == 0 && stepIndex > 0) { @@ -105,7 +105,7 @@ namespace HandyControl.Controls private static void OnStepIndexChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { var ctl = (StepBar) d; - ctl.OnStepIndexChanged((int)e.NewValue); + ctl.OnStepIndexChanged((int) e.NewValue); } private void OnStepIndexChanged(int stepIndex) @@ -129,7 +129,7 @@ namespace HandyControl.Controls if (ItemContainerGenerator.ContainerFromIndex(stepIndex) is StepBarItem stepItemSelected) stepItemSelected.Status = StepStatus.UnderWay; _progressBarBack?.BeginAnimation(RangeBase.ValueProperty, AnimationHelper.CreateAnimation(stepIndex)); - + RaiseEvent(new FunctionEventArgs(StepChangedEvent, this) { Info = stepIndex @@ -138,7 +138,7 @@ namespace HandyControl.Controls public int StepIndex { - get => (int)GetValue(StepIndexProperty); + get => (int) GetValue(StepIndexProperty); set => SetValue(StepIndexProperty, value); } @@ -147,7 +147,7 @@ namespace HandyControl.Controls public Dock Dock { - get => (Dock)GetValue(DockProperty); + get => (Dock) GetValue(DockProperty); set => SetValue(DockProperty, value); } @@ -181,4 +181,4 @@ namespace HandyControl.Controls public void Prev() => StepIndex--; } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Controls/StepBar/StepBarItem.cs b/src/Shared/HandyControl_Shared/Controls/StepBar/StepBarItem.cs index e69a6e6a..14d6e147 100644 --- a/src/Shared/HandyControl_Shared/Controls/StepBar/StepBarItem.cs +++ b/src/Shared/HandyControl_Shared/Controls/StepBar/StepBarItem.cs @@ -39,4 +39,4 @@ namespace HandyControl.Controls internal set => SetValue(StatusProperty, value); } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Controls/TabControl/TabControl.cs b/src/Shared/HandyControl_Shared/Controls/TabControl/TabControl.cs index c50c092a..3df908e4 100644 --- a/src/Shared/HandyControl_Shared/Controls/TabControl/TabControl.cs +++ b/src/Shared/HandyControl_Shared/Controls/TabControl/TabControl.cs @@ -58,7 +58,7 @@ namespace HandyControl.Controls /// public bool IsAnimationEnabled { - get => (bool)GetValue(IsAnimationEnabledProperty); + get => (bool) GetValue(IsAnimationEnabledProperty); set => SetValue(IsAnimationEnabledProperty, ValueBoxes.BooleanBox(value)); } @@ -73,7 +73,7 @@ namespace HandyControl.Controls /// public bool IsDraggable { - get => (bool)GetValue(IsDraggableProperty); + get => (bool) GetValue(IsDraggableProperty); set => SetValue(IsDraggableProperty, ValueBoxes.BooleanBox(value)); } @@ -94,7 +94,7 @@ namespace HandyControl.Controls /// public bool ShowCloseButton { - get => (bool)GetValue(ShowCloseButtonProperty); + get => (bool) GetValue(ShowCloseButtonProperty); set => SetValue(ShowCloseButtonProperty, value); } @@ -115,7 +115,7 @@ namespace HandyControl.Controls /// public bool ShowContextMenu { - get => (bool)GetValue(ShowContextMenuProperty); + get => (bool) GetValue(ShowContextMenuProperty); set => SetValue(ShowContextMenuProperty, value); } @@ -130,7 +130,7 @@ namespace HandyControl.Controls /// public bool IsTabFillEnabled { - get => (bool)GetValue(IsTabFillEnabledProperty); + get => (bool) GetValue(IsTabFillEnabledProperty); set => SetValue(IsTabFillEnabledProperty, ValueBoxes.BooleanBox(value)); } @@ -145,7 +145,7 @@ namespace HandyControl.Controls /// public double TabItemWidth { - get => (double)GetValue(TabItemWidthProperty); + get => (double) GetValue(TabItemWidthProperty); set => SetValue(TabItemWidthProperty, value); } @@ -160,7 +160,7 @@ namespace HandyControl.Controls /// public double TabItemHeight { - get => (double)GetValue(TabItemHeightProperty); + get => (double) GetValue(TabItemHeightProperty); set => SetValue(TabItemHeightProperty, value); } @@ -299,7 +299,7 @@ namespace HandyControl.Controls { if (!IsTabFillEnabled) { - _itemShowCount = (int)(ActualWidth / TabItemWidth); + _itemShowCount = (int) (ActualWidth / TabItemWidth); _buttonOverflow?.Show(ShowOverflowButton && Items.Count > 0 && Items.Count >= _itemShowCount); } } @@ -321,7 +321,7 @@ namespace HandyControl.Controls _buttonOverflow.Menu.Items.Clear(); for (var i = 0; i < Items.Count; i++) { - if(!(ItemContainerGenerator.ContainerFromIndex(i) is TabItem item)) continue; + if (!(ItemContainerGenerator.ContainerFromIndex(i) is TabItem item)) continue; var menuItem = new MenuItem { @@ -429,4 +429,4 @@ namespace HandyControl.Controls protected override DependencyObject GetContainerForItemOverride() => new TabItem(); } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Controls/TabControl/TabItem.cs b/src/Shared/HandyControl_Shared/Controls/TabControl/TabItem.cs index 8ef16a65..d732a5a2 100644 --- a/src/Shared/HandyControl_Shared/Controls/TabControl/TabItem.cs +++ b/src/Shared/HandyControl_Shared/Controls/TabControl/TabItem.cs @@ -140,7 +140,7 @@ namespace HandyControl.Controls /// public bool ShowCloseButton { - get => (bool)GetValue(ShowCloseButtonProperty); + get => (bool) GetValue(ShowCloseButtonProperty); set => SetValue(ShowCloseButtonProperty, value); } @@ -148,7 +148,7 @@ namespace HandyControl.Controls => element.SetValue(ShowCloseButtonProperty, ValueBoxes.BooleanBox(value)); public static bool GetShowCloseButton(DependencyObject element) - => (bool)element.GetValue(ShowCloseButtonProperty); + => (bool) element.GetValue(ShowCloseButtonProperty); /// /// 是否显示上下文菜单 @@ -161,7 +161,7 @@ namespace HandyControl.Controls var ctl = (TabItem) d; if (ctl.Menu != null) { - var show = (bool)e.NewValue; + var show = (bool) e.NewValue; ctl.Menu.IsEnabled = show; ctl.Menu.Show(show); } @@ -180,7 +180,7 @@ namespace HandyControl.Controls => element.SetValue(ShowContextMenuProperty, ValueBoxes.BooleanBox(value)); public static bool GetShowContextMenu(DependencyObject element) - => (bool)element.GetValue(ShowContextMenuProperty); + => (bool) element.GetValue(ShowContextMenuProperty); public static readonly DependencyProperty MenuProperty = DependencyProperty.Register( "Menu", typeof(ContextMenu), typeof(TabItem), new PropertyMetadata(default(ContextMenu), OnMenuChanged)); @@ -283,7 +283,7 @@ namespace HandyControl.Controls TabPanel.SetValue(TabPanel.FluidMoveDurationPropertyKey, parent.IsAnimationEnabled ? new Duration(TimeSpan.FromMilliseconds(200)) : new Duration(TimeSpan.FromMilliseconds(1))); - + parent.IsInternalAction = true; RaiseEvent(new RoutedEventArgs(ClosedEvent, item)); @@ -332,18 +332,18 @@ namespace HandyControl.Controls var subX = TranslatePoint(new Point(), parent).X + _scrollHorizontalOffset; CurrentIndex = CalLocationIndex(subX); - + var p = e.GetPosition(parent); p = new Point(p.X + _scrollHorizontalOffset, p.Y); - + var subLeft = p.X - _dragPoint.X; var totalLeft = p.X - _mouseDownPoint.X; if (Math.Abs(subLeft) <= WaitLength && _isWaiting) return; - + _isWaiting = false; _isDragged = true; - + var left = subLeft + RenderTransform.Value.OffsetX; if (totalLeft < _maxMoveLeft) { @@ -353,7 +353,7 @@ namespace HandyControl.Controls { left = _maxMoveRight + _mouseDownOffsetX; } - + var t = new TranslateTransform(left, 0); RenderTransform = t; _dragPoint = p; @@ -363,9 +363,9 @@ namespace HandyControl.Controls protected override void OnMouseLeftButtonUp(MouseButtonEventArgs e) { base.OnMouseLeftButtonUp(e); - + ReleaseMouseCapture(); - + if (_isDragged) { var parent = TabControlParent; @@ -377,7 +377,7 @@ namespace HandyControl.Controls var offsetX = RenderTransform.Value.OffsetX; CreateAnimation(offsetX, offsetX - subX + left, index); } - + _isDragging = false; ItemIsDragging = false; _isDragged = false; @@ -412,7 +412,7 @@ namespace HandyControl.Controls TabPanel.ForceUpdate = true; TabPanel.Measure(new Size(TabPanel.DesiredSize.Width, ActualHeight)); TabPanel.ForceUpdate = false; - + Focus(); IsSelected = true; @@ -447,10 +447,10 @@ namespace HandyControl.Controls if (_isWaiting) { return CurrentIndex; - } - + } + var maxIndex = TabControlParent.Items.Count - 1; - var div = (int)(left / ItemWidth); + var div = (int) (left / ItemWidth); var rest = left % ItemWidth; var result = rest / ItemWidth > .5 ? div + 1 : div; @@ -473,4 +473,4 @@ namespace HandyControl.Controls remove => RemoveHandler(ClosedEvent, value); } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Controls/TabControl/TabPanel.cs b/src/Shared/HandyControl_Shared/Controls/TabControl/TabPanel.cs index a695649e..38899f48 100644 --- a/src/Shared/HandyControl_Shared/Controls/TabControl/TabPanel.cs +++ b/src/Shared/HandyControl_Shared/Controls/TabControl/TabPanel.cs @@ -37,7 +37,7 @@ namespace HandyControl.Controls /// public Duration FluidMoveDuration { - get => (Duration)GetValue(FluidMoveDurationProperty); + get => (Duration) GetValue(FluidMoveDurationProperty); set => SetValue(FluidMoveDurationProperty, value); } @@ -52,7 +52,7 @@ namespace HandyControl.Controls /// public bool IsTabFillEnabled { - get => (bool)GetValue(IsTabFillEnabledProperty); + get => (bool) GetValue(IsTabFillEnabledProperty); set => SetValue(IsTabFillEnabledProperty, ValueBoxes.BooleanBox(value)); } @@ -67,7 +67,7 @@ namespace HandyControl.Controls /// public double TabItemWidth { - get => (double)GetValue(TabItemWidthProperty); + get => (double) GetValue(TabItemWidthProperty); set => SetValue(TabItemWidthProperty, value); } @@ -82,7 +82,7 @@ namespace HandyControl.Controls /// public double TabItemHeight { - get => (double)GetValue(TabItemHeightProperty); + get => (double) GetValue(TabItemHeightProperty); set => SetValue(TabItemHeightProperty, value); } @@ -127,7 +127,7 @@ namespace HandyControl.Controls { if (TemplatedParent is TabControl tabControl) { - arr = ArithmeticHelper.DivideInt2Arr((int)tabControl.ActualWidth + InternalChildren.Count, count); + arr = ArithmeticHelper.DivideInt2Arr((int) tabControl.ActualWidth + InternalChildren.Count, count); } } @@ -176,4 +176,4 @@ namespace HandyControl.Controls }; } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Controls/Tag/Tag.cs b/src/Shared/HandyControl_Shared/Controls/Tag/Tag.cs index 6e175a63..441ee698 100644 --- a/src/Shared/HandyControl_Shared/Controls/Tag/Tag.cs +++ b/src/Shared/HandyControl_Shared/Controls/Tag/Tag.cs @@ -58,7 +58,7 @@ namespace HandyControl.Controls private static void OnHeaderChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { - var ctrl = (Tag)d; + var ctrl = (Tag) d; ctrl.SetValue(HasHeaderPropertyKey, e.NewValue != null ? ValueBoxes.TrueBox : ValueBoxes.FalseBox); ctrl.OnHeaderChanged(e.OldValue, e.NewValue); @@ -145,4 +145,4 @@ namespace HandyControl.Controls } } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Controls/Tag/TagContainer.cs b/src/Shared/HandyControl_Shared/Controls/Tag/TagContainer.cs index f79d1488..13aaef92 100644 --- a/src/Shared/HandyControl_Shared/Controls/Tag/TagContainer.cs +++ b/src/Shared/HandyControl_Shared/Controls/Tag/TagContainer.cs @@ -50,4 +50,4 @@ namespace HandyControl.Controls protected override bool IsItemItsOwnContainerOverride(object item) => item is Tag; } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Controls/Text/OutlineText.cs b/src/Shared/HandyControl_Shared/Controls/Text/OutlineText.cs index 37815e53..722a0235 100644 --- a/src/Shared/HandyControl_Shared/Controls/Text/OutlineText.cs +++ b/src/Shared/HandyControl_Shared/Controls/Text/OutlineText.cs @@ -108,7 +108,7 @@ namespace HandyControl.Controls public FontFamily FontFamily { - get => (FontFamily)GetValue(FontFamilyProperty); + get => (FontFamily) GetValue(FontFamilyProperty); set => SetValue(FontFamilyProperty, value); } @@ -119,7 +119,7 @@ namespace HandyControl.Controls [TypeConverter(typeof(FontSizeConverter))] public double FontSize { - get => (double)GetValue(FontSizeProperty); + get => (double) GetValue(FontSizeProperty); set => SetValue(FontSizeProperty, value); } @@ -129,7 +129,7 @@ namespace HandyControl.Controls public FontStretch FontStretch { - get => (FontStretch)GetValue(FontStretchProperty); + get => (FontStretch) GetValue(FontStretchProperty); set => SetValue(FontStretchProperty, value); } @@ -139,7 +139,7 @@ namespace HandyControl.Controls public FontStyle FontStyle { - get => (FontStyle)GetValue(FontStyleProperty); + get => (FontStyle) GetValue(FontStyleProperty); set => SetValue(FontStyleProperty, value); } @@ -149,7 +149,7 @@ namespace HandyControl.Controls public FontWeight FontWeight { - get => (FontWeight)GetValue(FontWeightProperty); + get => (FontWeight) GetValue(FontWeightProperty); set => SetValue(FontWeightProperty, value); } @@ -219,7 +219,7 @@ namespace HandyControl.Controls Text, CultureInfo.CurrentUICulture, FlowDirection, - new Typeface(FontFamily, FontStyle, FontWeight, FontStretch), + new Typeface(FontFamily, FontStyle, FontWeight, FontStretch), FontSize, Fill, dpi); #endif @@ -264,7 +264,7 @@ namespace HandyControl.Controls private static void OnFormattedTextUpdated(DependencyObject d, DependencyPropertyChangedEventArgs e) { - var outlinedTextBlock = (OutlineText)d; + var outlinedTextBlock = (OutlineText) d; outlinedTextBlock.UpdateFormattedText(); outlinedTextBlock._textGeometry = null; @@ -274,7 +274,7 @@ namespace HandyControl.Controls private static void OnFormattedTextInvalidated(DependencyObject d, DependencyPropertyChangedEventArgs e) { - var outlinedTextBlock = (OutlineText)d; + var outlinedTextBlock = (OutlineText) d; outlinedTextBlock._formattedText = null; outlinedTextBlock._textGeometry = null; @@ -298,4 +298,4 @@ namespace HandyControl.Controls return new Size(_formattedText.Width, _formattedText.Height); } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Controls/Text/SimpleText.cs b/src/Shared/HandyControl_Shared/Controls/Text/SimpleText.cs index 7224cedd..60c72f38 100644 --- a/src/Shared/HandyControl_Shared/Controls/Text/SimpleText.cs +++ b/src/Shared/HandyControl_Shared/Controls/Text/SimpleText.cs @@ -26,7 +26,7 @@ namespace HandyControl.Controls public string Text { - get => (string)GetValue(TextProperty); + get => (string) GetValue(TextProperty); set => SetValue(TextProperty, value); } @@ -36,7 +36,7 @@ namespace HandyControl.Controls public TextAlignment TextAlignment { - get => (TextAlignment)GetValue(TextAlignmentProperty); + get => (TextAlignment) GetValue(TextAlignmentProperty); set => SetValue(TextAlignmentProperty, value); } @@ -46,7 +46,7 @@ namespace HandyControl.Controls public TextTrimming TextTrimming { - get => (TextTrimming)GetValue(TextTrimmingProperty); + get => (TextTrimming) GetValue(TextTrimmingProperty); set => SetValue(TextTrimmingProperty, value); } @@ -56,7 +56,7 @@ namespace HandyControl.Controls public TextWrapping TextWrapping { - get => (TextWrapping)GetValue(TextWrappingProperty); + get => (TextWrapping) GetValue(TextWrappingProperty); set => SetValue(TextWrappingProperty, value); } @@ -75,7 +75,7 @@ namespace HandyControl.Controls public FontFamily FontFamily { - get => (FontFamily)GetValue(FontFamilyProperty); + get => (FontFamily) GetValue(FontFamilyProperty); set => SetValue(FontFamilyProperty, value); } @@ -86,7 +86,7 @@ namespace HandyControl.Controls [TypeConverter(typeof(FontSizeConverter))] public double FontSize { - get => (double)GetValue(FontSizeProperty); + get => (double) GetValue(FontSizeProperty); set => SetValue(FontSizeProperty, value); } @@ -96,7 +96,7 @@ namespace HandyControl.Controls public FontStretch FontStretch { - get => (FontStretch)GetValue(FontStretchProperty); + get => (FontStretch) GetValue(FontStretchProperty); set => SetValue(FontStretchProperty, value); } @@ -106,7 +106,7 @@ namespace HandyControl.Controls public FontStyle FontStyle { - get => (FontStyle)GetValue(FontStyleProperty); + get => (FontStyle) GetValue(FontStyleProperty); set => SetValue(FontStyleProperty, value); } @@ -116,7 +116,7 @@ namespace HandyControl.Controls public FontWeight FontWeight { - get => (FontWeight)GetValue(FontWeightProperty); + get => (FontWeight) GetValue(FontWeightProperty); set => SetValue(FontWeightProperty, value); } @@ -175,7 +175,7 @@ namespace HandyControl.Controls private static void OnFormattedTextUpdated(DependencyObject d, DependencyPropertyChangedEventArgs e) { - var outlinedTextBlock = (SimpleText)d; + var outlinedTextBlock = (SimpleText) d; outlinedTextBlock.UpdateFormattedText(); outlinedTextBlock.InvalidateMeasure(); @@ -184,7 +184,7 @@ namespace HandyControl.Controls private static void OnFormattedTextInvalidated(DependencyObject d, DependencyPropertyChangedEventArgs e) { - var outlinedTextBlock = (SimpleText)d; + var outlinedTextBlock = (SimpleText) d; outlinedTextBlock._formattedText = null; outlinedTextBlock.InvalidateMeasure(); @@ -201,4 +201,4 @@ namespace HandyControl.Controls return new Size(_formattedText.Width, _formattedText.Height); } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Controls/Time/CalendarWithClock.cs b/src/Shared/HandyControl_Shared/Controls/Time/CalendarWithClock.cs index 27b79b58..8a5dc7a3 100644 --- a/src/Shared/HandyControl_Shared/Controls/Time/CalendarWithClock.cs +++ b/src/Shared/HandyControl_Shared/Controls/Time/CalendarWithClock.cs @@ -77,7 +77,7 @@ namespace HandyControl.Controls public string DateTimeFormat { - get => (string)GetValue(DateTimeFormatProperty); + get => (string) GetValue(DateTimeFormatProperty); set => SetValue(DateTimeFormatProperty, value); } @@ -86,7 +86,7 @@ namespace HandyControl.Controls public bool ShowConfirmButton { - get => (bool)GetValue(ShowConfirmButtonProperty); + get => (bool) GetValue(ShowConfirmButtonProperty); set => SetValue(ShowConfirmButtonProperty, ValueBoxes.BooleanBox(value)); } @@ -95,8 +95,8 @@ namespace HandyControl.Controls private static void OnSelectedDateTimeChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { - var ctl = (CalendarWithClock)d; - var v = (DateTime?)e.NewValue; + var ctl = (CalendarWithClock) d; + var v = (DateTime?) e.NewValue; ctl.OnSelectedDateTimeChanged(new FunctionEventArgs(SelectedDateTimeChangedEvent, ctl) { Info = v @@ -105,7 +105,7 @@ namespace HandyControl.Controls public DateTime? SelectedDateTime { - get => (DateTime?)GetValue(SelectedDateTimeProperty); + get => (DateTime?) GetValue(SelectedDateTimeProperty); set => SetValue(SelectedDateTimeProperty, value); } @@ -114,9 +114,9 @@ namespace HandyControl.Controls private static void OnDisplayDateTimeChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { - var ctl = (CalendarWithClock)d; + var ctl = (CalendarWithClock) d; if (ctl.IsHandlerSuspended(DisplayDateTimeProperty)) return; - var v = (DateTime)e.NewValue; + var v = (DateTime) e.NewValue; ctl._clock.SelectedTime = v; ctl._calendar.SelectedDate = v; ctl.OnDisplayDateTimeChanged(new FunctionEventArgs(v)); @@ -124,7 +124,7 @@ namespace HandyControl.Controls public DateTime DisplayDateTime { - get => (DateTime)GetValue(DisplayDateTimeProperty); + get => (DateTime) GetValue(DisplayDateTimeProperty); set => SetValue(DisplayDateTimeProperty, value); } @@ -257,4 +257,4 @@ namespace HandyControl.Controls #endregion } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Controls/Time/Clock/Clock.cs b/src/Shared/HandyControl_Shared/Controls/Time/Clock/Clock.cs index 7c0dead1..260aa6d2 100644 --- a/src/Shared/HandyControl_Shared/Controls/Time/Clock/Clock.cs +++ b/src/Shared/HandyControl_Shared/Controls/Time/Clock/Clock.cs @@ -203,7 +203,7 @@ namespace HandyControl.Controls private void Canvas_OnMouseWheel(object sender, MouseWheelEventArgs e) { - var value = (int)_rotateTransformClock.Angle; + var value = (int) _rotateTransformClock.Angle; if (e.Delta < 0) { value += 6; @@ -297,7 +297,7 @@ namespace HandyControl.Controls var hRest = h % 12; if (hRest == 0) hRest = 12; - var ctl = _radioButtonList[hRest-1]; + var ctl = _radioButtonList[hRest - 1]; ctl.IsChecked = true; ctl.RaiseEvent(new RoutedEventArgs { RoutedEvent = ButtonBase.ClickEvent }); @@ -322,7 +322,7 @@ namespace HandyControl.Controls hValue = 0; } var now = DateTime.Now; - return new DateTime(now.Year, now.Month, now.Day, hValue, (int)Math.Abs(_rotateTransformClock.Angle) % 360 / 6, _secValue); + return new DateTime(now.Year, now.Month, now.Day, hValue, (int) Math.Abs(_rotateTransformClock.Angle) % 360 / 6, _secValue); } private void ButtonAm_OnClick(object sender, RoutedEventArgs e) => Update(); @@ -331,4 +331,4 @@ namespace HandyControl.Controls #endregion Private Methods } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Controls/Time/Clock/ClockBase.cs b/src/Shared/HandyControl_Shared/Controls/Time/Clock/ClockBase.cs index d524d12c..d30a02f4 100644 --- a/src/Shared/HandyControl_Shared/Controls/Time/Clock/ClockBase.cs +++ b/src/Shared/HandyControl_Shared/Controls/Time/Clock/ClockBase.cs @@ -33,7 +33,7 @@ namespace HandyControl.Controls public string TimeFormat { - get => (string)GetValue(TimeFormatProperty); + get => (string) GetValue(TimeFormatProperty); set => SetValue(TimeFormatProperty, value); } @@ -42,8 +42,8 @@ namespace HandyControl.Controls private static void OnSelectedTimeChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { - var ctl = (ClockBase)d; - var v = (DateTime?)e.NewValue; + var ctl = (ClockBase) d; + var v = (DateTime?) e.NewValue; ctl.DisplayTime = v ?? DateTime.Now; ctl.OnSelectedTimeChanged(new FunctionEventArgs(SelectedTimeChangedEvent, ctl) { @@ -64,15 +64,15 @@ namespace HandyControl.Controls private static void OnDisplayTimeChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { - var ctl = (ClockBase)d; - var v = (DateTime)e.NewValue; + var ctl = (ClockBase) d; + var v = (DateTime) e.NewValue; ctl.Update(v); ctl.OnDisplayTimeChanged(new FunctionEventArgs(v)); } public DateTime DisplayTime { - get => (DateTime)GetValue(DisplayTimeProperty); + get => (DateTime) GetValue(DisplayTimeProperty); set => SetValue(DisplayTimeProperty, value); } @@ -103,4 +103,4 @@ namespace HandyControl.Controls protected void Clock_SelectedTimeChanged(object sender, FunctionEventArgs e) => SelectedTime = e.Info; } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Controls/Time/Clock/ClockRadioButton.cs b/src/Shared/HandyControl_Shared/Controls/Time/Clock/ClockRadioButton.cs index 6c14245a..5242c3cf 100644 --- a/src/Shared/HandyControl_Shared/Controls/Time/Clock/ClockRadioButton.cs +++ b/src/Shared/HandyControl_Shared/Controls/Time/Clock/ClockRadioButton.cs @@ -7,4 +7,4 @@ namespace HandyControl.Controls { public int Num { get; set; } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Controls/Time/Clock/ListClock.cs b/src/Shared/HandyControl_Shared/Controls/Time/Clock/ListClock.cs index dc739dda..51979109 100644 --- a/src/Shared/HandyControl_Shared/Controls/Time/Clock/ListClock.cs +++ b/src/Shared/HandyControl_Shared/Controls/Time/Clock/ListClock.cs @@ -145,4 +145,4 @@ namespace HandyControl.Controls DisplayTime = time; } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Controls/Time/FlipClock/FlipClock.cs b/src/Shared/HandyControl_Shared/Controls/Time/FlipClock/FlipClock.cs index d7d1fc0d..28be2cfa 100644 --- a/src/Shared/HandyControl_Shared/Controls/Time/FlipClock/FlipClock.cs +++ b/src/Shared/HandyControl_Shared/Controls/Time/FlipClock/FlipClock.cs @@ -13,7 +13,7 @@ namespace HandyControl.Controls private bool _isDisposed; public static readonly DependencyProperty NumberListProperty = DependencyProperty.Register( - "NumberList", typeof(List), typeof(FlipClock), new PropertyMetadata(new List {0, 0, 0, 0, 0, 0})); + "NumberList", typeof(List), typeof(FlipClock), new PropertyMetadata(new List { 0, 0, 0, 0, 0, 0 })); public List NumberList { @@ -85,4 +85,4 @@ namespace HandyControl.Controls private void DispatcherTimer_Tick(object sender, EventArgs e) => DisplayTime = DateTime.Now; } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Controls/Time/FlipClock/FlipNumber.cs b/src/Shared/HandyControl_Shared/Controls/Time/FlipClock/FlipNumber.cs index 9a4cf8e6..4d3c6214 100644 --- a/src/Shared/HandyControl_Shared/Controls/Time/FlipClock/FlipNumber.cs +++ b/src/Shared/HandyControl_Shared/Controls/Time/FlipClock/FlipNumber.cs @@ -40,7 +40,7 @@ namespace HandyControl.Controls public CornerRadius CornerRadius { - get => (CornerRadius)GetValue(CornerRadiusProperty); + get => (CornerRadius) GetValue(CornerRadiusProperty); set => SetValue(CornerRadiusProperty, value); } @@ -49,7 +49,7 @@ namespace HandyControl.Controls public Brush Background { - get => (Brush)GetValue(BackgroundProperty); + get => (Brush) GetValue(BackgroundProperty); set => SetValue(BackgroundProperty, value); } @@ -58,7 +58,7 @@ namespace HandyControl.Controls public Brush Foreground { - get => (Brush)GetValue(ForegroundProperty); + get => (Brush) GetValue(ForegroundProperty); set => SetValue(ForegroundProperty, value); } @@ -68,7 +68,7 @@ namespace HandyControl.Controls [TypeConverter(typeof(FontSizeConverter))] public double FontSize { - get => (double)GetValue(FontSizeProperty); + get => (double) GetValue(FontSizeProperty); set => SetValue(FontSizeProperty, value); } @@ -76,11 +76,11 @@ namespace HandyControl.Controls "Number", typeof(int), typeof(FlipNumber), new PropertyMetadata(ValueBoxes.Int0Box, OnNumberChanged)); private static void OnNumberChanged(DependencyObject s, DependencyPropertyChangedEventArgs e) => - ((FlipNumber)s).OnNumberChanged(); + ((FlipNumber) s).OnNumberChanged(); public int Number { - get => (int)GetValue(NumberProperty); + get => (int) GetValue(NumberProperty); set => SetValue(NumberProperty, value); } @@ -281,4 +281,4 @@ namespace HandyControl.Controls return child; } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Controls/Time/TimeBar/SpeTextBlock.cs b/src/Shared/HandyControl_Shared/Controls/Time/TimeBar/SpeTextBlock.cs index 2dbf5b65..97810796 100644 --- a/src/Shared/HandyControl_Shared/Controls/Time/TimeBar/SpeTextBlock.cs +++ b/src/Shared/HandyControl_Shared/Controls/Time/TimeBar/SpeTextBlock.cs @@ -48,4 +48,4 @@ namespace HandyControl.Controls /// public void MoveX(double offsetX) => Canvas.SetLeft(this, X + offsetX); } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Controls/Time/TimeBar/TimeBar.cs b/src/Shared/HandyControl_Shared/Controls/Time/TimeBar/TimeBar.cs index 4c0e412a..9567d410 100644 --- a/src/Shared/HandyControl_Shared/Controls/Time/TimeBar/TimeBar.cs +++ b/src/Shared/HandyControl_Shared/Controls/Time/TimeBar/TimeBar.cs @@ -78,7 +78,7 @@ namespace HandyControl.Controls /// public bool ShowSpeStr { - get => (bool)GetValue(ShowSpeStrProperty); + get => (bool) GetValue(ShowSpeStrProperty); set => SetValue(ShowSpeStrProperty, ValueBoxes.BooleanBox(value)); } @@ -102,7 +102,7 @@ namespace HandyControl.Controls /// internal string SpeStr { - get => (string)GetValue(SpeStrProperty); + get => (string) GetValue(SpeStrProperty); set => SetValue(SpeStrProperty, value); } @@ -116,7 +116,7 @@ namespace HandyControl.Controls { if (d is TimeBar timeBar && timeBar._textBlockSelected != null) { - timeBar.OnSelectedTimeChanged((DateTime)e.NewValue); + timeBar.OnSelectedTimeChanged((DateTime) e.NewValue); } } @@ -125,7 +125,7 @@ namespace HandyControl.Controls /// public DateTime SelectedTime { - get => (DateTime)GetValue(SelectedTimeProperty); + get => (DateTime) GetValue(SelectedTimeProperty); set => SetValue(SelectedTimeProperty, value); } @@ -237,7 +237,7 @@ namespace HandyControl.Controls _dateTimeRanges.Add(item); } } - else if(e.Action == NotifyCollectionChangedAction.Remove) + else if (e.Action == NotifyCollectionChangedAction.Remove) { foreach (DateTimeRange item in e.OldItems) { @@ -300,7 +300,7 @@ namespace HandyControl.Controls private void CheckNull() { - if (_borderTop == null || _textBlockMove == null|| _textBlockSelected == null || _canvasSpe == null) throw new Exception(); + if (_borderTop == null || _textBlockMove == null || _textBlockSelected == null || _canvasSpe == null) throw new Exception(); } /// @@ -474,10 +474,10 @@ namespace HandyControl.Controls private void Update() { if (_canvasSpe == null) return; - + _speBlockList.Clear(); _canvasSpe.Children.Clear(); - _speCount = (int)(ActualWidth / 800 * 9) | 1; + _speCount = (int) (ActualWidth / 800 * 9) | 1; var itemWidthOld = _itemWidth; _itemWidth = ActualWidth / _speCount; @@ -505,7 +505,7 @@ namespace HandyControl.Controls { SetSpeTimeFormat("HH:mm:ss"); } - + ShowSpeStr = ActualWidth > 320; for (var i = 0; i < _speCount; i++) { @@ -580,7 +580,7 @@ namespace HandyControl.Controls var set = _dateTimeRanges.GetViewBetween(new DateTimeRange(start), new DateTimeRange(end)); var unitLength = ActualWidth / mlliseconds * 0.5; - + foreach (var range in set) { var width = range.TotalMilliseconds * unitLength; @@ -597,4 +597,4 @@ namespace HandyControl.Controls } } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Controls/Transfer/Transfer.cs b/src/Shared/HandyControl_Shared/Controls/Transfer/Transfer.cs index 75354351..2da727e1 100644 --- a/src/Shared/HandyControl_Shared/Controls/Transfer/Transfer.cs +++ b/src/Shared/HandyControl_Shared/Controls/Transfer/Transfer.cs @@ -57,7 +57,7 @@ namespace HandyControl.Controls public IList SelectedItems { - get => (IList)GetValue(SelectedItemsProperty); + get => (IList) GetValue(SelectedItemsProperty); set => SetValue(SelectedItemsProperty, value); } @@ -286,4 +286,4 @@ namespace HandyControl.Controls } } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Controls/Transfer/TransferGroup.cs b/src/Shared/HandyControl_Shared/Controls/Transfer/TransferGroup.cs index 4455d7d6..39f14780 100644 --- a/src/Shared/HandyControl_Shared/Controls/Transfer/TransferGroup.cs +++ b/src/Shared/HandyControl_Shared/Controls/Transfer/TransferGroup.cs @@ -62,4 +62,4 @@ namespace HandyControl.Controls } } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Controls/Transfer/TransferItem.cs b/src/Shared/HandyControl_Shared/Controls/Transfer/TransferItem.cs index b7e623fc..c5bf5557 100644 --- a/src/Shared/HandyControl_Shared/Controls/Transfer/TransferItem.cs +++ b/src/Shared/HandyControl_Shared/Controls/Transfer/TransferItem.cs @@ -23,4 +23,4 @@ namespace HandyControl.Controls internal set => SetValue(IsOriginProperty, ValueBoxes.BooleanBox(value)); } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Controls/Window/BlurWindow.cs b/src/Shared/HandyControl_Shared/Controls/Window/BlurWindow.cs index 451bf379..9db557f3 100644 --- a/src/Shared/HandyControl_Shared/Controls/Window/BlurWindow.cs +++ b/src/Shared/HandyControl_Shared/Controls/Window/BlurWindow.cs @@ -13,13 +13,13 @@ namespace HandyControl.Controls base.OnApplyTemplate(); EnableBlur(this); } - + private static SystemVersionInfo GetSystemVersionInfo() { var osv = new InteropValues.RTL_OSVERSIONINFOEX(); - osv.dwOSVersionInfoSize = (uint)Marshal.SizeOf(osv); + osv.dwOSVersionInfoSize = (uint) Marshal.SizeOf(osv); InteropMethods.Gdip.RtlGetVersion(out osv); - return new SystemVersionInfo((int)osv.dwMajorVersion, (int)osv.dwMinorVersion, (int)osv.dwBuildNumber); + return new SystemVersionInfo((int) osv.dwMajorVersion, (int) osv.dwMinorVersion, (int) osv.dwBuildNumber); } internal static void EnableBlur(Window window) @@ -61,4 +61,4 @@ namespace HandyControl.Controls Marshal.FreeHGlobal(accentPtr); } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Controls/Window/GlowWindow.cs b/src/Shared/HandyControl_Shared/Controls/Window/GlowWindow.cs index e01890b8..17d81a5c 100644 --- a/src/Shared/HandyControl_Shared/Controls/Window/GlowWindow.cs +++ b/src/Shared/HandyControl_Shared/Controls/Window/GlowWindow.cs @@ -35,7 +35,7 @@ namespace HandyControl.Controls public Color ActiveGlowColor { - get => (Color)GetValue(ActiveGlowColorProperty); + get => (Color) GetValue(ActiveGlowColorProperty); set => SetValue(ActiveGlowColorProperty, value); } @@ -44,7 +44,7 @@ namespace HandyControl.Controls public Color InactiveGlowColor { - get => (Color)GetValue(InactiveGlowColorProperty); + get => (Color) GetValue(InactiveGlowColorProperty); set => SetValue(InactiveGlowColorProperty, value); } @@ -195,7 +195,7 @@ namespace HandyControl.Controls private GlowEdge GetOrCreateGlowWindow(int direction) { - return _glowEdges[direction] ?? (_glowEdges[direction] = new GlowEdge(this, (Dock)direction) + return _glowEdges[direction] ?? (_glowEdges[direction] = new GlowEdge(this, (Dock) direction) { ActiveGlowColor = ActiveGlowColor, InactiveGlowColor = InactiveGlowColor, @@ -205,11 +205,11 @@ namespace HandyControl.Controls private static void OnResizeModeChanged(DependencyObject obj, DependencyPropertyChangedEventArgs e) { - var customChromeWindow = (GlowWindow)obj; + var customChromeWindow = (GlowWindow) obj; customChromeWindow.UpdateGlowVisibility(false); } - private static void OnGlowColorChanged(DependencyObject obj, DependencyPropertyChangedEventArgs args) => ((GlowWindow)obj).UpdateGlowColors(); + private static void OnGlowColorChanged(DependencyObject obj, DependencyPropertyChangedEventArgs args) => ((GlowWindow) obj).UpdateGlowColors(); private void UpdateGlowColors() { @@ -303,7 +303,7 @@ namespace HandyControl.Controls private void WmWindowPosChanging(IntPtr lParam) { - var windowpos = (InteropValues.WINDOWPOS)Marshal.PtrToStructure(lParam, typeof(InteropValues.WINDOWPOS)); + var windowpos = (InteropValues.WINDOWPOS) Marshal.PtrToStructure(lParam, typeof(InteropValues.WINDOWPOS)); if ((windowpos.flags & 2u) == 0u && (windowpos.flags & 1u) == 0u && windowpos.cx > 0 && windowpos.cy > 0) { var rect = new Rect(windowpos.x, windowpos.y, windowpos.cx, windowpos.cy); @@ -317,8 +317,8 @@ namespace HandyControl.Controls var logicalRect = GetOnScreenPosition(rect); logicalRect = logicalRect.LogicalToDeviceUnits(); - windowpos.x = (int)logicalRect.X; - windowpos.y = (int)logicalRect.Y; + windowpos.x = (int) logicalRect.X; + windowpos.y = (int) logicalRect.Y; Marshal.StructureToPtr(windowpos, lParam, true); } } @@ -364,7 +364,7 @@ namespace HandyControl.Controls { try { - var windowpos = (InteropValues.WINDOWPOS)Marshal.PtrToStructure(lParam, typeof(InteropValues.WINDOWPOS)); + var windowpos = (InteropValues.WINDOWPOS) Marshal.PtrToStructure(lParam, typeof(InteropValues.WINDOWPOS)); UpdateGlowWindowPositions((windowpos.flags & 64u) == 0u); UpdateZOrderOfThisAndOwner(); @@ -399,7 +399,7 @@ namespace HandyControl.Controls { var hMonitor = InteropMethods.MonitorFromWindow(hWnd, 2); var result = default(InteropValues.MONITORINFO); - result.cbSize = (uint)Marshal.SizeOf(typeof(InteropValues.MONITORINFO)); + result.cbSize = (uint) Marshal.SizeOf(typeof(InteropValues.MONITORINFO)); InteropMethods.GetMonitorInfo(hMonitor, ref result); return result; } @@ -417,7 +417,7 @@ namespace HandyControl.Controls private void WmSysCommand(IntPtr hWnd, IntPtr wParam) { var num = InteropMethods.GET_SC_WPARAM(wParam); - + if (num == InteropValues.SC_MOVE) { InteropMethods.RedrawWindow(hWnd, IntPtr.Zero, IntPtr.Zero, @@ -430,13 +430,13 @@ namespace HandyControl.Controls { _logicalSizeForRestore = new Rect(Left, Top, Width, Height); } - + if (num == InteropValues.SC_MOVE && WindowState == WindowState.Maximized && _logicalSizeForRestore == Rect.Empty) { _logicalSizeForRestore = new Rect(Left, Top, Width, Height); } - - if (num == InteropValues.SC_RESTORE && WindowState != WindowState.Minimized && + + if (num == InteropValues.SC_RESTORE && WindowState != WindowState.Minimized && _logicalSizeForRestore.Width > 0.0 && _logicalSizeForRestore.Height > 0.0) { Left = _logicalSizeForRestore.Left; @@ -463,4 +463,4 @@ namespace HandyControl.Controls #endregion } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Controls/Window/ImageBrowser.cs b/src/Shared/HandyControl_Shared/Controls/Window/ImageBrowser.cs index cfcc61ac..bd8b9d79 100644 --- a/src/Shared/HandyControl_Shared/Controls/Window/ImageBrowser.cs +++ b/src/Shared/HandyControl_Shared/Controls/Window/ImageBrowser.cs @@ -35,7 +35,7 @@ namespace HandyControl.Controls static ImageBrowser() { IsFullScreenProperty.AddOwner(typeof(ImageBrowser), new PropertyMetadata(ValueBoxes.FalseBox)); - } + } public ImageBrowser() { @@ -127,4 +127,4 @@ namespace HandyControl.Controls } } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Controls/Window/MessageBox.cs b/src/Shared/HandyControl_Shared/Controls/Window/MessageBox.cs index 43ddf4ea..8300f7d6 100644 --- a/src/Shared/HandyControl_Shared/Controls/Window/MessageBox.cs +++ b/src/Shared/HandyControl_Shared/Controls/Window/MessageBox.cs @@ -55,7 +55,7 @@ namespace HandyControl.Controls public string Message { - get => (string)GetValue(MessageProperty); + get => (string) GetValue(MessageProperty); set => SetValue(MessageProperty, value); } @@ -64,7 +64,7 @@ namespace HandyControl.Controls public Geometry Image { - get => (Geometry)GetValue(ImageProperty); + get => (Geometry) GetValue(ImageProperty); set => SetValue(ImageProperty, value); } @@ -73,7 +73,7 @@ namespace HandyControl.Controls public Brush ImageBrush { - get => (Brush)GetValue(ImageBrushProperty); + get => (Brush) GetValue(ImageBrushProperty); set => SetValue(ImageBrushProperty, value); } @@ -82,7 +82,7 @@ namespace HandyControl.Controls public bool ShowImage { - get => (bool)GetValue(ShowImageProperty); + get => (bool) GetValue(ShowImageProperty); set => SetValue(ShowImageProperty, ValueBoxes.BooleanBox(value)); } @@ -133,7 +133,7 @@ namespace HandyControl.Controls { base.OnApplyTemplate(); - _panel = GetTemplateChild(ElementPanel) as Panel; + _panel = GetTemplateChild(ElementPanel) as Panel; if (_panel != null) { if (_buttonOk != null) @@ -419,15 +419,15 @@ namespace HandyControl.Controls { if (!IsValidMessageBoxButton(button)) { - throw new InvalidEnumArgumentException(nameof(button), (int)button, typeof(MessageBoxButton)); + throw new InvalidEnumArgumentException(nameof(button), (int) button, typeof(MessageBoxButton)); } if (!IsValidMessageBoxImage(icon)) { - throw new InvalidEnumArgumentException(nameof(icon), (int)icon, typeof(MessageBoxImage)); + throw new InvalidEnumArgumentException(nameof(icon), (int) icon, typeof(MessageBoxImage)); } if (!IsValidMessageBoxResult(defaultResult)) { - throw new InvalidEnumArgumentException(nameof(defaultResult), (int)defaultResult, typeof(MessageBoxResult)); + throw new InvalidEnumArgumentException(nameof(defaultResult), (int) defaultResult, typeof(MessageBoxResult)); } var ownerWindow = owner ?? WindowHelper.GetActiveWindow(); @@ -630,4 +630,4 @@ namespace HandyControl.Controls || value == MessageBoxResult.Yes; } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Controls/Window/PopupWindow.cs b/src/Shared/HandyControl_Shared/Controls/Window/PopupWindow.cs index b3e3f7bf..9306c45b 100644 --- a/src/Shared/HandyControl_Shared/Controls/Window/PopupWindow.cs +++ b/src/Shared/HandyControl_Shared/Controls/Window/PopupWindow.cs @@ -117,7 +117,7 @@ namespace HandyControl.Controls public bool ShowCancel { - get => (bool)GetValue(ShowCancelProperty); + get => (bool) GetValue(ShowCancelProperty); set => SetValue(ShowCancelProperty, ValueBoxes.BooleanBox(value)); } @@ -232,4 +232,4 @@ namespace HandyControl.Controls PopupElement = null; } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Controls/Window/Window.cs b/src/Shared/HandyControl_Shared/Controls/Window/Window.cs index 4447445c..3ec97f16 100644 --- a/src/Shared/HandyControl_Shared/Controls/Window/Window.cs +++ b/src/Shared/HandyControl_Shared/Controls/Window/Window.cs @@ -128,7 +128,7 @@ namespace HandyControl.Controls private void WmGetMinMaxInfo(IntPtr hwnd, IntPtr lParam) { - var mmi = (InteropValues.MINMAXINFO)Marshal.PtrToStructure(lParam, typeof(InteropValues.MINMAXINFO)); + var mmi = (InteropValues.MINMAXINFO) Marshal.PtrToStructure(lParam, typeof(InteropValues.MINMAXINFO)); var monitor = InteropMethods.MonitorFromWindow(hwnd, InteropValues.MONITOR_DEFAULTTONEAREST); if (monitor != IntPtr.Zero && mmi != null) @@ -138,7 +138,7 @@ namespace HandyControl.Controls if (autoHide) { var monitorInfo = default(InteropValues.MONITORINFO); - monitorInfo.cbSize = (uint)Marshal.SizeOf(typeof(InteropValues.MONITORINFO)); + monitorInfo.cbSize = (uint) Marshal.SizeOf(typeof(InteropValues.MONITORINFO)); InteropMethods.GetMonitorInfo(monitor, ref monitorInfo); var rcWorkArea = monitorInfo.rcWork; var rcMonitorArea = monitorInfo.rcMonitor; @@ -177,37 +177,37 @@ namespace HandyControl.Controls public Brush CloseButtonBackground { - get => (Brush)GetValue(CloseButtonBackgroundProperty); + get => (Brush) GetValue(CloseButtonBackgroundProperty); set => SetValue(CloseButtonBackgroundProperty, value); } public Brush CloseButtonForeground { - get => (Brush)GetValue(CloseButtonForegroundProperty); + get => (Brush) GetValue(CloseButtonForegroundProperty); set => SetValue(CloseButtonForegroundProperty, value); } public Brush OtherButtonBackground { - get => (Brush)GetValue(OtherButtonBackgroundProperty); + get => (Brush) GetValue(OtherButtonBackgroundProperty); set => SetValue(OtherButtonBackgroundProperty, value); } public Brush OtherButtonForeground { - get => (Brush)GetValue(OtherButtonForegroundProperty); + get => (Brush) GetValue(OtherButtonForegroundProperty); set => SetValue(OtherButtonForegroundProperty, value); } public double NonClientAreaHeight { - get => (double)GetValue(NonClientAreaHeightProperty); + get => (double) GetValue(NonClientAreaHeightProperty); set => SetValue(NonClientAreaHeightProperty, value); } public bool IsFullScreen { - get => (bool)GetValue(IsFullScreenProperty); + get => (bool) GetValue(IsFullScreenProperty); set => SetValue(IsFullScreenProperty, ValueBoxes.BooleanBox(value)); } @@ -219,56 +219,56 @@ namespace HandyControl.Controls public Brush CloseButtonHoverBackground { - get => (Brush)GetValue(CloseButtonHoverBackgroundProperty); + get => (Brush) GetValue(CloseButtonHoverBackgroundProperty); set => SetValue(CloseButtonHoverBackgroundProperty, value); } public Brush CloseButtonHoverForeground { - get => (Brush)GetValue(CloseButtonHoverForegroundProperty); + get => (Brush) GetValue(CloseButtonHoverForegroundProperty); set => SetValue(CloseButtonHoverForegroundProperty, value); } public Brush OtherButtonHoverBackground { - get => (Brush)GetValue(OtherButtonHoverBackgroundProperty); + get => (Brush) GetValue(OtherButtonHoverBackgroundProperty); set => SetValue(OtherButtonHoverBackgroundProperty, value); } public Brush OtherButtonHoverForeground { - get => (Brush)GetValue(OtherButtonHoverForegroundProperty); + get => (Brush) GetValue(OtherButtonHoverForegroundProperty); set => SetValue(OtherButtonHoverForegroundProperty, value); } public Brush NonClientAreaBackground { - get => (Brush)GetValue(NonClientAreaBackgroundProperty); + get => (Brush) GetValue(NonClientAreaBackgroundProperty); set => SetValue(NonClientAreaBackgroundProperty, value); } public Brush NonClientAreaForeground { - get => (Brush)GetValue(NonClientAreaForegroundProperty); + get => (Brush) GetValue(NonClientAreaForegroundProperty); set => SetValue(NonClientAreaForegroundProperty, value); } public bool ShowNonClientArea { - get => (bool)GetValue(ShowNonClientAreaProperty); + get => (bool) GetValue(ShowNonClientAreaProperty); set => SetValue(ShowNonClientAreaProperty, ValueBoxes.BooleanBox(value)); } public bool ShowTitle { - get => (bool)GetValue(ShowTitleProperty); + get => (bool) GetValue(ShowTitleProperty); set => SetValue(ShowTitleProperty, ValueBoxes.BooleanBox(value)); } private static void OnShowNonClientAreaChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { - var ctl = (Window)d; - ctl.SwitchShowNonClientArea((bool)e.NewValue); + var ctl = (Window) d; + ctl.SwitchShowNonClientArea((bool) e.NewValue); } private void SwitchShowNonClientArea(bool showNonClientArea) @@ -303,8 +303,8 @@ namespace HandyControl.Controls private static void OnIsFullScreenChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { - var ctl = (Window)d; - ctl.SwitchIsFullScreen((bool)e.NewValue); + var ctl = (Window) d; + ctl.SwitchIsFullScreen((bool) e.NewValue); } private void SwitchIsFullScreen(bool isFullScreen) @@ -427,4 +427,4 @@ namespace HandyControl.Controls InvalidateMeasure(); } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Data/Args/CancelRoutedEventArgs.cs b/src/Shared/HandyControl_Shared/Data/Args/CancelRoutedEventArgs.cs index 53a17e1c..57460083 100644 --- a/src/Shared/HandyControl_Shared/Data/Args/CancelRoutedEventArgs.cs +++ b/src/Shared/HandyControl_Shared/Data/Args/CancelRoutedEventArgs.cs @@ -10,4 +10,4 @@ namespace HandyControl.Data public bool Cancel { get; set; } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Data/Args/FunctionEventArgs!1.cs b/src/Shared/HandyControl_Shared/Data/Args/FunctionEventArgs!1.cs index f248a60c..48e53ff8 100644 --- a/src/Shared/HandyControl_Shared/Data/Args/FunctionEventArgs!1.cs +++ b/src/Shared/HandyControl_Shared/Data/Args/FunctionEventArgs!1.cs @@ -16,4 +16,4 @@ namespace HandyControl.Data public T Info { get; set; } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Data/Args/KeyboardHookEventArgs.cs b/src/Shared/HandyControl_Shared/Data/Args/KeyboardHookEventArgs.cs index 4f50f3e1..52246981 100644 --- a/src/Shared/HandyControl_Shared/Data/Args/KeyboardHookEventArgs.cs +++ b/src/Shared/HandyControl_Shared/Data/Args/KeyboardHookEventArgs.cs @@ -15,4 +15,4 @@ namespace HandyControl.Data Key = KeyInterop.KeyFromVirtualKey(virtualKey); } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Data/Args/MouseHookEventArgs.cs b/src/Shared/HandyControl_Shared/Data/Args/MouseHookEventArgs.cs index b7c88e12..8f1685f4 100644 --- a/src/Shared/HandyControl_Shared/Data/Args/MouseHookEventArgs.cs +++ b/src/Shared/HandyControl_Shared/Data/Args/MouseHookEventArgs.cs @@ -9,4 +9,4 @@ namespace HandyControl.Data public InteropValues.POINT Point { get; set; } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Data/DisposableObject.cs b/src/Shared/HandyControl_Shared/Data/DisposableObject.cs index 482ede5e..28e2b551 100644 --- a/src/Shared/HandyControl_Shared/Data/DisposableObject.cs +++ b/src/Shared/HandyControl_Shared/Data/DisposableObject.cs @@ -66,4 +66,4 @@ namespace HandyControl.Data { } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Data/Enum/BadgeStatus.cs b/src/Shared/HandyControl_Shared/Data/Enum/BadgeStatus.cs index f55659c5..f5bf0df2 100644 --- a/src/Shared/HandyControl_Shared/Data/Enum/BadgeStatus.cs +++ b/src/Shared/HandyControl_Shared/Data/Enum/BadgeStatus.cs @@ -2,8 +2,8 @@ { public enum BadgeStatus { - Text, - Dot, + Text, + Dot, Processing } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Data/Enum/ChatMessageType.cs b/src/Shared/HandyControl_Shared/Data/Enum/ChatMessageType.cs index 47d2f58b..8d7b4759 100644 --- a/src/Shared/HandyControl_Shared/Data/Enum/ChatMessageType.cs +++ b/src/Shared/HandyControl_Shared/Data/Enum/ChatMessageType.cs @@ -7,4 +7,4 @@ Audio, Custom } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Data/Enum/ChatRoleType.cs b/src/Shared/HandyControl_Shared/Data/Enum/ChatRoleType.cs index e9fadbfe..372cb2a9 100644 --- a/src/Shared/HandyControl_Shared/Data/Enum/ChatRoleType.cs +++ b/src/Shared/HandyControl_Shared/Data/Enum/ChatRoleType.cs @@ -5,4 +5,4 @@ Sender, Receiver } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Data/Enum/ColLayoutStatus.cs b/src/Shared/HandyControl_Shared/Data/Enum/ColLayoutStatus.cs index bf0a6ea9..9da0c2f4 100644 --- a/src/Shared/HandyControl_Shared/Data/Enum/ColLayoutStatus.cs +++ b/src/Shared/HandyControl_Shared/Data/Enum/ColLayoutStatus.cs @@ -10,4 +10,4 @@ Xxl, Auto } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Data/Enum/HatchStyle.cs b/src/Shared/HandyControl_Shared/Data/Enum/HatchStyle.cs index 6f7f12e4..79abd5d8 100644 --- a/src/Shared/HandyControl_Shared/Data/Enum/HatchStyle.cs +++ b/src/Shared/HandyControl_Shared/Data/Enum/HatchStyle.cs @@ -56,4 +56,4 @@ OutlinedDiamond, SolidDiamond } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Data/Enum/ImageCodecFlags.cs b/src/Shared/HandyControl_Shared/Data/Enum/ImageCodecFlags.cs index c5fb0558..45801718 100644 --- a/src/Shared/HandyControl_Shared/Data/Enum/ImageCodecFlags.cs +++ b/src/Shared/HandyControl_Shared/Data/Enum/ImageCodecFlags.cs @@ -15,4 +15,4 @@ namespace HandyControl.Data System = 0x00020000, User = 0x00040000 } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Data/Enum/InfoType.cs b/src/Shared/HandyControl_Shared/Data/Enum/InfoType.cs index 1ae8e43d..d5922d4e 100644 --- a/src/Shared/HandyControl_Shared/Data/Enum/InfoType.cs +++ b/src/Shared/HandyControl_Shared/Data/Enum/InfoType.cs @@ -10,4 +10,4 @@ namespace HandyControl.Data Fatal, Ask } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Data/Enum/IpType.cs b/src/Shared/HandyControl_Shared/Data/Enum/IpType.cs index 374fa1c9..24d7eae4 100644 --- a/src/Shared/HandyControl_Shared/Data/Enum/IpType.cs +++ b/src/Shared/HandyControl_Shared/Data/Enum/IpType.cs @@ -27,4 +27,4 @@ namespace HandyControl.Data /// E } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Data/Enum/MouseHookMessageType.cs b/src/Shared/HandyControl_Shared/Data/Enum/MouseHookMessageType.cs index 4eeb302d..dec7ac09 100644 --- a/src/Shared/HandyControl_Shared/Data/Enum/MouseHookMessageType.cs +++ b/src/Shared/HandyControl_Shared/Data/Enum/MouseHookMessageType.cs @@ -9,4 +9,4 @@ RightButtonDown = 0x0204, RightButtonUp = 0x0205 } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Data/Enum/PlacementType.cs b/src/Shared/HandyControl_Shared/Data/Enum/PlacementType.cs index a32fb984..9b8eece1 100644 --- a/src/Shared/HandyControl_Shared/Data/Enum/PlacementType.cs +++ b/src/Shared/HandyControl_Shared/Data/Enum/PlacementType.cs @@ -7,12 +7,12 @@ namespace HandyControl.Data /// 左上 /// LeftTop, - + /// /// 左 /// Left, - + /// /// 左下 /// @@ -37,30 +37,30 @@ namespace HandyControl.Data /// 右上 /// RightTop, - + /// /// 右 /// Right, - + /// /// 右下 /// RightBottom, - + /// /// 下左 /// BottomLeft, - + /// /// 下 /// Bottom, - + /// /// 下右 /// BottomRight, } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Data/Enum/ResultType.cs b/src/Shared/HandyControl_Shared/Data/Enum/ResultType.cs index 4340a902..094c23d8 100644 --- a/src/Shared/HandyControl_Shared/Data/Enum/ResultType.cs +++ b/src/Shared/HandyControl_Shared/Data/Enum/ResultType.cs @@ -21,4 +21,4 @@ namespace HandyControl.Data /// None } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Data/Enum/ShowAnimation.cs b/src/Shared/HandyControl_Shared/Data/Enum/ShowAnimation.cs index 52e56c3f..dcadfbaa 100644 --- a/src/Shared/HandyControl_Shared/Data/Enum/ShowAnimation.cs +++ b/src/Shared/HandyControl_Shared/Data/Enum/ShowAnimation.cs @@ -7,4 +7,4 @@ VerticalMove, Fade } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Data/Enum/SideMenuItemRole.cs b/src/Shared/HandyControl_Shared/Data/Enum/SideMenuItemRole.cs index 75b6a1fc..2f1ff5c9 100644 --- a/src/Shared/HandyControl_Shared/Data/Enum/SideMenuItemRole.cs +++ b/src/Shared/HandyControl_Shared/Data/Enum/SideMenuItemRole.cs @@ -5,4 +5,4 @@ Header, Item } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Data/Enum/SkinType.cs b/src/Shared/HandyControl_Shared/Data/Enum/SkinType.cs index 30805b00..5518c231 100644 --- a/src/Shared/HandyControl_Shared/Data/Enum/SkinType.cs +++ b/src/Shared/HandyControl_Shared/Data/Enum/SkinType.cs @@ -7,4 +7,4 @@ namespace HandyControl.Data Dark, Violet } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Data/Enum/StepStatus.cs b/src/Shared/HandyControl_Shared/Data/Enum/StepStatus.cs index 1c46c467..86784c5d 100644 --- a/src/Shared/HandyControl_Shared/Data/Enum/StepStatus.cs +++ b/src/Shared/HandyControl_Shared/Data/Enum/StepStatus.cs @@ -20,4 +20,4 @@ /// Waiting } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Data/Enum/StrokePosition.cs b/src/Shared/HandyControl_Shared/Data/Enum/StrokePosition.cs index 96711a7d..b3462ade 100644 --- a/src/Shared/HandyControl_Shared/Data/Enum/StrokePosition.cs +++ b/src/Shared/HandyControl_Shared/Data/Enum/StrokePosition.cs @@ -6,4 +6,4 @@ Outside, Inside } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Data/Enum/TextType.cs b/src/Shared/HandyControl_Shared/Data/Enum/TextType.cs index bb73cf6d..970a52bc 100644 --- a/src/Shared/HandyControl_Shared/Data/Enum/TextType.cs +++ b/src/Shared/HandyControl_Shared/Data/Enum/TextType.cs @@ -24,4 +24,4 @@ namespace HandyControl.Data NnDouble, NpDouble } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Data/Enum/TitlePlacementType.cs b/src/Shared/HandyControl_Shared/Data/Enum/TitlePlacementType.cs index ce9d6402..8df94559 100644 --- a/src/Shared/HandyControl_Shared/Data/Enum/TitlePlacementType.cs +++ b/src/Shared/HandyControl_Shared/Data/Enum/TitlePlacementType.cs @@ -9,4 +9,4 @@ namespace HandyControl.Data Left, Top } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Data/Flex/FlexContentAlignment.cs b/src/Shared/HandyControl_Shared/Data/Flex/FlexContentAlignment.cs index 965ce360..da1d816f 100644 --- a/src/Shared/HandyControl_Shared/Data/Flex/FlexContentAlignment.cs +++ b/src/Shared/HandyControl_Shared/Data/Flex/FlexContentAlignment.cs @@ -9,4 +9,4 @@ SpaceBetween, SpaceAround } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Data/Flex/FlexContentJustify.cs b/src/Shared/HandyControl_Shared/Data/Flex/FlexContentJustify.cs index 5402f93e..94278877 100644 --- a/src/Shared/HandyControl_Shared/Data/Flex/FlexContentJustify.cs +++ b/src/Shared/HandyControl_Shared/Data/Flex/FlexContentJustify.cs @@ -8,4 +8,4 @@ SpaceBetween, SpaceAround } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Data/Gif/GPStream.cs b/src/Shared/HandyControl_Shared/Data/Gif/GPStream.cs index 64bfaa9e..c8d8b24b 100644 --- a/src/Shared/HandyControl_Shared/Data/Gif/GPStream.cs +++ b/src/Shared/HandyControl_Shared/Data/Gif/GPStream.cs @@ -84,7 +84,7 @@ namespace HandyControl.Data while (written < cb) { var toRead = bufsize; - if (written + toRead > cb) toRead = (int)(cb - written); + if (written + toRead > cb) toRead = (int) (cb - written); var read = Read(buffer, toRead); if (read == 0) break; if (pstm.Write(buffer, read) != read) @@ -198,7 +198,7 @@ namespace HandyControl.Data public void Stat(IntPtr pstatstg, int grfStatFlag) { - var stats = new STATSTG {cbSize = DataStream.Length}; + var stats = new STATSTG { cbSize = DataStream.Length }; Marshal.StructureToPtr(stats, pstatstg, true); } @@ -268,4 +268,4 @@ namespace HandyControl.Data public int reserved; } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Data/Gif/GifFrameDimension.cs b/src/Shared/HandyControl_Shared/Data/Gif/GifFrameDimension.cs index cc2a6366..9ec596d1 100644 --- a/src/Shared/HandyControl_Shared/Data/Gif/GifFrameDimension.cs +++ b/src/Shared/HandyControl_Shared/Data/Gif/GifFrameDimension.cs @@ -26,4 +26,4 @@ namespace HandyControl.Data return "[FrameDimension: " + Guid + "]"; } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Data/Gif/GifImageInfo.cs b/src/Shared/HandyControl_Shared/Data/Gif/GifImageInfo.cs index 7edab111..68087516 100644 --- a/src/Shared/HandyControl_Shared/Data/Gif/GifImageInfo.cs +++ b/src/Shared/HandyControl_Shared/Data/Gif/GifImageInfo.cs @@ -93,4 +93,4 @@ namespace HandyControl.Data protected void OnFrameChanged(EventArgs e) => FrameChangedHandler?.Invoke(Image, e); } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Data/Gif/GifPropertyItem.cs b/src/Shared/HandyControl_Shared/Data/Gif/GifPropertyItem.cs index e6061635..9be7bd19 100644 --- a/src/Shared/HandyControl_Shared/Data/Gif/GifPropertyItem.cs +++ b/src/Shared/HandyControl_Shared/Data/Gif/GifPropertyItem.cs @@ -10,4 +10,4 @@ public byte[] Value { get; set; } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Data/Gif/GifPropertyItemInternal.cs b/src/Shared/HandyControl_Shared/Data/Gif/GifPropertyItemInternal.cs index 58e11aae..228e0f91 100644 --- a/src/Shared/HandyControl_Shared/Data/Gif/GifPropertyItemInternal.cs +++ b/src/Shared/HandyControl_Shared/Data/Gif/GifPropertyItemInternal.cs @@ -111,4 +111,4 @@ namespace HandyControl.Data return props; } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Data/GlowWindow/GlowBitmap.cs b/src/Shared/HandyControl_Shared/Data/GlowWindow/GlowBitmap.cs index e75f1681..271fb3ce 100644 --- a/src/Shared/HandyControl_Shared/Data/GlowWindow/GlowBitmap.cs +++ b/src/Shared/HandyControl_Shared/Data/GlowWindow/GlowBitmap.cs @@ -48,7 +48,7 @@ namespace HandyControl.Data protected override void DisposeNativeResources() => InteropMethods.DeleteObject(Handle); - private static byte PremultiplyAlpha(byte channel, byte alpha) => (byte)(channel * alpha / 255.0); + private static byte PremultiplyAlpha(byte channel, byte alpha) => (byte) (channel * alpha / 255.0); internal static GlowBitmap Create(GlowDrawingContext drawingContext, GlowBitmapPart bitmapPart, Color color) { @@ -78,7 +78,7 @@ namespace HandyControl.Data private static CachedBitmapInfo GetOrCreateAlphaMask(GlowBitmapPart bitmapPart) { - if (_transparencyMasks[(int)bitmapPart] == null) + if (_transparencyMasks[(int) bitmapPart] == null) { var bitmapImage = new BitmapImage(new Uri($"pack://application:,,,/HandyControl;Component/Resources/Images/GlowWindow/{bitmapPart}.png")); @@ -87,14 +87,14 @@ namespace HandyControl.Data bitmapImage.CopyPixels(array, stride, 0); bitmapImage.Freeze(); - _transparencyMasks[(int)bitmapPart] = + _transparencyMasks[(int) bitmapPart] = new CachedBitmapInfo( array, bitmapImage.PixelWidth, bitmapImage.PixelHeight); } - return _transparencyMasks[(int)bitmapPart]; + return _transparencyMasks[(int) bitmapPart]; } private sealed class CachedBitmapInfo diff --git a/src/Shared/HandyControl_Shared/Data/GlowWindow/GlowDrawingContext.cs b/src/Shared/HandyControl_Shared/Data/GlowWindow/GlowDrawingContext.cs index 6d9b7388..e9cb7cf9 100644 --- a/src/Shared/HandyControl_Shared/Data/GlowWindow/GlowDrawingContext.cs +++ b/src/Shared/HandyControl_Shared/Data/GlowWindow/GlowDrawingContext.cs @@ -6,7 +6,7 @@ namespace HandyControl.Data internal class GlowDrawingContext : DisposableObject { private readonly GlowBitmap _windowBitmap; - + internal InteropValues.BLENDFUNCTION Blend; internal GlowDrawingContext(int width, int height) @@ -25,8 +25,8 @@ namespace HandyControl.Data InteropMethods.SelectObject(WindowDC, _windowBitmap.Handle); } - internal bool IsInitialized => - ScreenDC != IntPtr.Zero && WindowDC != IntPtr.Zero && + internal bool IsInitialized => + ScreenDC != IntPtr.Zero && WindowDC != IntPtr.Zero && BackgroundDC != IntPtr.Zero && _windowBitmap != null; internal IntPtr ScreenDC { get; } diff --git a/src/Shared/HandyControl_Shared/Data/GlowWindow/GlowEdge.cs b/src/Shared/HandyControl_Shared/Data/GlowWindow/GlowEdge.cs index 0fd7818a..4534c259 100644 --- a/src/Shared/HandyControl_Shared/Data/GlowWindow/GlowEdge.cs +++ b/src/Shared/HandyControl_Shared/Data/GlowWindow/GlowEdge.cs @@ -11,42 +11,42 @@ namespace HandyControl.Data internal class GlowEdge : HwndWrapper { private const string GlowEdgeClassName = "HandyControlGlowEdge"; - + private const int GlowDepth = 9; - + private const int CornerGripThickness = 18; private static ushort _sharedWindowClassAtom; - + // ReSharper disable once NotAccessedField.Local private static InteropValues.WndProc _sharedWndProc; private readonly GlowBitmap[] _activeGlowBitmaps = new GlowBitmap[16]; - + private readonly GlowBitmap[] _inactiveGlowBitmaps = new GlowBitmap[16]; - + private readonly Dock _orientation; - + private readonly GlowWindow _targetWindow; - + private Color _activeGlowColor = Colors.Transparent; - + private int _height; - + private Color _inactiveGlowColor = Colors.Transparent; - + private FieldInvalidationTypes _invalidatedValues; - + private bool _isActive; - + private bool _isVisible; - + private int _left; - + private bool _pendingDelayRender; - + private int _top; - + private int _width; internal static long CreatedGlowEdges { get; private set; } @@ -69,7 +69,7 @@ namespace HandyControl.Data if (_sharedWindowClassAtom == 0) { var wndclass = default(InteropValues.WNDCLASS); - + wndclass.cbClsExtra = 0; wndclass.cbWndExtra = 0; wndclass.hbrBackground = IntPtr.Zero; @@ -108,7 +108,7 @@ namespace HandyControl.Data internal int Width { get => _width; - set => UpdateProperty( ref _width, value, FieldInvalidationTypes.Size | FieldInvalidationTypes.Render); + set => UpdateProperty(ref _width, value, FieldInvalidationTypes.Size | FieldInvalidationTypes.Render); } internal int Height @@ -183,7 +183,7 @@ namespace HandyControl.Data if (msg == 6) return IntPtr.Zero; if (msg == 70) { - var windowpos = (InteropValues.WINDOWPOS)Marshal.PtrToStructure(lParam, typeof(InteropValues.WINDOWPOS)); + var windowpos = (InteropValues.WINDOWPOS) Marshal.PtrToStructure(lParam, typeof(InteropValues.WINDOWPOS)); windowpos.flags |= 16u; Marshal.StructureToPtr(windowpos, lParam, true); } diff --git a/src/Shared/HandyControl_Shared/Data/HandyControlConfig.cs b/src/Shared/HandyControl_Shared/Data/HandyControlConfig.cs index 10556160..46499c21 100644 --- a/src/Shared/HandyControl_Shared/Data/HandyControlConfig.cs +++ b/src/Shared/HandyControl_Shared/Data/HandyControlConfig.cs @@ -6,4 +6,4 @@ public int TimelineFrameRate { get; set; } = 60; } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Data/HwndWrapper.cs b/src/Shared/HandyControl_Shared/Data/HwndWrapper.cs index ff0f69d0..cda1c276 100644 --- a/src/Shared/HandyControl_Shared/Data/HwndWrapper.cs +++ b/src/Shared/HandyControl_Shared/Data/HwndWrapper.cs @@ -7,11 +7,11 @@ namespace HandyControl.Data public abstract class HwndWrapper : DisposableObject { private IntPtr _handle; - + private bool _isHandleCreationAllowed = true; - + private ushort _wndClassAtom; - + private Delegate _wndProc; protected ushort WindowClassAtom @@ -99,4 +99,4 @@ namespace HandyControl.Data DestroyWindowClassCore(); } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Data/Info/GrowlInfo.cs b/src/Shared/HandyControl_Shared/Data/Info/GrowlInfo.cs index ef7d87f9..27d25ff1 100644 --- a/src/Shared/HandyControl_Shared/Data/Info/GrowlInfo.cs +++ b/src/Shared/HandyControl_Shared/Data/Info/GrowlInfo.cs @@ -30,4 +30,4 @@ namespace HandyControl.Data public string Token { get; set; } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Data/Info/ImageCodecInfo.cs b/src/Shared/HandyControl_Shared/Data/Info/ImageCodecInfo.cs index 0b97ab5b..2d4deccc 100644 --- a/src/Shared/HandyControl_Shared/Data/Info/ImageCodecInfo.cs +++ b/src/Shared/HandyControl_Shared/Data/Info/ImageCodecInfo.cs @@ -123,7 +123,7 @@ namespace HandyControl.Data for (index = 0; index < numCodecs; index++) { - var curcodec = (IntPtr)((long)memoryStart + Marshal.SizeOf(typeof(InteropValues.ImageCodecInfoPrivate)) * index); + var curcodec = (IntPtr) ((long) memoryStart + Marshal.SizeOf(typeof(InteropValues.ImageCodecInfoPrivate)) * index); var codecp = new InteropValues.ImageCodecInfoPrivate(); InteropMethods.PtrToStructure(curcodec, codecp); @@ -147,12 +147,12 @@ namespace HandyControl.Data codecs[index].SignaturePatterns[j] = new byte[codecp.SigSize]; codecs[index].SignatureMasks[j] = new byte[codecp.SigSize]; - Marshal.Copy((IntPtr)((long)codecp.SigMask + j * codecp.SigSize), codecs[index].SignatureMasks[j], 0, codecp.SigSize); - Marshal.Copy((IntPtr)((long)codecp.SigPattern + j * codecp.SigSize), codecs[index].SignaturePatterns[j], 0, codecp.SigSize); + Marshal.Copy((IntPtr) ((long) codecp.SigMask + j * codecp.SigSize), codecs[index].SignatureMasks[j], 0, codecp.SigSize); + Marshal.Copy((IntPtr) ((long) codecp.SigPattern + j * codecp.SigSize), codecs[index].SignaturePatterns[j], 0, codecp.SigSize); } } return codecs; } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Data/Info/MessageBoxInfo.cs b/src/Shared/HandyControl_Shared/Data/Info/MessageBoxInfo.cs index 44791f97..0fa186a0 100644 --- a/src/Shared/HandyControl_Shared/Data/Info/MessageBoxInfo.cs +++ b/src/Shared/HandyControl_Shared/Data/Info/MessageBoxInfo.cs @@ -18,4 +18,4 @@ namespace HandyControl.Data public string StyleKey { get; set; } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Data/Info/SystemVersionInfo.cs b/src/Shared/HandyControl_Shared/Data/Info/SystemVersionInfo.cs index 0da9c89d..35e75912 100644 --- a/src/Shared/HandyControl_Shared/Data/Info/SystemVersionInfo.cs +++ b/src/Shared/HandyControl_Shared/Data/Info/SystemVersionInfo.cs @@ -35,7 +35,7 @@ namespace HandyControl.Data public static bool operator ==(SystemVersionInfo left, SystemVersionInfo right) => left.Equals(right); public static bool operator !=(SystemVersionInfo left, SystemVersionInfo right) => !(left == right); - + public int CompareTo(SystemVersionInfo other) { if (Major != other.Major) @@ -76,4 +76,4 @@ namespace HandyControl.Data public override string ToString() => $"{Major}.{Minor}.{Build}"; } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Data/Operation/OperationResult!1.cs b/src/Shared/HandyControl_Shared/Data/Operation/OperationResult!1.cs index 40a4d9cc..f74a1302 100644 --- a/src/Shared/HandyControl_Shared/Data/Operation/OperationResult!1.cs +++ b/src/Shared/HandyControl_Shared/Data/Operation/OperationResult!1.cs @@ -20,4 +20,4 @@ /// public string Message { get; set; } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Data/Operation/OperationResult.cs b/src/Shared/HandyControl_Shared/Data/Operation/OperationResult.cs index 05fbe781..bf61131b 100644 --- a/src/Shared/HandyControl_Shared/Data/Operation/OperationResult.cs +++ b/src/Shared/HandyControl_Shared/Data/Operation/OperationResult.cs @@ -22,4 +22,4 @@ }; } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Data/Range/ColorRange.cs b/src/Shared/HandyControl_Shared/Data/Range/ColorRange.cs index 7d946925..08e70a08 100644 --- a/src/Shared/HandyControl_Shared/Data/Range/ColorRange.cs +++ b/src/Shared/HandyControl_Shared/Data/Range/ColorRange.cs @@ -56,8 +56,8 @@ namespace HandyControl.Data public Color GetColor(double range) { if (range < 0 || range > 1) return default; - return Color.FromArgb((byte)(_start.A - _subColorArr[0] * range), (byte)(_start.R - _subColorArr[1] * range), - (byte)(_start.G - _subColorArr[2] * range), (byte)(_start.B - _subColorArr[3] * range)); + return Color.FromArgb((byte) (_start.A - _subColorArr[0] * range), (byte) (_start.R - _subColorArr[1] * range), + (byte) (_start.G - _subColorArr[2] * range), (byte) (_start.B - _subColorArr[3] * range)); } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Data/Range/DateTimeRange.cs b/src/Shared/HandyControl_Shared/Data/Range/DateTimeRange.cs index bd5225ac..65d2ba95 100644 --- a/src/Shared/HandyControl_Shared/Data/Range/DateTimeRange.cs +++ b/src/Shared/HandyControl_Shared/Data/Range/DateTimeRange.cs @@ -17,9 +17,9 @@ namespace HandyControl.Data } public DateTime Start { get; set; } - + public DateTime End { get; set; } public double TotalMilliseconds => (End - Start).TotalMilliseconds; } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Data/Range/DoubleRange.cs b/src/Shared/HandyControl_Shared/Data/Range/DoubleRange.cs index 592c1771..c90a80fa 100644 --- a/src/Shared/HandyControl_Shared/Data/Range/DoubleRange.cs +++ b/src/Shared/HandyControl_Shared/Data/Range/DoubleRange.cs @@ -3,7 +3,7 @@ public struct DoubleRange : IValueRange { public double Start { get; set; } - + public double End { get; set; } } } diff --git a/src/Shared/HandyControl_Shared/Data/ResourceToken.cs b/src/Shared/HandyControl_Shared/Data/ResourceToken.cs index 43afc83b..9c10187a 100644 --- a/src/Shared/HandyControl_Shared/Data/ResourceToken.cs +++ b/src/Shared/HandyControl_Shared/Data/ResourceToken.cs @@ -372,4 +372,4 @@ #endregion } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Data/ValueBoxes.cs b/src/Shared/HandyControl_Shared/Data/ValueBoxes.cs index dea64e0b..42ad020b 100644 --- a/src/Shared/HandyControl_Shared/Data/ValueBoxes.cs +++ b/src/Shared/HandyControl_Shared/Data/ValueBoxes.cs @@ -39,4 +39,4 @@ internal static object BooleanBox(bool value) => value ? TrueBox : FalseBox; } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Expression/Drawing/BezierCurveFlattener.cs b/src/Shared/HandyControl_Shared/Expression/Drawing/BezierCurveFlattener.cs index e26ee670..9708fea2 100644 --- a/src/Shared/HandyControl_Shared/Expression/Drawing/BezierCurveFlattener.cs +++ b/src/Shared/HandyControl_Shared/Expression/Drawing/BezierCurveFlattener.cs @@ -354,4 +354,4 @@ namespace HandyControl.Expression.Drawing } } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Expression/Drawing/CommonExtensions.cs b/src/Shared/HandyControl_Shared/Expression/Drawing/CommonExtensions.cs index 723cd864..6c5a617f 100644 --- a/src/Shared/HandyControl_Shared/Expression/Drawing/CommonExtensions.cs +++ b/src/Shared/HandyControl_Shared/Expression/Drawing/CommonExtensions.cs @@ -112,4 +112,4 @@ namespace HandyControl.Expression.Drawing list.RemoveAt(list.Count - 1); } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Expression/Drawing/ExceptionStringTable.cs b/src/Shared/HandyControl_Shared/Expression/Drawing/ExceptionStringTable.cs index d2deda04..c63c5788 100644 --- a/src/Shared/HandyControl_Shared/Expression/Drawing/ExceptionStringTable.cs +++ b/src/Shared/HandyControl_Shared/Expression/Drawing/ExceptionStringTable.cs @@ -36,4 +36,4 @@ namespace HandyControl.Expression.Drawing internal static string TypeNotSupported => ResourceManager.GetString("TypeNotSupported", Culture); } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Expression/Drawing/GeometryHelper.cs b/src/Shared/HandyControl_Shared/Expression/Drawing/GeometryHelper.cs index 8fdc12d9..785ea3ba 100644 --- a/src/Shared/HandyControl_Shared/Expression/Drawing/GeometryHelper.cs +++ b/src/Shared/HandyControl_Shared/Expression/Drawing/GeometryHelper.cs @@ -218,4 +218,4 @@ namespace HandyControl.Expression.Drawing return false; } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Expression/Drawing/MarchLocation.cs b/src/Shared/HandyControl_Shared/Expression/Drawing/MarchLocation.cs index 420104a2..c73ae913 100644 --- a/src/Shared/HandyControl_Shared/Expression/Drawing/MarchLocation.cs +++ b/src/Shared/HandyControl_Shared/Expression/Drawing/MarchLocation.cs @@ -47,4 +47,4 @@ namespace HandyControl.Expression.Drawing return GeometryHelper.Lerp(points[Index], points[Index + 1], Ratio); } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Expression/Drawing/MarchStopReason.cs b/src/Shared/HandyControl_Shared/Expression/Drawing/MarchStopReason.cs index 7a5a53f7..2a820c68 100644 --- a/src/Shared/HandyControl_Shared/Expression/Drawing/MarchStopReason.cs +++ b/src/Shared/HandyControl_Shared/Expression/Drawing/MarchStopReason.cs @@ -6,4 +6,4 @@ CompletePolyline, CornerPoint } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Expression/Drawing/MathHelper.cs b/src/Shared/HandyControl_Shared/Expression/Drawing/MathHelper.cs index c8c820a1..ea276dac 100644 --- a/src/Shared/HandyControl_Shared/Expression/Drawing/MathHelper.cs +++ b/src/Shared/HandyControl_Shared/Expression/Drawing/MathHelper.cs @@ -66,4 +66,4 @@ namespace HandyControl.Expression.Drawing return fallback; } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Expression/Drawing/PathFigureHelper.cs b/src/Shared/HandyControl_Shared/Expression/Drawing/PathFigureHelper.cs index 40c906ce..f27b79ab 100644 --- a/src/Shared/HandyControl_Shared/Expression/Drawing/PathFigureHelper.cs +++ b/src/Shared/HandyControl_Shared/Expression/Drawing/PathFigureHelper.cs @@ -112,4 +112,4 @@ namespace HandyControl.Expression.Drawing return flag | figure.SetIfDifferent(PathFigure.IsFilledProperty, isFilled); } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Expression/Drawing/PathGeometryHelper.cs b/src/Shared/HandyControl_Shared/Expression/Drawing/PathGeometryHelper.cs index d9307403..7d441fbd 100644 --- a/src/Shared/HandyControl_Shared/Expression/Drawing/PathGeometryHelper.cs +++ b/src/Shared/HandyControl_Shared/Expression/Drawing/PathGeometryHelper.cs @@ -22,4 +22,4 @@ namespace HandyControl.Expression.Drawing internal static Geometry FixPathGeometryBoundary(Geometry geometry) => geometry; } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Expression/Drawing/PathSegmentData.cs b/src/Shared/HandyControl_Shared/Expression/Drawing/PathSegmentData.cs index 6e7bb7b2..48b828a2 100644 --- a/src/Shared/HandyControl_Shared/Expression/Drawing/PathSegmentData.cs +++ b/src/Shared/HandyControl_Shared/Expression/Drawing/PathSegmentData.cs @@ -14,4 +14,4 @@ namespace HandyControl.Expression.Drawing public Point StartPoint { get; } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Expression/Drawing/PathSegmentHelper.cs b/src/Shared/HandyControl_Shared/Expression/Drawing/PathSegmentHelper.cs index e64fce79..ce29e1df 100644 --- a/src/Shared/HandyControl_Shared/Expression/Drawing/PathSegmentHelper.cs +++ b/src/Shared/HandyControl_Shared/Expression/Drawing/PathSegmentHelper.cs @@ -243,7 +243,7 @@ namespace HandyControl.Expression.Drawing public static PathSegmentImplementation Create(ArcSegment source) { - if (source != null) return new ArcSegmentImplementation {_segment = source}; + if (source != null) return new ArcSegmentImplementation { _segment = source }; return null; } @@ -454,13 +454,13 @@ namespace HandyControl.Expression.Drawing public static PathSegmentImplementation Create(BezierSegment source) { - if (source != null) return new BezierSegmentImplementation {_segment = source}; + if (source != null) return new BezierSegmentImplementation { _segment = source }; return null; } public override void Flatten(IList points, double tolerance) { - Point[] controlPoints = {Start, _segment.Point1, _segment.Point2, _segment.Point3}; + Point[] controlPoints = { Start, _segment.Point1, _segment.Point2, _segment.Point3 }; var resultPolyline = new List(); BezierCurveFlattener.FlattenCubic(controlPoints, tolerance, resultPolyline, true); points.AddRange(resultPolyline); @@ -493,7 +493,7 @@ namespace HandyControl.Expression.Drawing public static PathSegmentImplementation Create(LineSegment source) { - if (source != null) return new LineSegmentImplementation {_segment = source}; + if (source != null) return new LineSegmentImplementation { _segment = source }; return null; } @@ -538,7 +538,7 @@ namespace HandyControl.Expression.Drawing PolyQuadraticBezierSegmentImplementation.Create(segment as PolyQuadraticBezierSegment) ) == null) throw new NotSupportedException(string.Format(CultureInfo.CurrentCulture, - ExceptionStringTable.TypeNotSupported, new object[] {segment.GetType().FullName})); + ExceptionStringTable.TypeNotSupported, new object[] { segment.GetType().FullName })); return implementation; } @@ -569,7 +569,7 @@ namespace HandyControl.Expression.Drawing public static PathSegmentImplementation Create(PolyBezierSegment source) { - if (source != null) return new PolyBezierSegmentImplementation {_segment = source}; + if (source != null) return new PolyBezierSegmentImplementation { _segment = source }; return null; } @@ -579,7 +579,7 @@ namespace HandyControl.Expression.Drawing var num = _segment.Points.Count / 3 * 3; for (var i = 0; i < num; i += 3) { - Point[] controlPoints = {start, _segment.Points[i], _segment.Points[i + 1], _segment.Points[i + 2]}; + Point[] controlPoints = { start, _segment.Points[i], _segment.Points[i + 1], _segment.Points[i + 2] }; var resultPolyline = new List(); BezierCurveFlattener.FlattenCubic(controlPoints, tolerance, resultPolyline, true); points.AddRange(resultPolyline); @@ -626,7 +626,7 @@ namespace HandyControl.Expression.Drawing public static PathSegmentImplementation Create(PolyLineSegment source) { - if (source != null) return new PolyLineSegmentImplementation {_segment = source}; + if (source != null) return new PolyLineSegmentImplementation { _segment = source }; return null; } @@ -670,7 +670,7 @@ namespace HandyControl.Expression.Drawing public static PathSegmentImplementation Create(PolyQuadraticBezierSegment source) { - if (source != null) return new PolyQuadraticBezierSegmentImplementation {_segment = source}; + if (source != null) return new PolyQuadraticBezierSegmentImplementation { _segment = source }; return null; } @@ -680,7 +680,7 @@ namespace HandyControl.Expression.Drawing var num = _segment.Points.Count / 2 * 2; for (var i = 0; i < num; i += 2) { - Point[] controlPoints = {start, _segment.Points[i], _segment.Points[i + 1]}; + Point[] controlPoints = { start, _segment.Points[i], _segment.Points[i + 1] }; var resultPolyline = new List(); BezierCurveFlattener.FlattenQuadratic(controlPoints, tolerance, resultPolyline, true); points.AddRange(resultPolyline); @@ -728,13 +728,13 @@ namespace HandyControl.Expression.Drawing public static PathSegmentImplementation Create(QuadraticBezierSegment source) { - if (source != null) return new QuadraticBezierSegmentImplementation {_segment = source}; + if (source != null) return new QuadraticBezierSegmentImplementation { _segment = source }; return null; } public override void Flatten(IList points, double tolerance) { - Point[] controlPoints = {Start, _segment.Point1, _segment.Point2}; + Point[] controlPoints = { Start, _segment.Point1, _segment.Point2 }; var resultPolyline = new List(); BezierCurveFlattener.FlattenQuadratic(controlPoints, tolerance, resultPolyline, true); points.AddRange(resultPolyline); @@ -752,4 +752,4 @@ namespace HandyControl.Expression.Drawing } } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Expression/Drawing/PolylineData.cs b/src/Shared/HandyControl_Shared/Expression/Drawing/PolylineData.cs index 7520e267..a8b4ac28 100644 --- a/src/Shared/HandyControl_Shared/Expression/Drawing/PolylineData.cs +++ b/src/Shared/HandyControl_Shared/Expression/Drawing/PolylineData.cs @@ -149,4 +149,4 @@ namespace HandyControl.Expression.Drawing return Normals[index]; } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Expression/Drawing/PolylineHelper.cs b/src/Shared/HandyControl_Shared/Expression/Drawing/PolylineHelper.cs index b82d8928..10d9853a 100644 --- a/src/Shared/HandyControl_Shared/Expression/Drawing/PolylineHelper.cs +++ b/src/Shared/HandyControl_Shared/Expression/Drawing/PolylineHelper.cs @@ -113,4 +113,4 @@ namespace HandyControl.Expression.Drawing } } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Expression/Drawing/RandomEngine.cs b/src/Shared/HandyControl_Shared/Expression/Drawing/RandomEngine.cs index f370bd0d..da517c71 100644 --- a/src/Shared/HandyControl_Shared/Expression/Drawing/RandomEngine.cs +++ b/src/Shared/HandyControl_Shared/Expression/Drawing/RandomEngine.cs @@ -42,4 +42,4 @@ namespace HandyControl.Expression.Drawing private double Uniform() => _random.NextDouble(); } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Expression/Drawing/SimpleSegment.cs b/src/Shared/HandyControl_Shared/Expression/Drawing/SimpleSegment.cs index 0c117f0f..5b82f8ea 100644 --- a/src/Shared/HandyControl_Shared/Expression/Drawing/SimpleSegment.cs +++ b/src/Shared/HandyControl_Shared/Expression/Drawing/SimpleSegment.cs @@ -26,7 +26,7 @@ namespace HandyControl.Expression.Drawing var segment = new SimpleSegment { Type = SegmentType.Line, - Points = new[] {point0, point1} + Points = new[] { point0, point1 } }; return segment; } @@ -38,7 +38,7 @@ namespace HandyControl.Expression.Drawing var segment = new SimpleSegment { Type = SegmentType.CubicBeizer, - Points = new[] {point0, point, point3, point2} + Points = new[] { point0, point, point3, point2 } }; return segment; } @@ -48,7 +48,7 @@ namespace HandyControl.Expression.Drawing var segment = new SimpleSegment { Type = SegmentType.CubicBeizer, - Points = new[] {point0, point1, point2, point3} + Points = new[] { point0, point1, point2, point3 } }; return segment; } @@ -73,4 +73,4 @@ namespace HandyControl.Expression.Drawing } } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Expression/Media/ArcGeometrySource.cs b/src/Shared/HandyControl_Shared/Expression/Media/ArcGeometrySource.cs index 8270314a..515972c6 100644 --- a/src/Shared/HandyControl_Shared/Expression/Media/ArcGeometrySource.cs +++ b/src/Shared/HandyControl_Shared/Expression/Media/ArcGeometrySource.cs @@ -339,7 +339,7 @@ namespace HandyControl.Expression.Media figure = new PathFigure(); CachedGeometry = new PathGeometry { - Figures = {figure} + Figures = { figure } }; figure.Segments.Add(segment = new ArcSegment()); figure.IsClosed = false; @@ -371,7 +371,7 @@ namespace HandyControl.Expression.Media figure = new PathFigure(); CachedGeometry = new PathGeometry { - Figures = {figure} + Figures = { figure } }; figure.Segments.Add(segment = new ArcSegment()); figure.Segments.Add(segment2 = new LineSegment()); @@ -467,4 +467,4 @@ namespace HandyControl.Expression.Media return flag | geometry.SetIfDifferent(LineGeometry.EndPointProperty, point2); } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Expression/Media/DrawingPropertyChangedEventArgs.cs b/src/Shared/HandyControl_Shared/Expression/Media/DrawingPropertyChangedEventArgs.cs index 7bcb3406..deb73eb9 100644 --- a/src/Shared/HandyControl_Shared/Expression/Media/DrawingPropertyChangedEventArgs.cs +++ b/src/Shared/HandyControl_Shared/Expression/Media/DrawingPropertyChangedEventArgs.cs @@ -8,4 +8,4 @@ namespace HandyControl.Expression.Media public DrawingPropertyMetadata Metadata { get; set; } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Expression/Media/DrawingPropertyMetadata.cs b/src/Shared/HandyControl_Shared/Expression/Media/DrawingPropertyMetadata.cs index 941811e1..2c5e4284 100644 --- a/src/Shared/HandyControl_Shared/Expression/Media/DrawingPropertyMetadata.cs +++ b/src/Shared/HandyControl_Shared/Expression/Media/DrawingPropertyMetadata.cs @@ -15,7 +15,8 @@ namespace HandyControl.Expression.Media static DrawingPropertyMetadata() { - DrawingPropertyChanged += delegate (object sender, DrawingPropertyChangedEventArgs args) { + DrawingPropertyChanged += delegate (object sender, DrawingPropertyChangedEventArgs args) + { if ((sender is IShape shape) && args.Metadata.AffectsRender) { InvalidateGeometryReasons reasons = InvalidateGeometryReasons.PropertyChanged; @@ -36,7 +37,7 @@ namespace HandyControl.Expression.Media { } - private DrawingPropertyMetadata(DrawingPropertyMetadataOptions options, object defaultValue) : base(defaultValue, (FrameworkPropertyMetadataOptions)options) + private DrawingPropertyMetadata(DrawingPropertyMetadataOptions options, object defaultValue) : base(defaultValue, (FrameworkPropertyMetadataOptions) options) { } @@ -44,7 +45,7 @@ namespace HandyControl.Expression.Media { } - public DrawingPropertyMetadata(object defaultValue, DrawingPropertyMetadataOptions options, PropertyChangedCallback propertyChangedCallback) : base(defaultValue, (FrameworkPropertyMetadataOptions)options, AttachCallback(defaultValue, options, propertyChangedCallback)) + public DrawingPropertyMetadata(object defaultValue, DrawingPropertyMetadataOptions options, PropertyChangedCallback propertyChangedCallback) : base(defaultValue, (FrameworkPropertyMetadataOptions) options, AttachCallback(defaultValue, options, propertyChangedCallback)) { } @@ -73,4 +74,4 @@ namespace HandyControl.Expression.Media propertyChangedCallback?.Invoke(sender, e); } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Expression/Media/DrawingPropertyMetadataOptions.cs b/src/Shared/HandyControl_Shared/Expression/Media/DrawingPropertyMetadataOptions.cs index 82114f86..3eb487d9 100644 --- a/src/Shared/HandyControl_Shared/Expression/Media/DrawingPropertyMetadataOptions.cs +++ b/src/Shared/HandyControl_Shared/Expression/Media/DrawingPropertyMetadataOptions.cs @@ -9,4 +9,4 @@ namespace HandyControl.Expression.Media AffectsRender = 0x10, None = 0 } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Expression/Media/GeometryEffect.cs b/src/Shared/HandyControl_Shared/Expression/Media/GeometryEffect.cs index 84804c13..cf26c163 100644 --- a/src/Shared/HandyControl_Shared/Expression/Media/GeometryEffect.cs +++ b/src/Shared/HandyControl_Shared/Expression/Media/GeometryEffect.cs @@ -25,7 +25,7 @@ namespace HandyControl.Expression.Media static GeometryEffect() { DrawingPropertyMetadata.DrawingPropertyChanged += - delegate(object sender, DrawingPropertyChangedEventArgs args) + delegate (object sender, DrawingPropertyChangedEventArgs args) { if (sender is GeometryEffect effect && args.Metadata.AffectsRender) effect.InvalidateGeometry(InvalidateGeometryReasons.PropertyChanged); @@ -169,4 +169,4 @@ namespace HandyControl.Expression.Media } } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Expression/Media/GeometryEffectConverter.cs b/src/Shared/HandyControl_Shared/Expression/Media/GeometryEffectConverter.cs index 6dbfa57a..389831d2 100644 --- a/src/Shared/HandyControl_Shared/Expression/Media/GeometryEffectConverter.cs +++ b/src/Shared/HandyControl_Shared/Expression/Media/GeometryEffectConverter.cs @@ -56,4 +56,4 @@ namespace HandyControl.Expression.Media return null; } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Expression/Media/GeometrySource!1.cs b/src/Shared/HandyControl_Shared/Expression/Media/GeometrySource!1.cs index 0edc7fe1..dfdbd33c 100644 --- a/src/Shared/HandyControl_Shared/Expression/Media/GeometrySource!1.cs +++ b/src/Shared/HandyControl_Shared/Expression/Media/GeometrySource!1.cs @@ -85,4 +85,4 @@ namespace HandyControl.Expression.Media protected abstract bool UpdateCachedGeometry(TParameters parameters); } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Expression/Media/IArcGeometrySourceParameters.cs b/src/Shared/HandyControl_Shared/Expression/Media/IArcGeometrySourceParameters.cs index f4536306..05f02924 100644 --- a/src/Shared/HandyControl_Shared/Expression/Media/IArcGeometrySourceParameters.cs +++ b/src/Shared/HandyControl_Shared/Expression/Media/IArcGeometrySourceParameters.cs @@ -10,4 +10,4 @@ double StartAngle { get; } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Expression/Media/IGeometrySource.cs b/src/Shared/HandyControl_Shared/Expression/Media/IGeometrySource.cs index faaa3e8d..0b34166c 100644 --- a/src/Shared/HandyControl_Shared/Expression/Media/IGeometrySource.cs +++ b/src/Shared/HandyControl_Shared/Expression/Media/IGeometrySource.cs @@ -14,4 +14,4 @@ namespace HandyControl.Expression.Media Rect LogicalBounds { get; } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Expression/Media/IGeometrySourceExtensions.cs b/src/Shared/HandyControl_Shared/Expression/Media/IGeometrySourceExtensions.cs index 1e616211..2273384c 100644 --- a/src/Shared/HandyControl_Shared/Expression/Media/IGeometrySourceExtensions.cs +++ b/src/Shared/HandyControl_Shared/Expression/Media/IGeometrySourceExtensions.cs @@ -28,4 +28,4 @@ namespace HandyControl.Expression.Media return 0.0; } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Expression/Media/IGeometrySourceParameters.cs b/src/Shared/HandyControl_Shared/Expression/Media/IGeometrySourceParameters.cs index 5354b688..969b43c1 100644 --- a/src/Shared/HandyControl_Shared/Expression/Media/IGeometrySourceParameters.cs +++ b/src/Shared/HandyControl_Shared/Expression/Media/IGeometrySourceParameters.cs @@ -10,4 +10,4 @@ namespace HandyControl.Expression.Media double StrokeThickness { get; } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Expression/Media/IShape.cs b/src/Shared/HandyControl_Shared/Expression/Media/IShape.cs index 1f0fd37a..696197f1 100644 --- a/src/Shared/HandyControl_Shared/Expression/Media/IShape.cs +++ b/src/Shared/HandyControl_Shared/Expression/Media/IShape.cs @@ -22,4 +22,4 @@ namespace HandyControl.Expression.Media double StrokeThickness { get; set; } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Expression/Media/InvalidateGeometryReasons.cs b/src/Shared/HandyControl_Shared/Expression/Media/InvalidateGeometryReasons.cs index 32799de5..57a26573 100644 --- a/src/Shared/HandyControl_Shared/Expression/Media/InvalidateGeometryReasons.cs +++ b/src/Shared/HandyControl_Shared/Expression/Media/InvalidateGeometryReasons.cs @@ -11,4 +11,4 @@ namespace HandyControl.Expression.Media PropertyChanged = 1, TemplateChanged = 0x10 } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Expression/Media/SketchGeometryEffect.cs b/src/Shared/HandyControl_Shared/Expression/Media/SketchGeometryEffect.cs index 0969ca1a..62923d29 100644 --- a/src/Shared/HandyControl_Shared/Expression/Media/SketchGeometryEffect.cs +++ b/src/Shared/HandyControl_Shared/Expression/Media/SketchGeometryEffect.cs @@ -45,12 +45,12 @@ namespace HandyControl.Expression.Media { var startPoint = pathFigure.StartPoint; foreach (var iteratorVariable1 in pathFigure.AllSegments()) - foreach (var iteratorVariable2 in iteratorVariable1.PathSegment.GetSimpleSegments( - iteratorVariable1.StartPoint)) - { - yield return iteratorVariable2; - startPoint = iteratorVariable2.Points.Last(); - } + foreach (var iteratorVariable2 in iteratorVariable1.PathSegment.GetSimpleSegments( + iteratorVariable1.StartPoint)) + { + yield return iteratorVariable2; + startPoint = iteratorVariable2.Points.Last(); + } if (pathFigure.IsClosed) yield return SimpleSegment.Create(startPoint, pathFigure.StartPoint); } @@ -103,7 +103,7 @@ namespace HandyControl.Expression.Media var samplePoints = new List(sampleCount); var sampleNormals = new List(sampleCount); var sampleIndex = 0; - PolylineHelper.PathMarch(polyline, 0.0, 0.0, delegate(MarchLocation location) + PolylineHelper.PathMarch(polyline, 0.0, 0.0, delegate (MarchLocation location) { if (location.Reason == MarchStopReason.CompletePolyline) return double.NaN; if (location.Reason != MarchStopReason.CompleteStep) return location.Remain; @@ -132,4 +132,4 @@ namespace HandyControl.Expression.Media return flag; } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Expression/Media/UnitType.cs b/src/Shared/HandyControl_Shared/Expression/Media/UnitType.cs index 4aa8d7da..6c18b8d2 100644 --- a/src/Shared/HandyControl_Shared/Expression/Media/UnitType.cs +++ b/src/Shared/HandyControl_Shared/Expression/Media/UnitType.cs @@ -5,4 +5,4 @@ Pixel, Percent } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Expression/Shapes/Arc.cs b/src/Shared/HandyControl_Shared/Expression/Shapes/Arc.cs index ef9e0f00..da3d3bb4 100644 --- a/src/Shared/HandyControl_Shared/Expression/Shapes/Arc.cs +++ b/src/Shared/HandyControl_Shared/Expression/Shapes/Arc.cs @@ -57,4 +57,4 @@ namespace HandyControl.Expression.Shapes return new ArcGeometrySource(); } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Expression/Shapes/PrimitiveShape.cs b/src/Shared/HandyControl_Shared/Expression/Shapes/PrimitiveShape.cs index 716f48e3..b2656662 100644 --- a/src/Shared/HandyControl_Shared/Expression/Shapes/PrimitiveShape.cs +++ b/src/Shared/HandyControl_Shared/Expression/Shapes/PrimitiveShape.cs @@ -77,4 +77,4 @@ namespace HandyControl.Expression.Shapes private void RealizeGeometry() => RenderedGeometryChanged?.Invoke(this, EventArgs.Empty); } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Interactivity/AdornerContainer.cs b/src/Shared/HandyControl_Shared/Interactivity/AdornerContainer.cs index 27b0c0e5..e7afac8b 100644 --- a/src/Shared/HandyControl_Shared/Interactivity/AdornerContainer.cs +++ b/src/Shared/HandyControl_Shared/Interactivity/AdornerContainer.cs @@ -43,4 +43,4 @@ namespace HandyControl.Interactivity return base.GetVisualChild(index); } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Interactivity/AttachableCollection!1.cs b/src/Shared/HandyControl_Shared/Interactivity/AttachableCollection!1.cs index edcfdb83..8af0c189 100644 --- a/src/Shared/HandyControl_Shared/Interactivity/AttachableCollection!1.cs +++ b/src/Shared/HandyControl_Shared/Interactivity/AttachableCollection!1.cs @@ -165,4 +165,4 @@ namespace HandyControl.Interactivity } } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Interactivity/Behavior/Behavior!1.cs b/src/Shared/HandyControl_Shared/Interactivity/Behavior/Behavior!1.cs index bb1b7a14..c187ee43 100644 --- a/src/Shared/HandyControl_Shared/Interactivity/Behavior/Behavior!1.cs +++ b/src/Shared/HandyControl_Shared/Interactivity/Behavior/Behavior!1.cs @@ -8,6 +8,6 @@ namespace HandyControl.Interactivity { } - protected new T AssociatedObject => (T)base.AssociatedObject; + protected new T AssociatedObject => (T) base.AssociatedObject; } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Interactivity/Behavior/Behavior.cs b/src/Shared/HandyControl_Shared/Interactivity/Behavior/Behavior.cs index a8487a15..549dcc5b 100644 --- a/src/Shared/HandyControl_Shared/Interactivity/Behavior/Behavior.cs +++ b/src/Shared/HandyControl_Shared/Interactivity/Behavior/Behavior.cs @@ -43,7 +43,7 @@ namespace HandyControl.Interactivity if (dependencyObject != null && !AssociatedType.IsInstanceOfType(dependencyObject)) throw new InvalidOperationException(string.Format(CultureInfo.CurrentCulture, ExceptionStringTable.TypeConstraintViolatedExceptionMessage, - new object[] {GetType().Name, dependencyObject.GetType().Name, AssociatedType.Name})); + new object[] { GetType().Name, dependencyObject.GetType().Name, AssociatedType.Name })); WritePreamble(); _associatedObject = dependencyObject; WritePostscript(); @@ -84,4 +84,4 @@ namespace HandyControl.Interactivity { } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Interactivity/Behavior/BehaviorCollection.cs b/src/Shared/HandyControl_Shared/Interactivity/Behavior/BehaviorCollection.cs index 3c95df71..357cc834 100644 --- a/src/Shared/HandyControl_Shared/Interactivity/Behavior/BehaviorCollection.cs +++ b/src/Shared/HandyControl_Shared/Interactivity/Behavior/BehaviorCollection.cs @@ -39,4 +39,4 @@ namespace HandyControl.Interactivity return new BehaviorCollection(); } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Interactivity/Behavior/FluidMoveBehavior.cs b/src/Shared/HandyControl_Shared/Interactivity/Behavior/FluidMoveBehavior.cs index ebf168d9..4317002f 100644 --- a/src/Shared/HandyControl_Shared/Interactivity/Behavior/FluidMoveBehavior.cs +++ b/src/Shared/HandyControl_Shared/Interactivity/Behavior/FluidMoveBehavior.cs @@ -111,7 +111,7 @@ namespace HandyControl.Interactivity { renderTransform = new TransformGroup { - Children = {child.RenderTransform} + Children = { child.RenderTransform } }; child.RenderTransform = renderTransform; SetHasTransformWrapper(child, true); @@ -446,4 +446,4 @@ namespace HandyControl.Interactivity data.Timestamp = newTagData.Timestamp; } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Interactivity/Behavior/FluidMoveBehaviorBase.cs b/src/Shared/HandyControl_Shared/Interactivity/Behavior/FluidMoveBehaviorBase.cs index de2548a9..8e588d25 100644 --- a/src/Shared/HandyControl_Shared/Interactivity/Behavior/FluidMoveBehaviorBase.cs +++ b/src/Shared/HandyControl_Shared/Interactivity/Behavior/FluidMoveBehaviorBase.cs @@ -193,4 +193,4 @@ namespace HandyControl.Interactivity public DateTime Timestamp { get; set; } } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Interactivity/Behavior/MouseDragElementBehavior.cs b/src/Shared/HandyControl_Shared/Interactivity/Behavior/MouseDragElementBehavior.cs index 17eeba89..e4661ca2 100644 --- a/src/Shared/HandyControl_Shared/Interactivity/Behavior/MouseDragElementBehavior.cs +++ b/src/Shared/HandyControl_Shared/Interactivity/Behavior/MouseDragElementBehavior.cs @@ -220,7 +220,7 @@ namespace HandyControl.Interactivity Y = transform5.Y }; if (transform is MatrixTransform transform6) - return new MatrixTransform {Matrix = transform6.Matrix}; + return new MatrixTransform { Matrix = transform6.Matrix }; if (!(transform is TransformGroup group)) return null; var group2 = new TransformGroup(); @@ -349,4 +349,4 @@ namespace HandyControl.Interactivity } } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Interactivity/Behavior/MouseDragElementBehaviorEx.cs b/src/Shared/HandyControl_Shared/Interactivity/Behavior/MouseDragElementBehaviorEx.cs index 27793971..fe3d38b7 100644 --- a/src/Shared/HandyControl_Shared/Interactivity/Behavior/MouseDragElementBehaviorEx.cs +++ b/src/Shared/HandyControl_Shared/Interactivity/Behavior/MouseDragElementBehaviorEx.cs @@ -37,19 +37,19 @@ namespace HandyControl.Interactivity public double X { - get => (double)GetValue(MouseDragElementBehavior.XProperty); + get => (double) GetValue(MouseDragElementBehavior.XProperty); set => SetValue(MouseDragElementBehavior.XProperty, value); } public double Y { - get => (double)GetValue(MouseDragElementBehavior.YProperty); + get => (double) GetValue(MouseDragElementBehavior.YProperty); set => SetValue(MouseDragElementBehavior.YProperty, value); } public bool ConstrainToParentBounds { - get => (bool)GetValue(MouseDragElementBehavior.ConstrainToParentBoundsProperty); + get => (bool) GetValue(MouseDragElementBehavior.ConstrainToParentBoundsProperty); set => SetValue(MouseDragElementBehavior.ConstrainToParentBoundsProperty, ValueBoxes.BooleanBox(value)); } @@ -103,19 +103,19 @@ namespace HandyControl.Interactivity private static void OnXChanged(object sender, DependencyPropertyChangedEventArgs args) { - var dragElementBehavior = (MouseDragElementBehaviorEx)sender; - dragElementBehavior.UpdatePosition(new Point((double)args.NewValue, dragElementBehavior.Y)); + var dragElementBehavior = (MouseDragElementBehaviorEx) sender; + dragElementBehavior.UpdatePosition(new Point((double) args.NewValue, dragElementBehavior.Y)); } private static void OnYChanged(object sender, DependencyPropertyChangedEventArgs args) { - var dragElementBehavior = (MouseDragElementBehaviorEx)sender; - dragElementBehavior.UpdatePosition(new Point(dragElementBehavior.X, (double)args.NewValue)); + var dragElementBehavior = (MouseDragElementBehaviorEx) sender; + dragElementBehavior.UpdatePosition(new Point(dragElementBehavior.X, (double) args.NewValue)); } private static void OnConstrainToParentBoundsChanged(object sender, DependencyPropertyChangedEventArgs args) { - var dragElementBehavior = (MouseDragElementBehaviorEx)sender; + var dragElementBehavior = (MouseDragElementBehaviorEx) sender; dragElementBehavior.UpdatePosition(new Point(dragElementBehavior.X, dragElementBehavior.Y)); } @@ -366,4 +366,4 @@ namespace HandyControl.Interactivity } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Interactivity/Commands/CloseWindowCommand.cs b/src/Shared/HandyControl_Shared/Interactivity/Commands/CloseWindowCommand.cs index 392abeab..302f4372 100644 --- a/src/Shared/HandyControl_Shared/Interactivity/Commands/CloseWindowCommand.cs +++ b/src/Shared/HandyControl_Shared/Interactivity/Commands/CloseWindowCommand.cs @@ -21,4 +21,4 @@ namespace HandyControl.Interactivity public event EventHandler CanExecuteChanged; } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Interactivity/Commands/ControlCommands.cs b/src/Shared/HandyControl_Shared/Interactivity/Commands/ControlCommands.cs index fdcf231b..37ea2c43 100644 --- a/src/Shared/HandyControl_Shared/Interactivity/Commands/ControlCommands.cs +++ b/src/Shared/HandyControl_Shared/Interactivity/Commands/ControlCommands.cs @@ -182,4 +182,4 @@ namespace HandyControl.Interactivity /// public static RoutedCommand SortByName { get; } = new RoutedCommand(nameof(SortByName), typeof(ControlCommands)); } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Interactivity/Commands/OpenLinkCommand.cs b/src/Shared/HandyControl_Shared/Interactivity/Commands/OpenLinkCommand.cs index 9910ba9a..d21175a4 100644 --- a/src/Shared/HandyControl_Shared/Interactivity/Commands/OpenLinkCommand.cs +++ b/src/Shared/HandyControl_Shared/Interactivity/Commands/OpenLinkCommand.cs @@ -30,4 +30,4 @@ namespace HandyControl.Interactivity public event EventHandler CanExecuteChanged; } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Interactivity/Commands/PushMainWindow2TopCommand.cs b/src/Shared/HandyControl_Shared/Interactivity/Commands/PushMainWindow2TopCommand.cs index 386d6a78..654da612 100644 --- a/src/Shared/HandyControl_Shared/Interactivity/Commands/PushMainWindow2TopCommand.cs +++ b/src/Shared/HandyControl_Shared/Interactivity/Commands/PushMainWindow2TopCommand.cs @@ -20,4 +20,4 @@ namespace HandyControl.Interactivity public event EventHandler CanExecuteChanged; } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Interactivity/Commands/ShutdownAppCommand.cs b/src/Shared/HandyControl_Shared/Interactivity/Commands/ShutdownAppCommand.cs index 85bc706c..dd7920ca 100644 --- a/src/Shared/HandyControl_Shared/Interactivity/Commands/ShutdownAppCommand.cs +++ b/src/Shared/HandyControl_Shared/Interactivity/Commands/ShutdownAppCommand.cs @@ -12,4 +12,4 @@ namespace HandyControl.Interactivity public event EventHandler CanExecuteChanged; } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Interactivity/DefaultTriggerAttribute.cs b/src/Shared/HandyControl_Shared/Interactivity/DefaultTriggerAttribute.cs index 2eb1cf97..9e58a826 100644 --- a/src/Shared/HandyControl_Shared/Interactivity/DefaultTriggerAttribute.cs +++ b/src/Shared/HandyControl_Shared/Interactivity/DefaultTriggerAttribute.cs @@ -10,7 +10,7 @@ namespace HandyControl.Interactivity private readonly object[] _parameters; public DefaultTriggerAttribute(Type targetType, Type triggerType, object parameter) : this(targetType, - triggerType, new[] {parameter}) + triggerType, new[] { parameter }) { } @@ -19,7 +19,7 @@ namespace HandyControl.Interactivity if (!typeof(TriggerBase).IsAssignableFrom(triggerType)) throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, ExceptionStringTable.DefaultTriggerAttributeInvalidTriggerTypeSpecifiedExceptionMessage, - new object[] {triggerType.Name})); + new object[] { triggerType.Name })); TargetType = targetType; TriggerType = triggerType; _parameters = parameters; @@ -46,4 +46,4 @@ namespace HandyControl.Interactivity return (TriggerBase) obj2; } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Interactivity/EventToCommand.cs b/src/Shared/HandyControl_Shared/Interactivity/EventToCommand.cs index 7aa3bbe8..819b9923 100644 --- a/src/Shared/HandyControl_Shared/Interactivity/EventToCommand.cs +++ b/src/Shared/HandyControl_Shared/Interactivity/EventToCommand.cs @@ -192,4 +192,4 @@ namespace HandyControl.Interactivity private void OnCommandCanExecuteChanged(object sender, EventArgs e) => EnableDisableElement(); } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Interactivity/EventTrigger.cs b/src/Shared/HandyControl_Shared/Interactivity/EventTrigger.cs index 7df44802..a6ded793 100644 --- a/src/Shared/HandyControl_Shared/Interactivity/EventTrigger.cs +++ b/src/Shared/HandyControl_Shared/Interactivity/EventTrigger.cs @@ -16,14 +16,14 @@ namespace HandyControl.Interactivity private static void OnEventNameChanged(object sender, DependencyPropertyChangedEventArgs args) { - ((EventTrigger)sender).OnEventNameChanged((string)args.OldValue, (string)args.NewValue); + ((EventTrigger) sender).OnEventNameChanged((string) args.OldValue, (string) args.NewValue); } public string EventName { - get => (string)GetValue(EventNameProperty); + get => (string) GetValue(EventNameProperty); set => SetValue(EventNameProperty, value); } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Interactivity/EventTriggerBase!1.cs b/src/Shared/HandyControl_Shared/Interactivity/EventTriggerBase!1.cs index ee9acd56..a92e8ed2 100644 --- a/src/Shared/HandyControl_Shared/Interactivity/EventTriggerBase!1.cs +++ b/src/Shared/HandyControl_Shared/Interactivity/EventTriggerBase!1.cs @@ -16,6 +16,6 @@ OnSourceChanged(oldSource as T, newSource as T); } - public new T Source => (T)base.Source; + public new T Source => (T) base.Source; } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Interactivity/EventTriggerBase.cs b/src/Shared/HandyControl_Shared/Interactivity/EventTriggerBase.cs index 8dc8cc57..dcff858a 100644 --- a/src/Shared/HandyControl_Shared/Interactivity/EventTriggerBase.cs +++ b/src/Shared/HandyControl_Shared/Interactivity/EventTriggerBase.cs @@ -231,14 +231,14 @@ namespace HandyControl.Interactivity if (SourceObject != null) throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, ExceptionStringTable.EventTriggerCannotFindEventNameExceptionMessage, - new object[] {eventName, obj.GetType().Name})); + new object[] { eventName, obj.GetType().Name })); } else if (!IsValidEvent(eventInfo)) { if (SourceObject != null) throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, ExceptionStringTable.EventTriggerBaseInvalidEventExceptionMessage, - new object[] {eventName, obj.GetType().Name})); + new object[] { eventName, obj.GetType().Name })); } else { @@ -310,4 +310,4 @@ namespace HandyControl.Interactivity } } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Interactivity/ExceptionStringTable.cs b/src/Shared/HandyControl_Shared/Interactivity/ExceptionStringTable.cs index 60259a47..4e0041f7 100644 --- a/src/Shared/HandyControl_Shared/Interactivity/ExceptionStringTable.cs +++ b/src/Shared/HandyControl_Shared/Interactivity/ExceptionStringTable.cs @@ -55,4 +55,4 @@ namespace HandyControl.Interactivity internal static string UnableToResolveTargetNameWarningMessage => ResourceManager.GetString(nameof(UnableToResolveTargetNameWarningMessage), Culture); } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Interactivity/ExtendedVisualStateManager.cs b/src/Shared/HandyControl_Shared/Interactivity/ExtendedVisualStateManager.cs index f7e1d436..858c64ae 100644 --- a/src/Shared/HandyControl_Shared/Interactivity/ExtendedVisualStateManager.cs +++ b/src/Shared/HandyControl_Shared/Interactivity/ExtendedVisualStateManager.cs @@ -111,7 +111,7 @@ namespace HandyControl.Interactivity var sb = new Storyboard { Duration = transition.GeneratedDuration, - Children = {element} + Children = { element } }; Storyboard.SetTarget(element, stateGroupsRoot); Storyboard.SetTargetProperty(element, @@ -1139,4 +1139,4 @@ namespace HandyControl.Interactivity } } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Interactivity/FluidMoveScope.cs b/src/Shared/HandyControl_Shared/Interactivity/FluidMoveScope.cs index 75e6cc08..6db025b2 100644 --- a/src/Shared/HandyControl_Shared/Interactivity/FluidMoveScope.cs +++ b/src/Shared/HandyControl_Shared/Interactivity/FluidMoveScope.cs @@ -5,4 +5,4 @@ Self, Children } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Interactivity/IAttachedObject.cs b/src/Shared/HandyControl_Shared/Interactivity/IAttachedObject.cs index 27a3bcbf..22d5d08e 100644 --- a/src/Shared/HandyControl_Shared/Interactivity/IAttachedObject.cs +++ b/src/Shared/HandyControl_Shared/Interactivity/IAttachedObject.cs @@ -9,4 +9,4 @@ namespace HandyControl.Interactivity DependencyObject AssociatedObject { get; } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Interactivity/IEventArgsConverter.cs b/src/Shared/HandyControl_Shared/Interactivity/IEventArgsConverter.cs index 2f58cd27..e05fbfb4 100644 --- a/src/Shared/HandyControl_Shared/Interactivity/IEventArgsConverter.cs +++ b/src/Shared/HandyControl_Shared/Interactivity/IEventArgsConverter.cs @@ -28,4 +28,4 @@ namespace HandyControl.Interactivity { object Convert(object value, object parameter); } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Interactivity/Interaction.cs b/src/Shared/HandyControl_Shared/Interactivity/Interaction.cs index 564f1cd1..e3b567dc 100644 --- a/src/Shared/HandyControl_Shared/Interactivity/Interaction.cs +++ b/src/Shared/HandyControl_Shared/Interactivity/Interaction.cs @@ -74,4 +74,4 @@ namespace HandyControl.Interactivity return element.IsLoaded; } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Interactivity/InvokeCommandAction.cs b/src/Shared/HandyControl_Shared/Interactivity/InvokeCommandAction.cs index d188d9d4..2a10a040 100644 --- a/src/Shared/HandyControl_Shared/Interactivity/InvokeCommandAction.cs +++ b/src/Shared/HandyControl_Shared/Interactivity/InvokeCommandAction.cs @@ -35,7 +35,7 @@ namespace HandyControl.Interactivity public ICommand Command { - get => (ICommand)GetValue(CommandProperty); + get => (ICommand) GetValue(CommandProperty); set => SetValue(CommandProperty, value); } @@ -57,7 +57,7 @@ namespace HandyControl.Interactivity private ICommand ResolveCommand() { - var command = (ICommand)null; + var command = (ICommand) null; if (Command != null) command = Command; else if (AssociatedObject != null) @@ -65,8 +65,8 @@ namespace HandyControl.Interactivity .GetProperties(BindingFlags.Instance | BindingFlags.Public)) if (typeof(ICommand).IsAssignableFrom(property.PropertyType) && string.Equals(property.Name, CommandName, StringComparison.Ordinal)) - command = (ICommand)property.GetValue(AssociatedObject, null); + command = (ICommand) property.GetValue(AssociatedObject, null); return command; } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Interactivity/NameResolvedEventArgs.cs b/src/Shared/HandyControl_Shared/Interactivity/NameResolvedEventArgs.cs index 6d61d85a..a915e997 100644 --- a/src/Shared/HandyControl_Shared/Interactivity/NameResolvedEventArgs.cs +++ b/src/Shared/HandyControl_Shared/Interactivity/NameResolvedEventArgs.cs @@ -14,4 +14,4 @@ namespace HandyControl.Interactivity public object OldObject { get; } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Interactivity/NameResolver.cs b/src/Shared/HandyControl_Shared/Interactivity/NameResolver.cs index 517f59ac..125a5fb2 100644 --- a/src/Shared/HandyControl_Shared/Interactivity/NameResolver.cs +++ b/src/Shared/HandyControl_Shared/Interactivity/NameResolver.cs @@ -121,4 +121,4 @@ namespace HandyControl.Interactivity OnObjectChanged(oldObject, Object); } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Interactivity/PreviewInvokeEventArgs.cs b/src/Shared/HandyControl_Shared/Interactivity/PreviewInvokeEventArgs.cs index 7877fadd..e6ff78eb 100644 --- a/src/Shared/HandyControl_Shared/Interactivity/PreviewInvokeEventArgs.cs +++ b/src/Shared/HandyControl_Shared/Interactivity/PreviewInvokeEventArgs.cs @@ -6,4 +6,4 @@ namespace HandyControl.Interactivity { public bool Cancelling { get; set; } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Interactivity/RoutedEventTrigger.cs b/src/Shared/HandyControl_Shared/Interactivity/RoutedEventTrigger.cs index d9c4971f..47ae37e9 100644 --- a/src/Shared/HandyControl_Shared/Interactivity/RoutedEventTrigger.cs +++ b/src/Shared/HandyControl_Shared/Interactivity/RoutedEventTrigger.cs @@ -11,7 +11,7 @@ namespace HandyControl.Interactivity { var behavior = AssociatedObject as Behavior; var associatedElement = AssociatedObject as FrameworkElement; - if (behavior != null) associatedElement = ((IAttachedObject)behavior).AssociatedObject as FrameworkElement; + if (behavior != null) associatedElement = ((IAttachedObject) behavior).AssociatedObject as FrameworkElement; if (associatedElement == null) throw new ArgumentException(); if (RoutedEvent != null) associatedElement.AddHandler(RoutedEvent, new RoutedEventHandler(OnRoutedEvent)); } @@ -26,4 +26,4 @@ namespace HandyControl.Interactivity return RoutedEvent.Name; } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Interactivity/TagType.cs b/src/Shared/HandyControl_Shared/Interactivity/TagType.cs index bbda88c9..01b30e07 100644 --- a/src/Shared/HandyControl_Shared/Interactivity/TagType.cs +++ b/src/Shared/HandyControl_Shared/Interactivity/TagType.cs @@ -5,4 +5,4 @@ Element, DataContext } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Interactivity/TransitionEffect.cs b/src/Shared/HandyControl_Shared/Interactivity/TransitionEffect.cs index 07deaaf2..55c3abc3 100644 --- a/src/Shared/HandyControl_Shared/Interactivity/TransitionEffect.cs +++ b/src/Shared/HandyControl_Shared/Interactivity/TransitionEffect.cs @@ -53,4 +53,4 @@ namespace HandyControl.Interactivity protected abstract TransitionEffect DeepCopy(); } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Interactivity/TriggerAction!1.cs b/src/Shared/HandyControl_Shared/Interactivity/TriggerAction!1.cs index 57d0df4c..af2bdab6 100644 --- a/src/Shared/HandyControl_Shared/Interactivity/TriggerAction!1.cs +++ b/src/Shared/HandyControl_Shared/Interactivity/TriggerAction!1.cs @@ -10,10 +10,10 @@ namespace HandyControl.Interactivity } #pragma warning disable 108,114 - protected T AssociatedObject => (T)base.AssociatedObject; + protected T AssociatedObject => (T) base.AssociatedObject; #pragma warning restore 108,114 protected sealed override Type AssociatedObjectTypeConstraint => base.AssociatedObjectTypeConstraint; } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Interactivity/TriggerAction.cs b/src/Shared/HandyControl_Shared/Interactivity/TriggerAction.cs index 1a36f453..2cbae724 100644 --- a/src/Shared/HandyControl_Shared/Interactivity/TriggerAction.cs +++ b/src/Shared/HandyControl_Shared/Interactivity/TriggerAction.cs @@ -115,4 +115,4 @@ namespace HandyControl.Interactivity { } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Interactivity/TriggerActionCollection.cs b/src/Shared/HandyControl_Shared/Interactivity/TriggerActionCollection.cs index dbcee6e3..4f41f01b 100644 --- a/src/Shared/HandyControl_Shared/Interactivity/TriggerActionCollection.cs +++ b/src/Shared/HandyControl_Shared/Interactivity/TriggerActionCollection.cs @@ -43,4 +43,4 @@ namespace HandyControl.Interactivity action.Detach(); } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Interactivity/TriggerBase.cs b/src/Shared/HandyControl_Shared/Interactivity/TriggerBase.cs index d1eaeeff..f66e0341 100644 --- a/src/Shared/HandyControl_Shared/Interactivity/TriggerBase.cs +++ b/src/Shared/HandyControl_Shared/Interactivity/TriggerBase.cs @@ -107,4 +107,4 @@ namespace HandyControl.Interactivity { } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Interactivity/TriggerCollection.cs b/src/Shared/HandyControl_Shared/Interactivity/TriggerCollection.cs index ce0a4c4d..84fce1c2 100644 --- a/src/Shared/HandyControl_Shared/Interactivity/TriggerCollection.cs +++ b/src/Shared/HandyControl_Shared/Interactivity/TriggerCollection.cs @@ -39,4 +39,4 @@ namespace HandyControl.Interactivity return new TriggerCollection(); } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Interactivity/TypeConstraintAttribute.cs b/src/Shared/HandyControl_Shared/Interactivity/TypeConstraintAttribute.cs index edf0d49e..1984e7d2 100644 --- a/src/Shared/HandyControl_Shared/Interactivity/TypeConstraintAttribute.cs +++ b/src/Shared/HandyControl_Shared/Interactivity/TypeConstraintAttribute.cs @@ -12,4 +12,4 @@ namespace HandyControl.Interactivity public Type Constraint { get; } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Media/Animation/DiscreteGeometryKeyFrame.cs b/src/Shared/HandyControl_Shared/Media/Animation/DiscreteGeometryKeyFrame.cs index 2a228e9f..38c46d6d 100644 --- a/src/Shared/HandyControl_Shared/Media/Animation/DiscreteGeometryKeyFrame.cs +++ b/src/Shared/HandyControl_Shared/Media/Animation/DiscreteGeometryKeyFrame.cs @@ -22,4 +22,4 @@ namespace HandyControl.Media.Animation protected override double[] InterpolateValueCore(double[] baseValue, double keyFrameProgress) => keyFrameProgress < 1.0 ? baseValue : Numbers; } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Media/Animation/GeometryAnimation.cs b/src/Shared/HandyControl_Shared/Media/Animation/GeometryAnimation.cs index 55677025..86c26970 100644 --- a/src/Shared/HandyControl_Shared/Media/Animation/GeometryAnimation.cs +++ b/src/Shared/HandyControl_Shared/Media/Animation/GeometryAnimation.cs @@ -20,7 +20,7 @@ namespace HandyControl.Media.Animation public GeometryAnimation() { - + } public GeometryAnimation(string fromValue, string toValue) : this() @@ -61,7 +61,7 @@ namespace HandyControl.Media.Animation FillBehavior = fillBehavior; } - public new GeometryAnimation Clone() => (GeometryAnimation)base.Clone(); + public new GeometryAnimation Clone() => (GeometryAnimation) base.Clone(); protected override Freezable CreateInstanceCore() => new GeometryAnimation(); @@ -96,10 +96,10 @@ namespace HandyControl.Media.Animation } var accumulated = new double[_numbersAccumulator.Length]; - + if (IsCumulative) { - var currentRepeat = (double)(animationClock.CurrentIteration - 1); + var currentRepeat = (double) (animationClock.CurrentIteration - 1); if (currentRepeat > 0.0) { @@ -136,7 +136,7 @@ namespace HandyControl.Media.Animation public Geometry From { - get => (Geometry)GetValue(FromProperty); + get => (Geometry) GetValue(FromProperty); set => SetValue(FromProperty, value); } @@ -145,7 +145,7 @@ namespace HandyControl.Media.Animation private static void OnToChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { - var obj = (GeometryAnimation)d; + var obj = (GeometryAnimation) d; if (e.NewValue is Geometry geometry) { var geometryStr = geometry.ToString(CultureInfo.InvariantCulture); @@ -157,7 +157,7 @@ namespace HandyControl.Media.Animation public Geometry To { - get => (Geometry)GetValue(ToProperty); + get => (Geometry) GetValue(ToProperty); set => SetValue(ToProperty, value); } @@ -166,14 +166,14 @@ namespace HandyControl.Media.Animation public IEasingFunction EasingFunction { - get => (IEasingFunction)GetValue(EasingFunctionProperty); + get => (IEasingFunction) GetValue(EasingFunctionProperty); set => SetValue(EasingFunctionProperty, value); } public bool IsCumulative { - get => (bool)GetValue(IsCumulativeProperty); + get => (bool) GetValue(IsCumulativeProperty); set => SetValue(IsCumulativeProperty, value); } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Media/Animation/GeometryAnimationBase.cs b/src/Shared/HandyControl_Shared/Media/Animation/GeometryAnimationBase.cs index 630c8257..f791b568 100644 --- a/src/Shared/HandyControl_Shared/Media/Animation/GeometryAnimationBase.cs +++ b/src/Shared/HandyControl_Shared/Media/Animation/GeometryAnimationBase.cs @@ -13,7 +13,7 @@ namespace HandyControl.Media.Animation Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture; } - public new GeometryAnimationBase Clone() => (GeometryAnimationBase)base.Clone(); + public new GeometryAnimationBase Clone() => (GeometryAnimationBase) base.Clone(); public sealed override object GetCurrentValue(object defaultOriginValue, object defaultDestinationValue, AnimationClock animationClock) { @@ -25,7 +25,7 @@ namespace HandyControl.Media.Animation { throw new ArgumentNullException(nameof(defaultDestinationValue)); } - return GetCurrentValue((Geometry)defaultOriginValue, (Geometry)defaultDestinationValue, animationClock); + return GetCurrentValue((Geometry) defaultOriginValue, (Geometry) defaultDestinationValue, animationClock); } public override Type TargetPropertyType @@ -57,4 +57,4 @@ namespace HandyControl.Media.Animation protected abstract Geometry GetCurrentValueCore(Geometry defaultOriginValue, Geometry defaultDestinationValue, AnimationClock animationClock); } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Media/Animation/GeometryAnimationUsingKeyFrames.cs b/src/Shared/HandyControl_Shared/Media/Animation/GeometryAnimationUsingKeyFrames.cs index 1db93792..c3c56980 100644 --- a/src/Shared/HandyControl_Shared/Media/Animation/GeometryAnimationUsingKeyFrames.cs +++ b/src/Shared/HandyControl_Shared/Media/Animation/GeometryAnimationUsingKeyFrames.cs @@ -32,9 +32,9 @@ namespace HandyControl.Media.Animation } private GeometryKeyFrameCollection _keyFrames; - + private ResolvedKeyFrameEntry[] _sortedResolvedKeyFrames; - + private bool _areKeyTimesValid; public GeometryAnimationUsingKeyFrames() @@ -42,9 +42,9 @@ namespace HandyControl.Media.Animation _areKeyTimesValid = true; } - public new GeometryAnimationUsingKeyFrames Clone() => (GeometryAnimationUsingKeyFrames)base.Clone(); + public new GeometryAnimationUsingKeyFrames Clone() => (GeometryAnimationUsingKeyFrames) base.Clone(); - public new GeometryAnimationUsingKeyFrames CloneCurrentValue() => (GeometryAnimationUsingKeyFrames)base.CloneCurrentValue(); + public new GeometryAnimationUsingKeyFrames CloneCurrentValue() => (GeometryAnimationUsingKeyFrames) base.CloneCurrentValue(); protected override bool FreezeCore(bool isChecking) { @@ -71,7 +71,7 @@ namespace HandyControl.Media.Animation protected override void CloneCore(Freezable sourceFreezable) { - var sourceAnimation = (GeometryAnimationUsingKeyFrames)sourceFreezable; + var sourceAnimation = (GeometryAnimationUsingKeyFrames) sourceFreezable; base.CloneCore(sourceFreezable); CopyCommon(sourceAnimation, false); @@ -79,7 +79,7 @@ namespace HandyControl.Media.Animation protected override void CloneCurrentValueCore(Freezable sourceFreezable) { - var sourceAnimation = (GeometryAnimationUsingKeyFrames)sourceFreezable; + var sourceAnimation = (GeometryAnimationUsingKeyFrames) sourceFreezable; base.CloneCurrentValueCore(sourceFreezable); CopyCommon(sourceAnimation, true); @@ -87,7 +87,7 @@ namespace HandyControl.Media.Animation protected override void GetAsFrozenCore(Freezable source) { - var sourceAnimation = (GeometryAnimationUsingKeyFrames)source; + var sourceAnimation = (GeometryAnimationUsingKeyFrames) source; base.GetAsFrozenCore(source); CopyCommon(sourceAnimation, false); @@ -95,7 +95,7 @@ namespace HandyControl.Media.Animation protected override void GetCurrentValueAsFrozenCore(Freezable source) { - var sourceAnimation = (GeometryAnimationUsingKeyFrames)source; + var sourceAnimation = (GeometryAnimationUsingKeyFrames) source; base.GetCurrentValueAsFrozenCore(source); CopyCommon(sourceAnimation, true); @@ -107,14 +107,14 @@ namespace HandyControl.Media.Animation if (_areKeyTimesValid && sourceAnimation._sortedResolvedKeyFrames != null) { - _sortedResolvedKeyFrames = (ResolvedKeyFrameEntry[])sourceAnimation._sortedResolvedKeyFrames.Clone(); + _sortedResolvedKeyFrames = (ResolvedKeyFrameEntry[]) sourceAnimation._sortedResolvedKeyFrames.Clone(); } if (sourceAnimation._keyFrames != null) { if (isCurrentValueClone) { - _keyFrames = (GeometryKeyFrameCollection)sourceAnimation._keyFrames.CloneCurrentValue(); + _keyFrames = (GeometryKeyFrameCollection) sourceAnimation._keyFrames.CloneCurrentValue(); } else { @@ -234,7 +234,7 @@ namespace HandyControl.Media.Animation currentIterationValue = GetResolvedKeyFrame(currentResolvedKeyFrameIndex).InterpolateValue(fromValue, currentSegmentProgress); } - + return AnimationHelper.ComposeGeometry(Strings, currentIterationValue); } @@ -243,7 +243,7 @@ namespace HandyControl.Media.Animation IList IKeyFrameAnimation.KeyFrames { get => KeyFrames; - set => KeyFrames = (GeometryKeyFrameCollection)value; + set => KeyFrames = (GeometryKeyFrameCollection) value; } public GeometryKeyFrameCollection KeyFrames diff --git a/src/Shared/HandyControl_Shared/Media/Animation/GeometryKeyFrame.cs b/src/Shared/HandyControl_Shared/Media/Animation/GeometryKeyFrame.cs index 96c57116..f91698a6 100644 --- a/src/Shared/HandyControl_Shared/Media/Animation/GeometryKeyFrame.cs +++ b/src/Shared/HandyControl_Shared/Media/Animation/GeometryKeyFrame.cs @@ -11,7 +11,7 @@ public abstract class GeometryKeyFrame : Freezable, IKeyFrame protected GeometryKeyFrame() { - + } protected GeometryKeyFrame(Geometry value) @@ -35,7 +35,7 @@ public abstract class GeometryKeyFrame : Freezable, IKeyFrame object IKeyFrame.Value { get => Value; - set => Value = (Geometry)value; + set => Value = (Geometry) value; } public static readonly DependencyProperty ValueProperty = DependencyProperty.Register( @@ -66,4 +66,4 @@ public abstract class GeometryKeyFrame : Freezable, IKeyFrame } protected abstract double[] InterpolateValueCore(double[] baseValue, double keyFrameProgress); -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Media/Animation/GeometryKeyFrameCollection.cs b/src/Shared/HandyControl_Shared/Media/Animation/GeometryKeyFrameCollection.cs index dcf1b198..f8fdf353 100644 --- a/src/Shared/HandyControl_Shared/Media/Animation/GeometryKeyFrameCollection.cs +++ b/src/Shared/HandyControl_Shared/Media/Animation/GeometryKeyFrameCollection.cs @@ -9,7 +9,7 @@ namespace HandyControl.Media.Animation public class GeometryKeyFrameCollection : Freezable, IList { private List _keyFrames; - + private static GeometryKeyFrameCollection s_emptyCollection; public GeometryKeyFrameCollection() @@ -34,16 +34,16 @@ namespace HandyControl.Media.Animation } return s_emptyCollection; - } + } } - public new GeometryKeyFrameCollection Clone() => (GeometryKeyFrameCollection)base.Clone(); + public new GeometryKeyFrameCollection Clone() => (GeometryKeyFrameCollection) base.Clone(); protected override Freezable CreateInstanceCore() => new GeometryKeyFrameCollection(); protected override void CloneCore(Freezable sourceFreezable) { - var sourceCollection = (GeometryKeyFrameCollection)sourceFreezable; + var sourceCollection = (GeometryKeyFrameCollection) sourceFreezable; base.CloneCore(sourceFreezable); var count = sourceCollection._keyFrames.Count; @@ -52,7 +52,7 @@ namespace HandyControl.Media.Animation for (var i = 0; i < count; i++) { - var keyFrame = (GeometryKeyFrame)sourceCollection._keyFrames[i].Clone(); + var keyFrame = (GeometryKeyFrame) sourceCollection._keyFrames[i].Clone(); _keyFrames.Add(keyFrame); OnFreezablePropertyChanged(null, keyFrame); } @@ -60,7 +60,7 @@ namespace HandyControl.Media.Animation protected override void CloneCurrentValueCore(Freezable sourceFreezable) { - var sourceCollection = (GeometryKeyFrameCollection)sourceFreezable; + var sourceCollection = (GeometryKeyFrameCollection) sourceFreezable; base.CloneCurrentValueCore(sourceFreezable); var count = sourceCollection._keyFrames.Count; @@ -69,7 +69,7 @@ namespace HandyControl.Media.Animation for (var i = 0; i < count; i++) { - var keyFrame = (GeometryKeyFrame)sourceCollection._keyFrames[i].CloneCurrentValue(); + var keyFrame = (GeometryKeyFrame) sourceCollection._keyFrames[i].CloneCurrentValue(); _keyFrames.Add(keyFrame); OnFreezablePropertyChanged(null, keyFrame); } @@ -77,7 +77,7 @@ namespace HandyControl.Media.Animation protected override void GetAsFrozenCore(Freezable sourceFreezable) { - var sourceCollection = (GeometryKeyFrameCollection)sourceFreezable; + var sourceCollection = (GeometryKeyFrameCollection) sourceFreezable; base.GetAsFrozenCore(sourceFreezable); var count = sourceCollection._keyFrames.Count; @@ -86,7 +86,7 @@ namespace HandyControl.Media.Animation for (var i = 0; i < count; i++) { - var keyFrame = (GeometryKeyFrame)sourceCollection._keyFrames[i].GetAsFrozen(); + var keyFrame = (GeometryKeyFrame) sourceCollection._keyFrames[i].GetAsFrozen(); _keyFrames.Add(keyFrame); OnFreezablePropertyChanged(null, keyFrame); } @@ -94,7 +94,7 @@ namespace HandyControl.Media.Animation protected override void GetCurrentValueAsFrozenCore(Freezable sourceFreezable) { - var sourceCollection = (GeometryKeyFrameCollection)sourceFreezable; + var sourceCollection = (GeometryKeyFrameCollection) sourceFreezable; base.GetCurrentValueAsFrozenCore(sourceFreezable); var count = sourceCollection._keyFrames.Count; @@ -103,7 +103,7 @@ namespace HandyControl.Media.Animation for (var i = 0; i < count; i++) { - var keyFrame = (GeometryKeyFrame)sourceCollection._keyFrames[i].GetCurrentValueAsFrozen(); + var keyFrame = (GeometryKeyFrame) sourceCollection._keyFrames[i].GetCurrentValueAsFrozen(); _keyFrames.Add(keyFrame); OnFreezablePropertyChanged(null, keyFrame); } @@ -132,7 +132,7 @@ namespace HandyControl.Media.Animation { ReadPreamble(); - ((ICollection)_keyFrames).CopyTo(array, index); + ((ICollection) _keyFrames).CopyTo(array, index); } public void CopyTo(GeometryKeyFrame[] array, int index) @@ -151,14 +151,14 @@ namespace HandyControl.Media.Animation return _keyFrames.Count; } } - + public object SyncRoot { get { ReadPreamble(); - return ((ICollection)_keyFrames).SyncRoot; + return ((ICollection) _keyFrames).SyncRoot; } } @@ -172,7 +172,7 @@ namespace HandyControl.Media.Animation } } - int IList.Add(object keyFrame) => Add((GeometryKeyFrame)keyFrame); + int IList.Add(object keyFrame) => Add((GeometryKeyFrame) keyFrame); public int Add(GeometryKeyFrame keyFrame) { @@ -196,7 +196,7 @@ namespace HandyControl.Media.Animation WritePreamble(); if (_keyFrames.Count <= 0) return; - + foreach (var frame in _keyFrames) { OnFreezablePropertyChanged(frame, null); @@ -207,7 +207,7 @@ namespace HandyControl.Media.Animation WritePostscript(); } - bool IList.Contains(object keyFrame) => Contains((GeometryKeyFrame)keyFrame); + bool IList.Contains(object keyFrame) => Contains((GeometryKeyFrame) keyFrame); public bool Contains(GeometryKeyFrame keyFrame) { @@ -216,7 +216,7 @@ namespace HandyControl.Media.Animation return _keyFrames.Contains(keyFrame); } - int IList.IndexOf(object keyFrame) => IndexOf((GeometryKeyFrame)keyFrame); + int IList.IndexOf(object keyFrame) => IndexOf((GeometryKeyFrame) keyFrame); public int IndexOf(GeometryKeyFrame keyFrame) { @@ -225,7 +225,7 @@ namespace HandyControl.Media.Animation return _keyFrames.IndexOf(keyFrame); } - void IList.Insert(int index, object keyFrame) => Insert(index, (GeometryKeyFrame)keyFrame); + void IList.Insert(int index, object keyFrame) => Insert(index, (GeometryKeyFrame) keyFrame); public void Insert(int index, GeometryKeyFrame keyFrame) { @@ -242,7 +242,7 @@ namespace HandyControl.Media.Animation WritePostscript(); } - void IList.Remove(object keyFrame) => Remove((GeometryKeyFrame)keyFrame); + void IList.Remove(object keyFrame) => Remove((GeometryKeyFrame) keyFrame); public void Remove(GeometryKeyFrame keyFrame) { @@ -270,7 +270,7 @@ namespace HandyControl.Media.Animation object IList.this[int index] { get => this[index]; - set => this[index] = (GeometryKeyFrame)value; + set => this[index] = (GeometryKeyFrame) value; } public GeometryKeyFrame this[int index] diff --git a/src/Shared/HandyControl_Shared/Media/Animation/ResolvedKeyFrameEntry.cs b/src/Shared/HandyControl_Shared/Media/Animation/ResolvedKeyFrameEntry.cs index 7531cffc..485128fa 100644 --- a/src/Shared/HandyControl_Shared/Media/Animation/ResolvedKeyFrameEntry.cs +++ b/src/Shared/HandyControl_Shared/Media/Animation/ResolvedKeyFrameEntry.cs @@ -5,12 +5,12 @@ namespace HandyControl.Media.Animation internal struct ResolvedKeyFrameEntry : IComparable { internal int _originalKeyFrameIndex; - + internal TimeSpan _resolvedKeyTime; public int CompareTo(object other) { - var otherEntry = (ResolvedKeyFrameEntry)other; + var otherEntry = (ResolvedKeyFrameEntry) other; if (otherEntry._resolvedKeyTime > _resolvedKeyTime) { diff --git a/src/Shared/HandyControl_Shared/Media/Effects/BrightnessEffect.cs b/src/Shared/HandyControl_Shared/Media/Effects/BrightnessEffect.cs index ca36952f..bd0e86cc 100644 --- a/src/Shared/HandyControl_Shared/Media/Effects/BrightnessEffect.cs +++ b/src/Shared/HandyControl_Shared/Media/Effects/BrightnessEffect.cs @@ -30,7 +30,7 @@ namespace HandyControl.Media.Effects public double Brightness { - get => (double)GetValue(BrightnessProperty); + get => (double) GetValue(BrightnessProperty); set => SetValue(BrightnessProperty, value); } } diff --git a/src/Shared/HandyControl_Shared/Media/Effects/ColorMatrixEffect.cs b/src/Shared/HandyControl_Shared/Media/Effects/ColorMatrixEffect.cs index 785f2431..ed6595d1 100644 --- a/src/Shared/HandyControl_Shared/Media/Effects/ColorMatrixEffect.cs +++ b/src/Shared/HandyControl_Shared/Media/Effects/ColorMatrixEffect.cs @@ -55,7 +55,7 @@ namespace HandyControl.Media.Effects public double M11 { - get => (double)GetValue(M11Property); + get => (double) GetValue(M11Property); set => SetValue(M11Property, value); } @@ -64,7 +64,7 @@ namespace HandyControl.Media.Effects public double M21 { - get => (double)GetValue(M21Property); + get => (double) GetValue(M21Property); set => SetValue(M21Property, value); } @@ -73,7 +73,7 @@ namespace HandyControl.Media.Effects public double M31 { - get => (double)GetValue(M31Property); + get => (double) GetValue(M31Property); set => SetValue(M31Property, value); } @@ -82,7 +82,7 @@ namespace HandyControl.Media.Effects public double M41 { - get => (double)GetValue(M41Property); + get => (double) GetValue(M41Property); set => SetValue(M41Property, value); } @@ -91,7 +91,7 @@ namespace HandyControl.Media.Effects public double M51 { - get => (double)GetValue(M51Property); + get => (double) GetValue(M51Property); set => SetValue(M51Property, value); } @@ -104,7 +104,7 @@ namespace HandyControl.Media.Effects public double M12 { - get => (double)GetValue(M12Property); + get => (double) GetValue(M12Property); set => SetValue(M12Property, value); } @@ -113,7 +113,7 @@ namespace HandyControl.Media.Effects public double M22 { - get => (double)GetValue(M22Property); + get => (double) GetValue(M22Property); set => SetValue(M22Property, value); } @@ -122,7 +122,7 @@ namespace HandyControl.Media.Effects public double M32 { - get => (double)GetValue(M32Property); + get => (double) GetValue(M32Property); set => SetValue(M32Property, value); } @@ -131,7 +131,7 @@ namespace HandyControl.Media.Effects public double M42 { - get => (double)GetValue(M42Property); + get => (double) GetValue(M42Property); set => SetValue(M42Property, value); } @@ -140,7 +140,7 @@ namespace HandyControl.Media.Effects public double M52 { - get => (double)GetValue(M52Property); + get => (double) GetValue(M52Property); set => SetValue(M52Property, value); } @@ -153,7 +153,7 @@ namespace HandyControl.Media.Effects public double M13 { - get => (double)GetValue(M13Property); + get => (double) GetValue(M13Property); set => SetValue(M13Property, value); } @@ -162,7 +162,7 @@ namespace HandyControl.Media.Effects public double M23 { - get => (double)GetValue(M23Property); + get => (double) GetValue(M23Property); set => SetValue(M23Property, value); } @@ -171,7 +171,7 @@ namespace HandyControl.Media.Effects public double M33 { - get => (double)GetValue(M33Property); + get => (double) GetValue(M33Property); set => SetValue(M33Property, value); } @@ -180,7 +180,7 @@ namespace HandyControl.Media.Effects public double M43 { - get => (double)GetValue(M43Property); + get => (double) GetValue(M43Property); set => SetValue(M43Property, value); } @@ -189,7 +189,7 @@ namespace HandyControl.Media.Effects public double M53 { - get => (double)GetValue(M53Property); + get => (double) GetValue(M53Property); set => SetValue(M53Property, value); } @@ -202,7 +202,7 @@ namespace HandyControl.Media.Effects public double M14 { - get => (double)GetValue(M14Property); + get => (double) GetValue(M14Property); set => SetValue(M14Property, value); } @@ -211,7 +211,7 @@ namespace HandyControl.Media.Effects public double M24 { - get => (double)GetValue(M24Property); + get => (double) GetValue(M24Property); set => SetValue(M24Property, value); } @@ -220,7 +220,7 @@ namespace HandyControl.Media.Effects public double M34 { - get => (double)GetValue(M34Property); + get => (double) GetValue(M34Property); set => SetValue(M34Property, value); } @@ -229,7 +229,7 @@ namespace HandyControl.Media.Effects public double M44 { - get => (double)GetValue(M44Property); + get => (double) GetValue(M44Property); set => SetValue(M44Property, value); } @@ -238,10 +238,10 @@ namespace HandyControl.Media.Effects public double M54 { - get => (double)GetValue(M54Property); + get => (double) GetValue(M54Property); set => SetValue(M54Property, value); } #endregion } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Media/Effects/ContrastEffect.cs b/src/Shared/HandyControl_Shared/Media/Effects/ContrastEffect.cs index 8fef34eb..ef837f7e 100644 --- a/src/Shared/HandyControl_Shared/Media/Effects/ContrastEffect.cs +++ b/src/Shared/HandyControl_Shared/Media/Effects/ContrastEffect.cs @@ -30,7 +30,7 @@ namespace HandyControl.Media.Effects public double Contrast { - get => (double)GetValue(ContrastProperty); + get => (double) GetValue(ContrastProperty); set => SetValue(ContrastProperty, value); } } diff --git a/src/Shared/HandyControl_Shared/Media/Effects/EffectBase.cs b/src/Shared/HandyControl_Shared/Media/Effects/EffectBase.cs index 15c9dc3c..5e7f9bc5 100644 --- a/src/Shared/HandyControl_Shared/Media/Effects/EffectBase.cs +++ b/src/Shared/HandyControl_Shared/Media/Effects/EffectBase.cs @@ -10,7 +10,7 @@ namespace HandyControl.Media.Effects public Brush Input { - get => (Brush)GetValue(InputProperty); + get => (Brush) GetValue(InputProperty); set => SetValue(InputProperty, value); } } diff --git a/src/Shared/HandyControl_Shared/Properties/AssemblyInfo.cs b/src/Shared/HandyControl_Shared/Properties/AssemblyInfo.cs index 5e7068dc..b4e566f8 100644 --- a/src/Shared/HandyControl_Shared/Properties/AssemblyInfo.cs +++ b/src/Shared/HandyControl_Shared/Properties/AssemblyInfo.cs @@ -12,4 +12,4 @@ [assembly: XmlnsDefinition("https://handyorg.github.io/handycontrol", "HandyControl.Data")] [assembly: XmlnsDefinition("https://handyorg.github.io/handycontrol", "HandyControl.Properties.Langs")] [assembly: XmlnsDefinition("https://handyorg.github.io/handycontrol", "HandyControl.Themes")] -[assembly: XmlnsPrefix("https://handyorg.github.io/handycontrol", "hc")] \ No newline at end of file +[assembly: XmlnsPrefix("https://handyorg.github.io/handycontrol", "hc")] diff --git a/src/Shared/HandyControl_Shared/Properties/Langs/LangProvider.cs b/src/Shared/HandyControl_Shared/Properties/Langs/LangProvider.cs index 5302237c..6a7cd365 100644 --- a/src/Shared/HandyControl_Shared/Properties/Langs/LangProvider.cs +++ b/src/Shared/HandyControl_Shared/Properties/Langs/LangProvider.cs @@ -35,48 +35,48 @@ namespace HandyControl.Properties.Langs Mode = BindingMode.OneWay }); - private void UpdateLangs() + private void UpdateLangs() { OnPropertyChanged(nameof(All)); OnPropertyChanged(nameof(Am)); - OnPropertyChanged(nameof(Cancel)); - OnPropertyChanged(nameof(CannotRegisterCompositeCommandInItself)); - OnPropertyChanged(nameof(CannotRegisterSameCommandTwice)); - OnPropertyChanged(nameof(Clear)); - OnPropertyChanged(nameof(Close)); - OnPropertyChanged(nameof(CloseAll)); - OnPropertyChanged(nameof(CloseOther)); - OnPropertyChanged(nameof(Confirm)); - OnPropertyChanged(nameof(ErrorImgPath)); - OnPropertyChanged(nameof(ErrorImgSize)); - OnPropertyChanged(nameof(Find)); - OnPropertyChanged(nameof(FormatError)); - OnPropertyChanged(nameof(Interval10m)); - OnPropertyChanged(nameof(Interval1h)); - OnPropertyChanged(nameof(Interval1m)); - OnPropertyChanged(nameof(Interval2h)); - OnPropertyChanged(nameof(Interval30m)); - OnPropertyChanged(nameof(Interval30s)); - OnPropertyChanged(nameof(Interval5m)); - OnPropertyChanged(nameof(IsNecessary)); - OnPropertyChanged(nameof(Jump)); - OnPropertyChanged(nameof(LangComment)); - OnPropertyChanged(nameof(NextPage)); - OnPropertyChanged(nameof(No)); - OnPropertyChanged(nameof(OutOfRange)); - OnPropertyChanged(nameof(PageMode)); - OnPropertyChanged(nameof(Pm)); - OnPropertyChanged(nameof(PngImg)); - OnPropertyChanged(nameof(PreviousPage)); - OnPropertyChanged(nameof(ScrollMode)); - OnPropertyChanged(nameof(Tip)); - OnPropertyChanged(nameof(TooLarge)); - OnPropertyChanged(nameof(TwoPageMode)); - OnPropertyChanged(nameof(Unknown)); - OnPropertyChanged(nameof(UnknownSize)); - OnPropertyChanged(nameof(Yes)); - OnPropertyChanged(nameof(ZoomIn)); - OnPropertyChanged(nameof(ZoomOut)); + OnPropertyChanged(nameof(Cancel)); + OnPropertyChanged(nameof(CannotRegisterCompositeCommandInItself)); + OnPropertyChanged(nameof(CannotRegisterSameCommandTwice)); + OnPropertyChanged(nameof(Clear)); + OnPropertyChanged(nameof(Close)); + OnPropertyChanged(nameof(CloseAll)); + OnPropertyChanged(nameof(CloseOther)); + OnPropertyChanged(nameof(Confirm)); + OnPropertyChanged(nameof(ErrorImgPath)); + OnPropertyChanged(nameof(ErrorImgSize)); + OnPropertyChanged(nameof(Find)); + OnPropertyChanged(nameof(FormatError)); + OnPropertyChanged(nameof(Interval10m)); + OnPropertyChanged(nameof(Interval1h)); + OnPropertyChanged(nameof(Interval1m)); + OnPropertyChanged(nameof(Interval2h)); + OnPropertyChanged(nameof(Interval30m)); + OnPropertyChanged(nameof(Interval30s)); + OnPropertyChanged(nameof(Interval5m)); + OnPropertyChanged(nameof(IsNecessary)); + OnPropertyChanged(nameof(Jump)); + OnPropertyChanged(nameof(LangComment)); + OnPropertyChanged(nameof(NextPage)); + OnPropertyChanged(nameof(No)); + OnPropertyChanged(nameof(OutOfRange)); + OnPropertyChanged(nameof(PageMode)); + OnPropertyChanged(nameof(Pm)); + OnPropertyChanged(nameof(PngImg)); + OnPropertyChanged(nameof(PreviousPage)); + OnPropertyChanged(nameof(ScrollMode)); + OnPropertyChanged(nameof(Tip)); + OnPropertyChanged(nameof(TooLarge)); + OnPropertyChanged(nameof(TwoPageMode)); + OnPropertyChanged(nameof(Unknown)); + OnPropertyChanged(nameof(UnknownSize)); + OnPropertyChanged(nameof(Yes)); + OnPropertyChanged(nameof(ZoomIn)); + OnPropertyChanged(nameof(ZoomOut)); } /// @@ -489,4 +489,4 @@ namespace HandyControl.Properties.Langs public static string ZoomOut = nameof(ZoomOut); } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Tools/Converter/Boolean2BooleanReConverter.cs b/src/Shared/HandyControl_Shared/Tools/Converter/Boolean2BooleanReConverter.cs index 474ea402..2c551e59 100644 --- a/src/Shared/HandyControl_Shared/Tools/Converter/Boolean2BooleanReConverter.cs +++ b/src/Shared/HandyControl_Shared/Tools/Converter/Boolean2BooleanReConverter.cs @@ -24,4 +24,4 @@ namespace HandyControl.Tools.Converter return value; } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Tools/Converter/Boolean2StrConverter.cs b/src/Shared/HandyControl_Shared/Tools/Converter/Boolean2StrConverter.cs index 68691273..075d0bf6 100644 --- a/src/Shared/HandyControl_Shared/Tools/Converter/Boolean2StrConverter.cs +++ b/src/Shared/HandyControl_Shared/Tools/Converter/Boolean2StrConverter.cs @@ -29,4 +29,4 @@ namespace HandyControl.Tools.Converter throw new NotImplementedException(); } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Tools/Converter/Boolean2VisibilityReConverter.cs b/src/Shared/HandyControl_Shared/Tools/Converter/Boolean2VisibilityReConverter.cs index 83eaad30..36d0242d 100644 --- a/src/Shared/HandyControl_Shared/Tools/Converter/Boolean2VisibilityReConverter.cs +++ b/src/Shared/HandyControl_Shared/Tools/Converter/Boolean2VisibilityReConverter.cs @@ -9,7 +9,7 @@ namespace HandyControl.Tools.Converter { public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { - return value != null && (bool)value ? Visibility.Collapsed : Visibility.Visible; + return value != null && (bool) value ? Visibility.Collapsed : Visibility.Visible; } public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) @@ -17,4 +17,4 @@ namespace HandyControl.Tools.Converter throw new NotImplementedException(); } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Tools/Converter/BooleanArr2VisibilityConverter.cs b/src/Shared/HandyControl_Shared/Tools/Converter/BooleanArr2VisibilityConverter.cs index 146d532e..ab8ae7fd 100644 --- a/src/Shared/HandyControl_Shared/Tools/Converter/BooleanArr2VisibilityConverter.cs +++ b/src/Shared/HandyControl_Shared/Tools/Converter/BooleanArr2VisibilityConverter.cs @@ -15,7 +15,7 @@ namespace HandyControl.Tools.Converter { return Visibility.Collapsed; } - + var arr = new List(); foreach (var item in values) { @@ -36,4 +36,4 @@ namespace HandyControl.Tools.Converter throw new NotImplementedException(); } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Tools/Converter/BorderCircularClipConverter.cs b/src/Shared/HandyControl_Shared/Tools/Converter/BorderCircularClipConverter.cs index 65a27532..a47acf92 100644 --- a/src/Shared/HandyControl_Shared/Tools/Converter/BorderCircularClipConverter.cs +++ b/src/Shared/HandyControl_Shared/Tools/Converter/BorderCircularClipConverter.cs @@ -33,4 +33,4 @@ namespace HandyControl.Tools.Converter throw new NotSupportedException(); } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Tools/Converter/BorderCircularConverter.cs b/src/Shared/HandyControl_Shared/Tools/Converter/BorderCircularConverter.cs index b7170562..13ec9abb 100644 --- a/src/Shared/HandyControl_Shared/Tools/Converter/BorderCircularConverter.cs +++ b/src/Shared/HandyControl_Shared/Tools/Converter/BorderCircularConverter.cs @@ -17,7 +17,7 @@ namespace HandyControl.Tools.Converter } var min = Math.Min(width, height); - return new CornerRadius(min/2); + return new CornerRadius(min / 2); } return DependencyProperty.UnsetValue; @@ -28,4 +28,4 @@ namespace HandyControl.Tools.Converter throw new NotSupportedException(); } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Tools/Converter/BorderClipConverter.cs b/src/Shared/HandyControl_Shared/Tools/Converter/BorderClipConverter.cs index e55cfb71..c4c30b75 100644 --- a/src/Shared/HandyControl_Shared/Tools/Converter/BorderClipConverter.cs +++ b/src/Shared/HandyControl_Shared/Tools/Converter/BorderClipConverter.cs @@ -47,4 +47,4 @@ namespace HandyControl.Tools.Converter throw new NotSupportedException(); } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Tools/Converter/ColLayoutConverter.cs b/src/Shared/HandyControl_Shared/Tools/Converter/ColLayoutConverter.cs index 0116ffa8..5411a8bc 100644 --- a/src/Shared/HandyControl_Shared/Tools/Converter/ColLayoutConverter.cs +++ b/src/Shared/HandyControl_Shared/Tools/Converter/ColLayoutConverter.cs @@ -108,9 +108,9 @@ namespace HandyControl.Tools.Converter return i switch { 1 => new ColLayout(lengths[0]), - 2 => new ColLayout {Xs = lengths[0], Sm = lengths[1]}, - 3 => new ColLayout {Xs = lengths[0], Sm = lengths[1], Md = lengths[2]}, - 4 => new ColLayout {Xs = lengths[0], Sm = lengths[1], Md = lengths[2], Lg = lengths[3]}, + 2 => new ColLayout { Xs = lengths[0], Sm = lengths[1] }, + 3 => new ColLayout { Xs = lengths[0], Sm = lengths[1], Md = lengths[2] }, + 4 => new ColLayout { Xs = lengths[0], Sm = lengths[1], Md = lengths[2], Lg = lengths[3] }, 5 => new ColLayout { Xs = lengths[0], @@ -132,4 +132,4 @@ namespace HandyControl.Tools.Converter }; } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Tools/Converter/Color2ChannelAConverter.cs b/src/Shared/HandyControl_Shared/Tools/Converter/Color2ChannelAConverter.cs index 84f2ed4f..2402f1d8 100644 --- a/src/Shared/HandyControl_Shared/Tools/Converter/Color2ChannelAConverter.cs +++ b/src/Shared/HandyControl_Shared/Tools/Converter/Color2ChannelAConverter.cs @@ -36,4 +36,4 @@ namespace HandyControl.Tools.Converter return parameter; } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Tools/Converter/Color2HexStrConverter.cs b/src/Shared/HandyControl_Shared/Tools/Converter/Color2HexStrConverter.cs index 661be69c..5bf18280 100644 --- a/src/Shared/HandyControl_Shared/Tools/Converter/Color2HexStrConverter.cs +++ b/src/Shared/HandyControl_Shared/Tools/Converter/Color2HexStrConverter.cs @@ -37,4 +37,4 @@ namespace HandyControl.Tools.Converter return new SolidColorBrush(default); } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Tools/Converter/Int2StrConverter.cs b/src/Shared/HandyControl_Shared/Tools/Converter/Int2StrConverter.cs index 9e98e746..a94b1bae 100644 --- a/src/Shared/HandyControl_Shared/Tools/Converter/Int2StrConverter.cs +++ b/src/Shared/HandyControl_Shared/Tools/Converter/Int2StrConverter.cs @@ -35,4 +35,4 @@ namespace HandyControl.Tools.Converter throw new NotImplementedException(); } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Tools/Converter/Long2FileSizeConverter.cs b/src/Shared/HandyControl_Shared/Tools/Converter/Long2FileSizeConverter.cs index 895b0b4f..246bd50e 100644 --- a/src/Shared/HandyControl_Shared/Tools/Converter/Long2FileSizeConverter.cs +++ b/src/Shared/HandyControl_Shared/Tools/Converter/Long2FileSizeConverter.cs @@ -49,4 +49,4 @@ namespace HandyControl.Tools.Converter throw new NotImplementedException(); } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Tools/Converter/Object2BooleanConverter.cs b/src/Shared/HandyControl_Shared/Tools/Converter/Object2BooleanConverter.cs index 399b4685..a0ba09a2 100644 --- a/src/Shared/HandyControl_Shared/Tools/Converter/Object2BooleanConverter.cs +++ b/src/Shared/HandyControl_Shared/Tools/Converter/Object2BooleanConverter.cs @@ -13,4 +13,4 @@ namespace HandyControl.Tools.Converter throw new NotImplementedException(); } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Tools/Converter/String2VisibilityConverter.cs b/src/Shared/HandyControl_Shared/Tools/Converter/String2VisibilityConverter.cs index 70a72827..6a8fba25 100644 --- a/src/Shared/HandyControl_Shared/Tools/Converter/String2VisibilityConverter.cs +++ b/src/Shared/HandyControl_Shared/Tools/Converter/String2VisibilityConverter.cs @@ -9,12 +9,12 @@ namespace HandyControl.Tools.Converter { public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { - return string.IsNullOrEmpty((string)value) ? Visibility.Collapsed : Visibility.Visible; + return string.IsNullOrEmpty((string) value) ? Visibility.Collapsed : Visibility.Visible; } public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) { - return value != null && (Visibility)value == Visibility.Collapsed; + return value != null && (Visibility) value == Visibility.Collapsed; } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Tools/Converter/String2VisibilityReConverter.cs b/src/Shared/HandyControl_Shared/Tools/Converter/String2VisibilityReConverter.cs index cb5e7e73..42fb8816 100644 --- a/src/Shared/HandyControl_Shared/Tools/Converter/String2VisibilityReConverter.cs +++ b/src/Shared/HandyControl_Shared/Tools/Converter/String2VisibilityReConverter.cs @@ -9,12 +9,12 @@ namespace HandyControl.Tools.Converter { public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { - return string.IsNullOrEmpty((string)value) ? Visibility.Visible : Visibility.Collapsed; + return string.IsNullOrEmpty((string) value) ? Visibility.Visible : Visibility.Collapsed; } public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) { - return value != null && (Visibility)value == Visibility.Collapsed; + return value != null && (Visibility) value == Visibility.Collapsed; } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Tools/Converter/TreeViewItemMarginConverter.cs b/src/Shared/HandyControl_Shared/Tools/Converter/TreeViewItemMarginConverter.cs index a6bbd3e7..34ac1758 100644 --- a/src/Shared/HandyControl_Shared/Tools/Converter/TreeViewItemMarginConverter.cs +++ b/src/Shared/HandyControl_Shared/Tools/Converter/TreeViewItemMarginConverter.cs @@ -6,7 +6,7 @@ using System.Windows.Media; namespace HandyControl.Tools.Converter { - public class TreeViewItemMarginConverter: IValueConverter + public class TreeViewItemMarginConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { @@ -14,7 +14,7 @@ namespace HandyControl.Tools.Converter UIElement element = value as TreeViewItem; while (element != null && element.GetType() != typeof(TreeView)) { - element = (UIElement)VisualTreeHelper.GetParent(element); + element = (UIElement) VisualTreeHelper.GetParent(element); if (element is TreeViewItem) left += 19.0; } @@ -25,4 +25,4 @@ namespace HandyControl.Tools.Converter throw new NotImplementedException(); } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Tools/Extension/ColLayout.cs b/src/Shared/HandyControl_Shared/Tools/Extension/ColLayout.cs index 4db36da3..08bc0915 100644 --- a/src/Shared/HandyControl_Shared/Tools/Extension/ColLayout.cs +++ b/src/Shared/HandyControl_Shared/Tools/Extension/ColLayout.cs @@ -39,7 +39,7 @@ namespace HandyControl.Tools.Extension public ColLayout() { - + } public ColLayout(int uniformWidth) @@ -124,4 +124,4 @@ namespace HandyControl.Tools.Extension return sb.ToString(); } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Tools/Extension/ColorExtension.cs b/src/Shared/HandyControl_Shared/Tools/Extension/ColorExtension.cs index f4f2e0c5..c73f40b0 100644 --- a/src/Shared/HandyControl_Shared/Tools/Extension/ColorExtension.cs +++ b/src/Shared/HandyControl_Shared/Tools/Extension/ColorExtension.cs @@ -30,4 +30,4 @@ namespace HandyControl.Tools.Extension color.B }; } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Tools/Extension/EnumerableExtension.cs b/src/Shared/HandyControl_Shared/Tools/Extension/EnumerableExtension.cs index 3d5685db..631001ad 100644 --- a/src/Shared/HandyControl_Shared/Tools/Extension/EnumerableExtension.cs +++ b/src/Shared/HandyControl_Shared/Tools/Extension/EnumerableExtension.cs @@ -28,4 +28,4 @@ namespace HandyControl.Tools.Extension return enumerable; } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Tools/Extension/FrameworkElementExtension.cs b/src/Shared/HandyControl_Shared/Tools/Extension/FrameworkElementExtension.cs index 8810122d..28b26358 100644 --- a/src/Shared/HandyControl_Shared/Tools/Extension/FrameworkElementExtension.cs +++ b/src/Shared/HandyControl_Shared/Tools/Extension/FrameworkElementExtension.cs @@ -55,4 +55,4 @@ namespace HandyControl.Tools.Extension return 0; } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Tools/Extension/GeometryExtension.cs b/src/Shared/HandyControl_Shared/Tools/Extension/GeometryExtension.cs index 1121bbca..f7b4ad68 100644 --- a/src/Shared/HandyControl_Shared/Tools/Extension/GeometryExtension.cs +++ b/src/Shared/HandyControl_Shared/Tools/Extension/GeometryExtension.cs @@ -47,4 +47,4 @@ namespace HandyControl.Tools.Extension return length / strokeThickness; } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Tools/Extension/LangExtension.cs b/src/Shared/HandyControl_Shared/Tools/Extension/LangExtension.cs index 4b7a1f0e..6cbca4b4 100644 --- a/src/Shared/HandyControl_Shared/Tools/Extension/LangExtension.cs +++ b/src/Shared/HandyControl_Shared/Tools/Extension/LangExtension.cs @@ -37,7 +37,7 @@ namespace HandyControl.Tools.Extension => element.SetValue(TargetPropertyProperty, value); private static DependencyProperty GetTargetProperty(DependencyObject element) - => (DependencyProperty)element.GetValue(TargetPropertyProperty); + => (DependencyProperty) element.GetValue(TargetPropertyProperty); public BindingMode Mode { get; set; } @@ -148,4 +148,4 @@ namespace HandyControl.Tools.Extension Mode = BindingMode.OneWay }; } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Tools/Extension/StringExtension.cs b/src/Shared/HandyControl_Shared/Tools/Extension/StringExtension.cs index 9cbe5e7a..9ecf53bf 100644 --- a/src/Shared/HandyControl_Shared/Tools/Extension/StringExtension.cs +++ b/src/Shared/HandyControl_Shared/Tools/Extension/StringExtension.cs @@ -9,7 +9,7 @@ namespace HandyControl.Tools.Extension { try { - return (T)TypeDescriptor.GetConverter(typeof(T)).ConvertFromString(input); + return (T) TypeDescriptor.GetConverter(typeof(T)).ConvertFromString(input); } catch { @@ -29,4 +29,4 @@ namespace HandyControl.Tools.Extension } } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Tools/Extension/UIElementExtension.cs b/src/Shared/HandyControl_Shared/Tools/Extension/UIElementExtension.cs index 7d242bec..2784b127 100644 --- a/src/Shared/HandyControl_Shared/Tools/Extension/UIElementExtension.cs +++ b/src/Shared/HandyControl_Shared/Tools/Extension/UIElementExtension.cs @@ -30,4 +30,4 @@ namespace HandyControl.Tools.Extension /// public static void Collapse(this UIElement element) => element.Visibility = Visibility.Collapsed; } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Tools/Extension/ValueExtension.cs b/src/Shared/HandyControl_Shared/Tools/Extension/ValueExtension.cs index ef3abf83..b57a6fe2 100644 --- a/src/Shared/HandyControl_Shared/Tools/Extension/ValueExtension.cs +++ b/src/Shared/HandyControl_Shared/Tools/Extension/ValueExtension.cs @@ -20,4 +20,4 @@ namespace HandyControl.Tools.Extension public static bool IsNaN(this double value) => double.IsNaN(value); } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Tools/Generator/ComparerGenerator.cs b/src/Shared/HandyControl_Shared/Tools/Generator/ComparerGenerator.cs index c1a30cb4..460f679a 100644 --- a/src/Shared/HandyControl_Shared/Tools/Generator/ComparerGenerator.cs +++ b/src/Shared/HandyControl_Shared/Tools/Generator/ComparerGenerator.cs @@ -18,7 +18,7 @@ namespace HandyControl.Tools { if (comparerType == ComparerTypeCode.DateTimeRange) { - return (IComparer)new DateTimeRangeComparer(); + return (IComparer) new DateTimeRangeComparer(); } return null; diff --git a/src/Shared/HandyControl_Shared/Tools/Generator/GithubGravatarGenerator.cs b/src/Shared/HandyControl_Shared/Tools/Generator/GithubGravatarGenerator.cs index 7fe3d3e0..b3263950 100644 --- a/src/Shared/HandyControl_Shared/Tools/Generator/GithubGravatarGenerator.cs +++ b/src/Shared/HandyControl_Shared/Tools/Generator/GithubGravatarGenerator.cs @@ -90,7 +90,7 @@ namespace HandyControl.Tools private Brush GetRenderBrush(string hashcode) { - var v = (double)int.Parse(hashcode.Substring(hashcode.Length - 7), NumberStyles.HexNumber); + var v = (double) int.Parse(hashcode.Substring(hashcode.Length - 7), NumberStyles.HexNumber); var scale = v / 0xfffffff; var color = Hsl2Rgb(scale); return new SolidColorBrush(color); @@ -116,4 +116,4 @@ namespace HandyControl.Tools (byte) (arr[(hValue | 8) % 6] * 255)); } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Tools/Generator/HatchBrushGenerator.cs b/src/Shared/HandyControl_Shared/Tools/Generator/HatchBrushGenerator.cs index d57d11ac..1ad76fa2 100644 --- a/src/Shared/HandyControl_Shared/Tools/Generator/HatchBrushGenerator.cs +++ b/src/Shared/HandyControl_Shared/Tools/Generator/HatchBrushGenerator.cs @@ -112,6 +112,6 @@ namespace HandyControl.Tools private byte[] GetHatchData(HatchStyle hatchStyle) => hatchStyle < HatchStyle.Horizontal || hatchStyle > HatchStyle.SolidDiamond ? throw new ArgumentOutOfRangeException(nameof(hatchStyle)) - : HatchBrushes[(int)hatchStyle]; + : HatchBrushes[(int) hatchStyle]; } } diff --git a/src/Shared/HandyControl_Shared/Tools/GifImageAnimator.cs b/src/Shared/HandyControl_Shared/Tools/GifImageAnimator.cs index bcab97e8..6cb612aa 100644 --- a/src/Shared/HandyControl_Shared/Tools/GifImageAnimator.cs +++ b/src/Shared/HandyControl_Shared/Tools/GifImageAnimator.cs @@ -272,4 +272,4 @@ namespace HandyControl.Tools } } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Tools/GlobalShortcut.cs b/src/Shared/HandyControl_Shared/Tools/GlobalShortcut.cs index b586e51f..450353ea 100644 --- a/src/Shared/HandyControl_Shared/Tools/GlobalShortcut.cs +++ b/src/Shared/HandyControl_Shared/Tools/GlobalShortcut.cs @@ -56,7 +56,7 @@ namespace HandyControl.Tools if (list == null) return; KeyBindingCollection = new ObservableCollection(list); if (KeyBindingCollection.Count == 0) return; - + AddKeyBindings(KeyBindingCollection); KeyboardHook.Start(); } @@ -118,4 +118,4 @@ namespace HandyControl.Tools public static ObservableCollection GetKeyBindings(DependencyObject element) => (ObservableCollection) element.GetValue(KeyBindingsProperty); } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Tools/Helper/AnimationHelper.cs b/src/Shared/HandyControl_Shared/Tools/Helper/AnimationHelper.cs index 90e7a5ce..096e631c 100644 --- a/src/Shared/HandyControl_Shared/Tools/Helper/AnimationHelper.cs +++ b/src/Shared/HandyControl_Shared/Tools/Helper/AnimationHelper.cs @@ -91,4 +91,4 @@ namespace HandyControl.Tools return accumulated; } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Tools/Helper/ArithmeticHelper.cs b/src/Shared/HandyControl_Shared/Tools/Helper/ArithmeticHelper.cs index 4725b812..24a39557 100644 --- a/src/Shared/HandyControl_Shared/Tools/Helper/ArithmeticHelper.cs +++ b/src/Shared/HandyControl_Shared/Tools/Helper/ArithmeticHelper.cs @@ -136,4 +136,4 @@ namespace HandyControl.Tools return Vector3D.CrossProduct(v0, v1); } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Tools/Helper/ColorHelper.cs b/src/Shared/HandyControl_Shared/Tools/Helper/ColorHelper.cs index 4a853dc8..c0bd59dd 100644 --- a/src/Shared/HandyControl_Shared/Tools/Helper/ColorHelper.cs +++ b/src/Shared/HandyControl_Shared/Tools/Helper/ColorHelper.cs @@ -17,4 +17,4 @@ namespace HandyControl.Tools return Color.FromArgb(bytes[3], bytes[2], bytes[1], bytes[0]); } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Tools/Helper/ConfigHelper.cs b/src/Shared/HandyControl_Shared/Tools/Helper/ConfigHelper.cs index 2b3662e9..50945976 100644 --- a/src/Shared/HandyControl_Shared/Tools/Helper/ConfigHelper.cs +++ b/src/Shared/HandyControl_Shared/Tools/Helper/ConfigHelper.cs @@ -20,7 +20,7 @@ namespace HandyControl.Tools } - public static ConfigHelper Instance = new Lazy(() => new ConfigHelper()).Value; + public static ConfigHelper Instance = new Lazy(() => new ConfigHelper()).Value; private XmlLanguage _lang = XmlLanguage.GetLanguage("zh-cn"); @@ -50,7 +50,7 @@ namespace HandyControl.Tools SetTimelineFrameRate(config.TimelineFrameRate); } - public void SetTimelineFrameRate(int rate) => + public void SetTimelineFrameRate(int rate) => Timeline.DesiredFrameRateProperty.OverrideMetadata(typeof(Timeline), new FrameworkPropertyMetadata(rate)); public void SetWindowDefaultStyle(object resourceKey = null) @@ -82,7 +82,7 @@ namespace HandyControl.Tools protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null) { PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); - } + } #endif } } diff --git a/src/Shared/HandyControl_Shared/Tools/Helper/DesignerHelper.cs b/src/Shared/HandyControl_Shared/Tools/Helper/DesignerHelper.cs index 7a92c9a0..0223ca41 100644 --- a/src/Shared/HandyControl_Shared/Tools/Helper/DesignerHelper.cs +++ b/src/Shared/HandyControl_Shared/Tools/Helper/DesignerHelper.cs @@ -13,10 +13,10 @@ namespace HandyControl.Tools { if (!_isInDesignMode.HasValue) { - _isInDesignMode = (bool)DependencyPropertyDescriptor.FromProperty(DesignerProperties.IsInDesignModeProperty, typeof(FrameworkElement)).Metadata.DefaultValue; + _isInDesignMode = (bool) DependencyPropertyDescriptor.FromProperty(DesignerProperties.IsInDesignModeProperty, typeof(FrameworkElement)).Metadata.DefaultValue; } return _isInDesignMode.Value; } } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Tools/Helper/DpiHelper.cs b/src/Shared/HandyControl_Shared/Tools/Helper/DpiHelper.cs index 7f56eb4b..5f7f96b3 100644 --- a/src/Shared/HandyControl_Shared/Tools/Helper/DpiHelper.cs +++ b/src/Shared/HandyControl_Shared/Tools/Helper/DpiHelper.cs @@ -10,7 +10,7 @@ namespace HandyControl.Tools { private const double LogicalDpi = 96.0; - [ThreadStatic] + [ThreadStatic] private static Matrix _transformToDip; static DpiHelper() @@ -101,4 +101,4 @@ namespace HandyControl.Tools return newValue; } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Tools/Helper/IconHelper.cs b/src/Shared/HandyControl_Shared/Tools/Helper/IconHelper.cs index f5f1bfb4..756ae609 100644 --- a/src/Shared/HandyControl_Shared/Tools/Helper/IconHelper.cs +++ b/src/Shared/HandyControl_Shared/Tools/Helper/IconHelper.cs @@ -37,7 +37,7 @@ namespace HandyControl.Tools { bf = GetBestMatch(bf.Decoder.Frames, size); - asGoodAsItGets = bf.Decoder is IconBitmapDecoder || bf.PixelWidth == (int)size.Width && bf.PixelHeight == (int)size.Height; + asGoodAsItGets = bf.Decoder is IconBitmapDecoder || bf.PixelWidth == (int) size.Width && bf.PixelHeight == (int) size.Height; image = bf; } @@ -130,7 +130,7 @@ namespace HandyControl.Tools var hPos = i % width; var vPos = i / width; var byteIndex = hPos / 8; - var offsetBit = (byte)(0x80 >> (hPos % 8)); + var offsetBit = (byte) (0x80 >> (hPos % 8)); if (colorArray[i * 4 + 3] == 0x00) { @@ -138,7 +138,7 @@ namespace HandyControl.Tools } else { - bitsMask[byteIndex + bytesPerScanLine * vPos] &= (byte)~offsetBit; + bitsMask[byteIndex + bytesPerScanLine * vPos] &= (byte) ~offsetBit; } if (hPos == width - 1 && width == 8) @@ -153,7 +153,7 @@ namespace HandyControl.Tools internal static int AlignToBytes(double original, int nBytesCount) { var nBitsCount = 8 << (nBytesCount - 1); - return ((int)Math.Ceiling(original) + (nBitsCount - 1)) / nBitsCount * nBitsCount; + return ((int) Math.Ceiling(original) + (nBitsCount - 1)) / nBitsCount * nBitsCount; } private static BitmapSource GenerateBitmapSource(ImageSource img, Size renderSize) @@ -183,7 +183,7 @@ namespace HandyControl.Tools dc.DrawImage(img, drawingDimensions); dc.Close(); - var bmp = new RenderTargetBitmap((int)renderSize.Width, (int)renderSize.Height, 96, 96, PixelFormats.Pbgra32); + var bmp = new RenderTargetBitmap((int) renderSize.Width, (int) renderSize.Height, 96, 96, PixelFormats.Pbgra32); bmp.Render(dv); return bmp; @@ -229,8 +229,8 @@ namespace HandyControl.Tools private static int MatchImage(BitmapFrame frame, Size size, int bpp) { var score = 2 * MyAbs(bpp, SystemBitDepth, false) + - MyAbs(frame.PixelWidth, (int)size.Width, true) + - MyAbs(frame.PixelHeight, (int)size.Height, true); + MyAbs(frame.PixelWidth, (int) size.Width, true) + + MyAbs(frame.PixelHeight, (int) size.Height, true); return score; } @@ -257,7 +257,7 @@ namespace HandyControl.Tools { var sysBitDepth = InteropMethods.GetDeviceCaps(hdcDesktop, InteropValues.BITSPIXEL); sysBitDepth *= InteropMethods.GetDeviceCaps(hdcDesktop, InteropValues.PLANES); - + if (sysBitDepth == 8) { sysBitDepth = 4; @@ -291,4 +291,4 @@ namespace HandyControl.Tools InteropMethods.ExtractIconEx(iconModuleFile, 0, out largeIconHandle, out smallIconHandle, 1); } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Tools/Helper/InputClickHelper.cs b/src/Shared/HandyControl_Shared/Tools/Helper/InputClickHelper.cs index b0475a17..9672d8ae 100644 --- a/src/Shared/HandyControl_Shared/Tools/Helper/InputClickHelper.cs +++ b/src/Shared/HandyControl_Shared/Tools/Helper/InputClickHelper.cs @@ -14,7 +14,7 @@ namespace HandyControl.Tools private static void SetInputInfo(DependencyObject element, InputInfo value) => element.SetValue(InputInfoProperty, value); - private static InputInfo GetInputInfo(DependencyObject element) => (InputInfo)element.GetValue(InputInfoProperty); + private static InputInfo GetInputInfo(DependencyObject element) => (InputInfo) element.GetValue(InputInfoProperty); /// /// 将 MouseDown MouseMove MouseUp 封装为点击事件 @@ -67,25 +67,25 @@ namespace HandyControl.Tools private static void Element_LostMouseCapture(object sender, MouseEventArgs e) { - var element = (UIElement)sender; + var element = (UIElement) sender; GetInputInfo(element)?.LostCapture(); } private static void Element_MouseUp(object sender, MouseButtonEventArgs e) { - var element = (UIElement)sender; + var element = (UIElement) sender; GetInputInfo(element)?.Up(e.GetPosition(element)); } private static void Element_MouseMove(object sender, MouseEventArgs e) { - var element = (UIElement)sender; + var element = (UIElement) sender; GetInputInfo(element)?.Move(e.GetPosition(element)); } private static void Element_MouseDown(object sender, MouseButtonEventArgs e) { - var element = (UIElement)sender; + var element = (UIElement) sender; GetInputInfo(element)?.Down(e.GetPosition(element)); } @@ -146,4 +146,4 @@ namespace HandyControl.Tools public bool IsEmpty() => ClickEventHandler is null && DragStarted is null; } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Tools/Helper/ResourceHelper.cs b/src/Shared/HandyControl_Shared/Tools/Helper/ResourceHelper.cs index d4462531..b17541e8 100644 --- a/src/Shared/HandyControl_Shared/Tools/Helper/ResourceHelper.cs +++ b/src/Shared/HandyControl_Shared/Tools/Helper/ResourceHelper.cs @@ -84,7 +84,7 @@ namespace HandyControl.Tools { Source = new Uri($"pack://application:,,,/{assembly.GetName().Name};component/{themePath}/Skin{SkinType.Default.ToString()}.xaml") }; - } + } } public static Theme GetTheme(string name, ResourceDictionary resourceDictionary) @@ -94,4 +94,4 @@ namespace HandyControl.Tools .FirstOrDefault(item => Equals(item.Name, name)); } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Tools/Helper/ScreenHelper.cs b/src/Shared/HandyControl_Shared/Tools/Helper/ScreenHelper.cs index 9bcfab2f..fc7ae801 100644 --- a/src/Shared/HandyControl_Shared/Tools/Helper/ScreenHelper.cs +++ b/src/Shared/HandyControl_Shared/Tools/Helper/ScreenHelper.cs @@ -20,7 +20,7 @@ namespace HandyControl.Tools { var rects = new List(); InteropMethods.EnumDisplayMonitors(IntPtr.Zero, IntPtr.Zero, - delegate(IntPtr hMonitor, IntPtr hdcMonitor, ref InteropValues.RECT rect, IntPtr lpData) + delegate (IntPtr hMonitor, IntPtr hdcMonitor, ref InteropValues.RECT rect, IntPtr lpData) { var monitorInfo = default(InteropValues.MONITORINFO); monitorInfo.cbSize = (uint) Marshal.SizeOf(typeof(InteropValues.MONITORINFO)); @@ -28,9 +28,9 @@ namespace HandyControl.Tools rects.Add(monitorInfo.rcWork); return true; }, IntPtr.Zero); - + var num = 0L; - + screenSubRect = new InteropValues.RECT { Left = 0, @@ -38,7 +38,7 @@ namespace HandyControl.Tools Top = 0, Bottom = 0 }; - + monitorRect = new InteropValues.RECT { Left = 0, @@ -46,7 +46,7 @@ namespace HandyControl.Tools Top = 0, Bottom = 0 }; - + foreach (var current in rects) { var rect = current; @@ -68,10 +68,10 @@ namespace HandyControl.Tools X = (int) point.X, Y = (int) point.Y }, 2); - + monitorRect = new Rect(0.0, 0.0, 0.0, 0.0); workAreaRect = new Rect(0.0, 0.0, 0.0, 0.0); - + if (intPtr != IntPtr.Zero) { InteropValues.MONITORINFO monitorInfo = default; @@ -82,4 +82,4 @@ namespace HandyControl.Tools } } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Tools/Helper/SecurityHelper.cs b/src/Shared/HandyControl_Shared/Tools/Helper/SecurityHelper.cs index 10c17ec4..97938f8f 100644 --- a/src/Shared/HandyControl_Shared/Tools/Helper/SecurityHelper.cs +++ b/src/Shared/HandyControl_Shared/Tools/Helper/SecurityHelper.cs @@ -19,4 +19,4 @@ namespace HandyControl.Tools _allWindowsUIPermission.Demand(); } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Tools/Helper/SingleOpenHelper.cs b/src/Shared/HandyControl_Shared/Tools/Helper/SingleOpenHelper.cs index f8594ac1..141e2da3 100644 --- a/src/Shared/HandyControl_Shared/Tools/Helper/SingleOpenHelper.cs +++ b/src/Shared/HandyControl_Shared/Tools/Helper/SingleOpenHelper.cs @@ -39,4 +39,4 @@ namespace HandyControl.Tools return default; } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Tools/Helper/TokenizerHelper.cs b/src/Shared/HandyControl_Shared/Tools/Helper/TokenizerHelper.cs index 2911bf39..6e06838a 100644 --- a/src/Shared/HandyControl_Shared/Tools/Helper/TokenizerHelper.cs +++ b/src/Shared/HandyControl_Shared/Tools/Helper/TokenizerHelper.cs @@ -230,4 +230,4 @@ namespace HandyControl.Tools return numericSeparator; } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Tools/Helper/ValidateHelper.cs b/src/Shared/HandyControl_Shared/Tools/Helper/ValidateHelper.cs index b5c7a21a..af86c119 100644 --- a/src/Shared/HandyControl_Shared/Tools/Helper/ValidateHelper.cs +++ b/src/Shared/HandyControl_Shared/Tools/Helper/ValidateHelper.cs @@ -12,7 +12,7 @@ /// public static bool IsInRangeOfDouble(object value) { - var v = (double)value; + var v = (double) value; return !(double.IsNaN(v) || double.IsInfinity(v)); } @@ -23,7 +23,7 @@ /// public static bool IsInRangeOfPosDouble(object value) { - var v = (double)value; + var v = (double) value; return !(double.IsNaN(v) || double.IsInfinity(v)) && v > 0; } @@ -34,7 +34,7 @@ /// public static bool IsInRangeOfPosDoubleIncludeZero(object value) { - var v = (double)value; + var v = (double) value; return !(double.IsNaN(v) || double.IsInfinity(v)) && v >= 0; } @@ -45,7 +45,7 @@ /// public static bool IsInRangeOfNegDouble(object value) { - var v = (double)value; + var v = (double) value; return !(double.IsNaN(v) || double.IsInfinity(v)) && v < 0; } @@ -56,7 +56,7 @@ /// public static bool IsInRangeOfNegDoubleIncludeZero(object value) { - var v = (double)value; + var v = (double) value; return !(double.IsNaN(v) || double.IsInfinity(v)) && v <= 0; } @@ -67,7 +67,7 @@ /// public static bool IsInRangeOfPosInt(object value) { - var v = (int)value; + var v = (int) value; return v > 0; } @@ -78,7 +78,7 @@ /// public static bool IsInRangeOfPosIntIncludeZero(object value) { - var v = (int)value; + var v = (int) value; return v >= 0; } @@ -89,7 +89,7 @@ /// public static bool IsInRangeOfNegInt(object value) { - var v = (int)value; + var v = (int) value; return v < 0; } @@ -100,8 +100,8 @@ /// public static bool IsInRangeOfNegIntIncludeZero(object value) { - var v = (int)value; + var v = (int) value; return v <= 0; } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Tools/Helper/VisualHelper.cs b/src/Shared/HandyControl_Shared/Tools/Helper/VisualHelper.cs index 5fd55877..01d914d3 100644 --- a/src/Shared/HandyControl_Shared/Tools/Helper/VisualHelper.cs +++ b/src/Shared/HandyControl_Shared/Tools/Helper/VisualHelper.cs @@ -74,4 +74,4 @@ namespace HandyControl.Tools return true; } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Tools/Helper/WindowHelper.cs b/src/Shared/HandyControl_Shared/Tools/Helper/WindowHelper.cs index fcbb36b6..cf1c9c2b 100644 --- a/src/Shared/HandyControl_Shared/Tools/Helper/WindowHelper.cs +++ b/src/Shared/HandyControl_Shared/Tools/Helper/WindowHelper.cs @@ -19,7 +19,7 @@ namespace HandyControl.Tools /// public static Window GetActiveWindow() => Application.Current.Windows.OfType().SingleOrDefault(x => x.IsActive); - private static readonly BitArray _cacheValid = new BitArray((int)InteropValues.CacheSlot.NumSlots); + private static readonly BitArray _cacheValid = new BitArray((int) InteropValues.CacheSlot.NumSlots); private static bool _setDpiX = true; @@ -90,7 +90,7 @@ namespace HandyControl.Tools try { _dpiX = InteropMethods.GetDeviceCaps(new HandleRef(null, dc), InteropValues.LOGPIXELSX); - _cacheValid[(int)InteropValues.CacheSlot.DpiX] = true; + _cacheValid[(int) InteropValues.CacheSlot.DpiX] = true; } finally { @@ -113,9 +113,9 @@ namespace HandyControl.Tools { lock (_cacheValid) { - while (!_cacheValid[(int)InteropValues.CacheSlot.WindowResizeBorderThickness]) + while (!_cacheValid[(int) InteropValues.CacheSlot.WindowResizeBorderThickness]) { - _cacheValid[(int)InteropValues.CacheSlot.WindowResizeBorderThickness] = true; + _cacheValid[(int) InteropValues.CacheSlot.WindowResizeBorderThickness] = true; var frameSize = new Size(InteropMethods.GetSystemMetrics(InteropValues.SM.CXSIZEFRAME), InteropMethods.GetSystemMetrics(InteropValues.SM.CYSIZEFRAME)); var frameSizeInDips = DpiHelper.DeviceSizeToLogical(frameSize, DpiX / 96.0, Dpi / 96.0); @@ -142,7 +142,7 @@ namespace HandyControl.Tools InteropMethods.ReleaseDC(IntPtr.Zero, hdc); return WindowResizeBorderThickness.Add(new Thickness((autoHide ? - 4 : 4) * scale)); #else - return WindowResizeBorderThickness.Add(new Thickness(autoHide ? - 4 : 4)); + return WindowResizeBorderThickness.Add(new Thickness(autoHide ? -4 : 4)); #endif } } diff --git a/src/Shared/HandyControl_Shared/Tools/Hook/KeyboardHook.cs b/src/Shared/HandyControl_Shared/Tools/Hook/KeyboardHook.cs index 1d3b3f0f..18ea9bcc 100644 --- a/src/Shared/HandyControl_Shared/Tools/Hook/KeyboardHook.cs +++ b/src/Shared/HandyControl_Shared/Tools/Hook/KeyboardHook.cs @@ -18,13 +18,13 @@ namespace HandyControl.Tools private static int VirtualKey; - private static readonly IntPtr KeyDownIntPtr = (IntPtr)InteropValues.WM_KEYDOWN; + private static readonly IntPtr KeyDownIntPtr = (IntPtr) InteropValues.WM_KEYDOWN; - private static readonly IntPtr KeyUpIntPtr = (IntPtr)InteropValues.WM_KEYUP; + private static readonly IntPtr KeyUpIntPtr = (IntPtr) InteropValues.WM_KEYUP; - private static readonly IntPtr SyskeyDownIntPtr = (IntPtr)InteropValues.WM_SYSKEYDOWN; + private static readonly IntPtr SyskeyDownIntPtr = (IntPtr) InteropValues.WM_SYSKEYDOWN; - private static readonly IntPtr SyskeyUpIntPtr = (IntPtr)InteropValues.WM_SYSKEYUP; + private static readonly IntPtr SyskeyUpIntPtr = (IntPtr) InteropValues.WM_SYSKEYUP; private static int Count; @@ -55,10 +55,10 @@ namespace HandyControl.Tools { using var curProcess = Process.GetCurrentProcess(); using var curModule = curProcess.MainModule; - + if (curModule != null) { - return InteropMethods.SetWindowsHookEx((int)InteropValues.HookType.WH_KEYBOARD_LL, proc, + return InteropMethods.SetWindowsHookEx((int) InteropValues.HookType.WH_KEYBOARD_LL, proc, InteropMethods.GetModuleHandle(curModule.ModuleName), 0); } return IntPtr.Zero; @@ -102,4 +102,4 @@ namespace HandyControl.Tools return InteropMethods.CallNextHookEx(HookId, nCode, wParam, lParam); } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Tools/Hook/MouseHook.cs b/src/Shared/HandyControl_Shared/Tools/Hook/MouseHook.cs index 43fbd507..8710d622 100644 --- a/src/Shared/HandyControl_Shared/Tools/Hook/MouseHook.cs +++ b/src/Shared/HandyControl_Shared/Tools/Hook/MouseHook.cs @@ -43,10 +43,10 @@ namespace HandyControl.Tools { using var curProcess = Process.GetCurrentProcess(); using var curModule = curProcess.MainModule; - + if (curModule != null) { - return InteropMethods.SetWindowsHookEx((int)InteropValues.HookType.WH_MOUSE_LL, proc, + return InteropMethods.SetWindowsHookEx((int) InteropValues.HookType.WH_MOUSE_LL, proc, InteropMethods.GetModuleHandle(curModule.ModuleName), 0); } return IntPtr.Zero; @@ -55,10 +55,10 @@ namespace HandyControl.Tools private static IntPtr HookCallback(int nCode, IntPtr wParam, IntPtr lParam) { if (nCode < 0) return InteropMethods.CallNextHookEx(HookId, nCode, wParam, lParam); - var hookStruct = (InteropValues.MOUSEHOOKSTRUCT)Marshal.PtrToStructure(lParam, typeof(InteropValues.MOUSEHOOKSTRUCT)); + var hookStruct = (InteropValues.MOUSEHOOKSTRUCT) Marshal.PtrToStructure(lParam, typeof(InteropValues.MOUSEHOOKSTRUCT)); StatusChanged?.Invoke(null, new MouseHookEventArgs { - MessageType = (MouseHookMessageType)wParam, + MessageType = (MouseHookMessageType) wParam, Point = new InteropValues.POINT(hookStruct.pt.X, hookStruct.pt.Y) }); diff --git a/src/Shared/HandyControl_Shared/Tools/Interop/Handle/BitmapHandle.cs b/src/Shared/HandyControl_Shared/Tools/Interop/Handle/BitmapHandle.cs index 2fda6685..cfe20115 100644 --- a/src/Shared/HandyControl_Shared/Tools/Interop/Handle/BitmapHandle.cs +++ b/src/Shared/HandyControl_Shared/Tools/Interop/Handle/BitmapHandle.cs @@ -42,4 +42,4 @@ namespace HandyControl.Tools.Interop }; } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Tools/Interop/Handle/CommonHandles.cs b/src/Shared/HandyControl_Shared/Tools/Interop/Handle/CommonHandles.cs index 9a61a221..ad178b03 100644 --- a/src/Shared/HandyControl_Shared/Tools/Interop/Handle/CommonHandles.cs +++ b/src/Shared/HandyControl_Shared/Tools/Interop/Handle/CommonHandles.cs @@ -13,4 +13,4 @@ namespace HandyControl.Tools.Interop public static readonly int Kernel = HandleCollector.RegisterType(nameof(Kernel), 0, 1000); } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Tools/Interop/Handle/HandleCollector.cs b/src/Shared/HandyControl_Shared/Tools/Interop/Handle/HandleCollector.cs index e0500e0f..38910da0 100644 --- a/src/Shared/HandyControl_Shared/Tools/Interop/Handle/HandleCollector.cs +++ b/src/Shared/HandyControl_Shared/Tools/Interop/Handle/HandleCollector.cs @@ -110,7 +110,7 @@ namespace HandyControl.Tools.Interop } var oldThreshHold = 100 * _threshHold / (100 + _deltaPercent); - if (oldThreshHold >= _initialThreshHold && _handleCount < (int)(oldThreshHold * .9F)) + if (oldThreshHold >= _initialThreshHold && _handleCount < (int) (oldThreshHold * .9F)) { _threshHold = oldThreshHold; } @@ -129,4 +129,4 @@ namespace HandyControl.Tools.Interop } } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Tools/Interop/Handle/IconHandle.cs b/src/Shared/HandyControl_Shared/Tools/Interop/Handle/IconHandle.cs index 96de9b10..bd1d2952 100644 --- a/src/Shared/HandyControl_Shared/Tools/Interop/Handle/IconHandle.cs +++ b/src/Shared/HandyControl_Shared/Tools/Interop/Handle/IconHandle.cs @@ -30,4 +30,4 @@ namespace HandyControl.Tools.Interop return handle; } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Tools/Interop/Handle/SafeFileMappingHandle.cs b/src/Shared/HandyControl_Shared/Tools/Interop/Handle/SafeFileMappingHandle.cs index c4aade37..6aa05d77 100644 --- a/src/Shared/HandyControl_Shared/Tools/Interop/Handle/SafeFileMappingHandle.cs +++ b/src/Shared/HandyControl_Shared/Tools/Interop/Handle/SafeFileMappingHandle.cs @@ -42,9 +42,9 @@ namespace HandyControl.Tools.Interop [SecurityCritical] public static bool CloseHandleNoThrow(HandleRef handle) { - HandleCollector.Remove((IntPtr)handle, CommonHandles.Kernel); + HandleCollector.Remove((IntPtr) handle, CommonHandles.Kernel); var result = InteropMethods.IntCloseHandle(handle); return result; } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Tools/Interop/Handle/WpfSafeHandle.cs b/src/Shared/HandyControl_Shared/Tools/Interop/Handle/WpfSafeHandle.cs index 8141a2cf..487751c8 100644 --- a/src/Shared/HandyControl_Shared/Tools/Interop/Handle/WpfSafeHandle.cs +++ b/src/Shared/HandyControl_Shared/Tools/Interop/Handle/WpfSafeHandle.cs @@ -21,4 +21,4 @@ namespace HandyControl.Tools.Interop base.Dispose(disposing); } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Tools/Interop/InteropMethods.cs b/src/Shared/HandyControl_Shared/Tools/Interop/InteropMethods.cs index 22a4350f..aa70a0fb 100644 --- a/src/Shared/HandyControl_Shared/Tools/Interop/InteropMethods.cs +++ b/src/Shared/HandyControl_Shared/Tools/Interop/InteropMethods.cs @@ -17,7 +17,7 @@ namespace HandyControl.Tools.Interop { #region common - internal const int E_FAIL = unchecked((int)0x80004005); + internal const int E_FAIL = unchecked((int) 0x80004005); internal static readonly IntPtr HRGN_NONE = new IntPtr(-1); @@ -120,7 +120,7 @@ namespace HandyControl.Tools.Interop [SecurityCritical] internal static int ReleaseDC(HandleRef hWnd, HandleRef hDC) { - HandleCollector.Remove((IntPtr)hDC, CommonHandles.HDC); + HandleCollector.Remove((IntPtr) hDC, CommonHandles.HDC); return IntReleaseDC(hWnd, hDC); } @@ -314,9 +314,9 @@ namespace HandyControl.Tools.Interop internal static int GetYLParam(int lParam) => HiWord(lParam); - internal static int HiWord(int value) => (short)(value >> 16); + internal static int HiWord(int value) => (short) (value >> 16); - internal static int LoWord(int value) => (short)(value & 65535); + internal static int LoWord(int value) => (short) (value & 65535); [DllImport(InteropValues.ExternDll.User32)] internal static extern IntPtr MonitorFromWindow(IntPtr handle, int flags); @@ -374,7 +374,7 @@ namespace HandyControl.Tools.Interop [DllImport(InteropValues.ExternDll.User32)] private static extern int GetWindowLong(IntPtr hWnd, int nIndex); - internal static int GetWindowLong(IntPtr hWnd, InteropValues.GWL nIndex) => GetWindowLong(hWnd, (int)nIndex); + internal static int GetWindowLong(IntPtr hWnd, InteropValues.GWL nIndex) => GetWindowLong(hWnd, (int) nIndex); internal static IntPtr SetWindowLong(IntPtr hWnd, int nIndex, IntPtr dwNewLong) { @@ -401,12 +401,12 @@ namespace HandyControl.Tools.Interop { if (IntPtr.Size == 8) { - return SetWindowLongPtr(hWnd, (int)nIndex, dwNewLong); + return SetWindowLongPtr(hWnd, (int) nIndex, dwNewLong); } - return new IntPtr(SetWindowLong(hWnd, (int)nIndex, dwNewLong.ToInt32())); + return new IntPtr(SetWindowLong(hWnd, (int) nIndex, dwNewLong.ToInt32())); } - internal static int SetWindowLong(IntPtr hWnd, InteropValues.GWL nIndex, int dwNewLong) => SetWindowLong(hWnd, (int)nIndex, dwNewLong); + internal static int SetWindowLong(IntPtr hWnd, InteropValues.GWL nIndex, int dwNewLong) => SetWindowLong(hWnd, (int) nIndex, dwNewLong); [DllImport(InteropValues.ExternDll.User32, CharSet = CharSet.Unicode)] internal static extern ushort RegisterClass(ref InteropValues.WNDCLASS lpWndClass); @@ -451,7 +451,7 @@ namespace HandyControl.Tools.Interop [return: MarshalAs(UnmanagedType.Bool)] internal static extern bool AlphaBlend(IntPtr hdcDest, int xoriginDest, int yoriginDest, int wDest, int hDest, IntPtr hdcSrc, int xoriginSrc, int yoriginSrc, int wSrc, int hSrc, InteropValues.BLENDFUNCTION pfn); - internal static int GET_SC_WPARAM(IntPtr wParam) => (int)wParam & 65520; + internal static int GET_SC_WPARAM(IntPtr wParam) => (int) wParam & 65520; [DllImport(InteropValues.ExternDll.User32)] internal static extern IntPtr ChildWindowFromPointEx(IntPtr hwndParent, InteropValues.POINT pt, int uFlags); @@ -486,7 +486,7 @@ namespace HandyControl.Tools.Interop private static bool Initialized => InitToken != IntPtr.Zero; - internal const int + internal const int Ok = 0, GenericError = 1, InvalidParameter = 2, @@ -508,7 +508,7 @@ namespace HandyControl.Tools.Interop GdiplusNotInitialized = 18, PropertyNotFound = 19, PropertyNotSupported = 20, - E_UNEXPECTED = unchecked((int)0x8000FFFF); + E_UNEXPECTED = unchecked((int) 0x8000FFFF); static Gdip() { @@ -719,4 +719,4 @@ namespace HandyControl.Tools.Interop } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Tools/Interop/InteropValues.cs b/src/Shared/HandyControl_Shared/Tools/Interop/InteropValues.cs index 9a3dd0e2..3b9c516b 100644 --- a/src/Shared/HandyControl_Shared/Tools/Interop/InteropValues.cs +++ b/src/Shared/HandyControl_Shared/Tools/Interop/InteropValues.cs @@ -35,7 +35,7 @@ namespace HandyControl.Tools.Interop PLANES = 14, BI_RGB = 0, DIB_RGB_COLORS = 0, - E_FAIL = unchecked((int)0x80004005), + E_FAIL = unchecked((int) 0x80004005), NIF_MESSAGE = 0x00000001, NIF_ICON = 0x00000002, NIF_TIP = 0x00000004, @@ -233,10 +233,10 @@ namespace HandyControl.Tools.Interop public RECT(Rect rect) { - Left = (int)rect.Left; - Top = (int)rect.Top; - Right = (int)rect.Right; - Bottom = (int)rect.Bottom; + Left = (int) rect.Left; + Top = (int) rect.Top; + Right = (int) rect.Right; + Bottom = (int) rect.Bottom; } public Point Position => new Point(Left, Top); @@ -717,11 +717,11 @@ namespace HandyControl.Tools.Interop [return: MarshalAs(UnmanagedType.I8)] long CopyTo([In, MarshalAs(UnmanagedType.Interface)] IStream pstm, [In, MarshalAs(UnmanagedType.I8)] long cb, [Out, MarshalAs(UnmanagedType.LPArray)] long[] pcbRead); - void Commit([In]int grfCommitFlags); + void Commit([In] int grfCommitFlags); void Revert(); - void LockRegion([In, MarshalAs(UnmanagedType.I8)]long libOffset, [In, MarshalAs(UnmanagedType.I8)] long cb, [In] int dwLockType); + void LockRegion([In, MarshalAs(UnmanagedType.I8)] long libOffset, [In, MarshalAs(UnmanagedType.I8)] long cb, [In] int dwLockType); void UnlockRegion([In, MarshalAs(UnmanagedType.I8)] long libOffset, [In, MarshalAs(UnmanagedType.I8)] long cb, [In] int dwLockType); @@ -820,7 +820,7 @@ namespace HandyControl.Tools.Interop while (written < cb) { var toRead = bufsize; - if (written + toRead > cb) toRead = (int)(cb - written); + if (written + toRead > cb) toRead = (int) (cb - written); var read = Read(buffer, toRead); if (read == 0) break; if (pstm.Write(buffer, read) != read) @@ -973,4 +973,4 @@ namespace HandyControl.Tools.Interop internal string szCSDVersion; } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Tools/Pool/SimplePool!1.cs b/src/Shared/HandyControl_Shared/Tools/Pool/SimplePool!1.cs index 53731a46..f21a6670 100644 --- a/src/Shared/HandyControl_Shared/Tools/Pool/SimplePool!1.cs +++ b/src/Shared/HandyControl_Shared/Tools/Pool/SimplePool!1.cs @@ -24,7 +24,7 @@ namespace HandyControl.Tools if (_poolSize > 0) { var lastPooledIndex = _poolSize - 1; - var instance = (T)_pool[lastPooledIndex]; + var instance = (T) _pool[lastPooledIndex]; _pool[lastPooledIndex] = null; _poolSize--; return instance; diff --git a/src/Shared/HandyControl_Shared/Tools/Pool/SynchronizedPool!1.cs b/src/Shared/HandyControl_Shared/Tools/Pool/SynchronizedPool!1.cs index 0a430778..8075228e 100644 --- a/src/Shared/HandyControl_Shared/Tools/Pool/SynchronizedPool!1.cs +++ b/src/Shared/HandyControl_Shared/Tools/Pool/SynchronizedPool!1.cs @@ -6,7 +6,7 @@ public SynchronizedPool(int maxPoolSize) : base(maxPoolSize) { - + } public override T Acquire() @@ -19,7 +19,8 @@ public override bool Release(T element) { - lock (_lockObj) { + lock (_lockObj) + { return base.Release(element); } } diff --git a/src/Shared/HandyControl_Shared/Tools/Queue/Deque!1.cs b/src/Shared/HandyControl_Shared/Tools/Queue/Deque!1.cs index af1aaf1f..fc5fcf6b 100644 --- a/src/Shared/HandyControl_Shared/Tools/Queue/Deque!1.cs +++ b/src/Shared/HandyControl_Shared/Tools/Queue/Deque!1.cs @@ -329,7 +329,7 @@ namespace HandyControl.Tools } } - void ICollection.CopyTo(Array array, int index) => CopyTo((T[])array, index); + void ICollection.CopyTo(Array array, int index) => CopyTo((T[]) array, index); IEnumerator IEnumerable.GetEnumerator() => GetEnumerator(); } diff --git a/src/Shared/HandyControl_Shared/Tools/RegexJudgment.cs b/src/Shared/HandyControl_Shared/Tools/RegexJudgment.cs index 1408d19b..c05feba6 100644 --- a/src/Shared/HandyControl_Shared/Tools/RegexJudgment.cs +++ b/src/Shared/HandyControl_Shared/Tools/RegexJudgment.cs @@ -94,4 +94,4 @@ namespace HandyControl.Tools return Regex.IsMatch(str, RegexPatterns.UrlPattern); } } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Tools/RegexPatterns.cs b/src/Shared/HandyControl_Shared/Tools/RegexPatterns.cs index 5ac9663d..5732bbc9 100644 --- a/src/Shared/HandyControl_Shared/Tools/RegexPatterns.cs +++ b/src/Shared/HandyControl_Shared/Tools/RegexPatterns.cs @@ -148,4 +148,4 @@ /// public object GetValue(string propertyName) => GetType().GetField(propertyName).GetValue(null); } -} \ No newline at end of file +} diff --git a/src/Shared/HandyControl_Shared/Tools/StyleSelector/ButtonGroupItemStyleSelector.cs b/src/Shared/HandyControl_Shared/Tools/StyleSelector/ButtonGroupItemStyleSelector.cs index 5edb7597..a01cfdae 100644 --- a/src/Shared/HandyControl_Shared/Tools/StyleSelector/ButtonGroupItemStyleSelector.cs +++ b/src/Shared/HandyControl_Shared/Tools/StyleSelector/ButtonGroupItemStyleSelector.cs @@ -17,67 +17,67 @@ namespace HandyControl.Tools switch (buttonBase) { case RadioButton _: - { - if (count == 1) { - return ResourceHelper.GetResource