From abb91ae77b1c9441ec865736ba716c0ae35041e8 Mon Sep 17 00:00:00 2001 From: Kazuki Sakamoto Date: Fri, 27 Jan 2017 09:04:11 -0800 Subject: [PATCH] Remove deprecated code Summary: - Remove classes and methods marked as `Obsolete` Reviewed By: emilsjolander Differential Revision: D4474945 fbshipit-source-id: 43552fa638c8b321603858a862a386c5296db2fa --- csharp/Facebook.Yoga/Border.cs | 32 --- .../Facebook.Yoga.Shared.projitems | 5 +- csharp/Facebook.Yoga/Spacing.cs | 32 --- csharp/Facebook.Yoga/YogaNode.Create.cs | 234 ------------------ csharp/Facebook.Yoga/YogaNode.cs | 75 ------ 5 files changed, 1 insertion(+), 377 deletions(-) delete mode 100644 csharp/Facebook.Yoga/Border.cs delete mode 100644 csharp/Facebook.Yoga/Spacing.cs delete mode 100644 csharp/Facebook.Yoga/YogaNode.Create.cs diff --git a/csharp/Facebook.Yoga/Border.cs b/csharp/Facebook.Yoga/Border.cs deleted file mode 100644 index 6f046664..00000000 --- a/csharp/Facebook.Yoga/Border.cs +++ /dev/null @@ -1,32 +0,0 @@ -/** - * Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -namespace Facebook.Yoga -{ - [System.Obsolete] - public class Border - { - public float? Top; - public float? Bottom; - public float? Left; - public float? Right; - - public Border( - float? top = null, - float? bottom = null, - float? left = null, - float? right = null) - { - Top = top; - Bottom = bottom; - Left = left; - Right = right; - } - } -} diff --git a/csharp/Facebook.Yoga/Facebook.Yoga.Shared.projitems b/csharp/Facebook.Yoga/Facebook.Yoga.Shared.projitems index 66fff377..1a641829 100644 --- a/csharp/Facebook.Yoga/Facebook.Yoga.Shared.projitems +++ b/csharp/Facebook.Yoga/Facebook.Yoga.Shared.projitems @@ -10,11 +10,9 @@ - - @@ -28,7 +26,6 @@ - @@ -40,4 +37,4 @@ - \ No newline at end of file + diff --git a/csharp/Facebook.Yoga/Spacing.cs b/csharp/Facebook.Yoga/Spacing.cs deleted file mode 100644 index 0c02800f..00000000 --- a/csharp/Facebook.Yoga/Spacing.cs +++ /dev/null @@ -1,32 +0,0 @@ -/** - * Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -namespace Facebook.Yoga -{ - [System.Obsolete] - public class Spacing - { - public YogaValue? Top; - public YogaValue? Bottom; - public YogaValue? Left; - public YogaValue? Right; - - public Spacing( - YogaValue? top = null, - YogaValue? bottom = null, - YogaValue? left = null, - YogaValue? right = null) - { - Top = top; - Bottom = bottom; - Left = left; - Right = right; - } - } -} diff --git a/csharp/Facebook.Yoga/YogaNode.Create.cs b/csharp/Facebook.Yoga/YogaNode.Create.cs deleted file mode 100644 index b44eb798..00000000 --- a/csharp/Facebook.Yoga/YogaNode.Create.cs +++ /dev/null @@ -1,234 +0,0 @@ -/** - * Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -using System; - -namespace Facebook.Yoga -{ - public partial class YogaNode - { - [Obsolete("use Object Initializer")] - public static YogaNode Create( - YogaDirection? styleDirection = null, - YogaFlexDirection? flexDirection = null, - YogaJustify? justifyContent = null, - YogaAlign? alignContent = null, - YogaAlign? alignItems = null, - YogaAlign? alignSelf = null, - YogaPositionType? positionType = null, - YogaWrap? wrap = null, - YogaOverflow? overflow = null, - float? flex = null, - float? flexGrow = null, - float? flexShrink = null, - YogaValue? flexBasis = null, - Spacing position = null, - Spacing margin = null, - Spacing padding = null, - Border border = null, - YogaValue? width = null, - YogaValue? height = null, - YogaValue? maxWidth = null, - YogaValue? maxHeight = null, - YogaValue? minWidth = null, - YogaValue? minHeight = null) - { - YogaNode node = new YogaNode(); - - if (styleDirection.HasValue) - { - node.StyleDirection = styleDirection.Value; - } - - if (flexDirection.HasValue) - { - node.FlexDirection = flexDirection.Value; - } - - if (justifyContent.HasValue) - { - node.JustifyContent = justifyContent.Value; - } - - if (alignContent.HasValue) - { - node.AlignContent = alignContent.Value; - } - - if (alignItems.HasValue) - { - node.AlignItems = alignItems.Value; - } - - if (alignSelf.HasValue) - { - node.AlignSelf = alignSelf.Value; - } - - if (positionType.HasValue) - { - node.PositionType = positionType.Value; - } - - if (wrap.HasValue) - { - node.Wrap = wrap.Value; - } - - if (overflow.HasValue) - { - node.Overflow = overflow.Value; - } - - if (flex.HasValue) - { - node.Flex = flex.Value; - } - - if (flexGrow.HasValue) - { - node.FlexGrow = flexGrow.Value; - } - - if (flexShrink.HasValue) - { - node.FlexShrink = flexShrink.Value; - } - - if (flexBasis.HasValue) - { - node.FlexBasis = flexBasis.Value; - } - - if (position != null) - { - if (position.Top.HasValue) - { - node.Top = position.Top.Value; - } - - if (position.Bottom.HasValue) - { - node.Bottom = position.Bottom.Value; - } - - if (position.Left.HasValue) - { - node.Left = position.Left.Value; - } - - if (position.Right.HasValue) - { - node.Right = position.Right.Value; - } - } - - if (margin != null) - { - if (margin.Top.HasValue) - { - node.MarginTop = margin.Top.Value; - } - - if (margin.Bottom.HasValue) - { - node.MarginBottom = margin.Bottom.Value; - } - - if (margin.Left.HasValue) - { - node.MarginLeft = margin.Left.Value; - } - - if (margin.Right.HasValue) - { - node.MarginRight = margin.Right.Value; - } - } - - if (padding != null) - { - if (padding.Top.HasValue) - { - node.PaddingTop = padding.Top.Value; - } - - if (padding.Bottom.HasValue) - { - node.PaddingBottom = padding.Bottom.Value; - } - - if (padding.Left.HasValue) - { - node.PaddingLeft = padding.Left.Value; - } - - if (padding.Right.HasValue) - { - node.PaddingRight = padding.Right.Value; - } - } - - if (border != null) - { - if (border.Top.HasValue) - { - node.BorderTopWidth = border.Top.Value; - } - - if (border.Bottom.HasValue) - { - node.BorderBottomWidth = border.Bottom.Value; - } - - if (border.Left.HasValue) - { - node.BorderLeftWidth = border.Left.Value; - } - - if (border.Right.HasValue) - { - node.BorderRightWidth = border.Right.Value; - } - } - - if (width.HasValue) - { - node.Width = width.Value; - } - - if (height.HasValue) - { - node.Height = height.Value; - } - - if (minWidth.HasValue) - { - node.MinWidth = minWidth.Value; - } - - if (minHeight.HasValue) - { - node.MinHeight = minHeight.Value; - } - - if (maxWidth.HasValue) - { - node.MaxWidth = maxWidth.Value; - } - - if (maxHeight.HasValue) - { - node.MaxHeight = maxHeight.Value; - } - - return node; - } - } -} diff --git a/csharp/Facebook.Yoga/YogaNode.cs b/csharp/Facebook.Yoga/YogaNode.cs index 112d2b3f..9b5bd796 100644 --- a/csharp/Facebook.Yoga/YogaNode.cs +++ b/csharp/Facebook.Yoga/YogaNode.cs @@ -264,81 +264,6 @@ namespace Facebook.Yoga } } - [Obsolete("use Margin properties")] - public YogaValue GetMargin(YogaEdge edge) - { - return Native.YGNodeStyleGetMargin(_ygNode, edge); - } - - [Obsolete("use Margin properties")] - public void SetMargin(YogaEdge edge, YogaValue value) - { - if (value.Unit == YogaUnit.Percent) - { - Native.YGNodeStyleSetMarginPercent(_ygNode, edge, value.Value); - } - else - { - Native.YGNodeStyleSetMargin(_ygNode, edge, value.Value); - } - } - - [Obsolete("use Padding properties")] - public YogaValue GetPadding(YogaEdge edge) - { - return Native.YGNodeStyleGetPadding(_ygNode, edge); - } - - [Obsolete("use Padding properties")] - public void SetPadding(YogaEdge edge, YogaValue value) - { - if (value.Unit == YogaUnit.Percent) - { - Native.YGNodeStyleSetPaddingPercent(_ygNode, edge, value.Value); - } - else - { - Native.YGNodeStyleSetPadding(_ygNode, edge, value.Value); - } - } - - [Obsolete("use BorderWidth properties")] - public float GetBorder(YogaEdge edge) - { - return Native.YGNodeStyleGetBorder(_ygNode, edge); - } - - [Obsolete("use BorderWidth properties")] - public void SetBorder(YogaEdge edge, float border) - { - Native.YGNodeStyleSetBorder(_ygNode, edge, border); - } - - [Obsolete("use Position properties")] - public YogaValue GetPosition(YogaEdge edge) - { - return Native.YGNodeStyleGetPosition(_ygNode, edge); - } - - [Obsolete("use Position properties")] - public void SetPosition(YogaEdge edge, YogaValue value) - { - if (value.Unit == YogaUnit.Percent) - { - Native.YGNodeStyleSetPositionPercent(_ygNode, edge, value.Value); - } - else - { - Native.YGNodeStyleSetPosition(_ygNode, edge, value.Value); - } - } - - [Obsolete("use LayoutPadding properties")] - public float GetLayoutPadding(YogaEdge edge) - { - return Native.YGNodeLayoutGetPadding(_ygNode, edge); - } - public YogaValue Width { get