From: Eunki Hong Date: Tue, 1 Apr 2025 15:17:13 +0000 (+0900) Subject: [NUI] Reduce build warning CA1805 (Deprecated, BaseComponents, etc) X-Git-Tag: submit/tizen/20250409.021432~1^2~8 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f984f73d83055c4b6460e3159cf7c52bfa75dd90;p=platform%2Fcore%2Fcsapi%2Ftizenfx.git [NUI] Reduce build warning CA1805 (Deprecated, BaseComponents, etc) Phase 2 of #6805. Build warning counts : 1521 -> 1424 (Reduce 97) Signed-off-by: Eunki Hong --- diff --git a/src/Tizen.NUI/src/deprecated/Rendering/Renderer_Deprecated.cs b/src/Tizen.NUI/src/deprecated/Rendering/Renderer_Deprecated.cs index c245b2e23..d234a4e0b 100755 --- a/src/Tizen.NUI/src/deprecated/Rendering/Renderer_Deprecated.cs +++ b/src/Tizen.NUI/src/deprecated/Rendering/Renderer_Deprecated.cs @@ -27,8 +27,8 @@ namespace Tizen.NUI /// 3 public class Renderer : Animatable { - private Geometry CurrentGeometry = null; - private Shader CurrentShader = null; + private Geometry CurrentGeometry; + private Shader CurrentShader; /// /// Create an instance of Renderer. diff --git a/src/Tizen.NUI/src/public/BaseComponents/AnimatedVectorImageView.cs b/src/Tizen.NUI/src/public/BaseComponents/AnimatedVectorImageView.cs index 3d197dc4d..669c306a3 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/AnimatedVectorImageView.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/AnimatedVectorImageView.cs @@ -838,12 +838,12 @@ namespace Tizen.NUI.BaseComponents #region Private - private string resourceUrl = null; - private int repeatCnt = 0; + private string resourceUrl; + private int repeatCnt; private RepeatModes repeatMode = RepeatModes.Restart; private int minimumFrame = -1, maximumFrame = -1; - private string minimumFrameMarker = null; - private string maximumFrameMarker = null; + private string minimumFrameMarker; + private string maximumFrameMarker; private minMaxSetTypes isMinMaxFrameSet = minMaxSetTypes.NotSetByUser; private int innerCurrentFrame = -1; private EndActions innerEndAction = EndActions.Cancel; diff --git a/src/Tizen.NUI/src/public/BaseComponents/ImageView.cs b/src/Tizen.NUI/src/public/BaseComponents/ImageView.cs index b6517035e..c818d8342 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/ImageView.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/ImageView.cs @@ -151,9 +151,9 @@ namespace Tizen.NUI.BaseComponents ImageVisualProperty.FastTrackUploading, }; internal PropertyMap cachedImagePropertyMap; - internal bool imagePropertyUpdatedFlag = false; + internal bool imagePropertyUpdatedFlag; - private bool imagePropertyUpdateProcessAttachedFlag = false; + private bool imagePropertyUpdateProcessAttachedFlag; private Rectangle _border; // Development Guide : Please make ensure that these 5 values are matched with current image. @@ -161,7 +161,7 @@ namespace Tizen.NUI.BaseComponents private string _alphaMaskUrl = ""; private int _desired_width = -1; private int _desired_height = -1; - private bool _fastTrackUploading = false; + private bool _fastTrackUploading; private TriggerableSelector resourceUrlSelector; private TriggerableSelector borderSelector; @@ -1947,7 +1947,7 @@ namespace Tizen.NUI.BaseComponents NotifyPropertyChanged(); } } - private bool adjustViewSize = false; + private bool adjustViewSize; /// /// ImageView PlaceHolderUrl, type string. diff --git a/src/Tizen.NUI/src/public/BaseComponents/LottieAnimationView.cs b/src/Tizen.NUI/src/public/BaseComponents/LottieAnimationView.cs index 07d9482f7..ee2c67524 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/LottieAnimationView.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/LottieAnimationView.cs @@ -1660,7 +1660,7 @@ namespace Tizen.NUI.BaseComponents private VisualEventSignalCallbackType visualEventSignalCallback; private EventHandler visualEventSignalHandler; - static private int dynamicPropertyCallbackId = 0; + static private int dynamicPropertyCallbackId; //static private Dictionary dynamicPropertyCallbacks = new Dictionary(); static private ConcurrentDictionary> weakReferencesOfLottie = new ConcurrentDictionary>(); diff --git a/src/Tizen.NUI/src/public/BaseComponents/TextEditor.cs b/src/Tizen.NUI/src/public/BaseComponents/TextEditor.cs index a8b19242e..8fe213f0c 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/TextEditor.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/TextEditor.cs @@ -34,23 +34,23 @@ namespace Tizen.NUI.BaseComponents { static private string defaultStyleName = "Tizen.NUI.BaseComponents.TextEditor"; static private string defaultFontFamily = "TizenSans"; - private string textEditorTextSid = null; - private string textEditorPlaceHolderTextSid = null; - private InputMethodContext inputMethodContext = null; + private string textEditorTextSid; + private string textEditorPlaceHolderTextSid; + private InputMethodContext inputMethodContext; private string fontFamily = defaultFontFamily; private float fontSizeScale = 1.0f; - private bool hasSystemLanguageChanged = false; - private bool hasSystemFontSizeChanged = false; - private bool hasSystemFontTypeChanged = false; - private bool isSettingTextInCSharp = false; - - private Color internalPlaceholderTextColor = null; - private Vector4 internalPrimaryCursorColor = null; - private Vector4 internalSecondaryCursorColor = null; - private Vector4 internalSelectionHighlightColor = null; - private Vector4 internalInputColor = null; - private Vector4 internalTextColor = null; - private Color internalGrabHandleColor = null; + private bool hasSystemLanguageChanged; + private bool hasSystemFontSizeChanged; + private bool hasSystemFontTypeChanged; + private bool isSettingTextInCSharp; + + private Color internalPlaceholderTextColor; + private Vector4 internalPrimaryCursorColor; + private Vector4 internalSecondaryCursorColor; + private Vector4 internalSelectionHighlightColor; + private Vector4 internalInputColor; + private Vector4 internalTextColor; + private Color internalGrabHandleColor; static TextEditor() diff --git a/src/Tizen.NUI/src/public/BaseComponents/TextField.cs b/src/Tizen.NUI/src/public/BaseComponents/TextField.cs index c0822ceb8..d398cd647 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/TextField.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/TextField.cs @@ -33,24 +33,24 @@ namespace Tizen.NUI.BaseComponents { static private string defaultStyleName = "Tizen.NUI.BaseComponents.TextField"; static private string defaultFontFamily = "TizenSans"; - private string textFieldTextSid = null; - private string textFieldPlaceHolderTextSid = null; - private string textFieldPlaceHolderTextFocusedSid = null; - private InputMethodContext inputMethodCotext = null; + private string textFieldTextSid; + private string textFieldPlaceHolderTextSid; + private string textFieldPlaceHolderTextFocusedSid; + private InputMethodContext inputMethodCotext; private string fontFamily = defaultFontFamily; private float fontSizeScale = 1.0f; - private bool hasSystemLanguageChanged = false; - private bool hasSystemFontSizeChanged = false; - private bool hasSystemFontTypeChanged = false; - private bool isSettingTextInCSharp = false; - - private Vector4 internalPlaceholderTextColor = null; - private Vector4 internalPrimaryCursorColor = null; - private Vector4 internalSecondaryCursorColor = null; - private Vector4 internalSelectionHighlightColor = null; - private Vector4 internalInputColor = null; - private Color internalTextColor = null; - private Color internalGrabHandleColor = null; + private bool hasSystemLanguageChanged; + private bool hasSystemFontSizeChanged; + private bool hasSystemFontTypeChanged; + private bool isSettingTextInCSharp; + + private Vector4 internalPlaceholderTextColor; + private Vector4 internalPrimaryCursorColor; + private Vector4 internalSecondaryCursorColor; + private Vector4 internalSelectionHighlightColor; + private Vector4 internalInputColor; + private Color internalTextColor; + private Color internalGrabHandleColor; static TextField() diff --git a/src/Tizen.NUI/src/public/BaseComponents/TextLabel.cs b/src/Tizen.NUI/src/public/BaseComponents/TextLabel.cs index 8e8a3c968..c71d9bd54 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/TextLabel.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/TextLabel.cs @@ -244,16 +244,16 @@ namespace Tizen.NUI.BaseComponents static private string defaultStyleName = "Tizen.NUI.BaseComponents.TextLabel"; static private string defaultFontFamily = "BreezeSans"; - private string textLabelSid = null; + private string textLabelSid; private TextLabelSelectorData selectorData; private string fontFamily = defaultFontFamily; private float fontSizeScale = 1.0f; private bool textIsEmpty = true; - private bool hasSystemLanguageChanged = false; - private bool hasSystemFontSizeChanged = false; - private bool hasSystemFontTypeChanged = false; + private bool hasSystemLanguageChanged; + private bool hasSystemFontSizeChanged; + private bool hasSystemFontTypeChanged; private Color internalTextColor; private Color internalAnchorColor; diff --git a/src/Tizen.NUI/src/public/BaseComponents/View.cs b/src/Tizen.NUI/src/public/BaseComponents/View.cs index e4abf63fc..f2d289572 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/View.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/View.cs @@ -31,8 +31,8 @@ namespace Tizen.NUI.BaseComponents private static HashSet positionPropertyGroup = new HashSet(); private static HashSet sizePropertyGroup = new HashSet(); private static HashSet scalePropertyGroup = new HashSet(); - private static bool defaultGrabTouchAfterLeave = false; - private static bool defaultAllowOnlyOwnTouch = false; + private static bool defaultGrabTouchAfterLeave; + private static bool defaultAllowOnlyOwnTouch; internal BackgroundExtraData backgroundExtraData; private int widthPolicy = LayoutParamPolicies.WrapContent; @@ -40,51 +40,59 @@ namespace Tizen.NUI.BaseComponents private LayoutExtraData layoutExtraData; private ThemeData themeData; private Dictionary attached; - private bool isThemeChanged = false; + private bool isThemeChanged; // Collection of image-sensitive properties, and need to update C# side cache value. private static readonly List cachedNUIViewBackgroundImagePropertyKeyList = new List { ImageVisualProperty.URL, ImageVisualProperty.SynchronousLoading, }; - private string backgroundImageUrl = null; - private bool backgroundImageSynchronousLoading = false; + private string backgroundImageUrl; + private bool backgroundImageSynchronousLoading; // List of constraints - private Constraint widthConstraint = null; - private Constraint heightConstraint = null; - - private Size2D internalMaximumSize = null; - private Size2D internalMinimumSize = null; - private Extents internalMargin = null; - private Extents internalPadding = null; - private Vector3 internalSizeModeFactor = null; - private Vector2 internalCellIndex = null; - private Color internalBackgroundColor = null; - private Color internalColor = null; - private Position internalPivotPoint = null; - private Position internalPosition = null; - private Position2D internalPosition2D = null; - private Vector3 internalScale = null; - private Size internalSize = null; - private Size2D internalSize2D = null; - private int layoutCount = 0; + private Constraint widthConstraint; + private Constraint heightConstraint; + + private float userSizeWidth; + private float userSizeHeight; + + private Size2D internalMaximumSize; + private Size2D internalMinimumSize; + private Extents internalMargin; + private Extents internalPadding; + private Vector3 internalSizeModeFactor; + private Vector2 internalCellIndex; + private Color internalBackgroundColor; + private Color internalColor; + private Position internalPivotPoint; + private Position internalPosition; + private Position2D internalPosition2D; + private Vector3 internalScale; + private Size internalSize; + private Size2D internalSize2D; + private int layoutCount; private ControlState propagatableControlStates = ControlState.All; private string internalName = string.Empty; - private Position internalCurrentParentOrigin = null; - private Position internalCurrentAnchorPoint = null; - private Vector3 internalTargetSize = null; - private Size2D internalCurrentSize = null; - private Position internalCurrentPosition = null; - private Vector3 internalCurrentWorldPosition = null; - private Vector3 internalCurrentScale = null; - private Vector3 internalCurrentWorldScale = null; - private Vector4 internalCurrentColor = null; - private Vector4 internalCurrentWorldColor = null; - private Vector2 internalCurrentScreenPosition = null; - - private static int aliveCount = 0; + private Position internalCurrentParentOrigin; + private Position internalCurrentAnchorPoint; + private Vector3 internalTargetSize; + private Size2D internalCurrentSize; + private Position internalCurrentPosition; + private Vector3 internalCurrentWorldPosition; + private Vector3 internalCurrentScale; + private Vector3 internalCurrentWorldScale; + private Vector4 internalCurrentColor; + private Vector4 internalCurrentWorldColor; + private Vector2 internalCurrentScreenPosition; + + /// + /// Indicates that this View should listen Touch event to handle its ControlState. + /// + private bool enableControlState; + + private static int aliveCount; static View() { diff --git a/src/Tizen.NUI/src/public/BaseComponents/ViewAccessibility.cs b/src/Tizen.NUI/src/public/BaseComponents/ViewAccessibility.cs index a5b8f7045..bc092bf69 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/ViewAccessibility.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/ViewAccessibility.cs @@ -32,12 +32,12 @@ namespace Tizen.NUI.BaseComponents /// /// Start position in stored text. /// - public int StartOffset { get; set; } = 0; + public int StartOffset { get; set; } /// /// End position in stored text. /// - public int EndOffset { get; set; } = 0; + public int EndOffset { get; set; } /// /// Text content in stored text. diff --git a/src/Tizen.NUI/src/public/BaseComponents/ViewBindableProperty.cs b/src/Tizen.NUI/src/public/BaseComponents/ViewBindableProperty.cs index b6f287b6c..d061fef07 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/ViewBindableProperty.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/ViewBindableProperty.cs @@ -27,9 +27,6 @@ namespace Tizen.NUI.BaseComponents /// 3 public partial class View { - private float userSizeWidth = 0.0f; - private float userSizeHeight = 0.0f; - /// /// StyleNameProperty (DALi json) /// diff --git a/src/Tizen.NUI/src/public/BaseComponents/ViewEvent.cs b/src/Tizen.NUI/src/public/BaseComponents/ViewEvent.cs index 9dc225de2..32faa31de 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/ViewEvent.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/ViewEvent.cs @@ -106,12 +106,12 @@ namespace Tizen.NUI.BaseComponents private delegate void LayoutDirectionChangedEventCallbackType(IntPtr data, ViewLayoutDirectionType type); // List of dispatch Event - private PanGestureDetector panGestureDetector = null; - private LongPressGestureDetector longGestureDetector = null; - private PinchGestureDetector pinchGestureDetector = null; - private TapGestureDetector tapGestureDetector = null; - private RotationGestureDetector rotationGestureDetector = null; - private int configGestureCount = 0; + private PanGestureDetector panGestureDetector; + private LongPressGestureDetector longGestureDetector; + private PinchGestureDetector pinchGestureDetector; + private TapGestureDetector tapGestureDetector; + private RotationGestureDetector rotationGestureDetector; + private int configGestureCount; private bool dispatchTouchEvents = true; private bool dispatchParentTouchEvents = true; private bool dispatchHoverEvents = true; diff --git a/src/Tizen.NUI/src/public/BaseComponents/ViewInternal.cs b/src/Tizen.NUI/src/public/BaseComponents/ViewInternal.cs index e66632eb1..d37773af4 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/ViewInternal.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/ViewInternal.cs @@ -346,11 +346,6 @@ namespace Tizen.NUI.BaseComponents } } - /// - /// Indicates that this View should listen Touch event to handle its ControlState. - /// - private bool enableControlState = false; - private int LeftFocusableViewId { get @@ -1441,6 +1436,11 @@ namespace Tizen.NUI.BaseComponents internalCurrentScreenPosition?.Dispose(); internalCurrentScreenPosition = null; + backgroundExtraData?.Dispose(); + backgroundExtraData = null; + layoutExtraData?.Dispose(); + layoutExtraData = null; + if (visualContainers != null) { foreach (var visualContainer in visualContainers) diff --git a/src/Tizen.NUI/src/public/BaseComponents/ViewVisuals.cs b/src/Tizen.NUI/src/public/BaseComponents/ViewVisuals.cs index 99ee99936..82320cc0a 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/ViewVisuals.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/ViewVisuals.cs @@ -29,7 +29,7 @@ namespace Tizen.NUI.BaseComponents public partial class View { #region Internal and Private - private List visualContainers = null; + private List visualContainers; /// /// Range of visual for the container. diff --git a/src/Tizen.NUI/src/public/BaseComponents/VisualView.cs b/src/Tizen.NUI/src/public/BaseComponents/VisualView.cs index 9ea5693c6..0110f1e3d 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/VisualView.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/VisualView.cs @@ -42,10 +42,10 @@ namespace Tizen.NUI.BaseComponents /// 3 public class VisualView : CustomView { - private Dictionary visualNameDictionary = null; - private Dictionary visualDictionary = null; - private Dictionary tranformDictionary = null; - private PropertyArray animateArray = null; + private Dictionary visualNameDictionary; + private Dictionary visualDictionary; + private Dictionary tranformDictionary; + private PropertyArray animateArray; /// /// Constructor. diff --git a/src/Tizen.NUI/src/public/Common/Color.cs b/src/Tizen.NUI/src/public/Common/Color.cs index 258efbfc3..7fac08a39 100755 --- a/src/Tizen.NUI/src/public/Common/Color.cs +++ b/src/Tizen.NUI/src/public/Common/Color.cs @@ -1083,7 +1083,7 @@ namespace Tizen.NUI } internal delegate void ColorChangedCallback(float r, float g, float b, float a); - private ColorChangedCallback callback = null; + private ColorChangedCallback callback; /// /// The red component. diff --git a/src/Tizen.NUI/src/public/Rendering/Renderable.cs b/src/Tizen.NUI/src/public/Rendering/Renderable.cs index e362a7d21..1d34e8b0f 100755 --- a/src/Tizen.NUI/src/public/Rendering/Renderable.cs +++ b/src/Tizen.NUI/src/public/Rendering/Renderable.cs @@ -27,8 +27,8 @@ namespace Tizen.NUI [EditorBrowsable(EditorBrowsableState.Never)] public partial class Renderable : Animatable { - private Geometry geometry = null; - private Shader shader = null; + private Geometry geometry; + private Shader shader; /// /// Create an instance of Renderable without Geometry or Shader.