/*
- * Copyright(c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*
*/
-using global::System;
+using System;
using System.ComponentModel;
using System.Runtime.InteropServices;
using Tizen.NUI.BaseComponents;
[EditorBrowsable(EditorBrowsableState.Never)]
public static Accessibility Instance
{
- get => _accessibility;
+ get => accessibility;
}
#endregion Property
public bool Say(string sentence, bool discardable)
{
IntPtr callbackIntPtr = IntPtr.Zero;
- if (_sayFinishedEventHandler != null)
+ if (sayFinishedEventHandler != null)
{
- callback = _sayFinishedEventCallback;
+ callback = SayFinishedEventCallback;
callbackIntPtr = Marshal.GetFunctionPointerForDelegate<Delegate>(callback);
}
bool ret = Interop.Accessibility.Say(View.getCPtr(dummy), sentence, discardable, callbackIntPtr);
[EditorBrowsable(EditorBrowsableState.Never)]
public event EventHandler<SayFinishedEventArgs> SayFinished
{
- add => _sayFinishedEventHandler += value;
- remove => _sayFinishedEventHandler -= value;
+ add => sayFinishedEventHandler += value;
+ remove => sayFinishedEventHandler -= value;
}
#endregion Event, Enum, Struct, ETC
internal bool Say(View target, string sentence, bool discardable)
{
IntPtr callbackIntPtr = IntPtr.Zero;
- if (_sayFinishedEventHandler != null)
+ if (sayFinishedEventHandler != null)
{
- callback = _sayFinishedEventCallback;
+ callback = SayFinishedEventCallback;
callbackIntPtr = Marshal.GetFunctionPointerForDelegate<Delegate>(callback);
}
bool ret = Interop.Accessibility.Say(View.getCPtr(target), sentence, discardable, callbackIntPtr);
#region Private
- private static readonly Accessibility _accessibility = new Accessibility();
+ private static readonly Accessibility accessibility = new Accessibility();
- private event EventHandler<SayFinishedEventArgs> _sayFinishedEventHandler;
+ private event EventHandler<SayFinishedEventArgs> sayFinishedEventHandler;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
- private delegate void _sayFinishedEventCallbackType(int result);
+ private delegate void SayFinishedEventCallbackType(int result);
- private _sayFinishedEventCallbackType callback = null;
+ private SayFinishedEventCallbackType callback = null;
- private void _sayFinishedEventCallback(int result)
+ private void SayFinishedEventCallback(int result)
{
- tlog.Fatal(tag, $"_sayFinishedEventCallback(res={result}) called!");
- _sayFinishedEventHandler?.Invoke(this, new SayFinishedEventArgs(result));
+ tlog.Fatal(tag, $"sayFinishedEventCallback(res={result}) called!");
+ sayFinishedEventHandler?.Invoke(this, new SayFinishedEventArgs(result));
}
private View dummy;
/*
- * Copyright(c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
// Callback for AccessibilityManager StatusChangedSignal
private bool OnStatusChanged(IntPtr data)
{
- if (_accessibilityManagerStatusChangedEventHandler != null)
- {
- //here we send all data to user event handlers
- return _accessibilityManagerStatusChangedEventHandler(instance, null);
- }
- return false;
+ return accessibilityManagerStatusChangedEventHandler?.Invoke(instance, null) ?? false;
}
// Callback for AccessibilityManager ActionNextSignal
private bool OnActionNext(IntPtr data)
{
- if (_accessibilityManagerActionNextEventHandler != null)
- {
- //here we send all data to user event handlers
- return _accessibilityManagerActionNextEventHandler(instance, null);
- }
- return false;
+ return accessibilityManagerActionNextEventHandler?.Invoke(instance, null) ?? false;
}
// Callback for AccessibilityManager ActionPreviousSignal
private bool OnActionPrevious(IntPtr data)
{
- if (_accessibilityManagerActionPreviousEventHandler != null)
- {
- //here we send all data to user event handlers
- return _accessibilityManagerActionPreviousEventHandler(instance, null);
- }
- return false;
+ return accessibilityManagerActionPreviousEventHandler?.Invoke(instance, null) ?? false;
}
// Callback for AccessibilityManager ActionActivateSignal
private bool OnActionActivate(IntPtr data)
{
- if (_accessibilityManagerActionActivateEventHandler != null)
- {
- //here we send all data to user event handlers
- return _accessibilityManagerActionActivateEventHandler(instance, null);
- }
- return false;
+ return accessibilityManagerActionActivateEventHandler?.Invoke(instance, null) ?? false;
}
// Callback for AccessibilityManager ActionReadSignal
private bool OnActionRead(IntPtr data)
{
-
- if (_accessibilityManagerActionReadEventHandler != null)
- {
- //here we send all data to user event handlers
- return _accessibilityManagerActionReadEventHandler(instance, null);
- }
- return false;
+ return accessibilityManagerActionReadEventHandler?.Invoke(instance, null) ?? false;
}
// Callback for AccessibilityManager ActionOverSignal
private bool OnActionOver(IntPtr data)
{
- if (_accessibilityManagerActionOverEventHandler != null)
- {
- //here we send all data to user event handlers
- return _accessibilityManagerActionOverEventHandler(instance, null);
- }
- return false;
+ return accessibilityManagerActionOverEventHandler?.Invoke(instance, null) ?? false;
}
// Callback for AccessibilityManager ActionReadNextSignal
private bool OnActionReadNext(IntPtr data)
{
- if (_accessibilityManagerActionReadNextEventHandler != null)
- {
- //here we send all data to user event handlers
- return _accessibilityManagerActionReadNextEventHandler(instance, null);
- }
- return false;
+ return accessibilityManagerActionReadNextEventHandler?.Invoke(instance, null) ?? false;
}
// Callback for AccessibilityManager ActionReadPreviousSignal
private bool OnActionReadPrevious(IntPtr data)
{
- if (_accessibilityManagerActionReadPreviousEventHandler != null)
- {
- //here we send all data to user event handlers
- return _accessibilityManagerActionReadPreviousEventHandler(instance, null);
- }
- return false;
+ return accessibilityManagerActionReadPreviousEventHandler?.Invoke(instance, null) ?? false;
}
// Callback for AccessibilityManager ActionUpSignal
private bool OnActionUp(IntPtr data)
{
- if (_accessibilityManagerActionUpEventHandler != null)
- {
- //here we send all data to user event handlers
- return _accessibilityManagerActionUpEventHandler(instance, null);
- }
- return false;
+ return accessibilityManagerActionUpEventHandler?.Invoke(instance, null) ?? false;
}
// Callback for AccessibilityManager ActionDownSignal
private bool OnActionDown(IntPtr data)
{
- if (_accessibilityManagerActionDownEventHandler != null)
- {
- //here we send all data to user event handlers
- return _accessibilityManagerActionDownEventHandler(instance, null);
- }
- return false;
+ return accessibilityManagerActionDownEventHandler?.Invoke(instance, null) ?? false;
}
// Callback for AccessibilityManager ActionClearFocusSignal
private bool OnActionClearFocus(IntPtr data)
{
- if (_accessibilityManagerActionClearFocusEventHandler != null)
- {
- //here we send all data to user event handlers
- return _accessibilityManagerActionClearFocusEventHandler(instance, null);
- }
- return false;
+ return accessibilityManagerActionClearFocusEventHandler?.Invoke(instance, null) ?? false;
}
// Callback for AccessibilityManager ActionBackSignal
private bool OnActionBack(IntPtr data)
{
- if (_accessibilityManagerActionBackEventHandler != null)
- {
- //here we send all data to user event handlers
- return _accessibilityManagerActionBackEventHandler(instance, null);
- }
- return false;
+ return accessibilityManagerActionBackEventHandler?.Invoke(instance, null) ?? false;
}
// Callback for AccessibilityManager ActionScrollUpSignal
private bool OnActionScrollUp(IntPtr data)
{
- if (_accessibilityManagerActionScrollUpEventHandler != null)
- {
- //here we send all data to user event handlers
- return _accessibilityManagerActionScrollUpEventHandler(instance, null);
- }
- return false;
+ return accessibilityManagerActionScrollUpEventHandler?.Invoke(instance, null) ?? false;
}
// Callback for AccessibilityManager ActionScrollDownSignal
private bool OnActionScrollDown(IntPtr data)
{
- if (_accessibilityManagerActionScrollDownEventHandler != null)
- {
- //here we send all data to user event handlers
- return _accessibilityManagerActionScrollDownEventHandler(instance, null);
- }
- return false;
+ return accessibilityManagerActionScrollDownEventHandler?.Invoke(instance, null) ?? false;
}
// Callback for AccessibilityManager ActionPageLeftSignal
private bool OnActionPageLeft(IntPtr data)
{
- if (_accessibilityManagerActionPageLeftEventHandler != null)
- {
- //here we send all data to user event handlers
- return _accessibilityManagerActionPageLeftEventHandler(instance, null);
- }
- return false;
+ return accessibilityManagerActionPageLeftEventHandler?.Invoke(instance, null) ?? false;
}
// Callback for AccessibilityManager ActionPageRightSignal
private bool OnActionPageRight(IntPtr data)
{
- if (_accessibilityManagerActionPageRightEventHandler != null)
- {
- //here we send all data to user event handlers
- return _accessibilityManagerActionPageRightEventHandler(instance, null);
- }
- return false;
+ return accessibilityManagerActionPageRightEventHandler?.Invoke(instance, null) ?? false;
}
// Callback for AccessibilityManager ActionPageUpSignal
private bool OnActionPageUp(IntPtr data)
{
- if (_accessibilityManagerActionPageUpEventHandler != null)
- {
- //here we send all data to user event handlers
- return _accessibilityManagerActionPageUpEventHandler(instance, null);
- }
- return false;
+ return accessibilityManagerActionPageUpEventHandler?.Invoke(instance, null) ?? false;
}
// Callback for AccessibilityManager ActionPageDownSignal
private bool OnActionPageDown(IntPtr data)
{
- if (_accessibilityManagerActionPageDownEventHandler != null)
- {
- //here we send all data to user event handlers
- return _accessibilityManagerActionPageDownEventHandler(instance, null);
- }
- return false;
+ return accessibilityManagerActionPageDownEventHandler?.Invoke(instance, null) ?? false;
}
// Callback for AccessibilityManager ActionMoveToFirstSignal
private bool OnActionMoveToFirst(IntPtr data)
{
- if (_accessibilityManagerActionMoveToFirstEventHandler != null)
- {
- //here we send all data to user event handlers
- return _accessibilityManagerActionMoveToFirstEventHandler(instance, null);
- }
- return false;
+ return accessibilityManagerActionMoveToFirstEventHandler?.Invoke(instance, null) ?? false;
}
// Callback for AccessibilityManager ActionMoveToLastSignal
private bool OnActionMoveToLast(IntPtr data)
{
- if (_accessibilityManagerActionMoveToLastEventHandler != null)
- {
- //here we send all data to user event handlers
- return _accessibilityManagerActionMoveToLastEventHandler(instance, null);
- }
- return false;
+ return accessibilityManagerActionMoveToLastEventHandler?.Invoke(instance, null) ?? false;
}
// Callback for AccessibilityManager ActionReadFromTopSignal
private bool OnActionReadFromTop(IntPtr data)
{
- if (_accessibilityManagerActionReadFromTopEventHandler != null)
- {
- //here we send all data to user event handlers
- return _accessibilityManagerActionReadFromTopEventHandler(instance, null);
- }
- return false;
+ return accessibilityManagerActionReadFromTopEventHandler?.Invoke(instance, null) ?? false;
}
// Callback for AccessibilityManager ActionReadFromNextSignal
private bool OnActionReadFromNext(IntPtr data)
{
- if (_accessibilityManagerActionReadFromNextEventHandler != null)
- {
- //here we send all data to user event handlers
- return _accessibilityManagerActionReadFromNextEventHandler(instance, null);
- }
- return false;
+ return accessibilityManagerActionReadFromNextEventHandler?.Invoke(instance, null) ?? false;
}
// Callback for AccessibilityManager ActionZoomSignal
private bool OnActionZoom(IntPtr data)
{
- if (_accessibilityManagerActionZoomEventHandler != null)
- {
- //here we send all data to user event handlers
- return _accessibilityManagerActionZoomEventHandler(instance, null);
- }
- return false;
+ return accessibilityManagerActionZoomEventHandler?.Invoke(instance, null) ?? false;
}
// Callback for AccessibilityManager ActionReadPauseResumeSignal
private bool OnActionReadPauseResume(IntPtr data)
{
- if (_accessibilityManagerActionReadPauseResumeEventHandler != null)
- {
- //here we send all data to user event handlers
- return _accessibilityManagerActionReadPauseResumeEventHandler(instance, null);
- }
- return false;
+ return accessibilityManagerActionReadPauseResumeEventHandler?.Invoke(instance, null) ?? false;
}
// Callback for AccessibilityManager ActionStartStopSignal
private bool OnActionStartStop(IntPtr data)
{
- if (_accessibilityManagerActionStartStopEventHandler != null)
- {
- //here we send all data to user event handlers
- return _accessibilityManagerActionStartStopEventHandler(instance, null);
- }
- return false;
+ return accessibilityManagerActionStartStopEventHandler?.Invoke(instance, null) ?? false;
}
// Callback for AccessibilityManager FocusChangedSignal
private void OnFocusChanged(IntPtr view1, IntPtr view2)
{
- FocusChangedEventArgs e = new FocusChangedEventArgs();
-
- // Populate all members of "e" (FocusChangedEventArgs) with real data
- e.ViewCurrent = Registry.GetManagedBaseHandleFromNativePtr(view1) as View;
- e.ViewNext = Registry.GetManagedBaseHandleFromNativePtr(view2) as View;
-
- if (_accessibilityManagerFocusChangedEventHandler != null)
+ if (accessibilityManagerFocusChangedEventHandler != null)
{
+ FocusChangedEventArgs e = new FocusChangedEventArgs();
+
+ // Populate all members of "e" (FocusChangedEventArgs) with real data
+ e.ViewCurrent = Registry.GetManagedBaseHandleFromNativePtr(view1) as View;
+ e.ViewNext = Registry.GetManagedBaseHandleFromNativePtr(view2) as View;
//here we send all data to user event handlers
- _accessibilityManagerFocusChangedEventHandler(this, e);
+ accessibilityManagerFocusChangedEventHandler(this, e);
}
}
// Callback for AccessibilityManager FocusedViewActivatedSignal
private void OnFocusedViewActivated(IntPtr view)
{
- FocusedViewActivatedEventArgs e = new FocusedViewActivatedEventArgs();
-
- // Populate all members of "e" (FocusedViewActivatedEventArgs) with real data
- e.View = Registry.GetManagedBaseHandleFromNativePtr(view) as View;
-
- if (_accessibilityManagerFocusedViewActivatedEventHandler != null)
+ if (accessibilityManagerFocusedViewActivatedEventHandler != null)
{
+ FocusedViewActivatedEventArgs e = new FocusedViewActivatedEventArgs();
+
+ // Populate all members of "e" (FocusedViewActivatedEventArgs) with real data
+ e.View = Registry.GetManagedBaseHandleFromNativePtr(view) as View;
//here we send all data to user event handlers
- _accessibilityManagerFocusedViewActivatedEventHandler(this, e);
+ accessibilityManagerFocusedViewActivatedEventHandler(this, e);
}
}
// Callback for AccessibilityManager FocusOvershotSignal
private void OnFocusOvershot(IntPtr currentFocusedView, AccessibilityManager.FocusOvershotDirection direction)
{
- FocusOvershotEventArgs e = new FocusOvershotEventArgs();
-
- // Populate all members of "e" (FocusOvershotEventArgs) with real data
- e.CurrentFocusedView = Registry.GetManagedBaseHandleFromNativePtr(currentFocusedView) as View;
- e.FocusOvershotDirection = direction;
-
- if (_accessibilityManagerFocusOvershotEventHandler != null)
+ if (accessibilityManagerFocusOvershotEventHandler != null)
{
+ FocusOvershotEventArgs e = new FocusOvershotEventArgs();
+
+ // Populate all members of "e" (FocusOvershotEventArgs) with real data
+ e.CurrentFocusedView = Registry.GetManagedBaseHandleFromNativePtr(currentFocusedView) as View;
+ e.FocusOvershotDirection = direction;
//here we send all data to user event handlers
- _accessibilityManagerFocusOvershotEventHandler(this, e);
+ accessibilityManagerFocusOvershotEventHandler(this, e);
}
}
/*
- * Copyright(c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
{
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
private delegate bool StatusChangedEventCallbackDelegate(IntPtr accessibilityManager);
- private ReturnTypeEventHandler<object, EventArgs, bool> _accessibilityManagerStatusChangedEventHandler;
- private StatusChangedEventCallbackDelegate _accessibilityManagerStatusChangedEventCallbackDelegate;
+ private ReturnTypeEventHandler<object, EventArgs, bool> accessibilityManagerStatusChangedEventHandler;
+ private StatusChangedEventCallbackDelegate accessibilityManagerStatusChangedEventCallbackDelegate;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
private delegate bool ActionNextEventCallbackDelegate(IntPtr accessibilityManager);
- private ReturnTypeEventHandler<object, EventArgs, bool> _accessibilityManagerActionNextEventHandler;
- private ActionNextEventCallbackDelegate _accessibilityManagerActionNextEventCallbackDelegate;
+ private ReturnTypeEventHandler<object, EventArgs, bool> accessibilityManagerActionNextEventHandler;
+ private ActionNextEventCallbackDelegate accessibilityManagerActionNextEventCallbackDelegate;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
private delegate bool ActionPreviousEventCallbackDelegate(IntPtr accessibilityManager);
- private ReturnTypeEventHandler<object, EventArgs, bool> _accessibilityManagerActionPreviousEventHandler;
- private ActionPreviousEventCallbackDelegate _accessibilityManagerActionPreviousEventCallbackDelegate;
+ private ReturnTypeEventHandler<object, EventArgs, bool> accessibilityManagerActionPreviousEventHandler;
+ private ActionPreviousEventCallbackDelegate accessibilityManagerActionPreviousEventCallbackDelegate;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
private delegate bool ActionActivateEventCallbackDelegate(IntPtr accessibilityManager);
- private ReturnTypeEventHandler<object, EventArgs, bool> _accessibilityManagerActionActivateEventHandler;
- private ActionActivateEventCallbackDelegate _accessibilityManagerActionActivateEventCallbackDelegate;
+ private ReturnTypeEventHandler<object, EventArgs, bool> accessibilityManagerActionActivateEventHandler;
+ private ActionActivateEventCallbackDelegate accessibilityManagerActionActivateEventCallbackDelegate;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
private delegate bool ActionReadEventCallbackDelegate(IntPtr accessibilityManager);
- private ReturnTypeEventHandler<object, EventArgs, bool> _accessibilityManagerActionReadEventHandler;
- private ActionReadEventCallbackDelegate _accessibilityManagerActionReadEventCallbackDelegate;
+ private ReturnTypeEventHandler<object, EventArgs, bool> accessibilityManagerActionReadEventHandler;
+ private ActionReadEventCallbackDelegate accessibilityManagerActionReadEventCallbackDelegate;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
private delegate bool ActionOverEventCallbackDelegate(IntPtr accessibilityManager);
- private ReturnTypeEventHandler<object, EventArgs, bool> _accessibilityManagerActionOverEventHandler;
- private ActionOverEventCallbackDelegate _accessibilityManagerActionOverEventCallbackDelegate;
+ private ReturnTypeEventHandler<object, EventArgs, bool> accessibilityManagerActionOverEventHandler;
+ private ActionOverEventCallbackDelegate accessibilityManagerActionOverEventCallbackDelegate;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
private delegate bool ActionReadNextEventCallbackDelegate(IntPtr accessibilityManager);
- private ReturnTypeEventHandler<object, EventArgs, bool> _accessibilityManagerActionReadNextEventHandler;
- private ActionReadNextEventCallbackDelegate _accessibilityManagerActionReadNextEventCallbackDelegate;
+ private ReturnTypeEventHandler<object, EventArgs, bool> accessibilityManagerActionReadNextEventHandler;
+ private ActionReadNextEventCallbackDelegate accessibilityManagerActionReadNextEventCallbackDelegate;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
private delegate bool ActionReadPreviousEventCallbackDelegate(IntPtr accessibilityManager);
- private ReturnTypeEventHandler<object, EventArgs, bool> _accessibilityManagerActionReadPreviousEventHandler;
- private ActionReadPreviousEventCallbackDelegate _accessibilityManagerActionReadPreviousEventCallbackDelegate;
+ private ReturnTypeEventHandler<object, EventArgs, bool> accessibilityManagerActionReadPreviousEventHandler;
+ private ActionReadPreviousEventCallbackDelegate accessibilityManagerActionReadPreviousEventCallbackDelegate;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
private delegate bool ActionUpEventCallbackDelegate(IntPtr accessibilityManager);
- private ReturnTypeEventHandler<object, EventArgs, bool> _accessibilityManagerActionUpEventHandler;
- private ActionUpEventCallbackDelegate _accessibilityManagerActionUpEventCallbackDelegate;
+ private ReturnTypeEventHandler<object, EventArgs, bool> accessibilityManagerActionUpEventHandler;
+ private ActionUpEventCallbackDelegate accessibilityManagerActionUpEventCallbackDelegate;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
private delegate bool ActionDownEventCallbackDelegate(IntPtr accessibilityManager);
- private ReturnTypeEventHandler<object, EventArgs, bool> _accessibilityManagerActionDownEventHandler;
- private ActionDownEventCallbackDelegate _accessibilityManagerActionDownEventCallbackDelegate;
+ private ReturnTypeEventHandler<object, EventArgs, bool> accessibilityManagerActionDownEventHandler;
+ private ActionDownEventCallbackDelegate accessibilityManagerActionDownEventCallbackDelegate;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
private delegate bool ActionClearFocusEventCallbackDelegate(IntPtr accessibilityManager);
- private ReturnTypeEventHandler<object, EventArgs, bool> _accessibilityManagerActionClearFocusEventHandler;
- private ActionClearFocusEventCallbackDelegate _accessibilityManagerActionClearFocusEventCallbackDelegate;
+ private ReturnTypeEventHandler<object, EventArgs, bool> accessibilityManagerActionClearFocusEventHandler;
+ private ActionClearFocusEventCallbackDelegate accessibilityManagerActionClearFocusEventCallbackDelegate;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
private delegate bool ActionBackEventCallbackDelegate(IntPtr accessibilityManager);
- private ReturnTypeEventHandler<object, EventArgs, bool> _accessibilityManagerActionBackEventHandler;
- private ActionBackEventCallbackDelegate _accessibilityManagerActionBackEventCallbackDelegate;
+ private ReturnTypeEventHandler<object, EventArgs, bool> accessibilityManagerActionBackEventHandler;
+ private ActionBackEventCallbackDelegate accessibilityManagerActionBackEventCallbackDelegate;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
private delegate bool ActionScrollUpEventCallbackDelegate(IntPtr accessibilityManager);
- private ReturnTypeEventHandler<object, EventArgs, bool> _accessibilityManagerActionScrollUpEventHandler;
- private ActionScrollUpEventCallbackDelegate _accessibilityManagerActionScrollUpEventCallbackDelegate;
+ private ReturnTypeEventHandler<object, EventArgs, bool> accessibilityManagerActionScrollUpEventHandler;
+ private ActionScrollUpEventCallbackDelegate accessibilityManagerActionScrollUpEventCallbackDelegate;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
private delegate bool ActionScrollDownEventCallbackDelegate(IntPtr accessibilityManager);
- private ReturnTypeEventHandler<object, EventArgs, bool> _accessibilityManagerActionScrollDownEventHandler;
- private ActionScrollDownEventCallbackDelegate _accessibilityManagerActionScrollDownEventCallbackDelegate;
+ private ReturnTypeEventHandler<object, EventArgs, bool> accessibilityManagerActionScrollDownEventHandler;
+ private ActionScrollDownEventCallbackDelegate accessibilityManagerActionScrollDownEventCallbackDelegate;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
private delegate bool ActionPageLeftEventCallbackDelegate(IntPtr accessibilityManager);
- private ReturnTypeEventHandler<object, EventArgs, bool> _accessibilityManagerActionPageLeftEventHandler;
- private ActionPageLeftEventCallbackDelegate _accessibilityManagerActionPageLeftEventCallbackDelegate;
+ private ReturnTypeEventHandler<object, EventArgs, bool> accessibilityManagerActionPageLeftEventHandler;
+ private ActionPageLeftEventCallbackDelegate accessibilityManagerActionPageLeftEventCallbackDelegate;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
private delegate bool ActionPageRightEventCallbackDelegate(IntPtr accessibilityManager);
- private ReturnTypeEventHandler<object, EventArgs, bool> _accessibilityManagerActionPageRightEventHandler;
- private ActionPageRightEventCallbackDelegate _accessibilityManagerActionPageRightEventCallbackDelegate;
+ private ReturnTypeEventHandler<object, EventArgs, bool> accessibilityManagerActionPageRightEventHandler;
+ private ActionPageRightEventCallbackDelegate accessibilityManagerActionPageRightEventCallbackDelegate;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
private delegate bool ActionPageUpEventCallbackDelegate(IntPtr accessibilityManager);
- private ReturnTypeEventHandler<object, EventArgs, bool> _accessibilityManagerActionPageUpEventHandler;
- private ActionPageUpEventCallbackDelegate _accessibilityManagerActionPageUpEventCallbackDelegate;
+ private ReturnTypeEventHandler<object, EventArgs, bool> accessibilityManagerActionPageUpEventHandler;
+ private ActionPageUpEventCallbackDelegate accessibilityManagerActionPageUpEventCallbackDelegate;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
private delegate bool ActionPageDownEventCallbackDelegate(IntPtr accessibilityManager);
- private ReturnTypeEventHandler<object, EventArgs, bool> _accessibilityManagerActionPageDownEventHandler;
- private ActionPageDownEventCallbackDelegate _accessibilityManagerActionPageDownEventCallbackDelegate;
+ private ReturnTypeEventHandler<object, EventArgs, bool> accessibilityManagerActionPageDownEventHandler;
+ private ActionPageDownEventCallbackDelegate accessibilityManagerActionPageDownEventCallbackDelegate;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
private delegate bool ActionMoveToFirstEventCallbackDelegate(IntPtr accessibilityManager);
- private ReturnTypeEventHandler<object, EventArgs, bool> _accessibilityManagerActionMoveToFirstEventHandler;
- private ActionMoveToFirstEventCallbackDelegate _accessibilityManagerActionMoveToFirstEventCallbackDelegate;
+ private ReturnTypeEventHandler<object, EventArgs, bool> accessibilityManagerActionMoveToFirstEventHandler;
+ private ActionMoveToFirstEventCallbackDelegate accessibilityManagerActionMoveToFirstEventCallbackDelegate;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
private delegate bool ActionMoveToLastEventCallbackDelegate(IntPtr accessibilityManager);
- private ReturnTypeEventHandler<object, EventArgs, bool> _accessibilityManagerActionMoveToLastEventHandler;
- private ActionMoveToLastEventCallbackDelegate _accessibilityManagerActionMoveToLastEventCallbackDelegate;
+ private ReturnTypeEventHandler<object, EventArgs, bool> accessibilityManagerActionMoveToLastEventHandler;
+ private ActionMoveToLastEventCallbackDelegate accessibilityManagerActionMoveToLastEventCallbackDelegate;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
private delegate bool ActionReadFromTopEventCallbackDelegate(IntPtr accessibilityManager);
- private ReturnTypeEventHandler<object, EventArgs, bool> _accessibilityManagerActionReadFromTopEventHandler;
- private ActionReadFromTopEventCallbackDelegate _accessibilityManagerActionReadFromTopEventCallbackDelegate;
+ private ReturnTypeEventHandler<object, EventArgs, bool> accessibilityManagerActionReadFromTopEventHandler;
+ private ActionReadFromTopEventCallbackDelegate accessibilityManagerActionReadFromTopEventCallbackDelegate;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
private delegate bool ActionReadFromNextEventCallbackDelegate(IntPtr accessibilityManager);
- private ReturnTypeEventHandler<object, EventArgs, bool> _accessibilityManagerActionReadFromNextEventHandler;
- private ActionReadFromNextEventCallbackDelegate _accessibilityManagerActionReadFromNextEventCallbackDelegate;
+ private ReturnTypeEventHandler<object, EventArgs, bool> accessibilityManagerActionReadFromNextEventHandler;
+ private ActionReadFromNextEventCallbackDelegate accessibilityManagerActionReadFromNextEventCallbackDelegate;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
private delegate bool ActionZoomEventCallbackDelegate(IntPtr accessibilityManager);
- private ReturnTypeEventHandler<object, EventArgs, bool> _accessibilityManagerActionZoomEventHandler;
- private ActionZoomEventCallbackDelegate _accessibilityManagerActionZoomEventCallbackDelegate;
+ private ReturnTypeEventHandler<object, EventArgs, bool> accessibilityManagerActionZoomEventHandler;
+ private ActionZoomEventCallbackDelegate accessibilityManagerActionZoomEventCallbackDelegate;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
private delegate bool ActionReadPauseResumeEventCallbackDelegate(IntPtr accessibilityManager);
- private ReturnTypeEventHandler<object, EventArgs, bool> _accessibilityManagerActionReadPauseResumeEventHandler;
- private ActionReadPauseResumeEventCallbackDelegate _accessibilityManagerActionReadPauseResumeEventCallbackDelegate;
+ private ReturnTypeEventHandler<object, EventArgs, bool> accessibilityManagerActionReadPauseResumeEventHandler;
+ private ActionReadPauseResumeEventCallbackDelegate accessibilityManagerActionReadPauseResumeEventCallbackDelegate;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
private delegate bool ActionStartStopEventCallbackDelegate(IntPtr accessibilityManager);
- private ReturnTypeEventHandler<object, EventArgs, bool> _accessibilityManagerActionStartStopEventHandler;
- private ActionStartStopEventCallbackDelegate _accessibilityManagerActionStartStopEventCallbackDelegate;
+ private ReturnTypeEventHandler<object, EventArgs, bool> accessibilityManagerActionStartStopEventHandler;
+ private ActionStartStopEventCallbackDelegate accessibilityManagerActionStartStopEventCallbackDelegate;
/*
// To be replaced by a new event that takes Touch
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
private delegate void FocusChangedEventCallbackDelegate(IntPtr view1, IntPtr view2);
- private EventHandler<FocusChangedEventArgs> _accessibilityManagerFocusChangedEventHandler;
- private FocusChangedEventCallbackDelegate _accessibilityManagerFocusChangedEventCallbackDelegate;
+ private EventHandler<FocusChangedEventArgs> accessibilityManagerFocusChangedEventHandler;
+ private FocusChangedEventCallbackDelegate accessibilityManagerFocusChangedEventCallbackDelegate;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
private delegate void FocusedViewActivatedEventCallbackDelegate(IntPtr view);
- private EventHandler<FocusedViewActivatedEventArgs> _accessibilityManagerFocusedViewActivatedEventHandler;
- private FocusedViewActivatedEventCallbackDelegate _accessibilityManagerFocusedViewActivatedEventCallbackDelegate;
+ private EventHandler<FocusedViewActivatedEventArgs> accessibilityManagerFocusedViewActivatedEventHandler;
+ private FocusedViewActivatedEventCallbackDelegate accessibilityManagerFocusedViewActivatedEventCallbackDelegate;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
private delegate void FocusOvershotEventCallbackDelegate(IntPtr currentFocusedView, AccessibilityManager.FocusOvershotDirection direction);
- private EventHandler<FocusOvershotEventArgs> _accessibilityManagerFocusOvershotEventHandler;
- private FocusOvershotEventCallbackDelegate _accessibilityManagerFocusOvershotEventCallbackDelegate;
+ private EventHandler<FocusOvershotEventArgs> accessibilityManagerFocusOvershotEventHandler;
+ private FocusOvershotEventCallbackDelegate accessibilityManagerFocusOvershotEventCallbackDelegate;
// Accessibility action signals
add
{
// Restricted to only one listener
- if (_accessibilityManagerStatusChangedEventHandler == null)
+ if (accessibilityManagerStatusChangedEventHandler == null)
{
- _accessibilityManagerStatusChangedEventCallbackDelegate = new StatusChangedEventCallbackDelegate(OnStatusChanged);
- this.StatusChangedSignal().Connect(_accessibilityManagerStatusChangedEventCallbackDelegate);
+ accessibilityManagerStatusChangedEventCallbackDelegate = new StatusChangedEventCallbackDelegate(OnStatusChanged);
+ this.StatusChangedSignal().Connect(accessibilityManagerStatusChangedEventCallbackDelegate);
}
- _accessibilityManagerStatusChangedEventHandler += value;
+ accessibilityManagerStatusChangedEventHandler += value;
}
remove
{
- _accessibilityManagerStatusChangedEventHandler -= value;
+ accessibilityManagerStatusChangedEventHandler -= value;
- if (_accessibilityManagerStatusChangedEventHandler == null && StatusChangedSignal().Empty() == false)
+ if (accessibilityManagerStatusChangedEventHandler == null && StatusChangedSignal().Empty() == false)
{
- this.StatusChangedSignal().Disconnect(_accessibilityManagerStatusChangedEventCallbackDelegate);
+ this.StatusChangedSignal().Disconnect(accessibilityManagerStatusChangedEventCallbackDelegate);
}
}
add
{
// Restricted to only one listener
- if (_accessibilityManagerActionNextEventHandler == null)
+ if (accessibilityManagerActionNextEventHandler == null)
{
- _accessibilityManagerActionNextEventCallbackDelegate = new ActionNextEventCallbackDelegate(OnActionNext);
- this.ActionNextSignal().Connect(_accessibilityManagerActionNextEventCallbackDelegate);
+ accessibilityManagerActionNextEventCallbackDelegate = new ActionNextEventCallbackDelegate(OnActionNext);
+ this.ActionNextSignal().Connect(accessibilityManagerActionNextEventCallbackDelegate);
}
- _accessibilityManagerActionNextEventHandler += value;
+ accessibilityManagerActionNextEventHandler += value;
}
remove
{
- _accessibilityManagerActionNextEventHandler -= value;
+ accessibilityManagerActionNextEventHandler -= value;
- if (_accessibilityManagerActionNextEventHandler == null && ActionNextSignal().Empty() == false)
+ if (accessibilityManagerActionNextEventHandler == null && ActionNextSignal().Empty() == false)
{
- this.ActionNextSignal().Disconnect(_accessibilityManagerActionNextEventCallbackDelegate);
+ this.ActionNextSignal().Disconnect(accessibilityManagerActionNextEventCallbackDelegate);
}
}
}
add
{
// Restricted to only one listener
- if (_accessibilityManagerActionPreviousEventHandler == null)
+ if (accessibilityManagerActionPreviousEventHandler == null)
{
- _accessibilityManagerActionPreviousEventCallbackDelegate = new ActionPreviousEventCallbackDelegate(OnActionPrevious);
- this.ActionPreviousSignal().Connect(_accessibilityManagerActionPreviousEventCallbackDelegate);
+ accessibilityManagerActionPreviousEventCallbackDelegate = new ActionPreviousEventCallbackDelegate(OnActionPrevious);
+ this.ActionPreviousSignal().Connect(accessibilityManagerActionPreviousEventCallbackDelegate);
}
- _accessibilityManagerActionPreviousEventHandler += value;
+ accessibilityManagerActionPreviousEventHandler += value;
}
remove
{
- _accessibilityManagerActionPreviousEventHandler -= value;
+ accessibilityManagerActionPreviousEventHandler -= value;
- if (_accessibilityManagerActionPreviousEventHandler == null && ActionPreviousSignal().Empty() == false)
+ if (accessibilityManagerActionPreviousEventHandler == null && ActionPreviousSignal().Empty() == false)
{
- this.ActionPreviousSignal().Disconnect(_accessibilityManagerActionPreviousEventCallbackDelegate);
+ this.ActionPreviousSignal().Disconnect(accessibilityManagerActionPreviousEventCallbackDelegate);
}
}
}
add
{
// Restricted to only one listener
- if (_accessibilityManagerActionActivateEventHandler == null)
+ if (accessibilityManagerActionActivateEventHandler == null)
{
- _accessibilityManagerActionActivateEventCallbackDelegate = new ActionActivateEventCallbackDelegate(OnActionActivate);
- this.ActionActivateSignal().Connect(_accessibilityManagerActionActivateEventCallbackDelegate);
+ accessibilityManagerActionActivateEventCallbackDelegate = new ActionActivateEventCallbackDelegate(OnActionActivate);
+ this.ActionActivateSignal().Connect(accessibilityManagerActionActivateEventCallbackDelegate);
}
- _accessibilityManagerActionActivateEventHandler += value;
+ accessibilityManagerActionActivateEventHandler += value;
}
remove
{
- _accessibilityManagerActionActivateEventHandler -= value;
+ accessibilityManagerActionActivateEventHandler -= value;
- if (_accessibilityManagerActionActivateEventHandler == null && ActionActivateSignal().Empty() == false)
+ if (accessibilityManagerActionActivateEventHandler == null && ActionActivateSignal().Empty() == false)
{
- this.ActionActivateSignal().Disconnect(_accessibilityManagerActionActivateEventCallbackDelegate);
+ this.ActionActivateSignal().Disconnect(accessibilityManagerActionActivateEventCallbackDelegate);
}
}
}
add
{
// Restricted to only one listener
- if (_accessibilityManagerActionReadEventHandler == null)
+ if (accessibilityManagerActionReadEventHandler == null)
{
- _accessibilityManagerActionReadEventCallbackDelegate = new ActionReadEventCallbackDelegate(OnActionRead);
- this.ActionReadSignal().Connect(_accessibilityManagerActionReadEventCallbackDelegate);
+ accessibilityManagerActionReadEventCallbackDelegate = new ActionReadEventCallbackDelegate(OnActionRead);
+ this.ActionReadSignal().Connect(accessibilityManagerActionReadEventCallbackDelegate);
}
- _accessibilityManagerActionReadEventHandler += value;
+ accessibilityManagerActionReadEventHandler += value;
}
remove
{
- _accessibilityManagerActionReadEventHandler -= value;
+ accessibilityManagerActionReadEventHandler -= value;
- if (_accessibilityManagerActionReadEventHandler == null && ActionReadSignal().Empty() == false)
+ if (accessibilityManagerActionReadEventHandler == null && ActionReadSignal().Empty() == false)
{
- this.ActionReadSignal().Disconnect(_accessibilityManagerActionReadEventCallbackDelegate);
+ this.ActionReadSignal().Disconnect(accessibilityManagerActionReadEventCallbackDelegate);
}
}
}
add
{
// Restricted to only one listener
- if (_accessibilityManagerActionOverEventHandler == null)
+ if (accessibilityManagerActionOverEventHandler == null)
{
- _accessibilityManagerActionOverEventCallbackDelegate = new ActionOverEventCallbackDelegate(OnActionOver);
- this.ActionOverSignal().Connect(_accessibilityManagerActionOverEventCallbackDelegate);
+ accessibilityManagerActionOverEventCallbackDelegate = new ActionOverEventCallbackDelegate(OnActionOver);
+ this.ActionOverSignal().Connect(accessibilityManagerActionOverEventCallbackDelegate);
}
- _accessibilityManagerActionOverEventHandler += value;
+ accessibilityManagerActionOverEventHandler += value;
}
remove
{
- _accessibilityManagerActionOverEventHandler -= value;
+ accessibilityManagerActionOverEventHandler -= value;
- if (_accessibilityManagerActionOverEventHandler == null && ActionOverSignal().Empty() == false)
+ if (accessibilityManagerActionOverEventHandler == null && ActionOverSignal().Empty() == false)
{
- this.ActionOverSignal().Disconnect(_accessibilityManagerActionOverEventCallbackDelegate);
+ this.ActionOverSignal().Disconnect(accessibilityManagerActionOverEventCallbackDelegate);
}
}
add
{
// Restricted to only one listener
- if (_accessibilityManagerActionReadNextEventHandler == null)
+ if (accessibilityManagerActionReadNextEventHandler == null)
{
- _accessibilityManagerActionReadNextEventCallbackDelegate = new ActionReadNextEventCallbackDelegate(OnActionReadNext);
- this.ActionReadNextSignal().Connect(_accessibilityManagerActionReadNextEventCallbackDelegate);
+ accessibilityManagerActionReadNextEventCallbackDelegate = new ActionReadNextEventCallbackDelegate(OnActionReadNext);
+ this.ActionReadNextSignal().Connect(accessibilityManagerActionReadNextEventCallbackDelegate);
}
- _accessibilityManagerActionReadNextEventHandler += value;
+ accessibilityManagerActionReadNextEventHandler += value;
}
remove
{
- _accessibilityManagerActionReadNextEventHandler -= value;
+ accessibilityManagerActionReadNextEventHandler -= value;
- if (_accessibilityManagerActionReadNextEventHandler == null && ActionReadNextSignal().Empty() == false)
+ if (accessibilityManagerActionReadNextEventHandler == null && ActionReadNextSignal().Empty() == false)
{
- this.ActionReadNextSignal().Disconnect(_accessibilityManagerActionReadNextEventCallbackDelegate);
+ this.ActionReadNextSignal().Disconnect(accessibilityManagerActionReadNextEventCallbackDelegate);
}
}
}
add
{
// Restricted to only one listener
- if (_accessibilityManagerActionReadPreviousEventHandler == null)
+ if (accessibilityManagerActionReadPreviousEventHandler == null)
{
- _accessibilityManagerActionReadPreviousEventCallbackDelegate = new ActionReadPreviousEventCallbackDelegate(OnActionReadPrevious);
- this.ActionReadPreviousSignal().Connect(_accessibilityManagerActionReadPreviousEventCallbackDelegate);
+ accessibilityManagerActionReadPreviousEventCallbackDelegate = new ActionReadPreviousEventCallbackDelegate(OnActionReadPrevious);
+ this.ActionReadPreviousSignal().Connect(accessibilityManagerActionReadPreviousEventCallbackDelegate);
}
- _accessibilityManagerActionReadPreviousEventHandler += value;
+ accessibilityManagerActionReadPreviousEventHandler += value;
}
remove
{
- _accessibilityManagerActionReadPreviousEventHandler -= value;
+ accessibilityManagerActionReadPreviousEventHandler -= value;
- if (_accessibilityManagerActionReadPreviousEventHandler == null && ActionReadPreviousSignal().Empty() == false)
+ if (accessibilityManagerActionReadPreviousEventHandler == null && ActionReadPreviousSignal().Empty() == false)
{
- this.ActionReadPreviousSignal().Disconnect(_accessibilityManagerActionReadPreviousEventCallbackDelegate);
+ this.ActionReadPreviousSignal().Disconnect(accessibilityManagerActionReadPreviousEventCallbackDelegate);
}
}
}
add
{
// Restricted to only one listener
- if (_accessibilityManagerActionUpEventHandler == null)
+ if (accessibilityManagerActionUpEventHandler == null)
{
- _accessibilityManagerActionUpEventCallbackDelegate = new ActionUpEventCallbackDelegate(OnActionUp);
- this.ActionUpSignal().Connect(_accessibilityManagerActionUpEventCallbackDelegate);
+ accessibilityManagerActionUpEventCallbackDelegate = new ActionUpEventCallbackDelegate(OnActionUp);
+ this.ActionUpSignal().Connect(accessibilityManagerActionUpEventCallbackDelegate);
}
- _accessibilityManagerActionUpEventHandler += value;
+ accessibilityManagerActionUpEventHandler += value;
}
remove
{
- _accessibilityManagerActionUpEventHandler -= value;
+ accessibilityManagerActionUpEventHandler -= value;
- if (_accessibilityManagerActionUpEventHandler == null && ActionUpSignal().Empty() == false)
+ if (accessibilityManagerActionUpEventHandler == null && ActionUpSignal().Empty() == false)
{
- this.ActionUpSignal().Disconnect(_accessibilityManagerActionUpEventCallbackDelegate);
+ this.ActionUpSignal().Disconnect(accessibilityManagerActionUpEventCallbackDelegate);
}
}
}
add
{
// Restricted to only one listener
- if (_accessibilityManagerActionDownEventHandler == null)
+ if (accessibilityManagerActionDownEventHandler == null)
{
- _accessibilityManagerActionDownEventCallbackDelegate = new ActionDownEventCallbackDelegate(OnActionDown);
- this.ActionDownSignal().Connect(_accessibilityManagerActionDownEventCallbackDelegate);
+ accessibilityManagerActionDownEventCallbackDelegate = new ActionDownEventCallbackDelegate(OnActionDown);
+ this.ActionDownSignal().Connect(accessibilityManagerActionDownEventCallbackDelegate);
}
- _accessibilityManagerActionDownEventHandler += value;
+ accessibilityManagerActionDownEventHandler += value;
}
remove
{
- _accessibilityManagerActionDownEventHandler -= value;
+ accessibilityManagerActionDownEventHandler -= value;
- if (_accessibilityManagerActionDownEventHandler == null && ActionDownSignal().Empty() == false)
+ if (accessibilityManagerActionDownEventHandler == null && ActionDownSignal().Empty() == false)
{
- this.ActionDownSignal().Disconnect(_accessibilityManagerActionDownEventCallbackDelegate);
+ this.ActionDownSignal().Disconnect(accessibilityManagerActionDownEventCallbackDelegate);
}
}
}
add
{
// Restricted to only one listener
- if (_accessibilityManagerActionClearFocusEventHandler == null)
+ if (accessibilityManagerActionClearFocusEventHandler == null)
{
- _accessibilityManagerActionClearFocusEventCallbackDelegate = new ActionClearFocusEventCallbackDelegate(OnActionClearFocus);
- this.ActionClearFocusSignal().Connect(_accessibilityManagerActionClearFocusEventCallbackDelegate);
+ accessibilityManagerActionClearFocusEventCallbackDelegate = new ActionClearFocusEventCallbackDelegate(OnActionClearFocus);
+ this.ActionClearFocusSignal().Connect(accessibilityManagerActionClearFocusEventCallbackDelegate);
}
- _accessibilityManagerActionClearFocusEventHandler += value;
+ accessibilityManagerActionClearFocusEventHandler += value;
}
remove
{
- _accessibilityManagerActionClearFocusEventHandler -= value;
+ accessibilityManagerActionClearFocusEventHandler -= value;
- if (_accessibilityManagerActionClearFocusEventHandler == null && ActionClearFocusSignal().Empty() == false)
+ if (accessibilityManagerActionClearFocusEventHandler == null && ActionClearFocusSignal().Empty() == false)
{
- this.ActionClearFocusSignal().Disconnect(_accessibilityManagerActionClearFocusEventCallbackDelegate);
+ this.ActionClearFocusSignal().Disconnect(accessibilityManagerActionClearFocusEventCallbackDelegate);
}
}
}
add
{
// Restricted to only one listener
- if (_accessibilityManagerActionBackEventHandler == null)
+ if (accessibilityManagerActionBackEventHandler == null)
{
- _accessibilityManagerActionBackEventCallbackDelegate = new ActionBackEventCallbackDelegate(OnActionBack);
- this.ActionBackSignal().Connect(_accessibilityManagerActionBackEventCallbackDelegate);
+ accessibilityManagerActionBackEventCallbackDelegate = new ActionBackEventCallbackDelegate(OnActionBack);
+ this.ActionBackSignal().Connect(accessibilityManagerActionBackEventCallbackDelegate);
}
- _accessibilityManagerActionBackEventHandler += value;
+ accessibilityManagerActionBackEventHandler += value;
}
remove
{
- _accessibilityManagerActionBackEventHandler -= value;
+ accessibilityManagerActionBackEventHandler -= value;
- if (_accessibilityManagerActionBackEventHandler == null && ActionBackSignal().Empty() == false)
+ if (accessibilityManagerActionBackEventHandler == null && ActionBackSignal().Empty() == false)
{
- this.ActionBackSignal().Disconnect(_accessibilityManagerActionBackEventCallbackDelegate);
+ this.ActionBackSignal().Disconnect(accessibilityManagerActionBackEventCallbackDelegate);
}
}
}
add
{
// Restricted to only one listener
- if (_accessibilityManagerActionScrollUpEventHandler == null)
+ if (accessibilityManagerActionScrollUpEventHandler == null)
{
- _accessibilityManagerActionScrollUpEventCallbackDelegate = new ActionScrollUpEventCallbackDelegate(OnActionScrollUp);
- this.ActionScrollUpSignal().Connect(_accessibilityManagerActionScrollUpEventCallbackDelegate);
+ accessibilityManagerActionScrollUpEventCallbackDelegate = new ActionScrollUpEventCallbackDelegate(OnActionScrollUp);
+ this.ActionScrollUpSignal().Connect(accessibilityManagerActionScrollUpEventCallbackDelegate);
}
- _accessibilityManagerActionScrollUpEventHandler += value;
+ accessibilityManagerActionScrollUpEventHandler += value;
}
remove
{
- _accessibilityManagerActionScrollUpEventHandler -= value;
+ accessibilityManagerActionScrollUpEventHandler -= value;
- if (_accessibilityManagerActionScrollUpEventHandler == null && ActionScrollUpSignal().Empty() == false)
+ if (accessibilityManagerActionScrollUpEventHandler == null && ActionScrollUpSignal().Empty() == false)
{
- this.ActionScrollUpSignal().Disconnect(_accessibilityManagerActionScrollUpEventCallbackDelegate);
+ this.ActionScrollUpSignal().Disconnect(accessibilityManagerActionScrollUpEventCallbackDelegate);
}
}
}
add
{
// Restricted to only one listener
- if (_accessibilityManagerActionScrollDownEventHandler == null)
+ if (accessibilityManagerActionScrollDownEventHandler == null)
{
- _accessibilityManagerActionScrollDownEventCallbackDelegate = new ActionScrollDownEventCallbackDelegate(OnActionScrollDown);
- this.ActionScrollDownSignal().Connect(_accessibilityManagerActionScrollDownEventCallbackDelegate);
+ accessibilityManagerActionScrollDownEventCallbackDelegate = new ActionScrollDownEventCallbackDelegate(OnActionScrollDown);
+ this.ActionScrollDownSignal().Connect(accessibilityManagerActionScrollDownEventCallbackDelegate);
}
- _accessibilityManagerActionScrollDownEventHandler += value;
+ accessibilityManagerActionScrollDownEventHandler += value;
}
remove
{
- _accessibilityManagerActionScrollDownEventHandler -= value;
+ accessibilityManagerActionScrollDownEventHandler -= value;
- if (_accessibilityManagerActionScrollDownEventHandler == null && ActionScrollDownSignal().Empty() == false)
+ if (accessibilityManagerActionScrollDownEventHandler == null && ActionScrollDownSignal().Empty() == false)
{
- this.ActionScrollDownSignal().Disconnect(_accessibilityManagerActionScrollDownEventCallbackDelegate);
+ this.ActionScrollDownSignal().Disconnect(accessibilityManagerActionScrollDownEventCallbackDelegate);
}
}
}
add
{
// Restricted to only one listener
- if (_accessibilityManagerActionPageLeftEventHandler == null)
+ if (accessibilityManagerActionPageLeftEventHandler == null)
{
- _accessibilityManagerActionPageLeftEventCallbackDelegate = new ActionPageLeftEventCallbackDelegate(OnActionPageLeft);
- this.ActionPageLeftSignal().Connect(_accessibilityManagerActionPageLeftEventCallbackDelegate);
+ accessibilityManagerActionPageLeftEventCallbackDelegate = new ActionPageLeftEventCallbackDelegate(OnActionPageLeft);
+ this.ActionPageLeftSignal().Connect(accessibilityManagerActionPageLeftEventCallbackDelegate);
}
- _accessibilityManagerActionPageLeftEventHandler += value;
+ accessibilityManagerActionPageLeftEventHandler += value;
}
remove
{
- _accessibilityManagerActionPageLeftEventHandler -= value;
+ accessibilityManagerActionPageLeftEventHandler -= value;
- if (_accessibilityManagerActionPageLeftEventHandler == null && ActionPageLeftSignal().Empty() == false)
+ if (accessibilityManagerActionPageLeftEventHandler == null && ActionPageLeftSignal().Empty() == false)
{
- this.ActionPageLeftSignal().Disconnect(_accessibilityManagerActionPageLeftEventCallbackDelegate);
+ this.ActionPageLeftSignal().Disconnect(accessibilityManagerActionPageLeftEventCallbackDelegate);
}
}
}
add
{
// Restricted to only one listener
- if (_accessibilityManagerActionPageRightEventHandler == null)
+ if (accessibilityManagerActionPageRightEventHandler == null)
{
- _accessibilityManagerActionPageRightEventCallbackDelegate = new ActionPageRightEventCallbackDelegate(OnActionPageRight);
- this.ActionPageRightSignal().Connect(_accessibilityManagerActionPageRightEventCallbackDelegate);
+ accessibilityManagerActionPageRightEventCallbackDelegate = new ActionPageRightEventCallbackDelegate(OnActionPageRight);
+ this.ActionPageRightSignal().Connect(accessibilityManagerActionPageRightEventCallbackDelegate);
}
- _accessibilityManagerActionPageRightEventHandler += value;
+ accessibilityManagerActionPageRightEventHandler += value;
}
remove
{
- _accessibilityManagerActionPageRightEventHandler -= value;
+ accessibilityManagerActionPageRightEventHandler -= value;
- if (_accessibilityManagerActionPageRightEventHandler == null && ActionPageRightSignal().Empty() == false)
+ if (accessibilityManagerActionPageRightEventHandler == null && ActionPageRightSignal().Empty() == false)
{
- this.ActionPageRightSignal().Disconnect(_accessibilityManagerActionPageRightEventCallbackDelegate);
+ this.ActionPageRightSignal().Disconnect(accessibilityManagerActionPageRightEventCallbackDelegate);
}
}
}
add
{
// Restricted to only one listener
- if (_accessibilityManagerActionPageUpEventHandler == null)
+ if (accessibilityManagerActionPageUpEventHandler == null)
{
- _accessibilityManagerActionPageUpEventCallbackDelegate = new ActionPageUpEventCallbackDelegate(OnActionPageUp);
- this.ActionPageUpSignal().Connect(_accessibilityManagerActionPageUpEventCallbackDelegate);
+ accessibilityManagerActionPageUpEventCallbackDelegate = new ActionPageUpEventCallbackDelegate(OnActionPageUp);
+ this.ActionPageUpSignal().Connect(accessibilityManagerActionPageUpEventCallbackDelegate);
}
- _accessibilityManagerActionPageUpEventHandler += value;
+ accessibilityManagerActionPageUpEventHandler += value;
}
remove
{
- _accessibilityManagerActionPageUpEventHandler -= value;
+ accessibilityManagerActionPageUpEventHandler -= value;
- if (_accessibilityManagerActionPageUpEventHandler == null && ActionPageUpSignal().Empty() == false)
+ if (accessibilityManagerActionPageUpEventHandler == null && ActionPageUpSignal().Empty() == false)
{
- this.ActionPageUpSignal().Disconnect(_accessibilityManagerActionPageUpEventCallbackDelegate);
+ this.ActionPageUpSignal().Disconnect(accessibilityManagerActionPageUpEventCallbackDelegate);
}
}
}
add
{
// Restricted to only one listener
- if (_accessibilityManagerActionPageDownEventHandler == null)
+ if (accessibilityManagerActionPageDownEventHandler == null)
{
- _accessibilityManagerActionPageDownEventCallbackDelegate = new ActionPageDownEventCallbackDelegate(OnActionPageDown);
- this.ActionPageDownSignal().Connect(_accessibilityManagerActionPageDownEventCallbackDelegate);
+ accessibilityManagerActionPageDownEventCallbackDelegate = new ActionPageDownEventCallbackDelegate(OnActionPageDown);
+ this.ActionPageDownSignal().Connect(accessibilityManagerActionPageDownEventCallbackDelegate);
}
- _accessibilityManagerActionPageDownEventHandler += value;
+ accessibilityManagerActionPageDownEventHandler += value;
}
remove
{
- _accessibilityManagerActionPageDownEventHandler -= value;
+ accessibilityManagerActionPageDownEventHandler -= value;
- if (_accessibilityManagerActionPageDownEventHandler == null && ActionPageDownSignal().Empty() == false)
+ if (accessibilityManagerActionPageDownEventHandler == null && ActionPageDownSignal().Empty() == false)
{
- this.ActionPageDownSignal().Disconnect(_accessibilityManagerActionPageDownEventCallbackDelegate);
+ this.ActionPageDownSignal().Disconnect(accessibilityManagerActionPageDownEventCallbackDelegate);
}
}
}
add
{
// Restricted to only one listener
- if (_accessibilityManagerActionMoveToFirstEventHandler == null)
+ if (accessibilityManagerActionMoveToFirstEventHandler == null)
{
- _accessibilityManagerActionMoveToFirstEventCallbackDelegate = new ActionMoveToFirstEventCallbackDelegate(OnActionMoveToFirst);
- this.ActionMoveToFirstSignal().Connect(_accessibilityManagerActionMoveToFirstEventCallbackDelegate);
+ accessibilityManagerActionMoveToFirstEventCallbackDelegate = new ActionMoveToFirstEventCallbackDelegate(OnActionMoveToFirst);
+ this.ActionMoveToFirstSignal().Connect(accessibilityManagerActionMoveToFirstEventCallbackDelegate);
}
- _accessibilityManagerActionMoveToFirstEventHandler += value;
+ accessibilityManagerActionMoveToFirstEventHandler += value;
}
remove
{
- _accessibilityManagerActionMoveToFirstEventHandler -= value;
+ accessibilityManagerActionMoveToFirstEventHandler -= value;
- if (_accessibilityManagerActionMoveToFirstEventHandler == null && ActionMoveToFirstSignal().Empty() == false)
+ if (accessibilityManagerActionMoveToFirstEventHandler == null && ActionMoveToFirstSignal().Empty() == false)
{
- this.ActionMoveToFirstSignal().Disconnect(_accessibilityManagerActionMoveToFirstEventCallbackDelegate);
+ this.ActionMoveToFirstSignal().Disconnect(accessibilityManagerActionMoveToFirstEventCallbackDelegate);
}
}
}
add
{
// Restricted to only one listener
- if (_accessibilityManagerActionMoveToLastEventHandler == null)
+ if (accessibilityManagerActionMoveToLastEventHandler == null)
{
- _accessibilityManagerActionMoveToLastEventCallbackDelegate = new ActionMoveToLastEventCallbackDelegate(OnActionMoveToLast);
- this.ActionMoveToLastSignal().Connect(_accessibilityManagerActionMoveToLastEventCallbackDelegate);
+ accessibilityManagerActionMoveToLastEventCallbackDelegate = new ActionMoveToLastEventCallbackDelegate(OnActionMoveToLast);
+ this.ActionMoveToLastSignal().Connect(accessibilityManagerActionMoveToLastEventCallbackDelegate);
}
- _accessibilityManagerActionMoveToLastEventHandler += value;
+ accessibilityManagerActionMoveToLastEventHandler += value;
}
remove
{
- _accessibilityManagerActionMoveToLastEventHandler -= value;
+ accessibilityManagerActionMoveToLastEventHandler -= value;
- if (_accessibilityManagerActionMoveToLastEventHandler == null && ActionMoveToLastSignal().Empty() == false)
+ if (accessibilityManagerActionMoveToLastEventHandler == null && ActionMoveToLastSignal().Empty() == false)
{
- this.ActionMoveToLastSignal().Disconnect(_accessibilityManagerActionMoveToLastEventCallbackDelegate);
+ this.ActionMoveToLastSignal().Disconnect(accessibilityManagerActionMoveToLastEventCallbackDelegate);
}
}
}
add
{
// Restricted to only one listener
- if (_accessibilityManagerActionReadFromTopEventHandler == null)
+ if (accessibilityManagerActionReadFromTopEventHandler == null)
{
- _accessibilityManagerActionReadFromTopEventCallbackDelegate = new ActionReadFromTopEventCallbackDelegate(OnActionReadFromTop);
- this.ActionReadFromTopSignal().Connect(_accessibilityManagerActionReadFromTopEventCallbackDelegate);
+ accessibilityManagerActionReadFromTopEventCallbackDelegate = new ActionReadFromTopEventCallbackDelegate(OnActionReadFromTop);
+ this.ActionReadFromTopSignal().Connect(accessibilityManagerActionReadFromTopEventCallbackDelegate);
}
- _accessibilityManagerActionReadFromTopEventHandler += value;
+ accessibilityManagerActionReadFromTopEventHandler += value;
}
remove
{
- _accessibilityManagerActionReadFromTopEventHandler -= value;
+ accessibilityManagerActionReadFromTopEventHandler -= value;
- if (_accessibilityManagerActionReadFromTopEventHandler == null && ActionReadFromTopSignal().Empty() == false)
+ if (accessibilityManagerActionReadFromTopEventHandler == null && ActionReadFromTopSignal().Empty() == false)
{
- this.ActionReadFromTopSignal().Disconnect(_accessibilityManagerActionReadFromTopEventCallbackDelegate);
+ this.ActionReadFromTopSignal().Disconnect(accessibilityManagerActionReadFromTopEventCallbackDelegate);
}
}
}
add
{
// Restricted to only one listener
- if (_accessibilityManagerActionReadFromNextEventHandler == null)
+ if (accessibilityManagerActionReadFromNextEventHandler == null)
{
- _accessibilityManagerActionReadFromNextEventCallbackDelegate = new ActionReadFromNextEventCallbackDelegate(OnActionReadFromNext);
- this.ActionReadFromNextSignal().Connect(_accessibilityManagerActionReadFromNextEventCallbackDelegate);
+ accessibilityManagerActionReadFromNextEventCallbackDelegate = new ActionReadFromNextEventCallbackDelegate(OnActionReadFromNext);
+ this.ActionReadFromNextSignal().Connect(accessibilityManagerActionReadFromNextEventCallbackDelegate);
}
- _accessibilityManagerActionReadFromNextEventHandler += value;
+ accessibilityManagerActionReadFromNextEventHandler += value;
}
remove
{
- _accessibilityManagerActionReadFromNextEventHandler -= value;
+ accessibilityManagerActionReadFromNextEventHandler -= value;
- if (_accessibilityManagerActionReadFromNextEventHandler == null && ActionReadFromNextSignal().Empty() == false)
+ if (accessibilityManagerActionReadFromNextEventHandler == null && ActionReadFromNextSignal().Empty() == false)
{
- this.ActionReadFromNextSignal().Disconnect(_accessibilityManagerActionReadFromNextEventCallbackDelegate);
+ this.ActionReadFromNextSignal().Disconnect(accessibilityManagerActionReadFromNextEventCallbackDelegate);
}
}
}
add
{
// Restricted to only one listener
- if (_accessibilityManagerActionZoomEventHandler == null)
+ if (accessibilityManagerActionZoomEventHandler == null)
{
- _accessibilityManagerActionZoomEventCallbackDelegate = new ActionZoomEventCallbackDelegate(OnActionZoom);
- this.ActionZoomSignal().Connect(_accessibilityManagerActionZoomEventCallbackDelegate);
+ accessibilityManagerActionZoomEventCallbackDelegate = new ActionZoomEventCallbackDelegate(OnActionZoom);
+ this.ActionZoomSignal().Connect(accessibilityManagerActionZoomEventCallbackDelegate);
}
- _accessibilityManagerActionZoomEventHandler += value;
+ accessibilityManagerActionZoomEventHandler += value;
}
remove
{
- _accessibilityManagerActionZoomEventHandler -= value;
+ accessibilityManagerActionZoomEventHandler -= value;
- if (_accessibilityManagerActionZoomEventHandler == null && ActionZoomSignal().Empty() == false)
+ if (accessibilityManagerActionZoomEventHandler == null && ActionZoomSignal().Empty() == false)
{
- this.ActionZoomSignal().Disconnect(_accessibilityManagerActionZoomEventCallbackDelegate);
+ this.ActionZoomSignal().Disconnect(accessibilityManagerActionZoomEventCallbackDelegate);
}
}
}
add
{
// Restricted to only one listener
- if (_accessibilityManagerActionReadPauseResumeEventHandler == null)
+ if (accessibilityManagerActionReadPauseResumeEventHandler == null)
{
- _accessibilityManagerActionReadPauseResumeEventCallbackDelegate = new ActionReadPauseResumeEventCallbackDelegate(OnActionReadPauseResume);
- this.ActionReadPauseResumeSignal().Connect(_accessibilityManagerActionReadPauseResumeEventCallbackDelegate);
+ accessibilityManagerActionReadPauseResumeEventCallbackDelegate = new ActionReadPauseResumeEventCallbackDelegate(OnActionReadPauseResume);
+ this.ActionReadPauseResumeSignal().Connect(accessibilityManagerActionReadPauseResumeEventCallbackDelegate);
}
- _accessibilityManagerActionReadPauseResumeEventHandler += value;
+ accessibilityManagerActionReadPauseResumeEventHandler += value;
}
remove
{
- _accessibilityManagerActionReadPauseResumeEventHandler -= value;
+ accessibilityManagerActionReadPauseResumeEventHandler -= value;
- if (_accessibilityManagerActionReadPauseResumeEventHandler == null && ActionReadPauseResumeSignal().Empty() == false)
+ if (accessibilityManagerActionReadPauseResumeEventHandler == null && ActionReadPauseResumeSignal().Empty() == false)
{
- this.ActionReadPauseResumeSignal().Disconnect(_accessibilityManagerActionReadPauseResumeEventCallbackDelegate);
+ this.ActionReadPauseResumeSignal().Disconnect(accessibilityManagerActionReadPauseResumeEventCallbackDelegate);
}
}
}
add
{
// Restricted to only one listener
- if (_accessibilityManagerActionStartStopEventHandler == null)
+ if (accessibilityManagerActionStartStopEventHandler == null)
{
- _accessibilityManagerActionStartStopEventCallbackDelegate = new ActionStartStopEventCallbackDelegate(OnActionStartStop);
- this.ActionStartStopSignal().Connect(_accessibilityManagerActionStartStopEventCallbackDelegate);
+ accessibilityManagerActionStartStopEventCallbackDelegate = new ActionStartStopEventCallbackDelegate(OnActionStartStop);
+ this.ActionStartStopSignal().Connect(accessibilityManagerActionStartStopEventCallbackDelegate);
}
- _accessibilityManagerActionStartStopEventHandler += value;
+ accessibilityManagerActionStartStopEventHandler += value;
}
remove
{
- _accessibilityManagerActionStartStopEventHandler -= value;
+ accessibilityManagerActionStartStopEventHandler -= value;
- if (_accessibilityManagerActionStartStopEventHandler == null && ActionStartStopSignal().Empty() == false)
+ if (accessibilityManagerActionStartStopEventHandler == null && ActionStartStopSignal().Empty() == false)
{
- this.ActionStartStopSignal().Disconnect(_accessibilityManagerActionStartStopEventCallbackDelegate);
+ this.ActionStartStopSignal().Disconnect(accessibilityManagerActionStartStopEventCallbackDelegate);
}
}
}
add
{
// Restricted to only one listener
- if (_accessibilityManagerFocusChangedEventHandler == null)
+ if (accessibilityManagerFocusChangedEventHandler == null)
{
- _accessibilityManagerFocusChangedEventCallbackDelegate = new FocusChangedEventCallbackDelegate(OnFocusChanged);
- this.FocusChangedSignal().Connect(_accessibilityManagerFocusChangedEventCallbackDelegate);
+ accessibilityManagerFocusChangedEventCallbackDelegate = new FocusChangedEventCallbackDelegate(OnFocusChanged);
+ this.FocusChangedSignal().Connect(accessibilityManagerFocusChangedEventCallbackDelegate);
}
- _accessibilityManagerFocusChangedEventHandler += value;
+ accessibilityManagerFocusChangedEventHandler += value;
}
remove
{
- _accessibilityManagerFocusChangedEventHandler -= value;
+ accessibilityManagerFocusChangedEventHandler -= value;
- if (_accessibilityManagerFocusChangedEventHandler == null && FocusChangedSignal().Empty() == false)
+ if (accessibilityManagerFocusChangedEventHandler == null && FocusChangedSignal().Empty() == false)
{
- this.FocusChangedSignal().Disconnect(_accessibilityManagerFocusChangedEventCallbackDelegate);
+ this.FocusChangedSignal().Disconnect(accessibilityManagerFocusChangedEventCallbackDelegate);
}
}
}
add
{
// Restricted to only one listener
- if (_accessibilityManagerFocusedViewActivatedEventHandler == null)
+ if (accessibilityManagerFocusedViewActivatedEventHandler == null)
{
- _accessibilityManagerFocusedViewActivatedEventCallbackDelegate = new FocusedViewActivatedEventCallbackDelegate(OnFocusedViewActivated);
- this.FocusedViewActivatedSignal().Connect(_accessibilityManagerFocusedViewActivatedEventCallbackDelegate);
+ accessibilityManagerFocusedViewActivatedEventCallbackDelegate = new FocusedViewActivatedEventCallbackDelegate(OnFocusedViewActivated);
+ this.FocusedViewActivatedSignal().Connect(accessibilityManagerFocusedViewActivatedEventCallbackDelegate);
}
- _accessibilityManagerFocusedViewActivatedEventHandler += value;
+ accessibilityManagerFocusedViewActivatedEventHandler += value;
}
remove
{
- _accessibilityManagerFocusedViewActivatedEventHandler -= value;
+ accessibilityManagerFocusedViewActivatedEventHandler -= value;
- if (_accessibilityManagerFocusedViewActivatedEventHandler == null && FocusedViewActivatedSignal().Empty() == false)
+ if (accessibilityManagerFocusedViewActivatedEventHandler == null && FocusedViewActivatedSignal().Empty() == false)
{
- this.FocusedViewActivatedSignal().Disconnect(_accessibilityManagerFocusedViewActivatedEventCallbackDelegate);
+ this.FocusedViewActivatedSignal().Disconnect(accessibilityManagerFocusedViewActivatedEventCallbackDelegate);
}
}
}
add
{
// Restricted to only one listener
- if (_accessibilityManagerFocusOvershotEventHandler == null)
+ if (accessibilityManagerFocusOvershotEventHandler == null)
{
- _accessibilityManagerFocusOvershotEventCallbackDelegate = new FocusOvershotEventCallbackDelegate(OnFocusOvershot);
- this.FocusOvershotSignal().Connect(_accessibilityManagerFocusOvershotEventCallbackDelegate);
+ accessibilityManagerFocusOvershotEventCallbackDelegate = new FocusOvershotEventCallbackDelegate(OnFocusOvershot);
+ this.FocusOvershotSignal().Connect(accessibilityManagerFocusOvershotEventCallbackDelegate);
}
- _accessibilityManagerFocusOvershotEventHandler += value;
+ accessibilityManagerFocusOvershotEventHandler += value;
}
remove
{
- _accessibilityManagerFocusOvershotEventHandler -= value;
+ accessibilityManagerFocusOvershotEventHandler -= value;
- if (_accessibilityManagerFocusOvershotEventHandler == null && FocusOvershotSignal().Empty() == false)
+ if (accessibilityManagerFocusOvershotEventHandler == null && FocusOvershotSignal().Empty() == false)
{
- this.FocusOvershotSignal().Disconnect(_accessibilityManagerFocusOvershotEventCallbackDelegate);
+ this.FocusOvershotSignal().Disconnect(accessibilityManagerFocusOvershotEventCallbackDelegate);
}
}
}
/*
- * Copyright(c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
[EditorBrowsable(EditorBrowsableState.Never)]
public class FocusChangedEventArgs : EventArgs
{
- private View _viewCurrent;
- private View _viewNext;
+ private View viewCurrent;
+ private View viewNext;
/// <since_tizen> 6 </since_tizen>
/// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
{
get
{
- return _viewCurrent;
+ return viewCurrent;
}
set
{
- _viewCurrent = value;
+ viewCurrent = value;
}
}
{
get
{
- return _viewNext;
+ return viewNext;
}
set
{
- _viewNext = value;
+ viewNext = value;
}
}
}
[EditorBrowsable(EditorBrowsableState.Never)]
public class FocusedViewActivatedEventArgs : EventArgs
{
- private View _view;
+ private View view;
/// <since_tizen> 6 </since_tizen>
{
get
{
- return _view;
+ return view;
}
set
{
- _view = value;
+ view = value;
}
}
}
[EditorBrowsable(EditorBrowsableState.Never)]
public class FocusOvershotEventArgs : EventArgs
{
- private View _currentFocusedView;
- private AccessibilityManager.FocusOvershotDirection _focusOvershotDirection;
+ private View currentFocusedView;
+ private AccessibilityManager.FocusOvershotDirection focusOvershotDirection;
/// <since_tizen> 6 </since_tizen>
/// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
{
get
{
- return _currentFocusedView;
+ return currentFocusedView;
}
set
{
- _currentFocusedView = value;
+ currentFocusedView = value;
}
}
{
get
{
- return _focusOvershotDirection;
+ return focusOvershotDirection;
}
set
{
- _focusOvershotDirection = value;
+ focusOvershotDirection = value;
}
}
}
using System;
using System.ComponentModel;
using System.Runtime.InteropServices;
- using Tizen.NUI.BaseComponents;
-
- using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
- using System.Xml;
- using Tizen.NUI.Binding.Internals;
- using Tizen.NUI.Binding;
using System.Globalization;
- using Tizen.NUI.Xaml.Internals;
using System.Diagnostics.CodeAnalysis;
+ using Tizen.NUI.BaseComponents;
+
/// <summary>
/// Animation can be used to animate the properties of any number of objects, typically view.<br />
/// If the "Finished" event is connected to a member function of an object, it must be disconnected before the object is destroyed.<br />
{
private static bool? disableAnimation = null;
+ private AnimationFinishedEventCallbackType animationFinishedEventCallback;
+ private System.IntPtr finishedCallbackOfNative;
- private AnimationFinishedEventCallbackType _animationFinishedEventCallback;
- private System.IntPtr _finishedCallbackOfNative;
-
- private AnimationProgressReachedEventCallbackType _animationProgressReachedEventCallback;
+ private AnimationProgressReachedEventCallbackType animationProgressReachedEventCallback;
- private string[] _properties = null;
- private string[] _destValue = null;
- private int[] _startTime = null;
- private int[] _endTime = null;
+ private string[] properties = null;
+ private string[] destValue = null;
+ private int[] startTime = null;
+ private int[] endTime = null;
private List<string> propertyList = null;
private List<string> destValueList = null;
internal Animation(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
{
-
- _animationFinishedEventCallback = OnFinished;
- _finishedCallbackOfNative = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate<System.Delegate>(_animationFinishedEventCallback);
+ animationFinishedEventCallback = OnFinished;
+ finishedCallbackOfNative = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate<System.Delegate>(animationFinishedEventCallback);
}
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
private delegate void AnimationProgressReachedEventCallbackType(IntPtr data);
- private event EventHandler _animationFinishedEventHandler;
+ private event EventHandler animationFinishedEventHandler;
/**
* @brief Event for the finished signal which can be used to subscribe or unsubscribe the event handler.
{
add
{
- if (_animationFinishedEventHandler == null && disposed == false)
+ if (animationFinishedEventHandler == null && disposed == false)
{
AnimationSignal finishedSignal = FinishedSignal();
- finishedSignal.Connect(_finishedCallbackOfNative);
+ finishedSignal.Connect(finishedCallbackOfNative);
finishedSignal.Dispose();
}
- _animationFinishedEventHandler += value;
+ animationFinishedEventHandler += value;
}
remove
{
- _animationFinishedEventHandler -= value;
+ animationFinishedEventHandler -= value;
AnimationSignal finishedSignal = FinishedSignal();
- if (_animationFinishedEventHandler == null && finishedSignal.Empty() == false)
+ if (animationFinishedEventHandler == null && finishedSignal.Empty() == false)
{
- finishedSignal.Disconnect(_finishedCallbackOfNative);
+ finishedSignal.Disconnect(finishedCallbackOfNative);
}
finishedSignal.Dispose();
}
}
- private event EventHandler _animationProgressReachedEventHandler;
+ private event EventHandler animationProgressReachedEventHandler;
/**
* @brief Event for the ProgressReached signal, which can be used to subscribe or unsubscribe the event handler.
{
add
{
- if (_animationProgressReachedEventHandler == null)
+ if (animationProgressReachedEventHandler == null)
{
- _animationProgressReachedEventCallback = OnProgressReached;
+ animationProgressReachedEventCallback = OnProgressReached;
AnimationSignal progressReachedSignal = ProgressReachedSignal();
- progressReachedSignal?.Connect(_animationProgressReachedEventCallback);
+ progressReachedSignal?.Connect(animationProgressReachedEventCallback);
progressReachedSignal?.Dispose();
}
- _animationProgressReachedEventHandler += value;
+ animationProgressReachedEventHandler += value;
}
remove
{
- _animationProgressReachedEventHandler -= value;
+ animationProgressReachedEventHandler -= value;
AnimationSignal progressReachedSignal = ProgressReachedSignal();
- if (_animationProgressReachedEventHandler == null && progressReachedSignal?.Empty() == false)
+ if (animationProgressReachedEventHandler == null && progressReachedSignal?.Empty() == false)
{
- progressReachedSignal?.Disconnect(_animationProgressReachedEventCallback);
+ progressReachedSignal?.Disconnect(animationProgressReachedEventCallback);
}
progressReachedSignal.Dispose();
}
{
get
{
- return _properties;
+ return properties;
}
set
{
- _properties = value;
+ properties = value;
}
}
{
get
{
- return _destValue;
+ return destValue;
}
set
{
- _destValue = value;
+ destValue = value;
}
}
{
get
{
- return _startTime;
+ return startTime;
}
set
{
- _startTime = value;
+ startTime = value;
}
}
{
get
{
- return _endTime;
+ return endTime;
}
set
{
- _endTime = value;
+ endTime = value;
}
}
}
else
{
- if (_properties.Length == _destValue.Length && _startTime.Length == _endTime.Length && _properties.Length == _startTime.Length)
+ if (properties.Length == destValue.Length && startTime.Length == endTime.Length && properties.Length == startTime.Length)
{
- int length = _properties.Length;
+ int length = properties.Length;
for (int index = 0; index < length; index++)
{
//object destinationValue = _destValue[index];
var elementType = target.GetType();
- PropertyInfo propertyInfo = elementType.GetProperties().FirstOrDefault(fi => fi.Name == _properties[index]);
+ PropertyInfo propertyInfo = elementType.GetProperties().FirstOrDefault(fi => fi.Name == properties[index]);
//var propertyInfo = elementType.GetRuntimeProperties().FirstOrDefault(p => p.Name == localName);
if (propertyInfo != null)
{
- object destinationValue = ConvertTo(_destValue[index], propertyInfo.PropertyType);
+ object destinationValue = ConvertTo(destValue[index], propertyInfo.PropertyType);
if (destinationValue != null)
{
- AnimateTo(target, _properties[index], destinationValue, _startTime[index], _endTime[index]);
+ AnimateTo(target, properties[index], destinationValue, startTime[index], endTime[index]);
}
}
}
return;
}
- if (_animationFinishedEventHandler != null)
+ if (animationFinishedEventHandler != null)
{
AnimationSignal finishedSignal = FinishedSignal();
- finishedSignal?.Disconnect(_finishedCallbackOfNative);
+ finishedSignal?.Disconnect(finishedCallbackOfNative);
finishedSignal?.Dispose();
- _animationFinishedEventHandler = null;
+ animationFinishedEventHandler = null;
}
- if (_animationProgressReachedEventCallback != null)
+ if (animationProgressReachedEventCallback != null)
{
AnimationSignal progressReachedSignal = ProgressReachedSignal();
- progressReachedSignal?.Disconnect(_animationProgressReachedEventCallback);
+ progressReachedSignal?.Disconnect(animationProgressReachedEventCallback);
progressReachedSignal?.Dispose();
- _animationProgressReachedEventCallback = null;
+ animationProgressReachedEventCallback = null;
}
base.Dispose(type);
private void OnFinished(IntPtr data)
{
- if (_animationFinishedEventHandler != null)
+ if (animationFinishedEventHandler != null)
{
//here we send all data to user event handlers
- _animationFinishedEventHandler(this, null);
+ animationFinishedEventHandler(this, null);
}
}
private void OnProgressReached(IntPtr data)
{
- if (_animationProgressReachedEventHandler != null)
+ if (animationProgressReachedEventHandler != null)
{
//here we send all data to user event handlers
- _animationProgressReachedEventHandler(this, null);
+ animationProgressReachedEventHandler(this, null);
}
}
/*
- * Copyright(c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*
*/
-using System;
using System.ComponentModel;
namespace Tizen.NUI
{
-
/// <summary>
/// A set of key frames for a property that can be animated using DALi animation.<br />
/// This allows the generation of key frame objects from individual Property::Values.<br />
/// <since_tizen> 3 </since_tizen>
public class KeyFrames : BaseHandle
{
-
/// <summary>
/// Creates an initialized KeyFrames handle.
/// </summary>
public KeyFrames() : this(Interop.KeyFrames.New(), true)
{
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-
}
internal KeyFrames(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
/*
- * Copyright(c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
namespace Tizen.NUI
{
-
/// <summary>
/// A 3D parametric curve.<br />
/// Paths can be used to animate the position and orientation of actors.<br />
/// <since_tizen> 3 </since_tizen>
public class Path : BaseHandle
{
-
/// <summary>
/// Creates an initialized path handle.
/// </summary>
-using System;
+/*
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+using System;
using System.Collections.Generic;
using System.ComponentModel;
-using System.Text;
-using Tizen.NUI;
using Tizen.NUI.BaseComponents;
namespace Tizen.NUI
/*
- * Copyright(c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
/// <since_tizen> 3 </since_tizen>
public class TransitionData : BaseHandle
{
-
/// <summary>
/// Create an instance of TransitionData.
/// </summary>
public TransitionData(PropertyMap transition) : this(Interop.TransitionData.NewByMap(PropertyMap.getCPtr(transition)), true)
{
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-
}
/// <summary>
/*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd All Rights Reserved
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd All Rights Reserved
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*/
using System;
-using System.Collections.Generic;
using System.ComponentModel;
-using System.Text;
using Tizen.Applications;
using Tizen.NUI.BaseComponents;
mainWindow = window;
}
-
/// <summary>
/// Set animated view of seamless animation.
/// </summary>
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
using System.Reflection;
using Tizen.Applications;
using Tizen.Applications.CoreBackend;
-using Tizen.NUI.Binding;
using Tizen.NUI.Xaml;
-using System.Collections.Generic;
namespace Tizen.NUI
{
internal const string GlesCSharpBinder = NDalicPINVOKE.Lib;
internal const string VulkanCSharpBinder = "libdali-csharp-binder-vk.so";
}
-
}
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd All Rights Reserved
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd All Rights Reserved
*
* Licensed under the Apache License, Version 2.0 (the License);
* you may not use this file except in compliance with the License.
using System.Collections.Generic;
using System.ComponentModel;
using Tizen.Applications;
-using Tizen.Applications.ComponentBased;
using Tizen.Applications.ComponentBased.Common;
-using Tizen.NUI.BaseComponents;
namespace Tizen.NUI
{
-
/// <summary>
/// The class for supporting multi-components application model.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
public class NUIComponentApplication : CoreApplication
{
- private Dictionary<Type, ComponentStateManger> _componentFactories = new Dictionary<Type, ComponentStateManger>();
+ private Dictionary<Type, ComponentStateManger> componentFactories = new Dictionary<Type, ComponentStateManger>();
/// <summary>
/// Initializes the ComponentApplication class.
RegisterComponent(component.Key, component.Value);
}
}
- (Backend as NUIComponentCoreBackend).ComponentFactories = _componentFactories;
+ (Backend as NUIComponentCoreBackend).ComponentFactories = componentFactories;
}
/// <summary>
[EditorBrowsable(EditorBrowsableState.Never)]
public void RegisterComponent(Type compType, string compId)
{
- if (_componentFactories.ContainsKey(compType))
+ if (componentFactories.ContainsKey(compType))
{
throw new ArgumentException("Already exist type");
}
if (typeof(FrameComponent).IsAssignableFrom(compType))
{
- _componentFactories.Add(compType, new FrameComponentStateManager(compType, compId, null));
+ componentFactories.Add(compType, new FrameComponentStateManager(compType, compId, null));
}
else if (typeof(ServiceComponent).IsAssignableFrom(compType))
{
- _componentFactories.Add(compType, new ServiceComponentStateManager(compType, compId, null));
+ componentFactories.Add(compType, new ServiceComponentStateManager(compType, compId, null));
}
else
{
}
}
-
/// <summary>
/// Runs the application's main loop.
/// </summary>
-using System;
-using System.Collections.Generic;
+/*
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
using System.ComponentModel;
-using System.Text;
using Tizen.Applications;
using Tizen.Applications.ComponentBased.Common;
-using Tizen.NUI;
namespace Tizen.NUI
{
/// <summary>
/// The class for showing UI module
/// </summary>
- /// <since_tizen> 6 </since_tizen>
[EditorBrowsable(EditorBrowsableState.Never)]
public class NUIFrameComponent : FrameComponent
{
/*
- * Copyright(c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*
*/
using System;
-using System.Diagnostics.CodeAnalysis;
using System.ComponentModel;
using System.Runtime.InteropServices;
using Tizen.NUI.Binding;
return temp;
}));
- private DaliEventHandler<object, StartedEventArgs> _scrollableStartedEventHandler;
- private StartedCallbackDelegate _scrollableStartedCallbackDelegate;
- private DaliEventHandler<object, UpdatedEventArgs> _scrollableUpdatedEventHandler;
- private UpdatedCallbackDelegate _scrollableUpdatedCallbackDelegate;
- private DaliEventHandler<object, CompletedEventArgs> _scrollableCompletedEventHandler;
- private CompletedCallbackDelegate _scrollableCompletedCallbackDelegate;
+ private DaliEventHandler<object, StartedEventArgs> scrollableStartedEventHandler;
+ private StartedCallbackDelegate scrollableStartedCallbackDelegate;
+ private DaliEventHandler<object, UpdatedEventArgs> scrollableUpdatedEventHandler;
+ private UpdatedCallbackDelegate scrollableUpdatedCallbackDelegate;
+ private DaliEventHandler<object, CompletedEventArgs> scrollableCompletedEventHandler;
+ private CompletedCallbackDelegate scrollableCompletedCallbackDelegate;
/// <summary>
/// Create an instance of scrollable.
add
{
// Restricted to only one listener
- if (_scrollableStartedEventHandler == null)
+ if (scrollableStartedEventHandler == null)
{
- _scrollableStartedEventHandler += value;
+ scrollableStartedEventHandler += value;
- _scrollableStartedCallbackDelegate = new StartedCallbackDelegate(OnStarted);
- this.ScrollStartedSignal().Connect(_scrollableStartedCallbackDelegate);
+ scrollableStartedCallbackDelegate = new StartedCallbackDelegate(OnStarted);
+ this.ScrollStartedSignal().Connect(scrollableStartedCallbackDelegate);
}
}
remove
{
- if (_scrollableStartedEventHandler != null)
+ if (scrollableStartedEventHandler != null)
{
- this.ScrollStartedSignal().Disconnect(_scrollableStartedCallbackDelegate);
+ this.ScrollStartedSignal().Disconnect(scrollableStartedCallbackDelegate);
}
- _scrollableStartedEventHandler -= value;
+ scrollableStartedEventHandler -= value;
}
}
add
{
// Restricted to only one listener
- if (_scrollableUpdatedEventHandler == null)
+ if (scrollableUpdatedEventHandler == null)
{
- _scrollableUpdatedEventHandler += value;
+ scrollableUpdatedEventHandler += value;
- _scrollableUpdatedCallbackDelegate = new UpdatedCallbackDelegate(OnUpdated);
- this.ScrollUpdatedSignal().Connect(_scrollableUpdatedCallbackDelegate);
+ scrollableUpdatedCallbackDelegate = new UpdatedCallbackDelegate(OnUpdated);
+ this.ScrollUpdatedSignal().Connect(scrollableUpdatedCallbackDelegate);
}
}
remove
{
- if (_scrollableUpdatedEventHandler != null)
+ if (scrollableUpdatedEventHandler != null)
{
- this.ScrollUpdatedSignal().Disconnect(_scrollableUpdatedCallbackDelegate);
+ this.ScrollUpdatedSignal().Disconnect(scrollableUpdatedCallbackDelegate);
}
- _scrollableUpdatedEventHandler -= value;
+ scrollableUpdatedEventHandler -= value;
}
}
add
{
// Restricted to only one listener
- if (_scrollableCompletedEventHandler == null)
+ if (scrollableCompletedEventHandler == null)
{
- _scrollableCompletedEventHandler += value;
+ scrollableCompletedEventHandler += value;
- _scrollableCompletedCallbackDelegate = new CompletedCallbackDelegate(OnCompleted);
- this.ScrollCompletedSignal().Connect(_scrollableCompletedCallbackDelegate);
+ scrollableCompletedCallbackDelegate = new CompletedCallbackDelegate(OnCompleted);
+ this.ScrollCompletedSignal().Connect(scrollableCompletedCallbackDelegate);
}
}
remove
{
- if (_scrollableCompletedEventHandler != null)
+ if (scrollableCompletedEventHandler != null)
{
- this.ScrollCompletedSignal().Disconnect(_scrollableCompletedCallbackDelegate);
+ this.ScrollCompletedSignal().Disconnect(scrollableCompletedCallbackDelegate);
}
- _scrollableCompletedEventHandler -= value;
+ scrollableCompletedEventHandler -= value;
}
}
// Use BaseHandle CPtr as current might have been deleted already in derived classes.
SwigCPtr = GetBaseHandleCPtrHandleRef;
- if (_scrollableCompletedCallbackDelegate != null)
+ if (scrollableCompletedCallbackDelegate != null)
{
- this.ScrollCompletedSignal().Disconnect(_scrollableCompletedCallbackDelegate);
+ this.ScrollCompletedSignal().Disconnect(scrollableCompletedCallbackDelegate);
}
- if (_scrollableUpdatedCallbackDelegate != null)
+ if (scrollableUpdatedCallbackDelegate != null)
{
- this.ScrollUpdatedSignal().Disconnect(_scrollableUpdatedCallbackDelegate);
+ this.ScrollUpdatedSignal().Disconnect(scrollableUpdatedCallbackDelegate);
}
- if (_scrollableStartedCallbackDelegate != null)
+ if (scrollableStartedCallbackDelegate != null)
{
- this.ScrollStartedSignal().Disconnect(_scrollableStartedCallbackDelegate);
+ this.ScrollStartedSignal().Disconnect(scrollableStartedCallbackDelegate);
}
// BaseHandle CPtr is used in Registry and there is danger of deletion if we keep using it here.
private void OnStarted(IntPtr vector2)
{
- StartedEventArgs e = new StartedEventArgs();
-
- // Populate all members of "e" (StartedEventArgs) with real data
- e.Vector2 = Tizen.NUI.Vector2.GetVector2FromPtr(vector2);
-
- if (_scrollableStartedEventHandler != null)
+ if (scrollableStartedEventHandler != null)
{
+ StartedEventArgs e = new StartedEventArgs();
+
+ // Populate all members of "e" (StartedEventArgs) with real data
+ e.Vector2 = Tizen.NUI.Vector2.GetVector2FromPtr(vector2);
//here we send all data to user event handlers
- _scrollableStartedEventHandler(this, e);
+ scrollableStartedEventHandler(this, e);
}
}
private void OnUpdated(IntPtr vector2)
{
- UpdatedEventArgs e = new UpdatedEventArgs();
-
- // Populate all members of "e" (UpdatedEventArgs) with real data
- e.Vector2 = Tizen.NUI.Vector2.GetVector2FromPtr(vector2);
-
- if (_scrollableUpdatedEventHandler != null)
+ if (scrollableUpdatedEventHandler != null)
{
+ UpdatedEventArgs e = new UpdatedEventArgs();
+
+ // Populate all members of "e" (UpdatedEventArgs) with real data
+ e.Vector2 = Tizen.NUI.Vector2.GetVector2FromPtr(vector2);
//here we send all data to user event handlers
- _scrollableUpdatedEventHandler(this, e);
+ scrollableUpdatedEventHandler(this, e);
}
}
private void OnCompleted(IntPtr vector2)
{
- CompletedEventArgs e = new CompletedEventArgs();
-
- // Populate all members of "e" (CompletedEventArgs) with real data
- e.Vector2 = Tizen.NUI.Vector2.GetVector2FromPtr(vector2);
-
- if (_scrollableCompletedEventHandler != null)
+ if (scrollableCompletedEventHandler != null)
{
+ CompletedEventArgs e = new CompletedEventArgs();
+
+ // Populate all members of "e" (CompletedEventArgs) with real data
+ e.Vector2 = Tizen.NUI.Vector2.GetVector2FromPtr(vector2);
//here we send all data to user event handlers
- _scrollableCompletedEventHandler(this, e);
+ scrollableCompletedEventHandler(this, e);
}
}
/// <since_tizen> 3 </since_tizen>
public class StartedEventArgs : EventArgs
{
- private Vector2 _vector2;
+ private Vector2 vector2;
/// <summary>
/// Vector2.
{
get
{
- return _vector2;
+ return vector2;
}
set
{
- _vector2 = value;
+ vector2 = value;
}
}
}
/// <since_tizen> 3 </since_tizen>
public class UpdatedEventArgs : EventArgs
{
- private Vector2 _vector2;
+ private Vector2 vector2;
/// <summary>
/// Vector2.
{
get
{
- return _vector2;
+ return vector2;
}
set
{
- _vector2 = value;
+ vector2 = value;
}
}
}
/// <since_tizen> 3 </since_tizen>
public class CompletedEventArgs : EventArgs
{
- private Vector2 _vector2;
+ private Vector2 vector2;
/// <summary>
/// Vector2.
{
get
{
- return _vector2;
+ return vector2;
}
set
{
- _vector2 = value;
+ vector2 = value;
}
}
}
/*
- * Copyright(c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* limitations under the License.
*
*/
-using System;
using System.ComponentModel;
using Tizen.NUI.Binding;
using System.Collections.Generic;
using System.ComponentModel;
using Tizen.NUI.Binding;
-using Tizen.NUI.Components;
namespace Tizen.NUI.BaseComponents
{
/*
- * Copyright(c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* limitations under the License.
*
*/
-using System;
using System.ComponentModel;
using Tizen.NUI.Binding;
/*
- * Copyright(c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*
*/
using System;
-using System.Collections.Generic;
using System.ComponentModel;
using Tizen.NUI.Binding;
/*
- * Copyright(c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
namespace Tizen.NUI.BaseComponents
{
-
/// <summary>
/// TableView is a layout container for aligning child actors in a grid like layout.<br />
/// TableView constraints the X and the Y position and the width and the height of the child actors.<br />
if (this.HasBody())
{
- if (_textEditorTextChangedCallbackDelegate != null)
+ if (textEditorTextChangedCallbackDelegate != null)
{
- TextChangedSignal().Disconnect(_textEditorTextChangedCallbackDelegate);
+ TextChangedSignal().Disconnect(textEditorTextChangedCallbackDelegate);
}
- if (_textEditorMaxLengthReachedCallbackDelegate != null)
+ if (textEditorMaxLengthReachedCallbackDelegate != null)
{
- this.MaxLengthReachedSignal().Disconnect(_textEditorMaxLengthReachedCallbackDelegate);
+ this.MaxLengthReachedSignal().Disconnect(textEditorMaxLengthReachedCallbackDelegate);
}
}
/*
- * Copyright(c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
/// <since_tizen> 3 </since_tizen>
public partial class TextEditor
{
- private EventHandler<TextChangedEventArgs> _textEditorTextChangedEventHandler;
- private TextChangedCallbackDelegate _textEditorTextChangedCallbackDelegate;
+ private EventHandler<TextChangedEventArgs> textEditorTextChangedEventHandler;
+ private TextChangedCallbackDelegate textEditorTextChangedCallbackDelegate;
- private EventHandler<ScrollStateChangedEventArgs> _textEditorScrollStateChangedEventHandler;
- private ScrollStateChangedCallbackDelegate _textEditorScrollStateChangedCallbackDelegate;
+ private EventHandler<ScrollStateChangedEventArgs> textEditorScrollStateChangedEventHandler;
+ private ScrollStateChangedCallbackDelegate textEditorScrollStateChangedCallbackDelegate;
- private EventHandler<MaxLengthReachedEventArgs> _textEditorMaxLengthReachedEventHandler;
- private MaxLengthReachedCallbackDelegate _textEditorMaxLengthReachedCallbackDelegate;
+ private EventHandler<MaxLengthReachedEventArgs> textEditorMaxLengthReachedEventHandler;
+ private MaxLengthReachedCallbackDelegate textEditorMaxLengthReachedCallbackDelegate;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
private delegate void TextChangedCallbackDelegate(IntPtr textEditor);
{
add
{
- if (_textEditorTextChangedEventHandler == null)
+ if (textEditorTextChangedEventHandler == null)
{
- _textEditorTextChangedCallbackDelegate = (OnTextChanged);
- TextChangedSignal().Connect(_textEditorTextChangedCallbackDelegate);
+ textEditorTextChangedCallbackDelegate = (OnTextChanged);
+ TextChangedSignal().Connect(textEditorTextChangedCallbackDelegate);
}
- _textEditorTextChangedEventHandler += value;
+ textEditorTextChangedEventHandler += value;
}
remove
{
- _textEditorTextChangedEventHandler -= value;
- if (_textEditorTextChangedEventHandler == null && TextChangedSignal().Empty() == false)
+ textEditorTextChangedEventHandler -= value;
+ if (textEditorTextChangedEventHandler == null && TextChangedSignal().Empty() == false)
{
- TextChangedSignal().Disconnect(_textEditorTextChangedCallbackDelegate);
+ TextChangedSignal().Disconnect(textEditorTextChangedCallbackDelegate);
}
}
}
{
add
{
- if (_textEditorScrollStateChangedEventHandler == null)
+ if (textEditorScrollStateChangedEventHandler == null)
{
- _textEditorScrollStateChangedCallbackDelegate = OnScrollStateChanged;
- ScrollStateChangedSignal(this).Connect(_textEditorScrollStateChangedCallbackDelegate);
+ textEditorScrollStateChangedCallbackDelegate = OnScrollStateChanged;
+ ScrollStateChangedSignal(this).Connect(textEditorScrollStateChangedCallbackDelegate);
}
- _textEditorScrollStateChangedEventHandler += value;
+ textEditorScrollStateChangedEventHandler += value;
}
remove
{
- _textEditorScrollStateChangedEventHandler -= value;
- if (_textEditorScrollStateChangedEventHandler == null && ScrollStateChangedSignal(this).Empty() == false)
+ textEditorScrollStateChangedEventHandler -= value;
+ if (textEditorScrollStateChangedEventHandler == null && ScrollStateChangedSignal(this).Empty() == false)
{
- ScrollStateChangedSignal(this).Disconnect(_textEditorScrollStateChangedCallbackDelegate);
+ ScrollStateChangedSignal(this).Disconnect(textEditorScrollStateChangedCallbackDelegate);
}
}
}
{
add
{
- if (_textEditorMaxLengthReachedEventHandler == null)
+ if (textEditorMaxLengthReachedEventHandler == null)
{
- _textEditorMaxLengthReachedCallbackDelegate = (OnMaxLengthReached);
- MaxLengthReachedSignal().Connect(_textEditorMaxLengthReachedCallbackDelegate);
+ textEditorMaxLengthReachedCallbackDelegate = (OnMaxLengthReached);
+ MaxLengthReachedSignal().Connect(textEditorMaxLengthReachedCallbackDelegate);
}
- _textEditorMaxLengthReachedEventHandler += value;
+ textEditorMaxLengthReachedEventHandler += value;
}
remove
{
- if (_textEditorMaxLengthReachedEventHandler == null && MaxLengthReachedSignal().Empty() == false)
+ if (textEditorMaxLengthReachedEventHandler == null && MaxLengthReachedSignal().Empty() == false)
{
- this.MaxLengthReachedSignal().Disconnect(_textEditorMaxLengthReachedCallbackDelegate);
+ this.MaxLengthReachedSignal().Disconnect(textEditorMaxLengthReachedCallbackDelegate);
}
- _textEditorMaxLengthReachedEventHandler -= value;
+ textEditorMaxLengthReachedEventHandler -= value;
}
}
private void OnTextChanged(IntPtr textEditor)
{
- TextChangedEventArgs e = new TextChangedEventArgs();
-
- // Populate all members of "e" (TextChangedEventArgs) with real data
- e.TextEditor = Registry.GetManagedBaseHandleFromNativePtr(textEditor) as TextEditor;
-
- if (_textEditorTextChangedEventHandler != null)
+ if (textEditorTextChangedEventHandler != null)
{
+ TextChangedEventArgs e = new TextChangedEventArgs();
+
+ // Populate all members of "e" (TextChangedEventArgs) with real data
+ e.TextEditor = Registry.GetManagedBaseHandleFromNativePtr(textEditor) as TextEditor;
//here we send all data to user event handlers
- _textEditorTextChangedEventHandler(this, e);
+ textEditorTextChangedEventHandler(this, e);
}
}
private void OnScrollStateChanged(IntPtr textEditor, ScrollState state)
{
- ScrollStateChangedEventArgs e = new ScrollStateChangedEventArgs();
-
- if (textEditor != global::System.IntPtr.Zero)
+ if (textEditorScrollStateChangedEventHandler != null)
{
- // Populate all members of "e" (ScrollStateChangedEventArgs) with real data
- e.TextEditor = Registry.GetManagedBaseHandleFromNativePtr(textEditor) as TextEditor;
- e.ScrollState = state;
- }
+ ScrollStateChangedEventArgs e = new ScrollStateChangedEventArgs();
- if (_textEditorScrollStateChangedEventHandler != null)
- {
+ if (textEditor != global::System.IntPtr.Zero)
+ {
+ // Populate all members of "e" (ScrollStateChangedEventArgs) with real data
+ e.TextEditor = Registry.GetManagedBaseHandleFromNativePtr(textEditor) as TextEditor;
+ e.ScrollState = state;
+ }
//here we send all data to user event handlers
- _textEditorScrollStateChangedEventHandler(this, e);
+ textEditorScrollStateChangedEventHandler(this, e);
}
}
private void OnMaxLengthReached(IntPtr textEditor)
{
- MaxLengthReachedEventArgs e = new MaxLengthReachedEventArgs();
-
- // Populate all members of "e" (MaxLengthReachedEventArgs) with real data
- e.TextEditor = Registry.GetManagedBaseHandleFromNativePtr(textEditor) as TextEditor;
-
- if (_textEditorMaxLengthReachedEventHandler != null)
+ if (textEditorMaxLengthReachedEventHandler != null)
{
+ MaxLengthReachedEventArgs e = new MaxLengthReachedEventArgs();
+
+ // Populate all members of "e" (MaxLengthReachedEventArgs) with real data
+ e.TextEditor = Registry.GetManagedBaseHandleFromNativePtr(textEditor) as TextEditor;
//here we send all data to user event handlers
- _textEditorMaxLengthReachedEventHandler(this, e);
+ textEditorMaxLengthReachedEventHandler(this, e);
}
}
/// <since_tizen> 3 </since_tizen>
public class TextChangedEventArgs : EventArgs
{
- private TextEditor _textEditor;
+ private TextEditor textEditor;
/// <summary>
/// TextEditor - is the texteditor control which has the text contents changed.
{
get
{
- return _textEditor;
+ return textEditor;
}
set
{
- _textEditor = value;
+ textEditor = value;
}
}
}
/// <since_tizen> 3 </since_tizen>
public class ScrollStateChangedEventArgs : EventArgs
{
- private TextEditor _textEditor;
- private ScrollState _scrollState;
+ private TextEditor textEditor;
+ private ScrollState scrollState;
/// <summary>
/// TextEditor - is the texteditor control which has the scroll state changed.
{
get
{
- return _textEditor;
+ return textEditor;
}
set
{
- _textEditor = value;
+ textEditor = value;
}
}
{
get
{
- return _scrollState;
+ return scrollState;
}
set
{
- _scrollState = value;
+ scrollState = value;
}
}
}
[EditorBrowsable(EditorBrowsableState.Never)]
public class MaxLengthReachedEventArgs : EventArgs
{
- private TextEditor _textEditor;
+ private TextEditor textEditor;
/// <summary>
/// TextEditor.
{
get
{
- return _textEditor;
+ return textEditor;
}
set
{
- _textEditor = value;
+ textEditor = value;
}
}
}
//because the execution order of Finalizes is non-deterministic.
if (this.HasBody())
{
- if (_textFieldMaxLengthReachedCallbackDelegate != null)
+ if (textFieldMaxLengthReachedCallbackDelegate != null)
{
- this.MaxLengthReachedSignal().Disconnect(_textFieldMaxLengthReachedCallbackDelegate);
+ this.MaxLengthReachedSignal().Disconnect(textFieldMaxLengthReachedCallbackDelegate);
}
- if (_textFieldTextChangedCallbackDelegate != null)
+ if (textFieldTextChangedCallbackDelegate != null)
{
- TextChangedSignal().Disconnect(_textFieldTextChangedCallbackDelegate);
+ TextChangedSignal().Disconnect(textFieldTextChangedCallbackDelegate);
}
}
/*
- * Copyright(c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
/// <since_tizen> 3 </since_tizen>
public partial class TextField
{
- private EventHandler<TextChangedEventArgs> _textFieldTextChangedEventHandler;
- private TextChangedCallbackDelegate _textFieldTextChangedCallbackDelegate;
- private EventHandler<MaxLengthReachedEventArgs> _textFieldMaxLengthReachedEventHandler;
- private MaxLengthReachedCallbackDelegate _textFieldMaxLengthReachedCallbackDelegate;
+ private EventHandler<TextChangedEventArgs> textFieldTextChangedEventHandler;
+ private TextChangedCallbackDelegate textFieldTextChangedCallbackDelegate;
+ private EventHandler<MaxLengthReachedEventArgs> textFieldMaxLengthReachedEventHandler;
+ private MaxLengthReachedCallbackDelegate textFieldMaxLengthReachedCallbackDelegate;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
private delegate void TextChangedCallbackDelegate(IntPtr textField);
{
add
{
- if (_textFieldTextChangedEventHandler == null)
+ if (textFieldTextChangedEventHandler == null)
{
- _textFieldTextChangedCallbackDelegate = (OnTextChanged);
- TextChangedSignal().Connect(_textFieldTextChangedCallbackDelegate);
+ textFieldTextChangedCallbackDelegate = (OnTextChanged);
+ TextChangedSignal().Connect(textFieldTextChangedCallbackDelegate);
}
- _textFieldTextChangedEventHandler += value;
+ textFieldTextChangedEventHandler += value;
}
remove
{
- _textFieldTextChangedEventHandler -= value;
- if (_textFieldTextChangedEventHandler == null && TextChangedSignal().Empty() == false)
+ textFieldTextChangedEventHandler -= value;
+ if (textFieldTextChangedEventHandler == null && TextChangedSignal().Empty() == false)
{
- TextChangedSignal().Disconnect(_textFieldTextChangedCallbackDelegate);
+ TextChangedSignal().Disconnect(textFieldTextChangedCallbackDelegate);
}
}
}
{
add
{
- if (_textFieldMaxLengthReachedEventHandler == null)
+ if (textFieldMaxLengthReachedEventHandler == null)
{
- _textFieldMaxLengthReachedCallbackDelegate = (OnMaxLengthReached);
- MaxLengthReachedSignal().Connect(_textFieldMaxLengthReachedCallbackDelegate);
+ textFieldMaxLengthReachedCallbackDelegate = (OnMaxLengthReached);
+ MaxLengthReachedSignal().Connect(textFieldMaxLengthReachedCallbackDelegate);
}
- _textFieldMaxLengthReachedEventHandler += value;
+ textFieldMaxLengthReachedEventHandler += value;
}
remove
{
- if (_textFieldMaxLengthReachedEventHandler == null && MaxLengthReachedSignal().Empty() == false)
+ if (textFieldMaxLengthReachedEventHandler == null && MaxLengthReachedSignal().Empty() == false)
{
- this.MaxLengthReachedSignal().Disconnect(_textFieldMaxLengthReachedCallbackDelegate);
+ this.MaxLengthReachedSignal().Disconnect(textFieldMaxLengthReachedCallbackDelegate);
}
- _textFieldMaxLengthReachedEventHandler -= value;
+ textFieldMaxLengthReachedEventHandler -= value;
}
}
private void OnTextChanged(IntPtr textField)
{
- TextChangedEventArgs e = new TextChangedEventArgs();
-
- // Populate all members of "e" (TextChangedEventArgs) with real data
- e.TextField = Registry.GetManagedBaseHandleFromNativePtr(textField) as TextField;
-
- if (_textFieldTextChangedEventHandler != null)
+ if (textFieldTextChangedEventHandler != null)
{
+ TextChangedEventArgs e = new TextChangedEventArgs();
+
+ // Populate all members of "e" (TextChangedEventArgs) with real data
+ e.TextField = Registry.GetManagedBaseHandleFromNativePtr(textField) as TextField;
//here we send all data to user event handlers
- _textFieldTextChangedEventHandler(this, e);
+ textFieldTextChangedEventHandler(this, e);
}
}
private void OnMaxLengthReached(IntPtr textField)
{
- MaxLengthReachedEventArgs e = new MaxLengthReachedEventArgs();
-
- // Populate all members of "e" (MaxLengthReachedEventArgs) with real data
- e.TextField = Registry.GetManagedBaseHandleFromNativePtr(textField) as TextField;
-
- if (_textFieldMaxLengthReachedEventHandler != null)
+ if (textFieldMaxLengthReachedEventHandler != null)
{
+ MaxLengthReachedEventArgs e = new MaxLengthReachedEventArgs();
+
+ // Populate all members of "e" (MaxLengthReachedEventArgs) with real data
+ e.TextField = Registry.GetManagedBaseHandleFromNativePtr(textField) as TextField;
//here we send all data to user event handlers
- _textFieldMaxLengthReachedEventHandler(this, e);
+ textFieldMaxLengthReachedEventHandler(this, e);
}
}
/// <since_tizen> 3 </since_tizen>
public class TextChangedEventArgs : EventArgs
{
- private TextField _textField;
+ private TextField textField;
/// <summary>
/// TextField.
{
get
{
- return _textField;
+ return textField;
}
set
{
- _textField = value;
+ textField = value;
}
}
}
/// <since_tizen> 3 </since_tizen>
public class MaxLengthReachedEventArgs : EventArgs
{
- private TextField _textField;
+ private TextField textField;
/// <summary>
/// TextField.
{
get
{
- return _textField;
+ return textField;
}
set
{
- _textField = value;
+ textField = value;
}
}
}
/*
- * Copyright(c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
extern alias TizenSystemSettings;
using TizenSystemSettings.Tizen.System;
+
using System;
using System.Globalization;
using System.ComponentModel;
-using Tizen.NUI.Binding;
namespace Tizen.NUI.BaseComponents
{
*/
extern alias TizenSystemSettings;
-using TizenSystemSettings.Tizen.System;
using System.ComponentModel;
using Tizen.NUI.Binding;
using TizenSystemSettings.Tizen.System;
using System;
using System.ComponentModel;
-using System.Collections.Generic;
-using Tizen.NUI.Binding;
namespace Tizen.NUI.BaseComponents
{
return temp;
}));
- private FinishedCallbackDelegate _videoViewFinishedCallbackDelegate;
- private EventHandler<FinishedEventArgs> _videoViewFinishedEventHandler;
+ private FinishedCallbackDelegate videoViewFinishedCallbackDelegate;
+ private EventHandler<FinishedEventArgs> videoViewFinishedEventHandler;
/// <summary>
/// Creates an initialized VideoView.
{
add
{
- if (_videoViewFinishedEventHandler == null)
+ if (videoViewFinishedEventHandler == null)
{
- _videoViewFinishedCallbackDelegate = (OnFinished);
- FinishedSignal().Connect(_videoViewFinishedCallbackDelegate);
+ videoViewFinishedCallbackDelegate = (OnFinished);
+ FinishedSignal().Connect(videoViewFinishedCallbackDelegate);
}
- _videoViewFinishedEventHandler += value;
+ videoViewFinishedEventHandler += value;
}
remove
{
- _videoViewFinishedEventHandler -= value;
- if (_videoViewFinishedEventHandler == null && FinishedSignal().Empty() == false)
+ videoViewFinishedEventHandler -= value;
+ if (videoViewFinishedEventHandler == null && FinishedSignal().Empty() == false)
{
- FinishedSignal().Disconnect(_videoViewFinishedCallbackDelegate);
+ FinishedSignal().Disconnect(videoViewFinishedCallbackDelegate);
}
}
}
//You should not access any managed member here except static instance.
//because the execution order of Finalizes is non-deterministic.
- if (this != null && _videoViewFinishedCallbackDelegate != null)
+ if (this != null && videoViewFinishedCallbackDelegate != null)
{
- FinishedSignal().Disconnect(_videoViewFinishedCallbackDelegate);
+ FinishedSignal().Disconnect(videoViewFinishedCallbackDelegate);
}
base.Dispose(type);
// Callback for VideoView Finished signal
private void OnFinished(IntPtr data)
{
- FinishedEventArgs e = new FinishedEventArgs();
-
- // Populate all members of "e" (FinishedEventArgs) with real data
- e.VideoView = Registry.GetManagedBaseHandleFromNativePtr(data) as VideoView;
-
- if (_videoViewFinishedEventHandler != null)
+ if (videoViewFinishedEventHandler != null)
{
+ FinishedEventArgs e = new FinishedEventArgs();
+
+ // Populate all members of "e" (FinishedEventArgs) with real data
+ e.VideoView = Registry.GetManagedBaseHandleFromNativePtr(data) as VideoView;
//here we send all data to user event handlers
- _videoViewFinishedEventHandler(this, e);
+ videoViewFinishedEventHandler(this, e);
}
}
/// <since_tizen> 3 </since_tizen>
public class FinishedEventArgs : EventArgs
{
- private VideoView _videoView;
+ private VideoView videoView;
/// <summary>
/// The view for video playback and display.
{
get
{
- return _videoView;
+ return videoView;
}
set
{
- _videoView = value;
+ videoView = value;
}
}
}
/*
- * Copyright(c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
using System;
using System.ComponentModel;
using System.Runtime.InteropServices;
-using Tizen.NUI.Components;
namespace Tizen.NUI.BaseComponents
{
/// <since_tizen> 3 </since_tizen>
public partial class View
{
- private EventHandler _offWindowEventHandler;
- private OffWindowEventCallbackType _offWindowEventCallback;
- private EventHandlerWithReturnType<object, WheelEventArgs, bool> _wheelEventHandler;
- private WheelEventCallbackType _wheelEventCallback;
- private EventHandlerWithReturnType<object, KeyEventArgs, bool> _keyEventHandler;
- private KeyCallbackType _keyCallback;
- private EventHandlerWithReturnType<object, TouchEventArgs, bool> _interceptTouchDataEventHandler;
- private TouchDataCallbackType _interceptTouchDataCallback;
- private EventHandlerWithReturnType<object, TouchEventArgs, bool> _touchDataEventHandler;
- private TouchDataCallbackType _touchDataCallback;
- private EventHandlerWithReturnType<object, HoverEventArgs, bool> _hoverEventHandler;
- private HoverEventCallbackType _hoverEventCallback;
- private EventHandler<VisibilityChangedEventArgs> _visibilityChangedEventHandler;
- private VisibilityChangedEventCallbackType _visibilityChangedEventCallback;
- private EventHandler _keyInputFocusGainedEventHandler;
- private KeyInputFocusGainedCallbackType _keyInputFocusGainedCallback;
- private EventHandler _keyInputFocusLostEventHandler;
- private KeyInputFocusLostCallbackType _keyInputFocusLostCallback;
- private EventHandler _onRelayoutEventHandler;
- private OnRelayoutEventCallbackType _onRelayoutEventCallback;
- private EventHandler _onWindowEventHandler;
- private OnWindowEventCallbackType _onWindowEventCallback;
- private EventHandler<LayoutDirectionChangedEventArgs> _layoutDirectionChangedEventHandler;
- private LayoutDirectionChangedEventCallbackType _layoutDirectionChangedEventCallback;
+ private EventHandler offWindowEventHandler;
+ private OffWindowEventCallbackType offWindowEventCallback;
+ private EventHandlerWithReturnType<object, WheelEventArgs, bool> wheelEventHandler;
+ private WheelEventCallbackType wheelEventCallback;
+ private EventHandlerWithReturnType<object, KeyEventArgs, bool> keyEventHandler;
+ private KeyCallbackType keyCallback;
+ private EventHandlerWithReturnType<object, TouchEventArgs, bool> interceptTouchDataEventHandler;
+ private TouchDataCallbackType interceptTouchDataCallback;
+ private EventHandlerWithReturnType<object, TouchEventArgs, bool> touchDataEventHandler;
+ private TouchDataCallbackType touchDataCallback;
+ private EventHandlerWithReturnType<object, HoverEventArgs, bool> hoverEventHandler;
+ private HoverEventCallbackType hoverEventCallback;
+ private EventHandler<VisibilityChangedEventArgs> visibilityChangedEventHandler;
+ private VisibilityChangedEventCallbackType visibilityChangedEventCallback;
+ private EventHandler keyInputFocusGainedEventHandler;
+ private KeyInputFocusGainedCallbackType keyInputFocusGainedCallback;
+ private EventHandler keyInputFocusLostEventHandler;
+ private KeyInputFocusLostCallbackType keyInputFocusLostCallback;
+ private EventHandler onRelayoutEventHandler;
+ private OnRelayoutEventCallbackType onRelayoutEventCallback;
+ private EventHandler onWindowEventHandler;
+ private OnWindowEventCallbackType onWindowEventCallback;
+ private EventHandler<LayoutDirectionChangedEventArgs> layoutDirectionChangedEventHandler;
+ private LayoutDirectionChangedEventCallbackType layoutDirectionChangedEventCallback;
// Resource Ready Signal
- private EventHandler _resourcesLoadedEventHandler;
- private ResourcesLoadedCallbackType _ResourcesLoadedCallback;
- private EventHandler<BackgroundResourceLoadedEventArgs> _backgroundResourceLoadedEventHandler;
- private _backgroundResourceLoadedCallbackType _backgroundResourceLoadedCallback;
+ private EventHandler resourcesLoadedEventHandler;
+ private ResourcesLoadedCallbackType ResourcesLoadedCallback;
+ private EventHandler<BackgroundResourceLoadedEventArgs> backgroundResourceLoadedEventHandler;
+ private _backgroundResourceLoadedCallbackType backgroundResourceLoadedCallback;
private void SendViewAddedEventToWindow(IntPtr data)
{
// Unused parameter
_ = data;
-
NUIApplication.GetDefaultWindow()?.SendViewAdded(this);
}
{
add
{
- if (_keyInputFocusGainedEventHandler == null)
+ if (keyInputFocusGainedEventHandler == null)
{
- _keyInputFocusGainedCallback = OnKeyInputFocusGained;
- this.KeyInputFocusGainedSignal().Connect(_keyInputFocusGainedCallback);
+ keyInputFocusGainedCallback = OnKeyInputFocusGained;
+ this.KeyInputFocusGainedSignal().Connect(keyInputFocusGainedCallback);
}
- _keyInputFocusGainedEventHandler += value;
+ keyInputFocusGainedEventHandler += value;
}
remove
{
- _keyInputFocusGainedEventHandler -= value;
+ keyInputFocusGainedEventHandler -= value;
- if (_keyInputFocusGainedEventHandler == null && KeyInputFocusGainedSignal().Empty() == false)
+ if (keyInputFocusGainedEventHandler == null && KeyInputFocusGainedSignal().Empty() == false)
{
- this.KeyInputFocusGainedSignal().Disconnect(_keyInputFocusGainedCallback);
+ this.KeyInputFocusGainedSignal().Disconnect(keyInputFocusGainedCallback);
}
}
}
{
add
{
- if (_keyInputFocusLostEventHandler == null)
+ if (keyInputFocusLostEventHandler == null)
{
- _keyInputFocusLostCallback = OnKeyInputFocusLost;
- this.KeyInputFocusLostSignal().Connect(_keyInputFocusLostCallback);
+ keyInputFocusLostCallback = OnKeyInputFocusLost;
+ this.KeyInputFocusLostSignal().Connect(keyInputFocusLostCallback);
}
- _keyInputFocusLostEventHandler += value;
+ keyInputFocusLostEventHandler += value;
}
remove
{
- _keyInputFocusLostEventHandler -= value;
+ keyInputFocusLostEventHandler -= value;
- if (_keyInputFocusLostEventHandler == null && KeyInputFocusLostSignal().Empty() == false)
+ if (keyInputFocusLostEventHandler == null && KeyInputFocusLostSignal().Empty() == false)
{
- this.KeyInputFocusLostSignal().Disconnect(_keyInputFocusLostCallback);
+ this.KeyInputFocusLostSignal().Disconnect(keyInputFocusLostCallback);
}
}
}
{
add
{
- if (_keyEventHandler == null)
+ if (keyEventHandler == null)
{
- _keyCallback = OnKeyEvent;
- this.KeyEventSignal().Connect(_keyCallback);
+ keyCallback = OnKeyEvent;
+ this.KeyEventSignal().Connect(keyCallback);
}
- _keyEventHandler += value;
+ keyEventHandler += value;
}
remove
{
- _keyEventHandler -= value;
+ keyEventHandler -= value;
- if (_keyEventHandler == null && KeyEventSignal().Empty() == false)
+ if (keyEventHandler == null && KeyEventSignal().Empty() == false)
{
- this.KeyEventSignal().Disconnect(_keyCallback);
+ this.KeyEventSignal().Disconnect(keyCallback);
}
}
}
{
add
{
- if (_onRelayoutEventHandler == null)
+ if (onRelayoutEventHandler == null)
{
- _onRelayoutEventCallback = OnRelayout;
- this.OnRelayoutSignal().Connect(_onRelayoutEventCallback);
+ onRelayoutEventCallback = OnRelayout;
+ this.OnRelayoutSignal().Connect(onRelayoutEventCallback);
}
- _onRelayoutEventHandler += value;
+ onRelayoutEventHandler += value;
}
remove
{
- _onRelayoutEventHandler -= value;
+ onRelayoutEventHandler -= value;
- if (_onRelayoutEventHandler == null && OnRelayoutSignal().Empty() == false)
+ if (onRelayoutEventHandler == null && OnRelayoutSignal().Empty() == false)
{
- this.OnRelayoutSignal().Disconnect(_onRelayoutEventCallback);
- _onRelayoutEventCallback = null;
+ this.OnRelayoutSignal().Disconnect(onRelayoutEventCallback);
+ onRelayoutEventCallback = null;
}
}
{
add
{
- if (_interceptTouchDataEventHandler == null)
+ if (interceptTouchDataEventHandler == null)
{
- _interceptTouchDataCallback = OnInterceptTouch;
- this.InterceptTouchSignal().Connect(_interceptTouchDataCallback);
+ interceptTouchDataCallback = OnInterceptTouch;
+ this.InterceptTouchSignal().Connect(interceptTouchDataCallback);
}
- _interceptTouchDataEventHandler += value;
+ interceptTouchDataEventHandler += value;
}
remove
{
- _interceptTouchDataEventHandler -= value;
+ interceptTouchDataEventHandler -= value;
- if (_interceptTouchDataEventHandler == null && InterceptTouchSignal().Empty() == false)
+ if (interceptTouchDataEventHandler == null && InterceptTouchSignal().Empty() == false)
{
- this.InterceptTouchSignal().Disconnect(_interceptTouchDataCallback);
+ this.InterceptTouchSignal().Disconnect(interceptTouchDataCallback);
}
}
}
{
add
{
- if (_touchDataEventHandler == null)
+ if (touchDataEventHandler == null)
{
- _touchDataCallback = OnTouch;
- this.TouchSignal().Connect(_touchDataCallback);
+ touchDataCallback = OnTouch;
+ this.TouchSignal().Connect(touchDataCallback);
}
- _touchDataEventHandler += value;
+ touchDataEventHandler += value;
}
remove
{
- _touchDataEventHandler -= value;
+ touchDataEventHandler -= value;
- if (_touchDataEventHandler == null && TouchSignal().Empty() == false)
+ if (touchDataEventHandler == null && TouchSignal().Empty() == false)
{
- this.TouchSignal().Disconnect(_touchDataCallback);
+ this.TouchSignal().Disconnect(touchDataCallback);
}
}
}
{
add
{
- if (_hoverEventHandler == null)
+ if (hoverEventHandler == null)
{
- _hoverEventCallback = OnHoverEvent;
- this.HoveredSignal().Connect(_hoverEventCallback);
+ hoverEventCallback = OnHoverEvent;
+ this.HoveredSignal().Connect(hoverEventCallback);
}
- _hoverEventHandler += value;
+ hoverEventHandler += value;
}
remove
{
- _hoverEventHandler -= value;
+ hoverEventHandler -= value;
- if (_hoverEventHandler == null && HoveredSignal().Empty() == false)
+ if (hoverEventHandler == null && HoveredSignal().Empty() == false)
{
- this.HoveredSignal().Disconnect(_hoverEventCallback);
+ this.HoveredSignal().Disconnect(hoverEventCallback);
}
}
{
add
{
- if (_wheelEventHandler == null)
+ if (wheelEventHandler == null)
{
- _wheelEventCallback = OnWheelEvent;
- this.WheelEventSignal().Connect(_wheelEventCallback);
+ wheelEventCallback = OnWheelEvent;
+ this.WheelEventSignal().Connect(wheelEventCallback);
}
- _wheelEventHandler += value;
+ wheelEventHandler += value;
if (WindowWheelEventHandler == null)
{
remove
{
- _wheelEventHandler -= value;
- if (_wheelEventHandler == null && WheelEventSignal().Empty() == false)
+ wheelEventHandler -= value;
+ if (wheelEventHandler == null && WheelEventSignal().Empty() == false)
{
- this.WheelEventSignal().Disconnect(_wheelEventCallback);
+ this.WheelEventSignal().Disconnect(wheelEventCallback);
}
WindowWheelEventHandler -= value;
{
add
{
- if (_onWindowEventHandler == null)
+ if (onWindowEventHandler == null)
{
- _onWindowEventCallback = OnWindow;
- this.OnWindowSignal().Connect(_onWindowEventCallback);
+ onWindowEventCallback = OnWindow;
+ this.OnWindowSignal().Connect(onWindowEventCallback);
}
- _onWindowEventHandler += value;
+ onWindowEventHandler += value;
}
remove
{
- _onWindowEventHandler -= value;
+ onWindowEventHandler -= value;
- if (_onWindowEventHandler == null && OnWindowSignal().Empty() == false)
+ if (onWindowEventHandler == null && OnWindowSignal().Empty() == false)
{
- this.OnWindowSignal().Disconnect(_onWindowEventCallback);
- _onWindowEventCallback = null;
+ this.OnWindowSignal().Disconnect(onWindowEventCallback);
+ onWindowEventCallback = null;
}
}
}
{
add
{
- if (_offWindowEventHandler == null)
+ if (offWindowEventHandler == null)
{
- _offWindowEventCallback = OffWindow;
- this.OffWindowSignal().Connect(_offWindowEventCallback);
+ offWindowEventCallback = OffWindow;
+ this.OffWindowSignal().Connect(offWindowEventCallback);
}
- _offWindowEventHandler += value;
+ offWindowEventHandler += value;
}
remove
{
- _offWindowEventHandler -= value;
+ offWindowEventHandler -= value;
- if (_offWindowEventHandler == null && OffWindowSignal().Empty() == false)
+ if (offWindowEventHandler == null && OffWindowSignal().Empty() == false)
{
- this.OffWindowSignal().Disconnect(_offWindowEventCallback);
- _offWindowEventCallback = null;
+ this.OffWindowSignal().Disconnect(offWindowEventCallback);
+ offWindowEventCallback = null;
}
}
}
{
add
{
- if (_visibilityChangedEventHandler == null)
+ if (visibilityChangedEventHandler == null)
{
- _visibilityChangedEventCallback = OnVisibilityChanged;
- VisibilityChangedSignal(this).Connect(_visibilityChangedEventCallback);
+ visibilityChangedEventCallback = OnVisibilityChanged;
+ VisibilityChangedSignal(this).Connect(visibilityChangedEventCallback);
}
- _visibilityChangedEventHandler += value;
+ visibilityChangedEventHandler += value;
}
remove
{
- _visibilityChangedEventHandler -= value;
+ visibilityChangedEventHandler -= value;
- if (_visibilityChangedEventHandler == null && VisibilityChangedSignal(this).Empty() == false)
+ if (visibilityChangedEventHandler == null && VisibilityChangedSignal(this).Empty() == false)
{
- VisibilityChangedSignal(this).Disconnect(_visibilityChangedEventCallback);
+ VisibilityChangedSignal(this).Disconnect(visibilityChangedEventCallback);
}
}
}
{
add
{
- if (_layoutDirectionChangedEventHandler == null)
+ if (layoutDirectionChangedEventHandler == null)
{
- _layoutDirectionChangedEventCallback = OnLayoutDirectionChanged;
- LayoutDirectionChangedSignal(this).Connect(_layoutDirectionChangedEventCallback);
+ layoutDirectionChangedEventCallback = OnLayoutDirectionChanged;
+ LayoutDirectionChangedSignal(this).Connect(layoutDirectionChangedEventCallback);
}
- _layoutDirectionChangedEventHandler += value;
+ layoutDirectionChangedEventHandler += value;
}
remove
{
- _layoutDirectionChangedEventHandler -= value;
+ layoutDirectionChangedEventHandler -= value;
- if (_layoutDirectionChangedEventHandler == null && LayoutDirectionChangedSignal(this).Empty() == false)
+ if (layoutDirectionChangedEventHandler == null && LayoutDirectionChangedSignal(this).Empty() == false)
{
- LayoutDirectionChangedSignal(this).Disconnect(_layoutDirectionChangedEventCallback);
+ LayoutDirectionChangedSignal(this).Disconnect(layoutDirectionChangedEventCallback);
}
}
}
{
add
{
- if (_resourcesLoadedEventHandler == null)
+ if (resourcesLoadedEventHandler == null)
{
- _ResourcesLoadedCallback = OnResourcesLoaded;
- this.ResourcesLoadedSignal().Connect(_ResourcesLoadedCallback);
+ ResourcesLoadedCallback = OnResourcesLoaded;
+ this.ResourcesLoadedSignal().Connect(ResourcesLoadedCallback);
}
- _resourcesLoadedEventHandler += value;
+ resourcesLoadedEventHandler += value;
}
remove
{
- _resourcesLoadedEventHandler -= value;
+ resourcesLoadedEventHandler -= value;
- if (_resourcesLoadedEventHandler == null && ResourcesLoadedSignal().Empty() == false)
+ if (resourcesLoadedEventHandler == null && ResourcesLoadedSignal().Empty() == false)
{
- this.ResourcesLoadedSignal().Disconnect(_ResourcesLoadedCallback);
- _ResourcesLoadedCallback = null;
+ this.ResourcesLoadedSignal().Disconnect(ResourcesLoadedCallback);
+ ResourcesLoadedCallback = null;
}
}
}
{
add
{
- if (_backgroundResourceLoadedEventHandler == null)
+ if (backgroundResourceLoadedEventHandler == null)
{
- _backgroundResourceLoadedCallback = OnBackgroundResourceLoaded;
- this.ResourcesLoadedSignal().Connect(_backgroundResourceLoadedCallback);
+ backgroundResourceLoadedCallback = OnBackgroundResourceLoaded;
+ this.ResourcesLoadedSignal().Connect(backgroundResourceLoadedCallback);
}
- _backgroundResourceLoadedEventHandler += value;
+ backgroundResourceLoadedEventHandler += value;
}
remove
{
- _backgroundResourceLoadedEventHandler -= value;
+ backgroundResourceLoadedEventHandler -= value;
- if (_backgroundResourceLoadedEventHandler == null && ResourcesLoadedSignal().Empty() == false)
+ if (backgroundResourceLoadedEventHandler == null && ResourcesLoadedSignal().Empty() == false)
{
- this.ResourcesLoadedSignal().Disconnect(_backgroundResourceLoadedCallback);
- _backgroundResourceLoadedCallback = null;
+ this.ResourcesLoadedSignal().Disconnect(backgroundResourceLoadedCallback);
+ backgroundResourceLoadedCallback = null;
}
}
}
private void OnKeyInputFocusGained(IntPtr view)
{
- if (_keyInputFocusGainedEventHandler != null)
+ if (keyInputFocusGainedEventHandler != null)
{
- _keyInputFocusGainedEventHandler(this, null);
+ keyInputFocusGainedEventHandler(this, null);
}
}
private void OnKeyInputFocusLost(IntPtr view)
{
- if (_keyInputFocusLostEventHandler != null)
+ if (keyInputFocusLostEventHandler != null)
{
- _keyInputFocusLostEventHandler(this, null);
+ keyInputFocusLostEventHandler(this, null);
}
}
e.Key = Tizen.NUI.Key.GetKeyFromPtr(keyEvent);
- if (_keyEventHandler != null)
+ if (keyEventHandler != null)
{
- Delegate[] delegateList = _keyEventHandler.GetInvocationList();
+ Delegate[] delegateList = keyEventHandler.GetInvocationList();
// Oring the result of each callback.
foreach (EventHandlerWithReturnType<object, KeyEventArgs, bool> del in delegateList)
// Callback for View OnRelayout signal
private void OnRelayout(IntPtr data)
{
- if (_onRelayoutEventHandler != null)
+ if (onRelayoutEventHandler != null)
{
- _onRelayoutEventHandler(this, null);
+ onRelayoutEventHandler(this, null);
}
}
bool consumed = false;
- if (_interceptTouchDataEventHandler != null)
+ if (interceptTouchDataEventHandler != null)
{
- consumed = _interceptTouchDataEventHandler(this, e);
+ consumed = interceptTouchDataEventHandler(this, e);
}
return consumed;
bool consumed = false;
- if (_touchDataEventHandler != null)
+ if (touchDataEventHandler != null)
{
- consumed = _touchDataEventHandler(this, e);
+ consumed = touchDataEventHandler(this, e);
}
if (enableControlState && !consumed)
e.Hover = Tizen.NUI.Hover.GetHoverFromPtr(hoverEvent);
- if (_hoverEventHandler != null)
+ if (hoverEventHandler != null)
{
- return _hoverEventHandler(this, e);
+ return hoverEventHandler(this, e);
}
return false;
}
e.Wheel = Tizen.NUI.Wheel.GetWheelFromPtr(wheelEvent);
- if (_wheelEventHandler != null)
+ if (wheelEventHandler != null)
{
- return _wheelEventHandler(this, e);
+ return wheelEventHandler(this, e);
}
return false;
}
// Callback for View OnWindow signal
private void OnWindow(IntPtr data)
{
- if (_onWindowEventHandler != null)
+ if (onWindowEventHandler != null)
{
- _onWindowEventHandler(this, null);
+ onWindowEventHandler(this, null);
}
}
// Callback for View OffWindow signal
private void OffWindow(IntPtr data)
{
- if (_offWindowEventHandler != null)
+ if (offWindowEventHandler != null)
{
- _offWindowEventHandler(this, null);
+ offWindowEventHandler(this, null);
}
}
e.Visibility = visibility;
e.Type = type;
- if (_visibilityChangedEventHandler != null)
+ if (visibilityChangedEventHandler != null)
{
- _visibilityChangedEventHandler(this, e);
+ visibilityChangedEventHandler(this, e);
}
}
}
e.Type = type;
- if (_layoutDirectionChangedEventHandler != null)
+ if (layoutDirectionChangedEventHandler != null)
{
- _layoutDirectionChangedEventHandler(this, e);
+ layoutDirectionChangedEventHandler(this, e);
}
}
private void OnResourcesLoaded(IntPtr view)
{
- if (_resourcesLoadedEventHandler != null)
+ if (resourcesLoadedEventHandler != null)
{
- _resourcesLoadedEventHandler(this, null);
+ resourcesLoadedEventHandler(this, null);
}
}
BackgroundResourceLoadedEventArgs e = new BackgroundResourceLoadedEventArgs();
e.Status = (ResourceLoadingStatusType)Interop.View.GetVisualResourceStatus(this.SwigCPtr, Property.BACKGROUND);
- if (_backgroundResourceLoadedEventHandler != null)
+ if (backgroundResourceLoadedEventHandler != null)
{
- _backgroundResourceLoadedEventHandler(this, e);
+ backgroundResourceLoadedEventHandler(this, e);
}
}
/*
- * Copyright(c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
using System;
using System.ComponentModel;
-using System.Collections.Generic;
-using System.IO;
-using System.Runtime.InteropServices;
-using Tizen.NUI.Binding;
-using Tizen.NUI.Xaml;
namespace Tizen.NUI.BaseComponents
{
// Use BaseHandle CPtr as current might have been deleted already in derived classes.
SwigCPtr = GetBaseHandleCPtrHandleRef;
- if (_onRelayoutEventCallback != null)
+ if (onRelayoutEventCallback != null)
{
ViewSignal signal = this.OnRelayoutSignal();
- signal?.Disconnect(_onRelayoutEventCallback);
+ signal?.Disconnect(onRelayoutEventCallback);
signal?.Dispose();
- _onRelayoutEventCallback = null;
+ onRelayoutEventCallback = null;
}
- if (_offWindowEventCallback != null)
+ if (offWindowEventCallback != null)
{
ViewSignal signal = this.OffWindowSignal();
- signal?.Disconnect(_offWindowEventCallback);
+ signal?.Disconnect(offWindowEventCallback);
signal?.Dispose();
- _offWindowEventCallback = null;
+ offWindowEventCallback = null;
}
- if (_onWindowEventCallback != null)
+ if (onWindowEventCallback != null)
{
ViewSignal signal = this.OnWindowSignal();
- signal?.Disconnect(_onWindowEventCallback);
+ signal?.Disconnect(onWindowEventCallback);
signal?.Dispose();
- _onWindowEventCallback = null;
+ onWindowEventCallback = null;
}
- if (_wheelEventCallback != null)
+ if (wheelEventCallback != null)
{
WheelSignal signal = this.WheelEventSignal();
- signal?.Disconnect(_wheelEventCallback);
+ signal?.Disconnect(wheelEventCallback);
signal?.Dispose();
}
NUIApplication.GetDefaultWindow().WheelEvent -= OnWindowWheelEvent;
}
- if (_hoverEventCallback != null)
+ if (hoverEventCallback != null)
{
HoverSignal signal = this.HoveredSignal();
- signal?.Disconnect(_hoverEventCallback);
+ signal?.Disconnect(hoverEventCallback);
signal?.Dispose();
}
- if (_interceptTouchDataCallback != null)
+ if (interceptTouchDataCallback != null)
{
TouchDataSignal signal = this.InterceptTouchSignal();
- signal?.Disconnect(_interceptTouchDataCallback);
+ signal?.Disconnect(interceptTouchDataCallback);
signal?.Dispose();
}
- if (_touchDataCallback != null)
+ if (touchDataCallback != null)
{
TouchDataSignal signal = this.TouchSignal();
- signal?.Disconnect(_touchDataCallback);
+ signal?.Disconnect(touchDataCallback);
signal?.Dispose();
}
- if (_ResourcesLoadedCallback != null)
+ if (ResourcesLoadedCallback != null)
{
ViewSignal signal = this.ResourcesLoadedSignal();
- signal?.Disconnect(_ResourcesLoadedCallback);
+ signal?.Disconnect(ResourcesLoadedCallback);
signal?.Dispose();
- _ResourcesLoadedCallback = null;
+ ResourcesLoadedCallback = null;
}
- if (_keyCallback != null)
+ if (keyCallback != null)
{
ControlKeySignal signal = this.KeyEventSignal();
- signal?.Disconnect(_keyCallback);
+ signal?.Disconnect(keyCallback);
signal?.Dispose();
}
- if (_keyInputFocusLostCallback != null)
+ if (keyInputFocusLostCallback != null)
{
KeyInputFocusSignal signal = this.KeyInputFocusLostSignal();
- signal?.Disconnect(_keyInputFocusLostCallback);
+ signal?.Disconnect(keyInputFocusLostCallback);
signal?.Dispose();
}
- if (_keyInputFocusGainedCallback != null)
+ if (keyInputFocusGainedCallback != null)
{
KeyInputFocusSignal signal = this.KeyInputFocusGainedSignal();
- signal?.Disconnect(_keyInputFocusGainedCallback);
+ signal?.Disconnect(keyInputFocusGainedCallback);
signal?.Dispose();
}
- if (_backgroundResourceLoadedCallback != null)
+ if (backgroundResourceLoadedCallback != null)
{
ViewSignal signal = this.ResourcesLoadedSignal();
- signal?.Disconnect(_backgroundResourceLoadedCallback);
+ signal?.Disconnect(backgroundResourceLoadedCallback);
signal?.Dispose();
- _backgroundResourceLoadedCallback = null;
+ backgroundResourceLoadedCallback = null;
}
// BaseHandle CPtr is used in Registry and there is danger of deletion if we keep using it here.
/*
- * Copyright(c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*/
using System;
using System.ComponentModel;
-using System.Runtime.InteropServices;
namespace Tizen.NUI
{
{
Interop.Adaptor.DeleteAdaptor(swigCPtr);
}
-
}
-
}
/*
- * Copyright(c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
using System.ComponentModel;
using System.Runtime.CompilerServices;
using Tizen.NUI.Binding;
-using Tizen.NUI.Binding.Internals;
namespace Tizen.NUI
{
-
/// <summary>
/// BaseHandle is a handle to an internal Dali resource.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
protected internal bool Disposed => disposed;
}
-
}
/*
- * Copyright(c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
/// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable (EditorBrowsableState.Never)]
Luminosity = 0x92B0
-
}
}
/*
- * Copyright(c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
namespace Tizen.NUI
{
-
/// <summary>
/// The Color class.
/// </summary>
/*
- * Copyright(c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
using System;
using System.Collections.Generic;
-using System.ComponentModel;
using Tizen.NUI.BaseComponents;
-using Tizen.NUI.Binding;
namespace Tizen.NUI
{
public abstract class Container : Animatable
{
internal BaseHandle InternalParent;
- private List<View> _childViews = new List<View>();
+ private List<View> childViews = new List<View>();
internal Container(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
{
{
get
{
- return _childViews;
+ return childViews;
}
}
/*
- * Copyright(c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*/
using System;
-using System.Collections.Generic;
using System.ComponentModel;
-using System.Reflection;
-using System.Text;
namespace Tizen.NUI
{
/*
- * Copyright(c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
{
internal class Property : Disposable
{
-
/// <summary>
/// This constructor creates a property instance.
/// </summary>
/*
- * Copyright(c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
/// <since_tizen> 3 </since_tizen>
public class PropertyArray : Disposable
{
-
/// <summary>
/// The constructor.
/// </summary>
/*
- * Copyright(c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
/// <since_tizen> 3 </since_tizen>
public class PropertyBuffer : BaseHandle
{
-
/// <summary>
/// Creates a PropertyBuffer.
/// </summary>
public PropertyBuffer(PropertyMap bufferFormat) : this(Interop.PropertyBuffer.New(PropertyMap.getCPtr(bufferFormat)), true)
{
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-
}
internal PropertyBuffer(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
public class PropertyNotification : BaseHandle
{
- private DaliEventHandler<object, NotifyEventArgs> _propertyNotificationNotifyEventHandler;
- private NotifyEventCallbackDelegate _propertyNotificationNotifyEventCallbackDelegate;
+ private DaliEventHandler<object, NotifyEventArgs> propertyNotificationNotifyEventHandler;
+ private NotifyEventCallbackDelegate propertyNotificationNotifyEventCallbackDelegate;
/// <summary>
/// Create a instance of PropertyNotification.
add
{
// Restricted to only one listener
- if (_propertyNotificationNotifyEventHandler == null)
+ if (propertyNotificationNotifyEventHandler == null)
{
- _propertyNotificationNotifyEventHandler += value;
+ propertyNotificationNotifyEventHandler += value;
- _propertyNotificationNotifyEventCallbackDelegate = new NotifyEventCallbackDelegate(OnPropertyNotificationNotify);
- this.NotifySignal().Connect(_propertyNotificationNotifyEventCallbackDelegate);
+ propertyNotificationNotifyEventCallbackDelegate = new NotifyEventCallbackDelegate(OnPropertyNotificationNotify);
+ this.NotifySignal().Connect(propertyNotificationNotifyEventCallbackDelegate);
}
}
remove
{
- if (_propertyNotificationNotifyEventHandler != null)
+ if (propertyNotificationNotifyEventHandler != null)
{
- this.NotifySignal().Disconnect(_propertyNotificationNotifyEventCallbackDelegate);
+ this.NotifySignal().Disconnect(propertyNotificationNotifyEventCallbackDelegate);
}
- _propertyNotificationNotifyEventHandler -= value;
+ propertyNotificationNotifyEventHandler -= value;
}
}
NotifyEventArgs e = new NotifyEventArgs();
e.PropertyNotification = GetPropertyNotificationFromPtr(propertyNotification);
- if (_propertyNotificationNotifyEventHandler != null)
+ if (propertyNotificationNotifyEventHandler != null)
{
//here we send all data to user event handlers
- _propertyNotificationNotifyEventHandler(this, e);
+ propertyNotificationNotifyEventHandler(this, e);
}
}
/// <since_tizen> 3 </since_tizen>
public class NotifyEventArgs : EventArgs
{
- private PropertyNotification _propertyNotification;
+ private PropertyNotification propertyNotification;
///<summary>
/// PropertyNotification - is the PropertyNotification handle that has the notification properties.
{
get
{
- return _propertyNotification;
+ return propertyNotification;
}
set
{
- _propertyNotification = value;
+ propertyNotification = value;
}
}
}
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
[Binding.TypeConverter(typeof(RelativeVector2TypeConverter))]
public class RelativeVector2 : Disposable
{
-
/// <summary>
/// The constructor.
/// </summary>
}
}
}
-
-
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
}
}
-
-
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
}
}
}
-
-
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
private SizeChangedCallback callback = null;
}
}
-
public class StyleManager : BaseHandle
{
private static readonly StyleManager instance = StyleManager.Get();
- private EventHandler<StyleChangedEventArgs> _styleManagerStyleChangedEventHandler;
- private StyleChangedCallbackDelegate _styleManagerStyleChangedCallbackDelegate;
+ private EventHandler<StyleChangedEventArgs> styleManagerStyleChangedEventHandler;
+ private StyleChangedCallbackDelegate styleManagerStyleChangedCallbackDelegate;
/// <summary>
/// Creates a StyleManager handle.<br />
{
add
{
- if (_styleManagerStyleChangedEventHandler == null)
+ if (styleManagerStyleChangedEventHandler == null)
{
- _styleManagerStyleChangedCallbackDelegate = (OnStyleChanged);
- StyleChangedSignal().Connect(_styleManagerStyleChangedCallbackDelegate);
+ styleManagerStyleChangedCallbackDelegate = (OnStyleChanged);
+ StyleChangedSignal().Connect(styleManagerStyleChangedCallbackDelegate);
}
- _styleManagerStyleChangedEventHandler += value;
+ styleManagerStyleChangedEventHandler += value;
}
remove
{
- _styleManagerStyleChangedEventHandler -= value;
- if (_styleManagerStyleChangedEventHandler == null && StyleChangedSignal().Empty() == false)
+ styleManagerStyleChangedEventHandler -= value;
+ if (styleManagerStyleChangedEventHandler == null && StyleChangedSignal().Empty() == false)
{
- StyleChangedSignal().Disconnect(_styleManagerStyleChangedCallbackDelegate);
+ StyleChangedSignal().Disconnect(styleManagerStyleChangedCallbackDelegate);
}
}
}
// Callback for StyleManager StyleChangedsignal
private void OnStyleChanged(IntPtr styleManager, StyleChangeType styleChange)
{
- StyleChangedEventArgs e = new StyleChangedEventArgs();
-
- // Populate all members of "e" (StyleChangedEventArgs) with real data.
- e.StyleManager = Registry.GetManagedBaseHandleFromNativePtr(styleManager) as StyleManager;
- e.StyleChange = styleChange;
-
- if (_styleManagerStyleChangedEventHandler != null)
+ if (styleManagerStyleChangedEventHandler != null)
{
+ StyleChangedEventArgs e = new StyleChangedEventArgs();
+
+ // Populate all members of "e" (StyleChangedEventArgs) with real data.
+ e.StyleManager = Registry.GetManagedBaseHandleFromNativePtr(styleManager) as StyleManager;
+ e.StyleChange = styleChange;
//Here we send all data to user event handlers.
- _styleManagerStyleChangedEventHandler(this, e);
+ styleManagerStyleChangedEventHandler(this, e);
}
}
[Obsolete("Deprecated in API9, Will be removed in API11. Please use ThemeManager instead.")]
public class StyleChangedEventArgs : EventArgs
{
- private StyleManager _styleManager;
- private StyleChangeType _styleChange;
+ private StyleManager styleManager;
+ private StyleChangeType styleChange;
/// <summary>
/// StyleManager.
{
get
{
- return _styleManager;
+ return styleManager;
}
set
{
- _styleManager = value;
+ styleManager = value;
}
}
{
get
{
- return _styleChange;
+ return styleChange;
}
set
{
- _styleChange = value;
+ styleChange = value;
}
}
}
+/*
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
using System.Reflection;
using System;
[AttributeUsage(AttributeTargets.Property)]
public class ScriptableProperty : System.Attribute
{
-
/// <since_tizen> 3 </since_tizen>
[Obsolete("Deprecated in API9, Will be removed in API11, Please use Type")]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1051:Do not declare visible instance fields", Justification = "<Pending>")]
/// <summary>
/// Lookup table to match C# types to DALi types, used for the automatic property registration.
/// </summary>
- private static readonly Dictionary<string, Tizen.NUI.PropertyType> _daliPropertyTypeLookup
+ private static readonly Dictionary<string, Tizen.NUI.PropertyType> daliPropertyTypeLookup
= new Dictionary<string, Tizen.NUI.PropertyType>
{
{ "float", PropertyType.Float },
/// </summary>
private static CustomViewRegistry instance = null;
- private CreateControlDelegate _createCallback;
- private SetPropertyDelegate _setPropertyCallback;
- private GetPropertyDelegate _getPropertyCallback;
- private PropertyRangeManager _propertyRangeManager;
+ private CreateControlDelegate createCallback;
+ private SetPropertyDelegate setPropertyCallback;
+ private GetPropertyDelegate getPropertyCallback;
+ private PropertyRangeManager propertyRangeManager;
///<summary>
/// Maps the name of a custom view to a create instance function
/// For example, given a string "Spin", we can get a function used to create the Spin View.
///</summary>
- private Dictionary<String, Func<CustomView>> _constructorMap;
+ private Dictionary<String, Func<CustomView>> constructorMap;
private CustomViewRegistry()
{
- _createCallback = new CreateControlDelegate(CreateControl);
- _getPropertyCallback = new GetPropertyDelegate(GetProperty);
- _setPropertyCallback = new SetPropertyDelegate(SetProperty);
+ createCallback = new CreateControlDelegate(CreateControl);
+ getPropertyCallback = new GetPropertyDelegate(GetProperty);
+ setPropertyCallback = new SetPropertyDelegate(SetProperty);
- _constructorMap = new Dictionary<string, Func<CustomView>>();
- _propertyRangeManager = new PropertyRangeManager();
+ constructorMap = new Dictionary<string, Func<CustomView>>();
+ propertyRangeManager = new PropertyRangeManager();
}
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
}
// add the mapping between the view name and it's create function
- _constructorMap.Add(viewType.ToString(), createFunction);
+ constructorMap.Add(viewType.ToString(), createFunction);
// Call into DALi C++ to register the control with the type registry
- TypeRegistration.RegisterControl(viewType.ToString(), _createCallback);
+ TypeRegistration.RegisterControl(viewType.ToString(), createCallback);
// Cycle through each property in the class
foreach (System.Reflection.PropertyInfo propertyInfo in viewType.GetProperties(BindingFlags.DeclaredOnly | BindingFlags.Instance | BindingFlags.Public))
ScriptableProperty scriptableProp = attr as ScriptableProperty;
// we get the start property index, based on the type and it's heirachy, e.g. DateView (70,000)-> Spin (60,000) -> View (50,000)
- int propertyIndex = _propertyRangeManager.GetPropertyIndex(viewType.ToString(), viewType, scriptableProp.type);
+ int propertyIndex = propertyRangeManager.GetPropertyIndex(viewType.ToString(), viewType, scriptableProp.type);
// get the enum for the property type... E.g. registering a string property returns Tizen.NUI.PropertyType.String
Tizen.NUI.PropertyType propertyType = GetDaliPropertyType(propertyInfo.PropertyType.Name);
// Example RegisterProperty("spin","maxValue", 50001, FLOAT, set, get );
// Native call to register the property
- TypeRegistration.RegisterProperty(viewType.ToString(), propertyInfo.Name, propertyIndex, propertyType, _setPropertyCallback, _getPropertyCallback);
+ TypeRegistration.RegisterProperty(viewType.ToString(), propertyInfo.Name, propertyIndex, propertyType, setPropertyCallback, getPropertyCallback);
}
}
NUILog.Debug("property name = " + propertyInfo.Name);
Func<CustomView> controlConstructor;
// find the control constructor
- if (Instance._constructorMap.TryGetValue(controlName, out controlConstructor))
+ if (Instance.constructorMap.TryGetValue(controlName, out controlConstructor))
{
// Create the control
CustomView newControl = controlConstructor();
private Tizen.NUI.PropertyType GetDaliPropertyType(string cSharpTypeName)
{
Tizen.NUI.PropertyType daliType;
- if (_daliPropertyTypeLookup.TryGetValue(cSharpTypeName, out daliType))
+ if (daliPropertyTypeLookup.TryGetValue(cSharpTypeName, out daliType))
{
NUILog.Debug("mapped " + cSharpTypeName + " to dAli type " + daliType);
/*
- * Copyright(c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*/
using System;
-using System.Runtime.InteropServices;
-using Tizen.NUI;
using Tizen.NUI.BaseComponents;
// A spin control (for continously changing values when users can easily predict a set of values)
-
namespace Tizen.NUI
{
///<summary>
/// <since_tizen> 3 </since_tizen>
public class Spin : CustomView
{
- private VisualBase _arrowVisual;
- private TextField _textField;
- private int _arrowVisualPropertyIndex;
- private string _arrowImage;
- private int _currentValue;
- private int _minValue;
- private int _maxValue;
- private int _singleStep;
- private bool _wrappingEnabled;
- private int _pointSize;
- private Color _textColor;
- private Color _textBackgroundColor;
- private int _maxTextLength;
+ private VisualBase arrowVisual;
+ private TextField textField;
+ private int arrowVisualPropertyIndex;
+ private string arrowImage;
+ private int currentValue;
+ private int minValue;
+ private int maxValue;
+ private int singleStep;
+ private bool wrappingEnabled;
+ private int pointSize;
+ private Color textColor;
+ private Color textBackgroundColor;
+ private int maxTextLength;
// static constructor registers the control type (only runs once)
static Spin()
{
get
{
- return _currentValue;
+ return currentValue;
}
set
{
NUILog.Debug("Value set to " + value);
- _currentValue = value;
+ currentValue = value;
// Make sure no invalid value is accepted
- if (_currentValue < _minValue)
+ if (currentValue < minValue)
{
- _currentValue = _minValue;
+ currentValue = minValue;
}
- if (_currentValue > _maxValue)
+ if (currentValue > maxValue)
{
- _currentValue = _maxValue;
+ currentValue = maxValue;
}
- _textField.Text = _currentValue.ToString();
+ textField.Text = currentValue.ToString();
}
}
{
get
{
- return _minValue;
+ return minValue;
}
set
{
- _minValue = value;
+ minValue = value;
}
}
{
get
{
- return _maxValue;
+ return maxValue;
}
set
{
- _maxValue = value;
+ maxValue = value;
}
}
{
get
{
- return _singleStep;
+ return singleStep;
}
set
{
- _singleStep = value;
+ singleStep = value;
}
}
{
get
{
- return _wrappingEnabled;
+ return wrappingEnabled;
}
set
{
- _wrappingEnabled = value;
+ wrappingEnabled = value;
}
}
{
get
{
- return _pointSize;
+ return pointSize;
}
set
{
- _pointSize = value;
- _textField.PointSize = _pointSize;
+ pointSize = value;
+ textField.PointSize = pointSize;
}
}
{
get
{
- return _textColor;
+ return textColor;
}
set
{
NUILog.Debug("TextColor set to " + value.R + "," + value.G + "," + value.B);
}
- _textColor = value;
- _textField.TextColor = _textColor;
+ textColor = value;
+ textField.TextColor = textColor;
}
}
{
get
{
- return _maxTextLength;
+ return maxTextLength;
}
set
{
- _maxTextLength = value;
- _textField.MaxLength = _maxTextLength;
+ maxTextLength = value;
+ textField.MaxLength = maxTextLength;
}
}
{
get
{
- return _textField;
+ return textField;
}
set
{
- _textField = value;
+ textField = value;
}
}
{
get
{
- return _arrowImage;
+ return arrowImage;
}
set
{
- _arrowImage = value;
+ arrowImage = value;
var ptMap = new PropertyMap();
var temp = new PropertyValue((int)Visual.Type.Image);
ptMap.Add(Visual.Property.Type, temp);
temp.Dispose();
- temp = new PropertyValue(_arrowImage);
+ temp = new PropertyValue(arrowImage);
ptMap.Add(ImageVisualProperty.URL, temp);
temp.Dispose();
ptMap.Add(ImageVisualProperty.DesiredWidth, temp);
temp.Dispose();
- _arrowVisual = VisualFactory.Instance.CreateVisual(ptMap);
+ arrowVisual = VisualFactory.Instance.CreateVisual(ptMap);
ptMap.Dispose();
- RegisterVisual(_arrowVisualPropertyIndex, _arrowVisual);
+ RegisterVisual(arrowVisualPropertyIndex, arrowVisual);
}
}
public override void OnInitialize()
{
// Initialize the propertiesControl
- _arrowImage = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "picture.png";
- _textBackgroundColor = new Color(0.6f, 0.6f, 0.6f, 1.0f);
- _currentValue = 0;
- _minValue = 0;
- _maxValue = 0;
- _singleStep = 1;
- _maxTextLength = 0;
+ arrowImage = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "picture.png";
+ textBackgroundColor = new Color(0.6f, 0.6f, 0.6f, 1.0f);
+ currentValue = 0;
+ minValue = 0;
+ maxValue = 0;
+ singleStep = 1;
+ maxTextLength = 0;
// Create image visual for the arrow keys
- var temp = new PropertyValue(_arrowImage);
- _arrowVisualPropertyIndex = RegisterProperty("ArrowImage", temp, Tizen.NUI.PropertyAccessMode.ReadWrite);
+ var temp = new PropertyValue(arrowImage);
+ arrowVisualPropertyIndex = RegisterProperty("ArrowImage", temp, Tizen.NUI.PropertyAccessMode.ReadWrite);
temp.Dispose();
var ptMap = new PropertyMap();
ptMap.Add(Visual.Property.Type, temp);
temp.Dispose();
- temp = new PropertyValue(_arrowImage);
+ temp = new PropertyValue(arrowImage);
ptMap.Add(ImageVisualProperty.URL, temp);
temp.Dispose();
ptMap.Add(ImageVisualProperty.DesiredWidth, temp);
temp.Dispose();
- _arrowVisual = VisualFactory.Instance.CreateVisual(ptMap);
+ arrowVisual = VisualFactory.Instance.CreateVisual(ptMap);
ptMap.Dispose();
- RegisterVisual(_arrowVisualPropertyIndex, _arrowVisual);
+ RegisterVisual(arrowVisualPropertyIndex, arrowVisual);
// Create a text field
- _textField = new TextField();
- _textField.PivotPoint = Tizen.NUI.PivotPoint.Center;
- _textField.WidthResizePolicy = ResizePolicyType.SizeRelativeToParent;
- _textField.HeightResizePolicy = ResizePolicyType.SizeRelativeToParent;
- _textField.SizeModeFactor = new Vector3(1.0f, 0.45f, 1.0f);
- _textField.PlaceholderText = "----";
- _textField.BackgroundColor = _textBackgroundColor;
- _textField.HorizontalAlignment = HorizontalAlignment.Center;
- _textField.VerticalAlignment = VerticalAlignment.Center;
- _textField.Focusable = (true);
- _textField.Name = "_textField";
- _textField.Position2D = new Position2D(0, 40);
-
- this.Add(_textField);
-
- _textField.FocusGained += TextFieldKeyInputFocusGained;
- _textField.FocusLost += TextFieldKeyInputFocusLost;
+ textField = new TextField();
+ textField.PivotPoint = Tizen.NUI.PivotPoint.Center;
+ textField.WidthResizePolicy = ResizePolicyType.SizeRelativeToParent;
+ textField.HeightResizePolicy = ResizePolicyType.SizeRelativeToParent;
+ textField.SizeModeFactor = new Vector3(1.0f, 0.45f, 1.0f);
+ textField.PlaceholderText = "----";
+ textField.BackgroundColor = textBackgroundColor;
+ textField.HorizontalAlignment = HorizontalAlignment.Center;
+ textField.VerticalAlignment = VerticalAlignment.Center;
+ textField.Focusable = (true);
+ textField.Name = "_textField";
+ textField.Position2D = new Position2D(0, 40);
+
+ this.Add(textField);
+
+ textField.FocusGained += TextFieldKeyInputFocusGained;
+ textField.FocusLost += TextFieldKeyInputFocusLost;
}
/// <summary>
/// <since_tizen> 3 </since_tizen>
public void TextFieldKeyInputFocusGained(object source, EventArgs e)
{
- FocusManager.Instance.SetCurrentFocusView(_textField);
+ FocusManager.Instance.SetCurrentFocusView(textField);
}
/// <summary>
/// <since_tizen> 3 </since_tizen>
public void TextFieldKeyInputFocusLost(object source, EventArgs e)
{
- int previousValue = _currentValue;
+ int previousValue = currentValue;
// If the input value is invalid, change it back to the previous valid value
- if (int.TryParse(_textField.Text, out _currentValue))
+ if (int.TryParse(textField.Text, out currentValue))
{
- if (_currentValue < _minValue || _currentValue > _maxValue)
+ if (currentValue < minValue || currentValue > maxValue)
{
- _currentValue = previousValue;
+ currentValue = previousValue;
}
}
else
{
- _currentValue = previousValue;
+ currentValue = previousValue;
}
// Otherwise take the new value
- this.Value = _currentValue;
+ this.Value = currentValue;
}
/// <summary>
if (direction == View.FocusDirection.Up)
{
this.Value += this.Step;
- nextFocusedView = _textField;
+ nextFocusedView = textField;
}
else if (direction == View.FocusDirection.Down)
{
this.Value -= this.Step;
- nextFocusedView = _textField;
+ nextFocusedView = textField;
}
else
{
/*
- * Copyright(c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
namespace Tizen.NUI
{
-
/// <summary>
/// A long press gesture is emitted when the user holds the screen with the stated number of fingers.<br />
/// A long press gesture finishes when all touches have been released.<br />
/// <since_tizen> 3 </since_tizen>
public class LongPressGesture : Gesture
{
-
/// <summary>
/// The constructor.
/// </summary>
{
}
- private DaliEventHandler<object, DetectedEventArgs> _detectedEventHandler;
+ private DaliEventHandler<object, DetectedEventArgs> detectedEventHandler;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
private delegate void DetectedCallbackType(IntPtr actor, IntPtr longPressGesture);
- private DetectedCallbackType _detectedCallback;
+ private DetectedCallbackType detectedCallback;
/// <summary>
/// This signal is emitted when the specified long press is detected on the attached view.
{
add
{
- if (_detectedEventHandler == null)
+ if (detectedEventHandler == null)
{
- _detectedCallback = OnLongPressGestureDetected;
- DetectedSignal().Connect(_detectedCallback);
+ detectedCallback = OnLongPressGestureDetected;
+ DetectedSignal().Connect(detectedCallback);
}
- _detectedEventHandler += value;
+ detectedEventHandler += value;
}
remove
{
- _detectedEventHandler -= value;
+ detectedEventHandler -= value;
- if (_detectedEventHandler == null && DetectedSignal().Empty() == false)
+ if (detectedEventHandler == null && DetectedSignal().Empty() == false)
{
- DetectedSignal().Disconnect(_detectedCallback);
+ DetectedSignal().Disconnect(detectedCallback);
}
}
}
[EditorBrowsable(EditorBrowsableState.Never)]
protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
{
- if (_detectedEventHandler == null && DetectedSignal().Empty() == false)
+ if (detectedEventHandler == null && DetectedSignal().Empty() == false)
{
- DetectedSignal().Disconnect(_detectedCallback);
+ DetectedSignal().Disconnect(detectedCallback);
}
Interop.LongPressGestureDetector.DeleteLongPressGestureDetector(swigCPtr);
}
e.LongPressGesture = Tizen.NUI.LongPressGesture.GetLongPressGestureFromPtr(longPressGesture);
- if (_detectedEventHandler != null)
+ if (detectedEventHandler != null)
{
//Here we send all data to user event handlers.
- _detectedEventHandler(this, e);
+ detectedEventHandler(this, e);
}
}
[EditorBrowsable(EditorBrowsableState.Never)]
public class DetectedEventArgs : EventArgs
{
- private View _view;
- private LongPressGesture _longPressGesture;
+ private View view;
+ private LongPressGesture longPressGesture;
/// <summary>
/// View the attached view.
{
get
{
- return _view;
+ return view;
}
set
{
- _view = value;
+ view = value;
}
}
{
get
{
- return _longPressGesture;
+ return longPressGesture;
}
set
{
- _longPressGesture = value;
+ longPressGesture = value;
}
}
}
/*
- * Copyright(c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
/*
- * Copyright(c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
{
}
- private DaliEventHandler<object, DetectedEventArgs> _detectedEventHandler;
+ private DaliEventHandler<object, DetectedEventArgs> detectedEventHandler;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
private delegate void DetectedCallbackType(IntPtr actor, IntPtr panGesture);
- private DetectedCallbackType _detectedCallback;
+ private DetectedCallbackType detectedCallback;
/// <summary>
/// This signal is emitted when the specified pan is detected on the attached view.
{
add
{
- if (_detectedEventHandler == null)
+ if (detectedEventHandler == null)
{
- _detectedCallback = OnPanGestureDetected;
- DetectedSignal().Connect(_detectedCallback);
+ detectedCallback = OnPanGestureDetected;
+ DetectedSignal().Connect(detectedCallback);
}
- _detectedEventHandler += value;
+ detectedEventHandler += value;
}
remove
{
- _detectedEventHandler -= value;
+ detectedEventHandler -= value;
- if (_detectedEventHandler == null && DetectedSignal().Empty() == false)
+ if (detectedEventHandler == null && DetectedSignal().Empty() == false)
{
- DetectedSignal().Disconnect(_detectedCallback);
+ DetectedSignal().Disconnect(detectedCallback);
}
}
}
[EditorBrowsable(EditorBrowsableState.Never)]
protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
{
- if (_detectedCallback != null)
+ if (detectedCallback != null)
{
- DetectedSignal().Disconnect(_detectedCallback);
+ DetectedSignal().Disconnect(detectedCallback);
}
Interop.PanGestureDetector.DeletePanGestureDetector(swigCPtr);
private void OnPanGestureDetected(IntPtr actor, IntPtr panGesture)
{
- DetectedEventArgs e = new DetectedEventArgs();
-
- // Populate all members of "e" (PanGestureEventArgs) with real data
- e.View = Registry.GetManagedBaseHandleFromNativePtr(actor) as View;
- if (null == e.View)
+ if (detectedEventHandler != null)
{
- e.View = Registry.GetManagedBaseHandleFromRefObject(actor) as View;
- }
+ DetectedEventArgs e = new DetectedEventArgs();
- e.PanGesture = Tizen.NUI.PanGesture.GetPanGestureFromPtr(panGesture);
+ // Populate all members of "e" (PanGestureEventArgs) with real data
+ e.View = Registry.GetManagedBaseHandleFromNativePtr(actor) as View;
+ if (null == e.View)
+ {
+ e.View = Registry.GetManagedBaseHandleFromRefObject(actor) as View;
+ }
- if (_detectedEventHandler != null)
- {
- _detectedEventHandler(this, e);
+ e.PanGesture = Tizen.NUI.PanGesture.GetPanGestureFromPtr(panGesture);
+ detectedEventHandler(this, e);
}
}
[EditorBrowsable(EditorBrowsableState.Never)]
public class DetectedEventArgs : EventArgs
{
- private View _view;
- private PanGesture _panGesture;
+ private View view;
+ private PanGesture panGesture;
/// <summary>
/// The attached view.
{
get
{
- return _view;
+ return view;
}
set
{
- _view = value;
+ view = value;
}
}
{
get
{
- return _panGesture;
+ return panGesture;
}
set
{
- _panGesture = value;
+ panGesture = value;
}
}
}
/*
- * Copyright(c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
namespace Tizen.NUI
{
-
/// <summary>
/// A PinchGesture is emitted when the user moves two fingers towards or away from each other.<br />
/// A pinch gesture will continue to be sent to the actor under the center point of the pinch until the pinch ends.<br />
/// <since_tizen> 3 </since_tizen>
public class PinchGesture : Gesture
{
-
internal PinchGesture(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
{
}
/*
- * Copyright(c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
{
}
- private DaliEventHandler<object, DetectedEventArgs> _detectedEventHandler;
+ private DaliEventHandler<object, DetectedEventArgs> detectedEventHandler;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
private delegate void DetectedCallbackType(IntPtr actor, IntPtr pinchGesture);
- private DetectedCallbackType _detectedCallback;
+ private DetectedCallbackType detectedCallback;
/// <summary>
/// This signal is emitted when the specified pinch is detected on the attached view.
{
add
{
- if (_detectedEventHandler == null)
+ if (detectedEventHandler == null)
{
- _detectedCallback = OnPinchGestureDetected;
- DetectedSignal().Connect(_detectedCallback);
+ detectedCallback = OnPinchGestureDetected;
+ DetectedSignal().Connect(detectedCallback);
}
- _detectedEventHandler += value;
+ detectedEventHandler += value;
}
remove
{
- _detectedEventHandler -= value;
+ detectedEventHandler -= value;
- if (_detectedEventHandler == null && DetectedSignal().Empty() == false)
+ if (detectedEventHandler == null && DetectedSignal().Empty() == false)
{
- DetectedSignal().Disconnect(_detectedCallback);
+ DetectedSignal().Disconnect(detectedCallback);
}
}
}
[EditorBrowsable(EditorBrowsableState.Never)]
protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
{
- if (_detectedCallback != null)
+ if (detectedCallback != null)
{
- DetectedSignal().Disconnect(_detectedCallback);
+ DetectedSignal().Disconnect(detectedCallback);
}
Interop.PinchGesture.DeletePinchGestureDetector(swigCPtr);
private void OnPinchGestureDetected(IntPtr actor, IntPtr pinchGesture)
{
- DetectedEventArgs e = new DetectedEventArgs();
-
- // Populate all members of "e" (DetectedEventArgs) with real data.
- e.View = Registry.GetManagedBaseHandleFromNativePtr(actor) as View;
- if (null == e.View)
+ if (detectedEventHandler != null)
{
- e.View = Registry.GetManagedBaseHandleFromRefObject(actor) as View;
- }
+ DetectedEventArgs e = new DetectedEventArgs();
- e.PinchGesture = Tizen.NUI.PinchGesture.GetPinchGestureFromPtr(pinchGesture);
+ // Populate all members of "e" (DetectedEventArgs) with real data.
+ e.View = Registry.GetManagedBaseHandleFromNativePtr(actor) as View;
+ if (null == e.View)
+ {
+ e.View = Registry.GetManagedBaseHandleFromRefObject(actor) as View;
+ }
- if (_detectedEventHandler != null)
- {
+ e.PinchGesture = Tizen.NUI.PinchGesture.GetPinchGestureFromPtr(pinchGesture);
//Here we send all data to user event handlers.
- _detectedEventHandler(this, e);
+ detectedEventHandler(this, e);
}
}
[EditorBrowsable(EditorBrowsableState.Never)]
public class DetectedEventArgs : EventArgs
{
- private View _view;
- private PinchGesture _pinchGesture;
+ private View view;
+ private PinchGesture pinchGesture;
/// <summary>
/// The attached view.
{
get
{
- return _view;
+ return view;
}
set
{
- _view = value;
+ view = value;
}
}
{
get
{
- return _pinchGesture;
+ return pinchGesture;
}
set
{
- _pinchGesture = value;
+ pinchGesture = value;
}
}
}
/*
- * Copyright(c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
namespace Tizen.NUI
{
-
/// <summary>
/// A RotationGesture is emitted when the user moves two fingers in a circular motion.<br />
/// A rotation gesture will continue to be sent to the actor under the center point of the rotation until the rotation ends.<br />
/*
- * Copyright(c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
{
}
- private DaliEventHandler<object, DetectedEventArgs> _detectedEventHandler;
+ private DaliEventHandler<object, DetectedEventArgs> detectedEventHandler;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
private delegate void DetectedCallbackType(IntPtr actor, IntPtr rotationGesture);
- private DetectedCallbackType _detectedCallback;
+ private DetectedCallbackType detectedCallback;
/// <summary>
/// This signal is emitted when the specified rotation is detected on the attached view.
{
add
{
- if (_detectedEventHandler == null)
+ if (detectedEventHandler == null)
{
- _detectedCallback = OnRotationGestureDetected;
- DetectedSignal().Connect(_detectedCallback);
+ detectedCallback = OnRotationGestureDetected;
+ DetectedSignal().Connect(detectedCallback);
}
- _detectedEventHandler += value;
+ detectedEventHandler += value;
}
remove
{
- _detectedEventHandler -= value;
+ detectedEventHandler -= value;
- if (_detectedEventHandler == null && DetectedSignal().Empty() == false)
+ if (detectedEventHandler == null && DetectedSignal().Empty() == false)
{
- DetectedSignal().Disconnect(_detectedCallback);
+ DetectedSignal().Disconnect(detectedCallback);
}
}
}
[EditorBrowsable(EditorBrowsableState.Never)]
protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
{
- if (_detectedCallback != null)
+ if (detectedCallback != null)
{
- DetectedSignal().Disconnect(_detectedCallback);
+ DetectedSignal().Disconnect(detectedCallback);
}
Interop.RotationGesture.DeleteRotationGestureDetector(swigCPtr);
private void OnRotationGestureDetected(IntPtr actor, IntPtr rotationGesture)
{
- DetectedEventArgs e = new DetectedEventArgs();
-
- // Populate all members of "e" (DetectedEventArgs) with real data.
- e.View = Registry.GetManagedBaseHandleFromNativePtr(actor) as View;
- if (null == e.View)
+ if (detectedEventHandler != null)
{
- e.View = Registry.GetManagedBaseHandleFromRefObject(actor) as View;
- }
+ DetectedEventArgs e = new DetectedEventArgs();
- e.RotationGesture = Tizen.NUI.RotationGesture.GetRotationGestureFromPtr(rotationGesture);
+ // Populate all members of "e" (DetectedEventArgs) with real data.
+ e.View = Registry.GetManagedBaseHandleFromNativePtr(actor) as View;
+ if (null == e.View)
+ {
+ e.View = Registry.GetManagedBaseHandleFromRefObject(actor) as View;
+ }
- if (_detectedEventHandler != null)
- {
+ e.RotationGesture = Tizen.NUI.RotationGesture.GetRotationGestureFromPtr(rotationGesture);
//Here we send all data to user event handlers.
- _detectedEventHandler(this, e);
+ detectedEventHandler(this, e);
}
}
[EditorBrowsable(EditorBrowsableState.Never)]
public class DetectedEventArgs : EventArgs
{
- private View _view;
- private RotationGesture _rotationGesture;
+ private View view;
+ private RotationGesture rotationGesture;
/// <summary>
/// The attached view.
{
get
{
- return _view;
+ return view;
}
set
{
- _view = value;
+ view = value;
}
}
{
get
{
- return _rotationGesture;
+ return rotationGesture;
}
set
{
- _rotationGesture = value;
+ rotationGesture = value;
}
}
}
/*
- * Copyright(c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*
*/
using System.ComponentModel;
-using System.Runtime.InteropServices;
using Tizen.NUI.BaseComponents;
namespace Tizen.NUI
/// <since_tizen> 3 </since_tizen>
public class Touch : BaseHandle
{
-
/// <summary>
/// An uninitialized touch instance.<br />
/// Calling member functions with an uninitialized touch handle is not allowed.<br />
/// <since_tizen> 5 </since_tizen>
Tertiary = 2,
}
-
}
/*
- * Copyright(c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*
*/
-using System;
using System.ComponentModel;
-using System.Runtime.InteropServices;
namespace Tizen.NUI
{
[EditorBrowsable(EditorBrowsableState.Never)]
public class NativeImageSource : NativeImageInterface
{
+ private IntPtr handle;
[EditorBrowsable(EditorBrowsableState.Never)]
public NativeImageSource(uint width, uint height, ColorDepth depth) : this(Interop.NativeImageSource.NewHandle(width, height, (int)depth), true)
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
- private IntPtr Handle;
internal NativeImageSource(IntPtr cPtr, bool cMemoryOwn) : base(Interop.NativeImageSource.New(cPtr), cMemoryOwn)
{
- Handle = cPtr;
+ handle = cPtr;
}
-
/// <summary>
/// Get URI from native image source.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
{
- Interop.NativeImageSource.Delete(Handle);
+ Interop.NativeImageSource.Delete(handle);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
/*
- * Copyright(c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
return ret;
}
-
-
/// This will not be public opened.
[EditorBrowsable(EditorBrowsableState.Never)]
protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
/*
- * Copyright(c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
/// <since_tizen> 3 </since_tizen>
COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR
}
-
}
/*
- * Copyright(c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
[EditorBrowsable(EditorBrowsableState.Never)]
public class AutofillContainer : BaseHandle
{
+ private AuthenticationEventCallbackType authenticationCallback;
+ private ListEventCallbackType listCallback;
- private AuthenticationEventCallbackType _authenticationCallback;
- private ListEventCallbackType _listCallback;
-
- private event EventHandler<AuthenticationEventArgs> _authenticationEventHandler;
- private event EventHandler<ListEventArgs> _listEventHandler;
+ private event EventHandler<AuthenticationEventArgs> authenticationEventHandler;
+ private event EventHandler<ListEventArgs> listEventHandler;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
private delegate void AuthenticationEventCallbackType(IntPtr autofillContainer);
{
add
{
- if (_authenticationEventHandler == null)
+ if (authenticationEventHandler == null)
{
- _authenticationCallback = OnServiceEvent;
- AutofillServiceEventSignal().Connect(_authenticationCallback);
+ authenticationCallback = OnServiceEvent;
+ AutofillServiceEventSignal().Connect(authenticationCallback);
}
- _authenticationEventHandler += value;
+ authenticationEventHandler += value;
}
remove
{
- _authenticationEventHandler -= value;
+ authenticationEventHandler -= value;
- if (_authenticationEventHandler == null && _authenticationCallback != null)
+ if (authenticationEventHandler == null && authenticationCallback != null)
{
- AutofillServiceEventSignal().Disconnect(_authenticationCallback);
+ AutofillServiceEventSignal().Disconnect(authenticationCallback);
}
}
}
{
add
{
- if (_listEventHandler == null)
+ if (listEventHandler == null)
{
- _listCallback = OnListEvent;
- AutofillListEventSignal().Connect(_listCallback);
+ listCallback = OnListEvent;
+ AutofillListEventSignal().Connect(listCallback);
}
- _listEventHandler += value;
+ listEventHandler += value;
}
remove
{
- _listEventHandler -= value;
+ listEventHandler -= value;
- if (_listEventHandler == null && _listCallback != null)
+ if (listEventHandler == null && listCallback != null)
{
- AutofillListEventSignal().Disconnect(_listCallback);
+ AutofillListEventSignal().Disconnect(listCallback);
}
}
}
public AutofillContainer(string name) : this(Interop.AutofillContainer.New(name), true)
{
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-
}
internal AutofillContainer(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
//Release your own unmanaged resources here.
//You should not access any managed member here except static instance.
//because the execution order of Finalizes is non-deterministic.
-
if (this != null)
{
- if (_authenticationCallback != null)
+ if (authenticationCallback != null)
{
- AutofillServiceEventSignal().Disconnect(_authenticationCallback);
+ AutofillServiceEventSignal().Disconnect(authenticationCallback);
}
- if (_listCallback != null)
+ if (listCallback != null)
{
- AutofillListEventSignal().Disconnect(_listCallback);
+ AutofillListEventSignal().Disconnect(listCallback);
}
}
AuthenticationEventArgs e = new AuthenticationEventArgs();
e.AutofillContainer = Registry.GetManagedBaseHandleFromNativePtr(autofillContainer) as AutofillContainer;
- if (_authenticationEventHandler != null)
+ if (authenticationEventHandler != null)
{
- _authenticationEventHandler(this, e);
+ authenticationEventHandler(this, e);
}
}
ListEventArgs e = new ListEventArgs();
e.Control = Registry.GetManagedBaseHandleFromNativePtr(control) as BaseComponents.View;
- if (_listEventHandler != null)
+ if (listEventHandler != null)
{
- _listEventHandler(this, e);
+ listEventHandler(this, e);
}
}
CreditCardSecurityCode
}
}
-
}
/*
- * Copyright(c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
public class FocusManager : BaseHandle
{
private static readonly FocusManager instance = FocusManager.Get();
- private CustomAlgorithmInterfaceWrapper _customAlgorithmInterfaceWrapper;
+ private CustomAlgorithmInterfaceWrapper customAlgorithmInterfaceWrapper;
- private EventHandlerWithReturnType<object, PreFocusChangeEventArgs, View> _preFocusChangeEventHandler;
- private PreFocusChangeEventCallback _preFocusChangeCallback;
+ private EventHandlerWithReturnType<object, PreFocusChangeEventArgs, View> preFocusChangeEventHandler;
+ private PreFocusChangeEventCallback preFocusChangeCallback;
- private EventHandler<FocusChangedEventArgs> _focusChangedEventHandler;
- private FocusChangedEventCallback _focusChangedEventCallback;
+ private EventHandler<FocusChangedEventArgs> focusChangedEventHandler;
+ private FocusChangedEventCallback focusChangedEventCallback;
- private EventHandler<FocusGroupChangedEventArgs> _focusGroupChangedEventHandler;
- private FocusGroupChangedEventCallback _focusGroupChangedEventCallback;
+ private EventHandler<FocusGroupChangedEventArgs> focusGroupChangedEventHandler;
+ private FocusGroupChangedEventCallback focusGroupChangedEventCallback;
- private EventHandler<FocusedViewActivatedEventArgs> _focusedViewEnterKeyEventHandler;
- private FocusedViewEnterKeyEventCallback _focusedViewEnterKeyEventCallback;
+ private EventHandler<FocusedViewActivatedEventArgs> focusedViewEnterKeyEventHandler;
+ private FocusedViewEnterKeyEventCallback focusedViewEnterKeyEventCallback;
- private EventHandler<FocusedViewActivatedEventArgs> _focusedViewEnterKeyEventHandler2;
- private FocusedViewEnterKeyEventCallback2 _focusedViewEnterKeyEventCallback2;
+ private EventHandler<FocusedViewActivatedEventArgs> focusedViewEnterKeyEventHandler2;
+ private FocusedViewEnterKeyEventCallback2 focusedViewEnterKeyEventCallback2;
internal FocusManager(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
{
{
add
{
- if (_preFocusChangeEventHandler == null)
+ if (preFocusChangeEventHandler == null)
{
- _preFocusChangeCallback = OnPreFocusChange;
- PreFocusChangeSignal().Connect(_preFocusChangeCallback);
+ preFocusChangeCallback = OnPreFocusChange;
+ PreFocusChangeSignal().Connect(preFocusChangeCallback);
}
- _preFocusChangeEventHandler += value;
+ preFocusChangeEventHandler += value;
}
remove
{
- _preFocusChangeEventHandler -= value;
- if (_preFocusChangeEventHandler == null && PreFocusChangeSignal().Empty() == false)
+ preFocusChangeEventHandler -= value;
+ if (preFocusChangeEventHandler == null && PreFocusChangeSignal().Empty() == false)
{
- PreFocusChangeSignal().Disconnect(_preFocusChangeCallback);
+ PreFocusChangeSignal().Disconnect(preFocusChangeCallback);
}
}
}
{
add
{
- if (_focusChangedEventCallback == null)
+ if (focusChangedEventCallback == null)
{
- _focusChangedEventCallback = OnFocusChanged;
- FocusChangedSignal().Connect(_focusChangedEventCallback);
+ focusChangedEventCallback = OnFocusChanged;
+ FocusChangedSignal().Connect(focusChangedEventCallback);
}
- _focusChangedEventHandler += value;
+ focusChangedEventHandler += value;
}
remove
{
- _focusChangedEventHandler -= value;
+ focusChangedEventHandler -= value;
- if (_focusChangedEventCallback == null && FocusChangedSignal().Empty() == false)
+ if (focusChangedEventCallback == null && FocusChangedSignal().Empty() == false)
{
- FocusChangedSignal().Disconnect(_focusChangedEventCallback);
+ FocusChangedSignal().Disconnect(focusChangedEventCallback);
}
}
}
{
add
{
- if (_focusGroupChangedEventCallback == null)
+ if (focusGroupChangedEventCallback == null)
{
- _focusGroupChangedEventCallback = OnFocusGroupChanged;
- FocusGroupChangedSignal().Connect(_focusGroupChangedEventCallback);
+ focusGroupChangedEventCallback = OnFocusGroupChanged;
+ FocusGroupChangedSignal().Connect(focusGroupChangedEventCallback);
}
- _focusGroupChangedEventHandler += value;
+ focusGroupChangedEventHandler += value;
}
remove
{
- _focusGroupChangedEventHandler -= value;
+ focusGroupChangedEventHandler -= value;
- if (_focusGroupChangedEventCallback == null && FocusGroupChangedSignal().Empty() == false)
+ if (focusGroupChangedEventCallback == null && FocusGroupChangedSignal().Empty() == false)
{
- FocusGroupChangedSignal().Disconnect(_focusGroupChangedEventCallback);
+ FocusGroupChangedSignal().Disconnect(focusGroupChangedEventCallback);
}
}
}
{
add
{
- if (_focusedViewEnterKeyEventCallback == null)
+ if (focusedViewEnterKeyEventCallback == null)
{
- _focusedViewEnterKeyEventCallback = OnFocusedViewEnterKey;
- FocusedViewEnterKeySignal().Connect(_focusedViewEnterKeyEventCallback);
+ focusedViewEnterKeyEventCallback = OnFocusedViewEnterKey;
+ FocusedViewEnterKeySignal().Connect(focusedViewEnterKeyEventCallback);
}
- _focusedViewEnterKeyEventHandler += value;
+ focusedViewEnterKeyEventHandler += value;
}
remove
{
- _focusedViewEnterKeyEventHandler -= value;
+ focusedViewEnterKeyEventHandler -= value;
- if (_focusedViewEnterKeyEventCallback != null && FocusedViewEnterKeySignal().Empty() == false)
+ if (focusedViewEnterKeyEventCallback != null && FocusedViewEnterKeySignal().Empty() == false)
{
- FocusedViewEnterKeySignal().Disconnect(_focusedViewEnterKeyEventCallback);
+ FocusedViewEnterKeySignal().Disconnect(focusedViewEnterKeyEventCallback);
}
}
}
{
add
{
- if (_focusedViewEnterKeyEventCallback2 == null)
+ if (focusedViewEnterKeyEventCallback2 == null)
{
- _focusedViewEnterKeyEventCallback2 = OnFocusedViewEnterKey2;
- FocusedViewEnterKeySignal().Connect(_focusedViewEnterKeyEventCallback2);
+ focusedViewEnterKeyEventCallback2 = OnFocusedViewEnterKey2;
+ FocusedViewEnterKeySignal().Connect(focusedViewEnterKeyEventCallback2);
}
- _focusedViewEnterKeyEventHandler2 += value;
+ focusedViewEnterKeyEventHandler2 += value;
}
remove
{
- _focusedViewEnterKeyEventHandler2 -= value;
+ focusedViewEnterKeyEventHandler2 -= value;
- if (_focusedViewEnterKeyEventCallback2 != null && FocusedViewEnterKeySignal().Empty() == false)
+ if (focusedViewEnterKeyEventCallback2 != null && FocusedViewEnterKeySignal().Empty() == false)
{
- FocusedViewEnterKeySignal().Disconnect(_focusedViewEnterKeyEventCallback2);
+ FocusedViewEnterKeySignal().Disconnect(focusedViewEnterKeyEventCallback2);
}
}
}
{
if (arg0 != null)
{
- _customAlgorithmInterfaceWrapper = new CustomAlgorithmInterfaceWrapper();
- _customAlgorithmInterfaceWrapper.SetFocusAlgorithm(arg0);
+ customAlgorithmInterfaceWrapper = new CustomAlgorithmInterfaceWrapper();
+ customAlgorithmInterfaceWrapper.SetFocusAlgorithm(arg0);
- Interop.NDalic.SetCustomAlgorithm(SwigCPtr, CustomAlgorithmInterface.getCPtr(_customAlgorithmInterfaceWrapper));
+ Interop.NDalic.SetCustomAlgorithm(SwigCPtr, CustomAlgorithmInterface.getCPtr(customAlgorithmInterfaceWrapper));
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
else
}
e.Direction = direction;
- if (_preFocusChangeEventHandler != null)
+ if (preFocusChangeEventHandler != null)
{
- view = _preFocusChangeEventHandler(this, e);
+ view = preFocusChangeEventHandler(this, e);
}
if (view != null)
private void OnFocusChanged(IntPtr current, IntPtr next)
{
- FocusChangedEventArgs e = new FocusChangedEventArgs();
-
- e.CurrentView = Registry.GetManagedBaseHandleFromNativePtr(current) as View;
- e.NextView = Registry.GetManagedBaseHandleFromNativePtr(next) as View;
-
- if (_focusChangedEventHandler != null)
+ if (focusChangedEventHandler != null)
{
- _focusChangedEventHandler(this, e);
+ FocusChangedEventArgs e = new FocusChangedEventArgs();
+
+ e.CurrentView = Registry.GetManagedBaseHandleFromNativePtr(current) as View;
+ e.NextView = Registry.GetManagedBaseHandleFromNativePtr(next) as View;
+ focusChangedEventHandler(this, e);
}
}
private void OnFocusGroupChanged(IntPtr current, bool forwardDirection)
{
- FocusGroupChangedEventArgs e = new FocusGroupChangedEventArgs();
-
- e.CurrentView = Registry.GetManagedBaseHandleFromNativePtr(current) as View;
- e.ForwardDirection = forwardDirection;
-
- if (_focusGroupChangedEventHandler != null)
+ if (focusGroupChangedEventHandler != null)
{
- _focusGroupChangedEventHandler(this, e);
+ FocusGroupChangedEventArgs e = new FocusGroupChangedEventArgs();
+
+ e.CurrentView = Registry.GetManagedBaseHandleFromNativePtr(current) as View;
+ e.ForwardDirection = forwardDirection;
+ focusGroupChangedEventHandler(this, e);
}
}
private void OnFocusedViewEnterKey(IntPtr view)
{
- FocusedViewActivatedEventArgs e = new FocusedViewActivatedEventArgs();
-
- e.View = Registry.GetManagedBaseHandleFromNativePtr(view) as View;
-
- if (_focusedViewEnterKeyEventHandler != null)
+ if (focusedViewEnterKeyEventHandler != null)
{
- _focusedViewEnterKeyEventHandler(this, e);
+ FocusedViewActivatedEventArgs e = new FocusedViewActivatedEventArgs();
+ e.View = Registry.GetManagedBaseHandleFromNativePtr(view) as View;
+ focusedViewEnterKeyEventHandler(this, e);
}
}
[EditorBrowsable(EditorBrowsableState.Never)]
private void OnFocusedViewEnterKey2(IntPtr view)
{
- FocusedViewActivatedEventArgs e = new FocusedViewActivatedEventArgs();
-
- e.View = Registry.GetManagedBaseHandleFromNativePtr(view) as View;
-
- if (_focusedViewEnterKeyEventHandler != null)
+ if (focusedViewEnterKeyEventHandler != null)
{
- _focusedViewEnterKeyEventHandler(this, e);
+ FocusedViewActivatedEventArgs e = new FocusedViewActivatedEventArgs();
+ e.View = Registry.GetManagedBaseHandleFromNativePtr(view) as View;
+ focusedViewEnterKeyEventHandler(this, e);
}
}
/// <since_tizen> 3 </since_tizen>
public class PreFocusChangeEventArgs : EventArgs
{
- private View _current;
- private View _proposed;
- private View.FocusDirection _direction;
+ private View current;
+ private View proposed;
+ private View.FocusDirection direction;
/// <summary>
/// The current focus view.
{
get
{
- return _current;
+ return current;
}
set
{
- _current = value;
+ current = value;
}
}
{
get
{
- return _proposed;
+ return proposed;
}
set
{
- _proposed = value;
+ proposed = value;
}
}
{
get
{
- return _direction;
+ return direction;
}
set
{
- _direction = value;
+ direction = value;
}
}
}
/// <since_tizen> 3 </since_tizen>
public class FocusChangedEventArgs : EventArgs
{
- private View _current;
- private View _next;
+ private View current;
+ private View next;
/// <summary>
/// The current focus view.
{
get
{
- return _current;
+ return current;
}
set
{
- _current = value;
+ current = value;
}
}
/// <summary>
{
get
{
- return _next;
+ return next;
}
set
{
- _next = value;
+ next = value;
}
}
}
/// <since_tizen> 3 </since_tizen>
public class FocusGroupChangedEventArgs : EventArgs
{
- private View _current;
- private bool _forwardDirection;
+ private View current;
+ private bool forwardDirection;
/// <summary>
/// The current focus view.
{
get
{
- return _current;
+ return current;
}
set
{
- _current = value;
+ current = value;
}
}
{
get
{
- return _forwardDirection;
+ return forwardDirection;
}
set
{
- _forwardDirection = value;
+ forwardDirection = value;
}
}
}
/// <since_tizen> 3 </since_tizen>
public class FocusedViewActivatedEventArgs : EventArgs
{
- private View _view;
+ private View view;
/// <summary>
/// View.
{
get
{
- return _view;
+ return view;
}
set
{
- _view = value;
+ view = value;
}
}
}
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1034:NestedTypesShouldNotBeVisible")]
public class FocusedViewEnterKeyEventArgs : EventArgs
{
- private View _view;
+ private View view;
/// <summary>
/// View.
{
get
{
- return _view;
+ return view;
}
set
{
- _view = value;
+ view = value;
}
}
}
private class CustomAlgorithmInterfaceWrapper : CustomAlgorithmInterface
{
- private FocusManager.ICustomFocusAlgorithm _customFocusAlgorithm;
+ private FocusManager.ICustomFocusAlgorithm customFocusAlgorithm;
public CustomAlgorithmInterfaceWrapper()
{
public void SetFocusAlgorithm(FocusManager.ICustomFocusAlgorithm customFocusAlgorithm)
{
- _customFocusAlgorithm = customFocusAlgorithm;
+ this.customFocusAlgorithm = customFocusAlgorithm;
}
public override View GetNextFocusableView(View current, View proposed, View.FocusDirection direction)
{
- if (_customFocusAlgorithm == null)
+ if (customFocusAlgorithm == null)
{
Tizen.Log.Error("NUI", $"[ERROR] User defined ICustomFocusAlgorithm interface class becomes unreachable. Null will be proposed for next focusing!");
return null;
}
- return _customFocusAlgorithm.GetNextFocusableView(current, proposed, direction);
+ return customFocusAlgorithm.GetNextFocusableView(current, proposed, direction);
}
}
-
-
}
}
-// Copyright (c) 2017 Samsung Electronics Co., Ltd.
+// Copyright (c) 2021 Samsung Electronics Co., Ltd.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
namespace Tizen.NUI
{
-
/// <summary>
/// A class encapsulating the input method map.
/// </summary>
/// <since_tizen> 3 </since_tizen>
public class InputMethod
{
- private PanelLayoutType? _panelLayout = null;
- private ActionButtonTitleType? _actionButton = null;
- private AutoCapitalType? _autoCapital = null;
- private int? _variation = null;
+ private PanelLayoutType? panelLayout = null;
+ private ActionButtonTitleType? actionButton = null;
+ private AutoCapitalType? autoCapital = null;
+ private int? variation = null;
/// <summary>
/// The default constructor.
{
get
{
- return _panelLayout ?? PanelLayoutType.Normal;
+ return panelLayout ?? PanelLayoutType.Normal;
}
set
{
- _panelLayout = value;
+ panelLayout = value;
}
}
{
get
{
- return _actionButton ?? ActionButtonTitleType.Default;
+ return actionButton ?? ActionButtonTitleType.Default;
}
set
{
- _actionButton = value;
+ actionButton = value;
}
}
{
get
{
- return _autoCapital ?? AutoCapitalType.None;
+ return autoCapital ?? AutoCapitalType.None;
}
set
{
- _autoCapital = value;
+ autoCapital = value;
}
}
{
get
{
- return _variation ?? 0;
+ return variation ?? 0;
}
set
{
- _variation = value;
+ variation = value;
}
}
{
get
{
- return (NormalLayoutType)(_variation ?? 0);
+ return (NormalLayoutType)(variation ?? 0);
}
set
{
- _variation = (int)value;
+ variation = (int)value;
}
}
{
get
{
- return (NumberOnlyLayoutType)(_variation ?? 0);
+ return (NumberOnlyLayoutType)(variation ?? 0);
}
set
{
- _variation = (int)value;
+ variation = (int)value;
}
}
{
get
{
- return (PasswordLayoutType)(_variation ?? 0);
+ return (PasswordLayoutType)(variation ?? 0);
}
set
{
- _variation = (int)value;
+ variation = (int)value;
}
}
private PropertyMap ComposingInputMethodMap()
{
- PropertyMap _outputMap = new PropertyMap();
+ PropertyMap outputMap = new PropertyMap();
PropertyValue temp;
- if (_panelLayout != null)
+ if (panelLayout != null)
{
- temp = new PropertyValue((int)_panelLayout);
- _outputMap.Add("PANEL_LAYOUT", temp);
+ temp = new PropertyValue((int)panelLayout);
+ outputMap.Add("PANEL_LAYOUT", temp);
temp.Dispose();
}
- if (_actionButton != null)
+ if (actionButton != null)
{
// Temporarily specify the values to match the types of ecore_imf.
- if (_actionButton == InputMethod.ActionButtonTitleType.Search) _actionButton = (InputMethod.ActionButtonTitleType.Search - 1); // 6
- else if (_actionButton == InputMethod.ActionButtonTitleType.Send) _actionButton = (InputMethod.ActionButtonTitleType.Send - 1); // 7
- else if (_actionButton == InputMethod.ActionButtonTitleType.SignIn) _actionButton = (InputMethod.ActionButtonTitleType.SignIn - 1); // 8
- else if (_actionButton == InputMethod.ActionButtonTitleType.Unspecified || _actionButton == InputMethod.ActionButtonTitleType.None) _actionButton = InputMethod.ActionButtonTitleType.Default;
- temp = new PropertyValue((int)_actionButton);
- _outputMap.Add("BUTTON_ACTION", temp);
+ if (actionButton == InputMethod.ActionButtonTitleType.Search) actionButton = (InputMethod.ActionButtonTitleType.Search - 1); // 6
+ else if (actionButton == InputMethod.ActionButtonTitleType.Send) actionButton = (InputMethod.ActionButtonTitleType.Send - 1); // 7
+ else if (actionButton == InputMethod.ActionButtonTitleType.SignIn) actionButton = (InputMethod.ActionButtonTitleType.SignIn - 1); // 8
+ else if (actionButton == InputMethod.ActionButtonTitleType.Unspecified || actionButton == InputMethod.ActionButtonTitleType.None) actionButton = InputMethod.ActionButtonTitleType.Default;
+ temp = new PropertyValue((int)actionButton);
+ outputMap.Add("BUTTON_ACTION", temp);
temp.Dispose();
}
- if (_autoCapital != null)
+ if (autoCapital != null)
{
- temp = new PropertyValue((int)_autoCapital);
- _outputMap.Add("AUTO_CAPITALIZE", temp);
+ temp = new PropertyValue((int)autoCapital);
+ outputMap.Add("AUTO_CAPITALIZE", temp);
temp.Dispose();
}
- if (_variation != null)
+ if (variation != null)
{
- temp = new PropertyValue((int)_variation);
- _outputMap.Add("VARIATION", temp);
+ temp = new PropertyValue((int)variation);
+ outputMap.Add("VARIATION", temp);
temp.Dispose();
}
- return _outputMap;
+ return outputMap;
}
}
}
/*
- * Copyright(c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
/// <since_tizen> 5 </since_tizen>
public class InputMethodContext : BaseHandle
{
-
- private ActivatedEventCallbackType _activatedEventCallback;
- private EventReceivedEventCallbackType _eventReceivedEventCallback;
- private StatusChangedEventCallbackType _statusChangedEventCallback;
- private ResizedEventCallbackType _resizedEventCallback;
- private LanguageChangedEventCallbackType _languageChangedEventCallback;
- private KeyboardTypeChangedEventCallbackType _keyboardTypeChangedEventCallback;
- private ContentReceivedCallbackType _contentReceivedEventCallback;
+ private ActivatedEventCallbackType activatedEventCallback;
+ private EventReceivedEventCallbackType eventReceivedEventCallback;
+ private StatusChangedEventCallbackType statusChangedEventCallback;
+ private ResizedEventCallbackType resizedEventCallback;
+ private LanguageChangedEventCallbackType languageChangedEventCallback;
+ private KeyboardTypeChangedEventCallbackType keyboardTypeChangedEventCallback;
+ private ContentReceivedCallbackType contentReceivedEventCallback;
/// <summary>
/// Constructor.<br/>
public InputMethodContext() : this(Interop.InputMethodContext.New(), true)
{
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-
}
internal InputMethodContext(IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
private delegate void KeyboardTypeChangedEventCallbackType(KeyboardType type);
private delegate void ContentReceivedCallbackType(string content, string description, string mimeType);
- private event EventHandler<ActivatedEventArgs> _activatedEventHandler;
- private event EventHandlerWithReturnType<object, EventReceivedEventArgs, CallbackData> _eventReceivedEventHandler;
- private event EventHandler<StatusChangedEventArgs> _statusChangedEventHandler;
- private event EventHandler<ResizedEventArgs> _resizedEventHandler;
- private event EventHandler<LanguageChangedEventArgs> _languageChangedEventHandler;
- private event EventHandler<KeyboardTypeChangedEventArgs> _keyboardTypeChangedEventHandler;
- private event EventHandler<ContentReceivedEventArgs> _contentReceivedEventHandler;
+ private event EventHandler<ActivatedEventArgs> activatedEventHandler;
+ private event EventHandlerWithReturnType<object, EventReceivedEventArgs, CallbackData> eventReceivedEventHandler;
+ private event EventHandler<StatusChangedEventArgs> statusChangedEventHandler;
+ private event EventHandler<ResizedEventArgs> resizedEventHandler;
+ private event EventHandler<LanguageChangedEventArgs> languageChangedEventHandler;
+ private event EventHandler<KeyboardTypeChangedEventArgs> keyboardTypeChangedEventHandler;
+ private event EventHandler<ContentReceivedEventArgs> contentReceivedEventHandler;
/// <summary>
/// InputMethodContext activated.
{
add
{
- if (_activatedEventHandler == null)
+ if (activatedEventHandler == null)
{
- _activatedEventCallback = OnActivated;
- ActivatedSignal().Connect(_activatedEventCallback);
+ activatedEventCallback = OnActivated;
+ ActivatedSignal().Connect(activatedEventCallback);
}
- _activatedEventHandler += value;
+ activatedEventHandler += value;
}
remove
{
- _activatedEventHandler -= value;
+ activatedEventHandler -= value;
- if (_activatedEventHandler == null && _activatedEventCallback != null)
+ if (activatedEventHandler == null && activatedEventCallback != null)
{
- ActivatedSignal().Disconnect(_activatedEventCallback);
+ ActivatedSignal().Disconnect(activatedEventCallback);
}
}
}
{
add
{
- if (_eventReceivedEventHandler == null)
+ if (eventReceivedEventHandler == null)
{
- _eventReceivedEventCallback = OnEventReceived;
- EventReceivedSignal().Connect(_eventReceivedEventCallback);
+ eventReceivedEventCallback = OnEventReceived;
+ EventReceivedSignal().Connect(eventReceivedEventCallback);
}
- _eventReceivedEventHandler += value;
+ eventReceivedEventHandler += value;
}
remove
{
- _eventReceivedEventHandler -= value;
+ eventReceivedEventHandler -= value;
- if (_eventReceivedEventHandler == null && _eventReceivedEventCallback != null)
+ if (eventReceivedEventHandler == null && eventReceivedEventCallback != null)
{
- EventReceivedSignal().Disconnect(_eventReceivedEventCallback);
+ EventReceivedSignal().Disconnect(eventReceivedEventCallback);
}
}
}
{
add
{
- if (_statusChangedEventHandler == null)
+ if (statusChangedEventHandler == null)
{
- _statusChangedEventCallback = OnStatusChanged;
- StatusChangedSignal().Connect(_statusChangedEventCallback);
+ statusChangedEventCallback = OnStatusChanged;
+ StatusChangedSignal().Connect(statusChangedEventCallback);
}
- _statusChangedEventHandler += value;
+ statusChangedEventHandler += value;
}
remove
{
- _statusChangedEventHandler -= value;
+ statusChangedEventHandler -= value;
- if (_statusChangedEventHandler == null && _statusChangedEventCallback != null)
+ if (statusChangedEventHandler == null && statusChangedEventCallback != null)
{
- StatusChangedSignal().Disconnect(_statusChangedEventCallback);
+ StatusChangedSignal().Disconnect(statusChangedEventCallback);
}
}
}
{
add
{
- if (_resizedEventHandler == null)
+ if (resizedEventHandler == null)
{
- _resizedEventCallback = OnResized;
- ResizedSignal().Connect(_resizedEventCallback);
+ resizedEventCallback = OnResized;
+ ResizedSignal().Connect(resizedEventCallback);
}
- _resizedEventHandler += value;
+ resizedEventHandler += value;
}
remove
{
- _resizedEventHandler -= value;
+ resizedEventHandler -= value;
- if (_resizedEventHandler == null && _resizedEventCallback != null)
+ if (resizedEventHandler == null && resizedEventCallback != null)
{
- ResizedSignal().Disconnect(_resizedEventCallback);
+ ResizedSignal().Disconnect(resizedEventCallback);
}
}
}
{
add
{
- if (_languageChangedEventHandler == null)
+ if (languageChangedEventHandler == null)
{
- _languageChangedEventCallback = OnLanguageChanged;
- LanguageChangedSignal().Connect(_languageChangedEventCallback);
+ languageChangedEventCallback = OnLanguageChanged;
+ LanguageChangedSignal().Connect(languageChangedEventCallback);
}
- _languageChangedEventHandler += value;
+ languageChangedEventHandler += value;
}
remove
{
- _languageChangedEventHandler -= value;
+ languageChangedEventHandler -= value;
- if (_languageChangedEventHandler == null && _languageChangedEventCallback != null)
+ if (languageChangedEventHandler == null && languageChangedEventCallback != null)
{
- LanguageChangedSignal().Disconnect(_languageChangedEventCallback);
+ LanguageChangedSignal().Disconnect(languageChangedEventCallback);
}
}
}
{
add
{
- if (_keyboardTypeChangedEventHandler == null)
+ if (keyboardTypeChangedEventHandler == null)
{
- _keyboardTypeChangedEventCallback = OnKeyboardTypeChanged;
- KeyboardTypeChangedSignal().Connect(_keyboardTypeChangedEventCallback);
+ keyboardTypeChangedEventCallback = OnKeyboardTypeChanged;
+ KeyboardTypeChangedSignal().Connect(keyboardTypeChangedEventCallback);
}
- _keyboardTypeChangedEventHandler += value;
+ keyboardTypeChangedEventHandler += value;
}
remove
{
- _keyboardTypeChangedEventHandler -= value;
+ keyboardTypeChangedEventHandler -= value;
- if (_keyboardTypeChangedEventHandler == null && _keyboardTypeChangedEventCallback != null)
+ if (keyboardTypeChangedEventHandler == null && keyboardTypeChangedEventCallback != null)
{
- KeyboardTypeChangedSignal().Disconnect(_keyboardTypeChangedEventCallback);
+ KeyboardTypeChangedSignal().Disconnect(keyboardTypeChangedEventCallback);
}
}
}
{
add
{
- if (_contentReceivedEventHandler == null)
+ if (contentReceivedEventHandler == null)
{
- _contentReceivedEventCallback = OnContentReceived;
- ContentReceivedSignal().Connect(_contentReceivedEventCallback);
+ contentReceivedEventCallback = OnContentReceived;
+ ContentReceivedSignal().Connect(contentReceivedEventCallback);
}
- _contentReceivedEventHandler += value;
+ contentReceivedEventHandler += value;
}
remove
{
- _contentReceivedEventHandler -= value;
+ contentReceivedEventHandler -= value;
- if (_contentReceivedEventHandler == null && _contentReceivedEventCallback != null)
+ if (contentReceivedEventHandler == null && contentReceivedEventCallback != null)
{
- ContentReceivedSignal().Disconnect(_contentReceivedEventCallback);
+ ContentReceivedSignal().Disconnect(contentReceivedEventCallback);
}
}
}
//You should not access any managed member here except static instance
//because the execution order of Finalizes is non-deterministic.
- if (_keyboardTypeChangedEventCallback != null)
+ if (keyboardTypeChangedEventCallback != null)
{
- KeyboardTypeChangedSignal().Disconnect(_keyboardTypeChangedEventCallback);
+ KeyboardTypeChangedSignal().Disconnect(keyboardTypeChangedEventCallback);
}
base.Dispose(type);
e.InputMethodContext = Registry.GetManagedBaseHandleFromNativePtr(data) as InputMethodContext;
}
- if (_activatedEventHandler != null)
+ if (activatedEventHandler != null)
{
- _activatedEventHandler(this, e);
+ activatedEventHandler(this, e);
}
}
e.EventData = EventData.GetEventDataFromPtr(eventData);
}
- if (_eventReceivedEventHandler != null)
+ if (eventReceivedEventHandler != null)
{
- callbackData = _eventReceivedEventHandler(this, e);
+ callbackData = eventReceivedEventHandler(this, e);
}
if (callbackData != null)
{
e.StatusChanged = statusChanged;
- if (_statusChangedEventHandler != null)
+ if (statusChangedEventHandler != null)
{
- _statusChangedEventHandler(this, e);
+ statusChangedEventHandler(this, e);
}
}
ResizedEventArgs e = new ResizedEventArgs();
e.Resized = resized;
- if (_resizedEventHandler != null)
+ if (resizedEventHandler != null)
{
- _resizedEventHandler(this, e);
+ resizedEventHandler(this, e);
}
}
LanguageChangedEventArgs e = new LanguageChangedEventArgs();
e.LanguageChanged = languageChanged;
- if (_languageChangedEventHandler != null)
+ if (languageChangedEventHandler != null)
{
- _languageChangedEventHandler(this, e);
+ languageChangedEventHandler(this, e);
}
}
e.KeyboardType = type;
- if (_keyboardTypeChangedEventHandler != null)
+ if (keyboardTypeChangedEventHandler != null)
{
- _keyboardTypeChangedEventHandler(this, e);
+ keyboardTypeChangedEventHandler(this, e);
}
}
e.Description = description;
e.MimeType = mimeType;
- if (_contentReceivedEventHandler != null)
+ if (contentReceivedEventHandler != null)
{
- _contentReceivedEventHandler(this, e);
+ contentReceivedEventHandler(this, e);
}
}
/*
- * Copyright(c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
namespace Tizen.NUI
{
-
/// <summary>
/// The key structure is used to store a key press.
/// </summary>
/// <since_tizen> 3 </since_tizen>
public class Key : BaseHandle
{
-
/// <summary>
/// The default constructor.
/// </summary>
/*
- * Copyright(c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
[SuppressMessage("Microsoft.Design", "CA1051:Do not declare visible instance fields")]
public PropertyValue TrueValue = null;
- private string _key = null;
- private object _originalValue = null;
- private object _originalKey = null;
+ private string key = null;
+ private object originalValue = null;
+ private object originalKey = null;
/// <summary>
/// Default Constructor.
{
get
{
- return _key;
+ return key;
}
set
{
- _key = value;
+ key = value;
ParseKey(value);
}
}
{
get
{
- return _originalKey;
+ return originalKey;
}
set
{
throw new ArgumentNullException(nameof(value));
}
- _originalKey = value;
+ originalKey = value;
if (value is int || value is Int32)
{
KeyInt = (int)value;
{
get
{
- return _originalValue;
+ return originalValue;
}
set
{
- _originalValue = value;
+ originalValue = value;
TrueValue = PropertyValue.CreateFromObject(value);
}
}
}
}
-
[EditorBrowsable(EditorBrowsableState.Never)]
protected virtual void Dispose(bool disposing)
{
-/* Copyright (c) 2020 Samsung Electronics Co., Ltd.
+/* Copyright (c) 2021 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* limitations under the License.
*
*/
-using Tizen.NUI.BaseComponents;
namespace Tizen.NUI
{
}
}
}
-
} // namespace
/*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
using System;
using System.Collections.Generic;
using System.ComponentModel;
-using System.Diagnostics;
-using Tizen.NUI.BaseComponents;
using System.Linq;
+
+using Tizen.NUI.BaseComponents;
using Tizen.NUI.Binding.Internals;
using static Tizen.NUI.Binding.BindableObject;
internal static Binding.BindableProperty.ValidateValueDelegate ValidateEnum(int enumMin, int enumMax)
{
-
return (Binding.BindableObject bindable, object value) =>
{
int @enum = (int)value;
/// </summary>
public class LayoutItem : IDisposable
{
- private bool disposed = false;
static bool LayoutDebugFrameData = false; // Debug flag
- private MeasureSpecification OldWidthMeasureSpec; // Store measure specification to compare against later
- private MeasureSpecification OldHeightMeasureSpec; // Store measure specification to compare against later
- private LayoutFlags Flags = LayoutFlags.None;
+ private bool disposed = false;
+ private MeasureSpecification oldWidthMeasureSpec; // Store measure specification to compare against later
+ private MeasureSpecification oldHeightMeasureSpec; // Store measure specification to compare against later
+
+ private LayoutFlags flags = LayoutFlags.None;
- private ILayoutParent Parent;
+ private ILayoutParent parent;
- LayoutData _layoutPositionData;
+ LayoutData layoutPositionData;
- private Extents _padding;
- private Extents _margin;
+ private Extents padding;
+ private Extents margin;
private bool parentReplacement = false;
private bool setPositionByLayout = true;
{
get
{
- return _margin;
+ return margin;
}
set
{
- _margin = value;
+ margin = value;
RequestLayout();
}
}
{
get
{
- return _padding;
+ return padding;
}
set
{
- _padding = value;
+ padding = value;
RequestLayout();
}
}
/// <param name="parent">Parent to set on this Layout.</param>
internal void SetParent(ILayoutParent parent)
{
- Parent = parent as LayoutGroup;
+ this.parent = parent as LayoutGroup;
}
/// <summary>
OnUnparent();
// Remove myself from parent
- Parent?.Remove(this);
+ parent?.Remove(this);
// Remove parent reference
- Parent = null;
+ parent = null;
// Lastly, clear layout from owning View.
Owner?.ResetLayout();
private void Initialize()
{
LayoutWithTransition = false;
- _layoutPositionData = new LayoutData(this, TransitionCondition.Unspecified, 0, 0, 0, 0);
- _padding = new Extents(0, 0, 0, 0);
- _margin = new Extents(0, 0, 0, 0);
+ layoutPositionData = new LayoutData(this, TransitionCondition.Unspecified, 0, 0, 0, 0);
+ padding = new Extents(0, 0, 0, 0);
+ margin = new Extents(0, 0, 0, 0);
}
/// <summary>
public void Measure(MeasureSpecification widthMeasureSpec, MeasureSpecification heightMeasureSpec)
{
// Check if relayouting is required.
- bool specChanged = (widthMeasureSpec.Size != OldWidthMeasureSpec.Size) ||
- (heightMeasureSpec.Size != OldHeightMeasureSpec.Size) ||
- (widthMeasureSpec.Mode != OldWidthMeasureSpec.Mode) ||
- (heightMeasureSpec.Mode != OldHeightMeasureSpec.Mode);
+ bool specChanged = (widthMeasureSpec.Size != oldWidthMeasureSpec.Size) ||
+ (heightMeasureSpec.Size != oldHeightMeasureSpec.Size) ||
+ (widthMeasureSpec.Mode != oldWidthMeasureSpec.Mode) ||
+ (heightMeasureSpec.Mode != oldHeightMeasureSpec.Mode);
bool isSpecExactly = (widthMeasureSpec.Mode == MeasureSpecification.ModeType.Exactly) &&
(heightMeasureSpec.Mode == MeasureSpecification.ModeType.Exactly);
(MeasuredHeight.Size == heightMeasureSpec.Size);
bool needsLayout = specChanged && (!isSpecExactly || !matchesSpecSize);
- needsLayout = needsLayout || ((Flags & LayoutFlags.ForceLayout) == LayoutFlags.ForceLayout);
+ needsLayout = needsLayout || ((flags & LayoutFlags.ForceLayout) == LayoutFlags.ForceLayout);
if (needsLayout)
{
OnMeasure(widthMeasureSpec, heightMeasureSpec);
OnMeasureIndependentChildren(widthMeasureSpec, heightMeasureSpec);
- Flags = Flags | LayoutFlags.LayoutRequired;
- Flags &= ~LayoutFlags.ForceLayout;
+ flags = flags | LayoutFlags.LayoutRequired;
+ flags &= ~LayoutFlags.ForceLayout;
}
- OldWidthMeasureSpec = widthMeasureSpec;
- OldHeightMeasureSpec = heightMeasureSpec;
+ oldWidthMeasureSpec = widthMeasureSpec;
+ oldHeightMeasureSpec = heightMeasureSpec;
}
/// <summary>
bottom.AsRoundedValue(), independent);
// Check if Measure needed before Layouting
- if (changed || ((Flags & LayoutFlags.LayoutRequired) == LayoutFlags.LayoutRequired))
+ if (changed || ((flags & LayoutFlags.LayoutRequired) == LayoutFlags.LayoutRequired))
{
OnLayout(changed, left, top, right, bottom);
OnLayoutIndependentChildren(changed, left, top, right, bottom);
// Clear flag
- Flags &= ~LayoutFlags.LayoutRequired;
+ flags &= ~LayoutFlags.LayoutRequired;
}
}
/// <since_tizen> 6 </since_tizen>
public ILayoutParent GetParent()
{
- return Parent;
+ return parent;
}
/// <summary>
/// <since_tizen> 6 </since_tizen>
public void RequestLayout()
{
- Flags = Flags | LayoutFlags.ForceLayout;
- if (Parent != null)
+ flags = flags | LayoutFlags.ForceLayout;
+ if (parent != null)
{
- LayoutGroup layoutGroup = Parent as LayoutGroup;
+ LayoutGroup layoutGroup = parent as LayoutGroup;
if (layoutGroup != null && !layoutGroup.LayoutRequested)
{
layoutGroup.RequestLayout();
{
get
{
- return (Flags & LayoutFlags.ForceLayout) == LayoutFlags.ForceLayout;
+ return (flags & LayoutFlags.ForceLayout) == LayoutFlags.ForceLayout;
}
}
{
MeasuredWidth = measuredWidth;
MeasuredHeight = measuredHeight;
- Flags = Flags | LayoutFlags.MeasuredDimensionSet;
+ flags = flags | LayoutFlags.MeasuredDimensionSet;
}
/// <summary>
{
bool changed = false;
- if (_layoutPositionData.Left != left ||
- _layoutPositionData.Right != right ||
- _layoutPositionData.Top != top ||
- _layoutPositionData.Bottom != bottom)
+ if (layoutPositionData.Left != left ||
+ layoutPositionData.Right != right ||
+ layoutPositionData.Top != top ||
+ layoutPositionData.Bottom != bottom)
{
changed = true;
- float oldWidth = _layoutPositionData.Right - _layoutPositionData.Left;
- float oldHeight = _layoutPositionData.Bottom - _layoutPositionData.Top;
+ float oldWidth = layoutPositionData.Right - layoutPositionData.Left;
+ float oldHeight = layoutPositionData.Bottom - layoutPositionData.Top;
float newWidth = right - left;
float newHeight = bottom - top;
bool sizeChanged = (newWidth != oldWidth) || (newHeight != oldHeight);
}
// Store new layout position data
- _layoutPositionData = new LayoutData(this, ConditionForAnimation, left, top, right, bottom);
+ layoutPositionData = new LayoutData(this, ConditionForAnimation, left, top, right, bottom);
- Debug.WriteLineIf(LayoutDebugFrameData, "LayoutItem FramePositionData View:" + _layoutPositionData.Item.Owner.Name +
- " left:" + _layoutPositionData.Left +
- " top:" + _layoutPositionData.Top +
- " right:" + _layoutPositionData.Right +
- " bottom:" + _layoutPositionData.Bottom);
+ Debug.WriteLineIf(LayoutDebugFrameData, "LayoutItem FramePositionData View:" + layoutPositionData.Item.Owner.Name +
+ " left:" + layoutPositionData.Left +
+ " top:" + layoutPositionData.Top +
+ " right:" + layoutPositionData.Right +
+ " bottom:" + layoutPositionData.Bottom);
View ownerView = Owner.GetParent() as View;
if (ownerView != null && ownerView.Layout != null && ownerView.Layout.LayoutWithTransition)
{
- NUIApplication.GetDefaultWindow().LayoutController.AddTransitionDataEntry(_layoutPositionData);
+ NUIApplication.GetDefaultWindow().LayoutController.AddTransitionDataEntry(layoutPositionData);
}
else
{
if (disposing)
{
- _margin?.Dispose();
- _padding?.Dispose();
+ margin?.Dispose();
+ padding?.Dispose();
}
disposed = true;
}
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*/
using System;
-using System.ComponentModel;
-using Tizen.NUI.BaseComponents;
namespace Tizen.NUI
{
/// </summary>
public struct LayoutLength : IEquatable<LayoutLength>
{
- private float _value;
+ private float value;
/// <summary>
/// [Draft] Constructor from an int
/// <since_tizen> 6 </since_tizen>
public LayoutLength(int value)
{
- _value = value;
+ this.value = value;
}
/// <summary>
/// <since_tizen> 6 </since_tizen>
public LayoutLength(float value)
{
- _value = value;
+ this.value = value;
}
/// <summary>
/// <since_tizen> 6 </since_tizen>
public LayoutLength(LayoutLength layoutLength)
{
- _value = layoutLength._value;
+ value = layoutLength.value;
}
/// <summary>
/// <since_tizen> 6 </since_tizen>
public float AsRoundedValue()
{
- return (float)Math.Round((decimal)_value, MidpointRounding.AwayFromZero);
+ return (float)Math.Round((decimal)value, MidpointRounding.AwayFromZero);
}
/// <summary>
/// <since_tizen> 6 </since_tizen>
public float AsDecimal()
{
- return _value;
+ return value;
}
/// <summary>
/// <since_tizen> 6 </since_tizen>
public bool Equals(LayoutLength layoutLength)
{
- return (Math.Abs(_value - layoutLength._value) <= float.Epsilon);
+ return (Math.Abs(value - layoutLength.value) <= float.Epsilon);
}
/// <summary>
/// <since_tizen> 6 </since_tizen>
public override int GetHashCode()
{
- return (int)Math.Ceiling(_value);
+ return (int)Math.Ceiling(value);
}
/// <summary>
/// <since_tizen> 6 </since_tizen>
public static LayoutLength operator +(LayoutLength arg1, LayoutLength arg2)
{
- return new LayoutLength(arg1._value + arg2._value);
+ return new LayoutLength(arg1.value + arg2.value);
}
/// <summary>
/// <since_tizen> 6 </since_tizen>
public static LayoutLength operator +(LayoutLength arg1, int arg2)
{
- return new LayoutLength(arg1._value + (float)arg2);
+ return new LayoutLength(arg1.value + (float)arg2);
}
/// <summary>
/// <since_tizen> 6 </since_tizen>
public static LayoutLength operator -(LayoutLength arg1, LayoutLength arg2)
{
- return new LayoutLength(arg1._value - arg2._value);
+ return new LayoutLength(arg1.value - arg2.value);
}
/// <summary>
/// <since_tizen> 6 </since_tizen>
public static LayoutLength operator -(LayoutLength arg1, int arg2)
{
- return new LayoutLength(arg1._value - (float)arg2);
+ return new LayoutLength(arg1.value - (float)arg2);
}
/// <summary>
/// <since_tizen> 6 </since_tizen>
public static LayoutLength operator *(LayoutLength arg1, LayoutLength arg2)
{
- return new LayoutLength(arg1._value * arg2._value);
+ return new LayoutLength(arg1.value * arg2.value);
}
/// <summary>
/// <since_tizen> 6 </since_tizen>
public static LayoutLength operator *(LayoutLength arg1, int arg2)
{
- return new LayoutLength(arg1._value * arg2);
+ return new LayoutLength(arg1.value * arg2);
}
/// <summary>
/// <since_tizen> 6 </since_tizen>
public static LayoutLength operator /(LayoutLength arg1, LayoutLength arg2)
{
- return new LayoutLength(arg1._value / arg2._value);
+ return new LayoutLength(arg1.value / arg2.value);
}
/// <summary>
/// <since_tizen> 6 </since_tizen>
public static LayoutLength operator /(LayoutLength arg1, int arg2)
{
- return new LayoutLength(arg1._value / (float)arg2);
+ return new LayoutLength(arg1.value / (float)arg2);
}
}
}
/// Target value to animate to.
/// </summary>
/// <since_tizen> 6 </since_tizen>
-
public object TargetValue { get; set; }
}
/// </summary>
/// <param name="sourceTransitionList">The source transition list.</param>
/// <param name="targetTransitionList">The target transition list to copy to.</param>
- static public void CopyTransitions(TransitionList sourceTransitionList,
- TransitionList targetTransitionList)
+ static public void CopyTransitions(TransitionList sourceTransitionList, TransitionList targetTransitionList)
{
targetTransitionList.Clear();
foreach (LayoutTransition transitionToApply in sourceTransitionList)
// Overwite existing transitions
targetTransitionList.Add(transitionToApply);
}
-
}
}
-
} // namespace Tizen.NUI
{
get
{
- return _linearOrientation;
+ return linearOrientation;
}
set
{
- _linearOrientation = value;
+ linearOrientation = value;
RequestLayout();
}
}
{
get
{
- return _cellPadding;
+ return cellPadding;
}
set
{
- _cellPadding = value;
+ cellPadding = value;
RequestLayout();
}
}
/// <since_tizen> 6 </since_tizen>
public LinearLayout.Alignment LinearAlignment { get; set; } = Alignment.Top;
- private float _totalLength = 0.0f;
- private Size2D _cellPadding = new Size2D(0, 0);
- private Orientation _linearOrientation = Orientation.Horizontal;
+ private float totalLength = 0.0f;
+ private Size2D cellPadding = new Size2D(0, 0);
+ private Orientation linearOrientation = Orientation.Horizontal;
/// <summary>
/// [Draft] Constructor
/// <since_tizen> 6 </since_tizen>
protected override void OnMeasure(MeasureSpecification widthMeasureSpec, MeasureSpecification heightMeasureSpec)
{
- if (_linearOrientation == Orientation.Horizontal)
+ if (linearOrientation == Orientation.Horizontal)
{
MeasureHorizontal(widthMeasureSpec, heightMeasureSpec);
}
/// <since_tizen> 6 </since_tizen>
protected override void OnLayout(bool changed, LayoutLength left, LayoutLength top, LayoutLength right, LayoutLength bottom)
{
- if (_linearOrientation == Orientation.Horizontal)
+ if (linearOrientation == Orientation.Horizontal)
{
LayoutHorizontal(left, top, right, bottom);
}
int childrenCount = IterateLayoutChildren().Count();
// Reset measure variables
- _totalLength = 0.0f;
+ totalLength = 0.0f;
float usedExcessSpace = 0.0f;
HeightAndWidthState childState = new HeightAndWidthState(MeasuredSize.StateType.MeasuredSizeOK,
MeasuredSize.StateType.MeasuredSizeOK);
if (isExactly && useExcessSpace)
{
// Children to be laid out with excess space can be measured later
- _totalLength = Math.Max(_totalLength, (_totalLength + childMargin.Start + childMargin.End));
+ totalLength = Math.Max(totalLength, (totalLength + childMargin.Start + childMargin.End));
}
else
{
LayoutLength childWidth = childLayout.MeasuredWidth.Size;
LayoutLength length = childWidth + childMargin.Start + childMargin.End;
- _totalLength = Math.Max(_totalLength, _totalLength + length.AsDecimal());
+ totalLength = Math.Max(totalLength, totalLength + length.AsDecimal());
}
bool matchHeightLocally = false;
}
} // foreach
- _totalLength = Math.Max(_totalLength, _totalLength + CellPadding.Width * (childrenCount - 1));
- float widthSize = _totalLength;
+ totalLength = Math.Max(totalLength, totalLength + CellPadding.Width * (childrenCount - 1));
+ float widthSize = totalLength;
widthSize = Math.Max(widthSize, SuggestedMinimumWidth.AsDecimal());
MeasuredSize widthSizeAndState = ResolveSizeAndState(new LayoutLength(widthSize + Padding.Start + Padding.End), widthMeasureSpec, MeasuredSize.StateType.MeasuredSizeOK);
widthSize = widthSizeAndState.Size.AsDecimal();
// We cycle through weighted children now (children with weight > 0).
// The children are measured with exact size equal to their share of the available space based on their weights.
// _totalLength is updated to include weighted children measured sizes.
- float remainingExcess = widthSize - _totalLength + usedExcessSpace - (Padding.Start + Padding.End);
+ float remainingExcess = widthSize - totalLength + usedExcessSpace - (Padding.Start + Padding.End);
if (remainingExcess != 0 && totalWeight > 0)
{
float remainingWeight = totalWeight;
maxHeight = 0;
- _totalLength = 0;
+ totalLength = 0;
foreach (LayoutItem childLayout in IterateLayoutChildren())
{
}
float length = childLayout.MeasuredWidth.Size.AsDecimal() + childMargin.Start + childMargin.End;
- _totalLength += length;
+ totalLength += length;
bool matchHeightLocally = (heightMode != MeasureSpecification.ModeType.Exactly) && (desiredChildHeight == LayoutParamPolicies.MatchParent);
float marginHeight = childMargin.Top + childMargin.Bottom;
alternativeMaxHeight = Math.Max(alternativeMaxHeight, matchHeightLocally ? marginHeight : childHeight);
allFillParent = (allFillParent && desiredChildHeight == LayoutParamPolicies.MatchParent);
} // for loop
- _totalLength = Math.Max(_totalLength, _totalLength + CellPadding.Width * (childrenCount - 1));
+ totalLength = Math.Max(totalLength, totalLength + CellPadding.Width * (childrenCount - 1));
}
else
{
int childrenCount = IterateLayoutChildren().Count();
// Reset total length
- _totalLength = 0.0f;
+ totalLength = 0.0f;
float usedExcessSpace = 0.0f;
HeightAndWidthState childState = new HeightAndWidthState(MeasuredSize.StateType.MeasuredSizeOK,
MeasuredSize.StateType.MeasuredSizeOK);
bool useExcessSpace = (childLayout.Owner.HeightSpecification == 0) && (childWeight > 0);
if (isExactly && useExcessSpace)
{
- _totalLength = Math.Max(_totalLength, (_totalLength + childMargin.Top + childMargin.Bottom));
+ totalLength = Math.Max(totalLength, (totalLength + childMargin.Top + childMargin.Bottom));
}
else
{
LayoutLength childHeight = childLayout.MeasuredHeight.Size;
LayoutLength length = childHeight + childMargin.Top + childMargin.Bottom;
- _totalLength = Math.Max(_totalLength, _totalLength + length.AsDecimal());
+ totalLength = Math.Max(totalLength, totalLength + length.AsDecimal());
}
bool matchWidthLocally = false;
}
} // foreach
- _totalLength = Math.Max(_totalLength, _totalLength + CellPadding.Height * (childrenCount - 1));
- float heightSize = _totalLength;
+ totalLength = Math.Max(totalLength, totalLength + CellPadding.Height * (childrenCount - 1));
+ float heightSize = totalLength;
heightSize = Math.Max(heightSize, SuggestedMinimumHeight.AsDecimal());
MeasuredSize heightSizeAndState = ResolveSizeAndState(new LayoutLength(heightSize + Padding.Top + Padding.Bottom), heightMeasureSpec, MeasuredSize.StateType.MeasuredSizeOK);
heightSize = heightSizeAndState.Size.AsDecimal();
// We cycle through weighted children now (children with weight > 0).
// The children are measured with exact size equal to their share of the available space based on their weights.
// _totalLength is updated to include weighted children measured sizes.
- float remainingExcess = heightSize - _totalLength + usedExcessSpace - (Padding.Top + Padding.Bottom);
+ float remainingExcess = heightSize - totalLength + usedExcessSpace - (Padding.Top + Padding.Bottom);
if (remainingExcess != 0 && totalWeight > 0.0f)
{
float remainingWeight = totalWeight;
maxWidth = 0;
- _totalLength = 0;
+ totalLength = 0;
foreach (LayoutItem childLayout in IterateLayoutChildren())
{
}
float length = childLayout.MeasuredHeight.Size.AsDecimal() + childMargin.Top + childMargin.Bottom;
- _totalLength += length;
+ totalLength += length;
bool matchWidthLocally = (widthMode != MeasureSpecification.ModeType.Exactly) && (desiredChildWidth == LayoutParamPolicies.MatchParent);
float marginWidth = childMargin.Start + childMargin.End;
alternativeMaxWidth = Math.Max(alternativeMaxWidth, matchWidthLocally ? marginWidth : childWidth);
allFillParent = (allFillParent && desiredChildWidth == LayoutParamPolicies.MatchParent);
} // for loop
- _totalLength = Math.Max(_totalLength, _totalLength + CellPadding.Height * (childrenCount - 1));
+ totalLength = Math.Max(totalLength, totalLength + CellPadding.Height * (childrenCount - 1));
}
else
{
}
else
{
- childLeft = new LayoutLength(Padding.Start + right.AsDecimal() - left.AsDecimal() - _totalLength);
+ childLeft = new LayoutLength(Padding.Start + right.AsDecimal() - left.AsDecimal() - totalLength);
}
break;
case Alignment.CenterHorizontal: // FALL THROUGH
case Alignment.Center:
// totalLength contains the padding already
- childLeft = new LayoutLength(Padding.Start + (right.AsDecimal() - left.AsDecimal() - _totalLength) / 2.0f);
+ childLeft = new LayoutLength(Padding.Start + (right.AsDecimal() - left.AsDecimal() - totalLength) / 2.0f);
break;
case Alignment.Begin: // FALL THROUGH (default)
default:
// In case of RTL map BEGIN alignment to the right edge
if (isLayoutRtl)
{
- childLeft = new LayoutLength(Padding.Start + right.AsDecimal() - left.AsDecimal() - _totalLength);
+ childLeft = new LayoutLength(Padding.Start + right.AsDecimal() - left.AsDecimal() - totalLength);
}
else
{
{
case Alignment.Bottom:
// totalLength contains the padding already
- childTop = new LayoutLength(Padding.Top + bottom.AsDecimal() - top.AsDecimal() - _totalLength);
+ childTop = new LayoutLength(Padding.Top + bottom.AsDecimal() - top.AsDecimal() - totalLength);
break;
case Alignment.CenterVertical: // FALL THROUGH
case Alignment.Center:
// totalLength contains the padding already
- childTop = new LayoutLength(Padding.Top + (bottom.AsDecimal() - top.AsDecimal() - _totalLength) / 2.0f);
+ childTop = new LayoutLength(Padding.Top + (bottom.AsDecimal() - top.AsDecimal() - totalLength) / 2.0f);
break;
case Alignment.Top: // FALL THROUGH (default)
default:
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
using System;
using System.ComponentModel;
using System.Diagnostics.CodeAnalysis;
-using Tizen.NUI.BaseComponents;
namespace Tizen.NUI
{
/*
- * Copyright(c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
namespace Tizen.NUI
{
- using System;
using System.ComponentModel;
/// <summary>
/*
- * Copyright(c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
/// <since_tizen> 3 </since_tizen>
public class Geometry : BaseHandle
{
-
/// <summary>
/// Create an instance of Geometry.
/// </summary>
public Geometry() : this(Interop.Geometry.New(), true)
{
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-
}
internal Geometry(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
/*
- * Copyright(c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
/// <since_tizen> 3 </since_tizen>
public class Renderer : Animatable
{
-
/// <summary>
/// Create an instance of Renderer.
/// </summary>
/*
- * Copyright(c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*
*/
using System;
-using System.Diagnostics.CodeAnalysis;
using System.ComponentModel;
namespace Tizen.NUI
/*
- * Copyright(c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
/// <since_tizen> 3 </since_tizen>
TEXTURE_CUBE
}
-
}
+/*
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
using System;
using System.ComponentModel;
using System.Collections.Generic;
-using System.ComponentModel;
+/*
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+using System.ComponentModel;
namespace Tizen.NUI.Binding
{
+/*
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
using System;
using System.ComponentModel;
using System.Collections.Generic;
+/*
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
using System;
using System.Collections.Generic;
using System.ComponentModel;
-using Tizen.NUI.Binding.Internals;
namespace Tizen.NUI.Binding
{
[EditorBrowsable(EditorBrowsableState.Never)]
public class ElementTemplate : IElement, IDataTemplate
{
- List<Action<object, ResourcesChangedEventArgs>> _changeHandlers;
- Element _parent;
- bool _canRecycle; // aka IsDeclarative
+ List<Action<object, ResourcesChangedEventArgs>> changeHandlers;
+ Element parent;
+ bool canRecycle; // aka IsDeclarative
internal ElementTemplate()
{
if (type == null)
throw new ArgumentNullException(nameof(type));
- _canRecycle = true;
+ canRecycle = true;
LoadTemplate = () => Activator.CreateInstance(type);
}
void IElement.AddResourcesChangedListener(Action<object, ResourcesChangedEventArgs> onchanged)
{
- _changeHandlers = _changeHandlers ?? new List<Action<object, ResourcesChangedEventArgs>>(1);
- _changeHandlers.Add(onchanged);
+ changeHandlers = changeHandlers ?? new List<Action<object, ResourcesChangedEventArgs>>(1);
+ changeHandlers.Add(onchanged);
}
- internal bool CanRecycle => _canRecycle;
+ internal bool CanRecycle => canRecycle;
Element IElement.Parent
{
- get { return _parent; }
+ get { return parent; }
set
{
- if (_parent == value)
+ if (parent == value)
return;
- if (_parent != null)
- ((IElement)_parent).RemoveResourcesChangedListener(OnResourcesChanged);
- _parent = value;
- if (_parent != null)
- ((IElement)_parent).AddResourcesChangedListener(OnResourcesChanged);
+ if (parent != null)
+ ((IElement)parent).RemoveResourcesChangedListener(OnResourcesChanged);
+ parent = value;
+ if (parent != null)
+ ((IElement)parent).AddResourcesChangedListener(OnResourcesChanged);
}
}
void IElement.RemoveResourcesChangedListener(Action<object, ResourcesChangedEventArgs> onchanged)
{
- if (_changeHandlers == null)
+ if (changeHandlers == null)
return;
- _changeHandlers.Remove(onchanged);
+ changeHandlers.Remove(onchanged);
}
/// <summary>
void OnResourcesChanged(object sender, ResourcesChangedEventArgs e)
{
- if (_changeHandlers == null)
+ if (changeHandlers == null)
return;
- foreach (Action<object, ResourcesChangedEventArgs> handler in _changeHandlers)
+ foreach (Action<object, ResourcesChangedEventArgs> handler in changeHandlers)
handler(this, e);
}
}
+/*
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
using System;
using System.ComponentModel;
/*
- * Copyright(c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* limitations under the License.
*
*/
+
using System;
using System.Collections.Generic;
using System.ComponentModel;
-using Tizen.NUI;
using Tizen.NUI.BaseComponents;
-using Tizen.NUI.Binding;
namespace Tizen.NUI
{
/*
- * Copyright(c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
[EditorBrowsable(EditorBrowsableState.Never)]
public class CubeTransitionEffect : View
{
- private EventHandler<TransitionCompletedEventArgs> _transitionCompletedEventHandler;
+ private EventHandler<TransitionCompletedEventArgs> transitionCompletedEventHandler;
private TransitionCompletedCallbackDelegate _transitionCompletedCallbackDelegate;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
{
add
{
- if (_transitionCompletedEventHandler == null)
+ if (transitionCompletedEventHandler == null)
{
_transitionCompletedCallbackDelegate = (OnTransitionCompleted);
TransitionCompletedSignal().Connect(_transitionCompletedCallbackDelegate);
}
- _transitionCompletedEventHandler += value;
+ transitionCompletedEventHandler += value;
}
remove
{
- _transitionCompletedEventHandler -= value;
- if (_transitionCompletedEventHandler == null && TransitionCompletedSignal().Empty() == false)
+ transitionCompletedEventHandler -= value;
+ if (transitionCompletedEventHandler == null && TransitionCompletedSignal().Empty() == false)
{
TransitionCompletedSignal().Disconnect(_transitionCompletedCallbackDelegate);
}
// Populate all members of "e" (TransitionCompletedEventArgs) with real data
//e.CubeTransitionEffect = Registry.GetManagedBaseHandleFromNativePtr(cubeTransition) as CubeTransitionEffect;
- if (_transitionCompletedEventHandler != null)
+ if (transitionCompletedEventHandler != null)
{
//here we send all data to user event handlers
- _transitionCompletedEventHandler(this, e);
+ transitionCompletedEventHandler(this, e);
}
}
[EditorBrowsable(EditorBrowsableState.Never)]
public class TransitionCompletedEventArgs : EventArgs
{
- private CubeTransitionEffect _cubeTransitionEffect;
- private Texture _cubeTransitonTexture;
+ private CubeTransitionEffect cubeTransitionEffect;
+ private Texture cubeTransitonTexture;
/// <summary>
/// CubeTransitionEffect.
{
get
{
- return _cubeTransitionEffect;
+ return cubeTransitionEffect;
}
set
{
- _cubeTransitionEffect = value;
+ cubeTransitionEffect = value;
}
}
{
get
{
- return _cubeTransitonTexture;
+ return cubeTransitonTexture;
}
set
{
- _cubeTransitonTexture = value;
+ cubeTransitonTexture = value;
}
}
}
/*
- * Copyright(c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
/// <since_tizen> 5 </since_tizen>
public class FontClient : BaseHandle
{
-
private static readonly FontClient instance = FontClient.Get();
internal FontClient(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
internal class GlyphBufferData : Disposable
{
-
public GlyphBufferData() : this(Interop.FontClient.NewFontClientGlyphBufferData(), true)
{
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
/*
- * Copyright(c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*
*/
-using System;
using System.ComponentModel;
using System.Globalization;
namespace Tizen.NUI
{
-
/// <summary>
/// GraphicsTypeConverter class to convert types.
/// </summary>
/*
- * Copyright(c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
namespace Tizen.NUI
{
-
/// <summary>
/// GraphicsTypeManager class to manage various types.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
public class GraphicsTypeManager
{
+ private volatile static GraphicsTypeManager graphicsTypeManager;
+ private GraphicsTypeConverter typeConverter;
/// <summary>
/// Creates private GraphicsTypeManager object.
/// </summary>
private GraphicsTypeManager()
{
- _typeConverter = new GraphicsTypeConverter();
+ typeConverter = new GraphicsTypeConverter();
}
/// <summary>
{
get
{
- if (_graphicsTypeManager == null)
+ if (graphicsTypeManager == null)
{
- _graphicsTypeManager = new GraphicsTypeManager();
+ graphicsTypeManager = new GraphicsTypeManager();
}
- return _graphicsTypeManager;
+ return graphicsTypeManager;
}
}
[EditorBrowsable(EditorBrowsableState.Never)]
public void SetTypeConverter(GraphicsTypeConverter typeConverter)
{
- _typeConverter = typeConverter;
+ this.typeConverter = typeConverter;
}
/// <summary>
[EditorBrowsable(EditorBrowsableState.Never)]
public float ConvertScriptToPixel(string scriptValue)
{
- return _typeConverter.ConvertScriptToPixel(scriptValue);
+ return typeConverter.ConvertScriptToPixel(scriptValue);
}
/// <summary>
[EditorBrowsable(EditorBrowsableState.Never)]
public virtual float ConvertToPixel(float value)
{
- return _typeConverter.ConvertToPixel(value);
+ return typeConverter.ConvertToPixel(value);
}
/// <summary>
[EditorBrowsable(EditorBrowsableState.Never)]
public virtual float ConvertFromPixel(float value)
{
- return _typeConverter.ConvertFromPixel(value);
+ return typeConverter.ConvertFromPixel(value);
}
internal void RegisterCustomConverterForDynamicResourceBinding(global::System.Type type, Tizen.NUI.Binding.TypeConverter userConverter)
}
//NUILog.Error($"user custom converter ditionary count={Tizen.NUI.Binding.BindableProperty.UserCustomConvertTypes.Count}");
}
-
- private volatile static GraphicsTypeManager _graphicsTypeManager;
- private GraphicsTypeConverter _typeConverter;
}
}
--- /dev/null
+/*
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Modified by Woochan Lee(wc0917.lee@samsung.com)
+ */
+
+using System;
+using System.Drawing;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.ComponentModel;
+using System.Threading.Tasks;
+
+namespace Tizen.NUI
+{
+ /// <summary>
+ /// A helper class to extract prominent colors from an image.
+ ///
+ /// A number of colors with different profiles are extracted from the image:
+ /// Vibrant, Vibrant Dark, Vibrant Light, Muted, Muted Dark, Muted Light
+ ///
+ /// These can be retrieved from the appropriate getter method.
+ ///
+ /// Palette supports both synchronous and asynchronous generation:
+ ///
+ /// Synchronous
+ /// Palette P = Palette.Generate(bitmap);
+ ///
+ /// Asynchronous
+ /// Palette.GenerateAsync(bitmap, (Palette p) => {
+ /// // Use generated instance
+ /// }};
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public sealed class Palette
+ {
+ private const int defaultCalculateNumberColors = 16;
+ private const int calculateBitmapMinDimension = 100;
+ private const float targetDarkLuma = 0.26f;
+ private const float maxDarkLuma = 0.45f;
+ private const float minLightLuma = 0.55f;
+ private const float targetLightLuma = 0.74f;
+ private const float minNormalLuma = 0.3f;
+ private const float targetNormalLuma = 0.5f;
+ private const float maxNormalLuma = 0.7f;
+ private const float targetMutedSaturation = 0.3f;
+ private const float maxMutedSaturation = 0.4f;
+ private const float targetVibrantSaturation = 1f;
+ private const float minVibrantSaturation = 0.35f;
+
+ private int highestPopulation;
+ private Swatch dominantSwatch;
+ private Swatch vibrantSwatch;
+ private Swatch mutedSwatch;
+ private Swatch darkVibrantSwatch;
+ private Swatch darkMutedSwatch;
+ private Swatch lightVibrantSwatch;
+ private Swatch lightMutedColor;
+ private List<Swatch> swatches;
+
+ private Palette() { }
+
+ private Palette(List<Swatch> swatcheList)
+ {
+ swatches = swatcheList;
+ highestPopulation = FindMaxPopulation();
+ vibrantSwatch = FindColor(targetNormalLuma, minNormalLuma, maxNormalLuma,
+ targetVibrantSaturation, minVibrantSaturation, 1f);
+
+ lightVibrantSwatch = FindColor(targetLightLuma, minLightLuma, 1f,
+ targetVibrantSaturation, minVibrantSaturation, 1f);
+
+ darkVibrantSwatch = FindColor(targetDarkLuma, 0f, maxDarkLuma,
+ targetVibrantSaturation, minVibrantSaturation, 1f);
+
+ mutedSwatch = FindColor(targetNormalLuma, minNormalLuma, maxNormalLuma,
+ targetMutedSaturation, 0f, maxMutedSaturation);
+
+ lightMutedColor = FindColor(targetLightLuma, minLightLuma, 1f,
+ targetMutedSaturation, 0f, maxMutedSaturation);
+
+ darkMutedSwatch = FindColor(targetDarkLuma, 0f, maxDarkLuma,
+ targetMutedSaturation, 0f, maxMutedSaturation);
+ // Now try and generate any missing colors
+ GenerateEmptyswatches();
+
+ // To get swatch infomation as string.
+ String[] swatchInfo = new String[6];
+
+ if (vibrantSwatch != null) swatchInfo[0] = vibrantSwatch.ToString();
+ if (lightVibrantSwatch != null) swatchInfo[1] = lightVibrantSwatch.ToString();
+ if (darkVibrantSwatch != null) swatchInfo[2] = darkVibrantSwatch.ToString();
+ if (mutedSwatch != null) swatchInfo[3] = mutedSwatch.ToString();
+ if (lightMutedColor != null) swatchInfo[4] = lightMutedColor.ToString();
+ if (darkMutedSwatch != null) swatchInfo[5] = darkMutedSwatch.ToString();
+
+ Tizen.Log.Info("Palette", "VibrantSwatch [" + swatchInfo[0] + "] " +
+ "lightVibrantSwatch [" + swatchInfo[1] + "] " +
+ "darkVibrantSwatch [" + swatchInfo[2] + "] " +
+ "MutedSwatch [" + swatchInfo[3] + "] " +
+ "lightMutedColor [" + swatchInfo[4] + "] " +
+ "darkMutedSwatch [" + swatchInfo[5] + "] \n");
+ }
+
+ public delegate void PaletteGeneratedEventHandler(Palette palette);
+
+ /// <summary>
+ /// Generate a Palette asynchronously using bitmap as source.
+ /// </summary>
+ /// <param name="bitmap">A Target image's bitmap.</param>
+ /// <param name="paletteGeneratedEventHandler">A method will be called with the palette when generated.</param>
+ /// <exception cref="ArgumentNullException">Thrown when the argument bitmap, PaletteGeneratedEventHandler is null.</exception>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static void GenerateAsync(Bitmap bitmap, PaletteGeneratedEventHandler paletteGeneratedEventHandler)
+ {
+ _ = AsyncTask(bitmap, null, paletteGeneratedEventHandler);
+ }
+
+ /// <summary>
+ /// Generate a Palette asynchronously using bitmap as source.
+ /// And set a region of the bitmap to be used exclusively when calculating the palette.
+ /// </summary>
+ /// <param name="bitmap">A Target image's bitmap.</param>
+ /// <param name="region">A rectangle used for region.</param>
+ /// <param name="paletteGeneratedEventHandler">A method will be called with the palette when generated.</param>
+ /// <exception cref="ArgumentNullException">Thrown when the argument bitmap, PaletteGeneratedEventHandler is null.</exception>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static void GenerateAsync(Bitmap bitmap, Tizen.NUI.Rectangle region, PaletteGeneratedEventHandler paletteGeneratedEventHandler)
+ {
+ _ = AsyncTask(bitmap, region, paletteGeneratedEventHandler);
+ }
+
+ /// <summary>
+ /// Generate a Palette synchronously using bitmap as source.
+ /// </summary>
+ /// <param name="bitmap">A Target image's bitmap.</param>
+ /// <exception cref="ArgumentNullException">Thrown when the argument bitmap is null.</exception>
+ /// <returns>the palette instance.</returns>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static Palette generate(Bitmap bitmap)
+ {
+ return Generate(bitmap, null);
+ }
+
+ /// <summary>
+ /// Generate a Palette synchronously using bitmap as source.
+ /// And set a region of the bitmap to be used exclusively when calculating the palette.
+ /// </summary>
+ /// <param name="bitmap">A Target image's bitmap.</param>
+ /// <param name="region">A rectangle used for region.</param>
+ /// <exception cref="ArgumentNullException">Thrown when the argument bitmap is null.</exception>
+ /// <returns>the palette instance.</returns>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static Palette Generate(Bitmap bitmap, Tizen.NUI.Rectangle region)
+ {
+ Tizen.Log.Info("Palette", "bitmap generate start with region: " + region + "\n");
+ if (bitmap == null)
+ {
+ throw new ArgumentNullException(nameof(bitmap), "bitmap should not be null.");
+ }
+
+ // First we'll scale down the bitmap so it's shortest dimension is 100px
+ // NOTE: scaledBitmap can gets bitmap origin value and new bitmap instance as well
+ // When ScaleBitmap created newly it will be dispose below.
+ // otherwise it should not disposed because of this instance from user side.
+ Bitmap scaledBitmap = ScaleBitmapDown(bitmap);
+
+ // Region set
+ if (scaledBitmap != bitmap && region != null)
+ {
+ double scale = scaledBitmap.Width / (double)bitmap.Width;
+ region.X = (int)Math.Floor(region.X * scale);
+ region.Y = (int)Math.Floor(region.Y * scale);
+ region.Width = Math.Min((int)Math.Ceiling(region.Width * scale), bitmap.Width);
+ region.Height = Math.Min((int)Math.Ceiling(region.Height * scale), bitmap.Height);
+ }
+
+ // Now generate a Quantizer from the Bitmap
+ // FIXME: defaultCalculateNumberColors should be changeable?
+ ColorCutQuantizer quantizer = ColorCutQuantizer.FromBitmap(scaledBitmap, region, defaultCalculateNumberColors);
+
+ if (scaledBitmap != bitmap) scaledBitmap.Dispose();
+
+ // Now return a ColorExtractor instance
+ return new Palette(quantizer.GetQuantizedColors());
+ }
+
+ /// <summary>
+ /// Returns all of the swatches which make up the palette.
+ /// </summary>
+ /// <returns>The swatch list</returns>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public ReadOnlyCollection<Swatch> GetSwatches()
+ {
+ return new ReadOnlyCollection<Swatch>(swatches);
+ }
+
+ /// <summary>
+ /// Returns the dominant swatch from the palette.
+ /// The dominant swatch is defined as the swatch with the greatest population (frequency) within the palette.
+ /// </summary>
+ /// <returns>The swatch instance</returns>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public Swatch GetDominantSwatch()
+ {
+ String swatchInfo = null;
+ if (dominantSwatch == null)
+ dominantSwatch = FinddominantSwatch();
+
+ if (dominantSwatch != null) swatchInfo = dominantSwatch.ToString();
+ Tizen.Log.Info("Palette", "dominantSwatch [" + swatchInfo + "] \n");
+
+ return dominantSwatch;
+ }
+
+ /// <summary>
+ /// Returns the most vibrant swatch in the palette. Might be null.
+ /// </summary>
+ /// <returns>The swatch instance</returns>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public Swatch GetVibrantSwatch()
+ {
+ return vibrantSwatch;
+ }
+
+ /// <summary>
+ /// Returns a light and vibrant swatch from the palette. Might be null.
+ /// </summary>
+ /// <returns>The swatch instance</returns>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public Swatch GetLightVibrantSwatch()
+ {
+ return lightVibrantSwatch;
+ }
+
+ /// <summary>
+ /// Returns a dark and vibrant swatch from the palette. Might be null.
+ /// </summary>
+ /// <returns>The swatch instance</returns>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public Swatch GetDarkVibrantSwatch()
+ {
+ return darkVibrantSwatch;
+ }
+
+ /// <summary>
+ /// Returns a muted swatch from the palette. Might be null.
+ /// </summary>
+ /// <returns>The swatch instance</returns>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public Swatch GetMutedSwatch()
+ {
+ return mutedSwatch;
+ }
+
+ /// <summary>
+ /// Returns a muted and light swatch from the palette. Might be null.
+ /// </summary>
+ /// <returns>The swatch instance</returns>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public Swatch GetLightMutedSwatch()
+ {
+ return lightMutedColor;
+ }
+
+ /// <summary>
+ /// Returns a muted and dark swatch from the palette. Might be null.
+ /// </summary>
+ /// <returns>The swatch instance</returns>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public Swatch GetDarkMutedSwatch()
+ {
+ return darkMutedSwatch;
+ }
+
+ private static async Task<Palette> AsyncTask(Bitmap bitmap, Tizen.NUI.Rectangle region, PaletteGeneratedEventHandler paletteGeneratedEventHandler)
+ {
+ if (paletteGeneratedEventHandler == null)
+ {
+ throw new ArgumentNullException(nameof(paletteGeneratedEventHandler), "PaletteGeneratedEventHandlergate should not be null.");
+ }
+
+ var GenerateTask = Task.Run(() =>
+ {
+ return Generate(bitmap, region);
+ }).ConfigureAwait(false);
+
+ Palette ret = await GenerateTask;
+ paletteGeneratedEventHandler(ret);
+
+ return null; ;
+ }
+
+ /// <summary>
+ /// Try and generate any missing swatches from the swatches we did find.
+ /// </summary>
+ private void GenerateEmptyswatches()
+ {
+ if (vibrantSwatch == null)
+ {
+ // If we do not have a vibrant color...
+ if (darkVibrantSwatch != null)
+ {
+ // ...but we do have a dark vibrant, generate the value by modifying the luma
+ float[] newHsl = CopyhslValues(darkVibrantSwatch);
+ newHsl[2] = targetNormalLuma;
+ vibrantSwatch = new Swatch(ColorUtils.HslToRgb(newHsl), 0);
+ Tizen.Log.Info("Palette", "Generate Vibrant Swatch \n");
+ }
+ }
+ if (darkVibrantSwatch == null)
+ {
+ // If we do not have a dark vibrant color...
+ if (vibrantSwatch != null)
+ {
+ // ...but we do have a vibrant, generate the value by modifying the luma
+ float[] newHsl = CopyhslValues(vibrantSwatch);
+ newHsl[2] = targetDarkLuma;
+ darkVibrantSwatch = new Swatch(ColorUtils.HslToRgb(newHsl), 0);
+ Tizen.Log.Info("Palette", "Generate DarkVibrant Swatch \n");
+ }
+ }
+ }
+
+ /// <summary>
+ /// Copy a Swatch's hsl values into a new float[].
+ /// </summary>
+ private static float[] CopyhslValues(Swatch color)
+ {
+ float[] newHsl = new float[3];
+ Array.Copy(color.GetHsl(), 0, newHsl, 0, 3);
+
+ return newHsl;
+ }
+
+ /// <summary>
+ /// return true if we have already selected swatch
+ /// </summary>
+ private bool IsAlreadySelected(Swatch swatch)
+ {
+ return vibrantSwatch == swatch || darkVibrantSwatch == swatch ||
+ lightVibrantSwatch == swatch || mutedSwatch == swatch ||
+ darkMutedSwatch == swatch || lightMutedColor == swatch;
+ }
+
+ private Swatch FindColor(float targetLuma, float minLuma, float maxLuma,
+ float targetSaturation, float minSaturation, float maxSaturation)
+ {
+ Swatch max = null;
+ float maxValue = 0f;
+
+ foreach (Swatch swatch in swatches)
+ {
+ float sat = swatch.GetHsl()[1];
+ float luma = swatch.GetHsl()[2];
+ if (sat >= minSaturation && sat <= maxSaturation &&
+ luma >= minLuma && luma <= maxLuma &&
+ !IsAlreadySelected(swatch))
+ {
+ float thisValue = CreateComparisonValue(sat, targetSaturation, luma, targetLuma,
+ swatch.GetPopulation(), highestPopulation);
+ if (max == null || thisValue > maxValue)
+ {
+ max = swatch;
+ maxValue = thisValue;
+ }
+ }
+ }
+
+ return max;
+ }
+
+ /// <summary>
+ /// Find the Swatch with the highest population value and return the population.
+ /// </summary>
+ private int FindMaxPopulation()
+ {
+ int population = 0;
+
+ foreach (Swatch swatch in swatches)
+ {
+ population = Math.Max(population, swatch.GetPopulation());
+ }
+
+ return population;
+ }
+
+ private Swatch FinddominantSwatch()
+ {
+ int maxPop = -1;
+ Swatch maxSwatch = null;
+
+ foreach (Swatch swatch in swatches)
+ {
+ if (swatch.GetPopulation() > maxPop)
+ {
+ maxSwatch = swatch;
+ maxPop = swatch.GetPopulation();
+ }
+ }
+
+ return maxSwatch;
+ }
+
+ /// <summary>
+ /// Scale the bitmap down so that it's smallest dimension is
+ /// calculateBitmapMinDimensionpx. If bitmap is smaller than this, than it
+ /// is returned.
+ /// </summary>
+ private static Bitmap ScaleBitmapDown(Bitmap bitmap)
+ {
+ int minDimension = Math.Min(bitmap.Width, bitmap.Height);
+
+ if (minDimension <= calculateBitmapMinDimension)
+ {
+ // If the bitmap is small enough already, just return it
+ return bitmap;
+ }
+
+ float scaleRatio = calculateBitmapMinDimension / (float)minDimension;
+
+ int width = (int)Math.Round(bitmap.Width * scaleRatio);
+ int height = (int)Math.Round(bitmap.Height * scaleRatio);
+
+ System.Drawing.Size Resize = new System.Drawing.Size(width, height);
+ Tizen.Log.Info("Palette", "bitmap resize to " + width + " " + height + "\n");
+
+ return new Bitmap(bitmap, Resize);
+ }
+
+ private static float CreateComparisonValue(float saturation, float targetSaturation,
+ float luma, float targetLuma,
+ int population, int highestPopulation)
+ {
+ return WeightedMean(InvertDiff(saturation, targetSaturation), 3f,
+ InvertDiff(luma, targetLuma), 6.5f,
+ population / (float)highestPopulation, 0.5f);
+ }
+
+ /// <summary>
+ /// Returns a value in the range 0-1. 1 is returned when value equals the
+ /// targetValue and then decreases as the absolute difference between value and
+ /// targetValue increases.
+ ///
+ /// param value the item's value
+ /// param targetValue the value which we desire
+ /// </summary>
+ private static float InvertDiff(float value, float targetValue)
+ {
+ return 1f - Math.Abs(value - targetValue);
+ }
+
+ private static float WeightedMean(params float[] values)
+ {
+ float sum = 0f;
+ float sumWeight = 0f;
+
+ for (int i = 0; i < values.Length; i += 2)
+ {
+ float value = values[i];
+ float weight = values[i + 1];
+ sum += (value * weight);
+ sumWeight += weight;
+ }
+
+ return sum / sumWeight;
+ }
+
+ // This is nested class for use by other internal classes(Color*), but is declared public.
+ // Futher confirmantion need of this architect.
+
+ /// <summary>
+ /// Represents a color swatch generated from an image's palette. The RGB color can be retrieved calling getRgb()
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public sealed class Swatch
+ {
+ private const float minContrastTitleText = 3.0f;
+ private const float minContrastBodyText = 4.5f;
+
+ private int red, green, blue;
+ private int colorInt, bodyTextColor, titleTextColor;
+ private int population;
+ private bool generatedTextColors;
+ private System.Drawing.Color rgbDrawingColor;
+ private float[] hsl;
+
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public Swatch(int rgbcolorInt, int populationOfSwatch)
+ {
+ System.Drawing.Color rgbColor = System.Drawing.Color.FromArgb(rgbcolorInt);
+ red = rgbColor.R;
+ green = rgbColor.G;
+ blue = rgbColor.B;
+ rgbDrawingColor = rgbColor;
+ colorInt = rgbcolorInt;
+ population = populationOfSwatch;
+ }
+
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public Swatch(int redValueOfSwatch, int greenValueOfSwatch, int blueValueOfSwatch, int populationOfSwatch)
+ {
+ red = redValueOfSwatch;
+ green = greenValueOfSwatch;
+ blue = blueValueOfSwatch;
+ rgbDrawingColor = System.Drawing.Color.FromArgb(red, green, blue);
+ colorInt = Convert.ToInt32(rgbDrawingColor.ToArgb());
+ population = populationOfSwatch;
+ }
+
+ /// <summary>
+ /// return this swatch's RGB color value
+ /// </summary>
+ /// <returns>A Tizen.NUI.Color value.</returns>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public Tizen.NUI.Color GetRgb()
+ {
+ return new Tizen.NUI.Color((float)red / 255, (float)green / 255, (float)blue / 255, 1.0f);
+ }
+
+ /// <summary>
+ /// Return this swatch's hsl values.
+ /// hsv[0] is Hue [0 .. 360)
+ /// hsv[1] is Saturation [0...1]
+ /// hsv[2] is Lightness [0...1]
+ /// </summary>
+ /// <returns>A float array value.</returns>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public float[] GetHsl()
+ {
+ if (hsl == null)
+ {
+ // Lazily generate hsl values from RGB
+ hsl = new float[3];
+ ColorUtils.RgbToHsl(red, green, blue, hsl);
+ }
+
+ return hsl;
+ }
+
+ /// <summary>
+ /// Returns an appropriate color to use for any 'title' text which is displayed over this
+ /// Palette.Swatchs color. This color is guaranteed to have sufficient contrast.
+ /// </summary>
+ /// <returns>A Tizen.NUI.Color value.</returns>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public Tizen.NUI.Color GetTitleTextColor()
+ {
+ EnsureTextColorsGenerated();
+
+ System.Drawing.Color titleRgbColor = System.Drawing.Color.FromArgb(titleTextColor);
+ Tizen.Log.Info("Palette", "Swatch Title Text Color = " + titleRgbColor + "\n");
+
+ return new Tizen.NUI.Color((float)titleRgbColor.R / 255, (float)titleRgbColor.G / 255, (float)titleRgbColor.B / 255, (float)titleRgbColor.A / 255);
+ }
+
+ /// <summary>
+ /// Returns an appropriate color to use for any 'body' text which is displayed over this
+ /// Palette.Swatchs color. This color is guaranteed to have sufficient contrast.
+ /// </summary>
+ /// <returns>A Tizen.NUI.Color value.</returns>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public Tizen.NUI.Color GetBodyTextColor()
+ {
+ EnsureTextColorsGenerated();
+
+ System.Drawing.Color bodyRgbColor = System.Drawing.Color.FromArgb(bodyTextColor);
+ Tizen.Log.Info("Palette", "Swatch Body Text Color = " + bodyRgbColor + "\n");
+
+ return new Tizen.NUI.Color((float)bodyRgbColor.R / 255, (float)bodyRgbColor.G / 255, (float)bodyRgbColor.B / 255, (float)bodyRgbColor.A / 255);
+ }
+
+ /// <summary>
+ /// return the number of pixels represented by this swatch.
+ /// </summary>
+ /// <returns>A number of pixels value.</returns>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public int GetPopulation()
+ {
+ return population;
+ }
+
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public override String ToString()
+ {
+ return rgbDrawingColor + " " + population;
+ }
+
+ private void EnsureTextColorsGenerated()
+ {
+ if (!generatedTextColors)
+ {
+ int colorWhite = (255 & 0xff) << 24 | (255 & 0xff) << 16 | (255 & 0xff) << 8 | (255 & 0xff);
+ int colorBlack = (255 & 0xff) << 24 | (0 & 0xff) << 16 | (0 & 0xff) << 8 | (0 & 0xff);
+
+ // First check white, as most colors will be dark
+ System.Drawing.Color rgbColor = System.Drawing.Color.FromArgb(colorInt);
+ int lightBodyAlpha = ColorUtils.CalculateMinimumAlpha(
+ colorWhite, colorInt, minContrastBodyText);
+ int lightTitleAlpha = ColorUtils.CalculateMinimumAlpha(
+ colorWhite, colorInt, minContrastTitleText);
+
+ if (lightBodyAlpha != -1 && lightTitleAlpha != -1)
+ {
+ // If we found valid light values, use them and return
+ bodyTextColor = ColorUtils.SetAlphaComponent(colorWhite, lightBodyAlpha);
+ titleTextColor = ColorUtils.SetAlphaComponent(colorWhite, lightTitleAlpha);
+ generatedTextColors = true;
+
+ return;
+ }
+
+ int darkBodyAlpha = ColorUtils.CalculateMinimumAlpha(
+ colorBlack, colorInt, minContrastBodyText);
+ int darkTitleAlpha = ColorUtils.CalculateMinimumAlpha(
+ colorBlack, colorInt, minContrastTitleText);
+
+ if (darkBodyAlpha != -1 && darkTitleAlpha != -1)
+ {
+ // If we found valid dark values, use them and return
+ bodyTextColor = ColorUtils.SetAlphaComponent(colorBlack, darkBodyAlpha);
+ titleTextColor = ColorUtils.SetAlphaComponent(colorBlack, darkTitleAlpha);
+ generatedTextColors = true;
+
+ return;
+ }
+
+ // If we reach here then we can not find title and body values which use the same
+ // lightness, we need to use mismatched values
+ bodyTextColor = lightBodyAlpha != -1
+ ? ColorUtils.SetAlphaComponent(colorWhite, lightBodyAlpha)
+ : ColorUtils.SetAlphaComponent(colorWhite, darkBodyAlpha);
+ titleTextColor = lightTitleAlpha != -1
+ ? ColorUtils.SetAlphaComponent(colorWhite, lightTitleAlpha)
+ : ColorUtils.SetAlphaComponent(colorWhite, darkTitleAlpha);
+ generatedTextColors = true;
+ }
+ }
+ }
+ }
+}
public class TTSPlayer : BaseHandle
{
private static readonly TTSPlayer instance = TTSPlayer.Get();
- private StateChangedEventCallbackType _stateChangedEventCallback;
+ private StateChangedEventCallbackType stateChangedEventCallback;
internal TTSPlayer(global::System.IntPtr cPtr, bool cMemoryOwn) : base(Interop.TtsPlayer.Upcast(cPtr), cMemoryOwn)
{
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
private delegate void StateChangedEventCallbackType(TTSState prevState, TTSState nextState);
- private event EventHandler<StateChangedEventArgs> _stateChangedEventHandler;
+ private event EventHandler<StateChangedEventArgs> stateChangedEventHandler;
/// <summary>
/// State changed event.
{
add
{
- if (_stateChangedEventHandler == null)
+ if (stateChangedEventHandler == null)
{
- _stateChangedEventCallback = OnStateChanged;
- StateChangedSignal().Connect(_stateChangedEventCallback);
+ stateChangedEventCallback = OnStateChanged;
+ StateChangedSignal().Connect(stateChangedEventCallback);
}
- _stateChangedEventHandler += value;
+ stateChangedEventHandler += value;
}
remove
{
- _stateChangedEventHandler -= value;
+ stateChangedEventHandler -= value;
- if (_stateChangedEventHandler == null && StateChangedSignal().Empty() == false && _stateChangedEventCallback != null)
+ if (stateChangedEventHandler == null && StateChangedSignal().Empty() == false && stateChangedEventCallback != null)
{
- StateChangedSignal().Disconnect(_stateChangedEventCallback);
+ StateChangedSignal().Disconnect(stateChangedEventCallback);
}
}
}
private void OnStateChanged(TTSState prevState, TTSState nextState)
{
- StateChangedEventArgs e = new StateChangedEventArgs();
-
- e.PrevState = prevState;
- e.NextState = nextState;
-
- if (_stateChangedEventHandler != null)
+ if (stateChangedEventHandler != null)
{
- _stateChangedEventHandler(this, e);
+ StateChangedEventArgs e = new StateChangedEventArgs();
+
+ e.PrevState = prevState;
+ e.NextState = nextState;
+ stateChangedEventHandler(this, e);
}
}
}
}
}
-
}
/*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
using System.ComponentModel;
using System.IO;
-
-using Tizen.NUI;
using Tizen.NUI.BaseComponents;
namespace Tizen.NUI.Utility
{
-
/// <summary>
/// This is a class for stroing the text of a page.
/// </summary>
private int MarkupProcess(int startOffset, int cutOffIndex)
{
-
int count = 0;
int offset = startOffset;
int character = 0;
if (character == -1) offset = -1;
return offset;
}
-
}
}
/*
- * Copyright(c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
public class Timer : BaseHandle
{
private bool played = false;
- private EventHandlerWithReturnType<object, TickEventArgs, bool> _timerTickEventHandler;
- private TickCallbackDelegate _timerTickCallbackDelegate;
+ private EventHandlerWithReturnType<object, TickEventArgs, bool> timerTickEventHandler;
+ private TickCallbackDelegate timerTickCallbackDelegate;
- private System.IntPtr _timerTickCallbackOfNative;
+ private System.IntPtr timerTickCallbackOfNative;
/// <summary>
/// Creates a tick timer that emits periodic signal.
internal Timer(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
{
-
- _timerTickCallbackDelegate = OnTick;
- _timerTickCallbackOfNative = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate<System.Delegate>(_timerTickCallbackDelegate);
+ timerTickCallbackDelegate = OnTick;
+ timerTickCallbackOfNative = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate<System.Delegate>(timerTickCallbackDelegate);
NUILog.Debug($"(0x{SwigCPtr.Handle:X})Timer() contructor!");
}
{
add
{
- if (_timerTickEventHandler == null && disposed == false)
+ if (timerTickEventHandler == null && disposed == false)
{
- TickSignal().Connect(_timerTickCallbackOfNative);
+ TickSignal().Connect(timerTickCallbackOfNative);
}
- _timerTickEventHandler += value;
+ timerTickEventHandler += value;
}
remove
{
- _timerTickEventHandler -= value;
- if (_timerTickEventHandler == null && TickSignal().Empty() == false)
+ timerTickEventHandler -= value;
+ if (timerTickEventHandler == null && TickSignal().Empty() == false)
{
- TickSignal().Disconnect(_timerTickCallbackOfNative);
+ TickSignal().Disconnect(timerTickCallbackOfNative);
}
}
}
{
Tizen.Log.Error("NUI", "current threadID : " + Thread.CurrentThread.ManagedThreadId);
-
StackTrace st = new StackTrace(true);
for (int i = 0; i < st.FrameCount; i++)
{
{
NUILog.Debug($"(0x{SwigCPtr.Handle:X}) Timer.Dispose(type={type}, disposed={disposed})");
- if (this != null && _timerTickCallbackDelegate != null)
+ if (this != null && timerTickCallbackDelegate != null)
{
- TickSignal().Disconnect(_timerTickCallbackOfNative);
+ TickSignal().Disconnect(timerTickCallbackOfNative);
}
if (disposed)
//throw new System.InvalidOperationException($"OnTick() excpetion!");
}
- if (_timerTickEventHandler != null && played == true)
+ if (timerTickEventHandler != null && played == true)
{
//here we send all data to user event handlers
- return _timerTickEventHandler(this, e);
+ return timerTickEventHandler(this, e);
}
return false;
}
{
}
}
-
}
-
/*
- * Copyright(c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
}
}
}
-
-
/*
- * Copyright(c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
return new PropertyValue(instance.propertyMap);
}
-
-
[EditorBrowsable(EditorBrowsableState.Never)]
protected virtual void Dispose(bool disposing)
{
/*
- * Copyright(c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
/// <since_tizen> 3 </since_tizen>
public class AnimatedImageVisual : VisualMap
{
- private List<string> _urls = null;
- private int? _batchSize = null;
- private int? _cacheSize = null;
- private float? _frameDelay = null;
- private float? _loopCount = null;
+ private List<string> urls = null;
+ private int? batchSize = null;
+ private int? cacheSize = null;
+ private float? frameDelay = null;
+ private float? loopCount = null;
/// <summary>
/// Constructor.
{
get
{
- if (_urls != null)
+ if (urls != null)
{
- return _urls[0];
+ return urls[0];
}
else
{
}
set
{
- if (_urls == null)
+ if (urls == null)
{
- _urls = new List<string>();
- _urls.Add(value);
+ urls = new List<string>();
+ urls.Add(value);
}
else
{
- _urls[0] = value;
+ urls[0] = value;
}
UpdateVisual();
}
{
get
{
- return _urls;
+ return urls;
}
set
{
- _urls = value;
+ urls = value;
UpdateVisual();
}
}
{
get
{
- return _batchSize ?? 1;
+ return batchSize ?? 1;
}
set
{
- _batchSize = value;
+ batchSize = value;
UpdateVisual();
}
}
{
get
{
- return _cacheSize ?? 1;
+ return cacheSize ?? 1;
}
set
{
- _cacheSize = value;
+ cacheSize = value;
UpdateVisual();
}
}
{
get
{
- return _frameDelay ?? 0.1f;
+ return frameDelay ?? 0.1f;
}
set
{
- _frameDelay = value;
+ frameDelay = value;
UpdateVisual();
}
}
{
get
{
- return _loopCount ?? -1;
+ return loopCount ?? -1;
}
set
{
- _loopCount = value;
+ loopCount = value;
UpdateVisual();
}
}
/// <since_tizen> 3 </since_tizen>
protected override void ComposingPropertyMap()
{
- if (_urls != null)
+ if (urls != null)
{
_outputVisualMap = new PropertyMap();
PropertyValue temp = new PropertyValue((int)Visual.Type.AnimatedImage);
_outputVisualMap.Add(Visual.Property.Type, temp);
temp.Dispose();
- if (_urls.Count == 1)
+ if (urls.Count == 1)
{
- temp = new PropertyValue(_urls[0]);
+ temp = new PropertyValue(urls[0]);
_outputVisualMap.Add(ImageVisualProperty.URL, temp);
temp.Dispose();
}
else
{
var urlArray = new PropertyArray();
- foreach (var url in _urls)
+ foreach (var url in urls)
{
urlArray.Add(new PropertyValue(url));
}
temp.Dispose();
urlArray.Dispose();
}
- if (_batchSize != null)
+ if (batchSize != null)
{
- temp = new PropertyValue((int)_batchSize);
+ temp = new PropertyValue((int)batchSize);
_outputVisualMap.Add(ImageVisualProperty.BatchSize, temp);
temp.Dispose();
}
- if (_cacheSize != null)
+ if (cacheSize != null)
{
- temp = new PropertyValue((int)_cacheSize);
+ temp = new PropertyValue((int)cacheSize);
_outputVisualMap.Add(ImageVisualProperty.CacheSize, temp);
temp.Dispose();
}
- if (_frameDelay != null)
+ if (frameDelay != null)
{
- temp = new PropertyValue((float)_frameDelay);
+ temp = new PropertyValue((float)frameDelay);
_outputVisualMap.Add(ImageVisualProperty.FrameDelay, temp);
temp.Dispose();
}
- if (_loopCount != null)
+ if (loopCount != null)
{
- temp = new PropertyValue((int)_loopCount);
+ temp = new PropertyValue((int)loopCount);
_outputVisualMap.Add(ImageVisualProperty.LoopCount, temp);
temp.Dispose();
}
/*
- * Copyright(c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*
*/
-using System;
-using System.Runtime.InteropServices;
using System.ComponentModel;
namespace Tizen.NUI
/*
- * Copyright(c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
namespace Tizen.NUI
{
-
/// <summary>
/// The VisualFactory is a singleton object that provides and shares visuals between views.
/// </summary>
/// <since_tizen> 3 </since_tizen>
public class VisualFactory : BaseHandle
{
-
/// <summary>
/// Instance of the VisualFactory singleton.
/// </summary>
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
-
}
-
}
/*
- * Copyright(c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
/// <since_tizen> 3 </since_tizen>
public class WidgetView : View
{
- private EventHandler<WidgetViewEventArgs> _widgetAddedEventHandler;
- private WidgetAddedEventCallbackType _widgetAddedEventCallback;
- private EventHandler<WidgetViewEventArgs> _widgetContentUpdatedEventHandler;
- private WidgetContentUpdatedEventCallbackType _widgetContentUpdatedEventCallback;
- private EventHandler<WidgetViewEventArgs> _widgetDeletedEventHandler;
- private WidgetDeletedEventCallbackType _widgetDeletedEventCallback;
- private EventHandler<WidgetViewEventArgs> _widgetCreationAbortedEventHandler;
- private WidgetCreationAbortedEventCallbackType _widgetCreationAbortedEventCallback;
- private EventHandler<WidgetViewEventArgs> _widgetUpdatePeriodChangedEventHandler;
- private WidgetUpdatePeriodChangedEventCallbackType _widgetUpdatePeriodChangedEventCallback;
- private EventHandler<WidgetViewEventArgs> _widgetFaultedEventHandler;
- private WidgetFaultedEventCallbackType _widgetFaultedEventCallback;
+ private EventHandler<WidgetViewEventArgs> widgetAddedEventHandler;
+ private WidgetAddedEventCallbackType widgetAddedEventCallback;
+ private EventHandler<WidgetViewEventArgs> widgetContentUpdatedEventHandler;
+ private WidgetContentUpdatedEventCallbackType widgetContentUpdatedEventCallback;
+ private EventHandler<WidgetViewEventArgs> widgetDeletedEventHandler;
+ private WidgetDeletedEventCallbackType widgetDeletedEventCallback;
+ private EventHandler<WidgetViewEventArgs> widgetCreationAbortedEventHandler;
+ private WidgetCreationAbortedEventCallbackType widgetCreationAbortedEventCallback;
+ private EventHandler<WidgetViewEventArgs> widgetUpdatePeriodChangedEventHandler;
+ private WidgetUpdatePeriodChangedEventCallbackType widgetUpdatePeriodChangedEventCallback;
+ private EventHandler<WidgetViewEventArgs> widgetFaultedEventHandler;
+ private WidgetFaultedEventCallbackType widgetFaultedEventCallback;
/// <summary>
/// Creates a new WidgetView.
/// </summary>
{
add
{
- if (_widgetAddedEventHandler == null)
+ if (widgetAddedEventHandler == null)
{
- _widgetAddedEventCallback = OnWidgetAdded;
+ widgetAddedEventCallback = OnWidgetAdded;
WidgetViewSignal widgetAdded = WidgetAddedSignal();
- widgetAdded?.Connect(_widgetAddedEventCallback);
+ widgetAdded?.Connect(widgetAddedEventCallback);
widgetAdded?.Dispose();
}
- _widgetAddedEventHandler += value;
+ widgetAddedEventHandler += value;
}
remove
{
- _widgetAddedEventHandler -= value;
+ widgetAddedEventHandler -= value;
WidgetViewSignal widgetAdded = WidgetAddedSignal();
- if (_widgetAddedEventHandler == null && widgetAdded?.Empty() == false)
+ if (widgetAddedEventHandler == null && widgetAdded?.Empty() == false)
{
- widgetAdded?.Disconnect(_widgetAddedEventCallback);
+ widgetAdded?.Disconnect(widgetAddedEventCallback);
}
widgetAdded?.Dispose();
}
{
add
{
- if (_widgetContentUpdatedEventHandler == null)
+ if (widgetContentUpdatedEventHandler == null)
{
- _widgetContentUpdatedEventCallback = OnWidgetContentUpdated;
+ widgetContentUpdatedEventCallback = OnWidgetContentUpdated;
WidgetViewSignal widgetContentUpdated = WidgetContentUpdatedSignal();
- widgetContentUpdated?.Connect(_widgetContentUpdatedEventCallback);
+ widgetContentUpdated?.Connect(widgetContentUpdatedEventCallback);
widgetContentUpdated?.Dispose();
}
- _widgetContentUpdatedEventHandler += value;
+ widgetContentUpdatedEventHandler += value;
}
remove
{
- _widgetContentUpdatedEventHandler -= value;
+ widgetContentUpdatedEventHandler -= value;
WidgetViewSignal widgetContentUpdated = WidgetContentUpdatedSignal();
- if (_widgetContentUpdatedEventHandler == null && widgetContentUpdated?.Empty() == false)
+ if (widgetContentUpdatedEventHandler == null && widgetContentUpdated?.Empty() == false)
{
- widgetContentUpdated?.Disconnect(_widgetContentUpdatedEventCallback);
+ widgetContentUpdated?.Disconnect(widgetContentUpdatedEventCallback);
}
widgetContentUpdated?.Dispose();
}
{
add
{
- if (_widgetDeletedEventHandler == null)
+ if (widgetDeletedEventHandler == null)
{
- _widgetDeletedEventCallback = OnWidgetDeleted;
+ widgetDeletedEventCallback = OnWidgetDeleted;
WidgetViewSignal widgetDeleted = WidgetDeletedSignal();
- widgetDeleted?.Connect(_widgetDeletedEventCallback);
+ widgetDeleted?.Connect(widgetDeletedEventCallback);
widgetDeleted?.Dispose();
}
- _widgetDeletedEventHandler += value;
+ widgetDeletedEventHandler += value;
}
remove
{
- _widgetDeletedEventHandler -= value;
+ widgetDeletedEventHandler -= value;
WidgetViewSignal widgetDeleted = WidgetDeletedSignal();
- if (_widgetDeletedEventHandler == null && widgetDeleted?.Empty() == false)
+ if (widgetDeletedEventHandler == null && widgetDeleted?.Empty() == false)
{
- widgetDeleted?.Disconnect(_widgetDeletedEventCallback);
+ widgetDeleted?.Disconnect(widgetDeletedEventCallback);
}
widgetDeleted?.Dispose();
}
{
add
{
- if (_widgetCreationAbortedEventHandler == null)
+ if (widgetCreationAbortedEventHandler == null)
{
- _widgetCreationAbortedEventCallback = OnWidgetCreationAborted;
+ widgetCreationAbortedEventCallback = OnWidgetCreationAborted;
WidgetViewSignal widgetCreationAborted = WidgetCreationAbortedSignal();
- widgetCreationAborted?.Connect(_widgetCreationAbortedEventCallback);
+ widgetCreationAborted?.Connect(widgetCreationAbortedEventCallback);
widgetCreationAborted?.Dispose();
}
- _widgetCreationAbortedEventHandler += value;
+ widgetCreationAbortedEventHandler += value;
}
remove
{
- _widgetCreationAbortedEventHandler -= value;
+ widgetCreationAbortedEventHandler -= value;
WidgetViewSignal widgetCreationAborted = WidgetCreationAbortedSignal();
- if (_widgetCreationAbortedEventHandler == null && widgetCreationAborted?.Empty() == false)
+ if (widgetCreationAbortedEventHandler == null && widgetCreationAborted?.Empty() == false)
{
- widgetCreationAborted?.Disconnect(_widgetCreationAbortedEventCallback);
+ widgetCreationAborted?.Disconnect(widgetCreationAbortedEventCallback);
}
widgetCreationAborted?.Dispose();
}
{
add
{
- if (_widgetUpdatePeriodChangedEventHandler == null)
+ if (widgetUpdatePeriodChangedEventHandler == null)
{
- _widgetUpdatePeriodChangedEventCallback = OnWidgetUpdatePeriodChanged;
+ widgetUpdatePeriodChangedEventCallback = OnWidgetUpdatePeriodChanged;
WidgetViewSignal widgetUpdatePeriodChanged = WidgetUpdatePeriodChangedSignal();
- widgetUpdatePeriodChanged?.Connect(_widgetUpdatePeriodChangedEventCallback);
+ widgetUpdatePeriodChanged?.Connect(widgetUpdatePeriodChangedEventCallback);
widgetUpdatePeriodChanged?.Dispose();
}
- _widgetUpdatePeriodChangedEventHandler += value;
+ widgetUpdatePeriodChangedEventHandler += value;
}
remove
{
- _widgetUpdatePeriodChangedEventHandler -= value;
+ widgetUpdatePeriodChangedEventHandler -= value;
WidgetViewSignal widgetUpdatePeriodChanged = WidgetUpdatePeriodChangedSignal();
- if (_widgetUpdatePeriodChangedEventHandler == null && widgetUpdatePeriodChanged?.Empty() == false)
+ if (widgetUpdatePeriodChangedEventHandler == null && widgetUpdatePeriodChanged?.Empty() == false)
{
- widgetUpdatePeriodChanged?.Disconnect(_widgetUpdatePeriodChangedEventCallback);
+ widgetUpdatePeriodChanged?.Disconnect(widgetUpdatePeriodChangedEventCallback);
}
widgetUpdatePeriodChanged?.Dispose();
}
{
add
{
- if (_widgetFaultedEventHandler == null)
+ if (widgetFaultedEventHandler == null)
{
- _widgetFaultedEventCallback = OnWidgetFaulted;
+ widgetFaultedEventCallback = OnWidgetFaulted;
WidgetViewSignal widgetFaulted = WidgetFaultedSignal();
- widgetFaulted?.Connect(_widgetFaultedEventCallback);
+ widgetFaulted?.Connect(widgetFaultedEventCallback);
widgetFaulted?.Dispose();
}
- _widgetFaultedEventHandler += value;
+ widgetFaultedEventHandler += value;
}
remove
{
- _widgetFaultedEventHandler -= value;
+ widgetFaultedEventHandler -= value;
WidgetViewSignal widgetFaulted = WidgetFaultedSignal();
- if (_widgetFaultedEventHandler == null && widgetFaulted?.Empty() == false)
+ if (widgetFaultedEventHandler == null && widgetFaulted?.Empty() == false)
{
- widgetFaulted?.Disconnect(_widgetFaultedEventCallback);
+ widgetFaulted?.Disconnect(widgetFaultedEventCallback);
}
widgetFaulted?.Dispose();
}
//You should not access any managed member here except static instance.
//because the execution order of Finalizes is non-deterministic.
- if (_widgetAddedEventCallback != null)
+ if (widgetAddedEventCallback != null)
{
WidgetViewSignal widgetAdded = this.WidgetAddedSignal();
- widgetAdded?.Disconnect(_widgetAddedEventCallback);
+ widgetAdded?.Disconnect(widgetAddedEventCallback);
widgetAdded?.Dispose();
}
- if (_widgetContentUpdatedEventCallback != null)
+ if (widgetContentUpdatedEventCallback != null)
{
WidgetViewSignal widgetContentUpdated = this.WidgetContentUpdatedSignal();
- widgetContentUpdated?.Disconnect(_widgetContentUpdatedEventCallback);
+ widgetContentUpdated?.Disconnect(widgetContentUpdatedEventCallback);
widgetContentUpdated?.Dispose();
}
- if (_widgetCreationAbortedEventCallback != null)
+ if (widgetCreationAbortedEventCallback != null)
{
WidgetViewSignal widgetCreationAborted = this.WidgetCreationAbortedSignal();
- widgetCreationAborted?.Disconnect(_widgetCreationAbortedEventCallback);
+ widgetCreationAborted?.Disconnect(widgetCreationAbortedEventCallback);
widgetCreationAborted?.Dispose();
}
- if (_widgetDeletedEventCallback != null)
+ if (widgetDeletedEventCallback != null)
{
WidgetViewSignal widgetDeleted = this.WidgetDeletedSignal();
- widgetDeleted?.Disconnect(_widgetDeletedEventCallback);
+ widgetDeleted?.Disconnect(widgetDeletedEventCallback);
widgetDeleted?.Dispose();
}
- if (_widgetFaultedEventCallback != null)
+ if (widgetFaultedEventCallback != null)
{
WidgetViewSignal widgetFaulted = this.WidgetFaultedSignal();
- widgetFaulted?.Disconnect(_widgetFaultedEventCallback);
+ widgetFaulted?.Disconnect(widgetFaultedEventCallback);
widgetFaulted?.Dispose();
}
- if (_widgetUpdatePeriodChangedEventCallback != null)
+ if (widgetUpdatePeriodChangedEventCallback != null)
{
WidgetViewSignal widgetUpdatePeriodChanged = this.WidgetUpdatePeriodChangedSignal();
- widgetUpdatePeriodChanged?.Disconnect(_widgetUpdatePeriodChangedEventCallback);
+ widgetUpdatePeriodChanged?.Disconnect(widgetUpdatePeriodChangedEventCallback);
widgetUpdatePeriodChanged?.Dispose();
}
e.WidgetView = WidgetView.GetWidgetViewFromPtr(data);
}
- if (_widgetAddedEventHandler != null)
+ if (widgetAddedEventHandler != null)
{
- _widgetAddedEventHandler(this, e);
+ widgetAddedEventHandler(this, e);
}
}
e.WidgetView = WidgetView.GetWidgetViewFromPtr(data);
}
- if (_widgetDeletedEventHandler != null)
+ if (widgetDeletedEventHandler != null)
{
- _widgetDeletedEventHandler(this, e);
+ widgetDeletedEventHandler(this, e);
}
}
e.WidgetView = WidgetView.GetWidgetViewFromPtr(data);
}
- if (_widgetCreationAbortedEventHandler != null)
+ if (widgetCreationAbortedEventHandler != null)
{
- _widgetCreationAbortedEventHandler(this, e);
+ widgetCreationAbortedEventHandler(this, e);
}
}
e.WidgetView = WidgetView.GetWidgetViewFromPtr(data);
}
- if (_widgetContentUpdatedEventHandler != null)
+ if (widgetContentUpdatedEventHandler != null)
{
- _widgetContentUpdatedEventHandler(this, e);
+ widgetContentUpdatedEventHandler(this, e);
}
}
e.WidgetView = WidgetView.GetWidgetViewFromPtr(data);
}
- if (_widgetUpdatePeriodChangedEventHandler != null)
+ if (widgetUpdatePeriodChangedEventHandler != null)
{
- _widgetUpdatePeriodChangedEventHandler(this, e);
+ widgetUpdatePeriodChangedEventHandler(this, e);
}
}
e.WidgetView = WidgetView.GetWidgetViewFromPtr(data);
}
- if (_widgetFaultedEventHandler != null)
+ if (widgetFaultedEventHandler != null)
{
- _widgetFaultedEventHandler(this, e);
+ widgetFaultedEventHandler(this, e);
}
}
/*
- * Copyright(c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*/
extern alias TizenSystemInformation;
-using TizenSystemInformation.Tizen.System;
-using global::System;
+
+using System;
using System.ComponentModel;
using System.Collections.Generic;
-using global::System.Runtime.InteropServices;
-using Tizen.NUI.BaseComponents;
+using System.Runtime.InteropServices;
namespace Tizen.NUI
{
/*
- * Copyright(c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
{
public partial class GLWindow
{
- private FocusChangedEventCallbackType _focusChangedEventCallback;
- private GLWindowTouchDataCallbackType _windowTouchDataCallback;
- private EventCallbackDelegateType1 _windowKeyCallbackDelegate;
- private WindowResizedEventCallbackType _windowResizedEventCallback;
+ private FocusChangedEventCallbackType focusChangedEventCallback;
+ private GLWindowTouchDataCallbackType windowTouchDataCallback;
+ private EventCallbackDelegateType1 windowKeyCallbackDelegate;
+ private WindowResizedEventCallbackType windowResizedEventCallback;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
private delegate void FocusChangedEventCallbackType(IntPtr window, bool focusGained);
{
add
{
- if (_focusChangedEventCallback == null)
+ if (focusChangedEventCallback == null)
{
- _focusChangedEventCallback = OnWindowFocusedChanged;
- FocusChangedSignal().Connect(_focusChangedEventCallback);
+ focusChangedEventCallback = OnWindowFocusedChanged;
+ FocusChangedSignal().Connect(focusChangedEventCallback);
}
- _focusChangedEventHandler += value;
+ focusChangedEventHandler += value;
}
remove
{
- _focusChangedEventHandler -= value;
+ focusChangedEventHandler -= value;
- if (_focusChangedEventHandler == null && FocusChangedSignal().Empty() == false && _focusChangedEventCallback != null)
+ if (focusChangedEventHandler == null && FocusChangedSignal().Empty() == false && focusChangedEventCallback != null)
{
- FocusChangedSignal().Disconnect(_focusChangedEventCallback);
+ FocusChangedSignal().Disconnect(focusChangedEventCallback);
}
}
}
{
add
{
- if (_windoTouchDataEventHandler == null)
+ if (windoTouchDataEventHandler == null)
{
- _windowTouchDataCallback = OnWindowTouch;
- this.TouchSignal().Connect(_windowTouchDataCallback);
+ windowTouchDataCallback = OnWindowTouch;
+ this.TouchSignal().Connect(windowTouchDataCallback);
}
- _windoTouchDataEventHandler += value;
+ windoTouchDataEventHandler += value;
}
remove
{
- _windoTouchDataEventHandler -= value;
- if (_windoTouchDataEventHandler == null && TouchSignal().Empty() == false && _windowTouchDataCallback != null)
+ windoTouchDataEventHandler -= value;
+ if (windoTouchDataEventHandler == null && TouchSignal().Empty() == false && windowTouchDataCallback != null)
{
- this.TouchSignal().Disconnect(_windowTouchDataCallback);
+ this.TouchSignal().Disconnect(windowTouchDataCallback);
}
}
}
{
add
{
- if (_stageKeyHandler == null)
+ if (stageKeyHandler == null)
{
- _windowKeyCallbackDelegate = OnStageKey;
- KeyEventSignal().Connect(_windowKeyCallbackDelegate);
+ windowKeyCallbackDelegate = OnStageKey;
+ KeyEventSignal().Connect(windowKeyCallbackDelegate);
}
- _stageKeyHandler += value;
+ stageKeyHandler += value;
}
remove
{
- _stageKeyHandler -= value;
- if (_stageKeyHandler == null && KeyEventSignal().Empty() == false)
+ stageKeyHandler -= value;
+ if (stageKeyHandler == null && KeyEventSignal().Empty() == false)
{
- KeyEventSignal().Disconnect(_windowKeyCallbackDelegate);
+ KeyEventSignal().Disconnect(windowKeyCallbackDelegate);
}
}
}
{
add
{
- if (_windowResizedEventHandler == null)
+ if (windowResizedEventHandler == null)
{
- _windowResizedEventCallback = OnResized;
- GLWindowResizedSignal().Connect(_windowResizedEventCallback);
+ windowResizedEventCallback = OnResized;
+ GLWindowResizedSignal().Connect(windowResizedEventCallback);
}
- _windowResizedEventHandler += value;
+ windowResizedEventHandler += value;
}
remove
{
- _windowResizedEventHandler -= value;
+ windowResizedEventHandler -= value;
- if (_windowResizedEventHandler == null && GLWindowResizedSignal().Empty() == false && _windowResizedEventCallback != null)
+ if (windowResizedEventHandler == null && GLWindowResizedSignal().Empty() == false && windowResizedEventCallback != null)
{
- GLWindowResizedSignal().Disconnect(_windowResizedEventCallback);
+ GLWindowResizedSignal().Disconnect(windowResizedEventCallback);
}
}
}
- private event EventHandler<FocusChangedEventArgs> _focusChangedEventHandler;
- private event EventHandler<TouchEventArgs> _windoTouchDataEventHandler;
- private event EventHandler<KeyEventArgs> _stageKeyHandler;
- private event EventHandler<ResizedEventArgs> _windowResizedEventHandler;
+ private event EventHandler<FocusChangedEventArgs> focusChangedEventHandler;
+ private event EventHandler<TouchEventArgs> windoTouchDataEventHandler;
+ private event EventHandler<KeyEventArgs> stageKeyHandler;
+ private event EventHandler<ResizedEventArgs> windowResizedEventHandler;
internal WindowFocusSignalType FocusChangedSignal()
{
/// </summary>
internal void DisconnectNativeSignals()
{
- if (_focusChangedEventCallback != null)
+ if (focusChangedEventCallback != null)
{
- FocusChangedSignal().Disconnect(_focusChangedEventCallback);
+ FocusChangedSignal().Disconnect(focusChangedEventCallback);
}
- if (_windowTouchDataCallback != null)
+ if (windowTouchDataCallback != null)
{
- TouchSignal().Disconnect(_windowTouchDataCallback);
+ TouchSignal().Disconnect(windowTouchDataCallback);
}
- if (_windowKeyCallbackDelegate != null)
+ if (windowKeyCallbackDelegate != null)
{
- KeyEventSignal().Disconnect(_windowKeyCallbackDelegate);
+ KeyEventSignal().Disconnect(windowKeyCallbackDelegate);
}
- if (_windowResizedEventCallback != null)
+ if (windowResizedEventCallback != null)
{
- GLWindowResizedSignal().Disconnect(_windowResizedEventCallback);
+ GLWindowResizedSignal().Disconnect(windowResizedEventCallback);
}
}
e.FocusGained = focusGained;
- if (_focusChangedEventHandler != null)
+ if (focusChangedEventHandler != null)
{
- _focusChangedEventHandler(this, e);
+ focusChangedEventHandler(this, e);
}
}
return false;
}
- TouchEventArgs e = new TouchEventArgs();
-
- e.Touch = Tizen.NUI.Touch.GetTouchFromPtr(touchData);
-
- if (_windoTouchDataEventHandler != null)
+ if (windoTouchDataEventHandler != null)
{
- _windoTouchDataEventHandler(this, e);
+ TouchEventArgs e = new TouchEventArgs();
+ e.Touch = Tizen.NUI.Touch.GetTouchFromPtr(touchData);
+ windoTouchDataEventHandler(this, e);
}
return false;
}
// Callback for Stage KeyEventsignal
private void OnStageKey(IntPtr data)
{
- KeyEventArgs e = new KeyEventArgs();
- e.Key = Tizen.NUI.Key.GetKeyFromPtr(data);
-
-
- if (_stageKeyHandler != null)
+ if (stageKeyHandler != null)
{
+ KeyEventArgs e = new KeyEventArgs();
+ e.Key = Tizen.NUI.Key.GetKeyFromPtr(data);
//here we send all data to user event handlers
- _stageKeyHandler(this, e);
+ stageKeyHandler(this, e);
}
}
private void OnResized(IntPtr windowSize)
{
- ResizedEventArgs e = new ResizedEventArgs();
- // var val = new Uint16Pair(windowSize, false);
- // e.WindowSize = new Size2D(val.GetWidth(), val.GetHeight());
- // val.Dispose();
-
- // Workaround : windowSize should be valid pointer from dali,
- // but currenlty it is fixed and is not Uint16Pair class.
- // will be fixed later.
- e.WindowSize = this.WindowSize;
-
- if (_windowResizedEventHandler != null)
+ if (windowResizedEventHandler != null)
{
- _windowResizedEventHandler(this, e);
+ ResizedEventArgs e = new ResizedEventArgs();
+ // var val = new Uint16Pair(windowSize, false);
+ // e.WindowSize = new Size2D(val.GetWidth(), val.GetHeight());
+ // val.Dispose();
+
+ // Workaround : windowSize should be valid pointer from dali,
+ // but currenlty it is fixed and is not Uint16Pair class.
+ // will be fixed later.
+ e.WindowSize = this.WindowSize;
+ windowResizedEventHandler(this, e);
}
}
[EditorBrowsable(EditorBrowsableState.Never)]
public class TouchEventArgs : EventArgs
{
- private Touch _touch;
+ private Touch touch;
/// <summary>
/// Touch.
{
get
{
- return _touch;
+ return touch;
}
set
{
- _touch = value;
+ touch = value;
}
}
}
[EditorBrowsable(EditorBrowsableState.Never)]
public class KeyEventArgs : EventArgs
{
- private Key _key;
+ private Key key;
/// <summary>
/// Key.
{
get
{
- return _key;
+ return key;
}
set
{
- _key = value;
+ key = value;
}
}
}
[EditorBrowsable(EditorBrowsableState.Never)]
public class ResizedEventArgs : EventArgs
{
- Size2D _windowSize;
+ Size2D windowSize;
/// <summary>
/// This window size.
{
get
{
- return _windowSize;
+ return windowSize;
}
set
{
- _windowSize = value;
+ windowSize = value;
}
}
}
[EditorBrowsable(EditorBrowsableState.Never)]
public class VisibilityChangedEventArgs : EventArgs
{
- private bool _visibility;
+ private bool visibility;
/// <summary>
/// Visibility
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
public bool Visibility
{
- get => _visibility;
+ get => visibility;
set
{
- _visibility = value;
+ visibility = value;
}
}
}
VisibilityChangedEventArgs e = new VisibilityChangedEventArgs();
e.Visibility = visibility;
- if (VisibilityChangedEventHandler != null)
+ if (visibilityChangedEventHandler != null)
{
- VisibilityChangedEventHandler.Invoke(this, e);
+ visibilityChangedEventHandler.Invoke(this, e);
}
}
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
private delegate void GLVisibilityChangedEventCallbackType(IntPtr window, bool visibility);
- private GLVisibilityChangedEventCallbackType _GLVisibilityChangedEventCallback;
- private event EventHandler<VisibilityChangedEventArgs> VisibilityChangedEventHandler;
- private GLWindowVisibilityChangedEvent _GLVisibilityChangedEventSignal;
+ private GLVisibilityChangedEventCallbackType glVisibilityChangedEventCallback;
+ private event EventHandler<VisibilityChangedEventArgs> visibilityChangedEventHandler;
+ private GLWindowVisibilityChangedEvent glVisibilityChangedEventSignal;
/// <summary>
/// EffectStart
{
add
{
- if (VisibilityChangedEventHandler == null)
+ if (visibilityChangedEventHandler == null)
{
- _GLVisibilityChangedEventCallback = OnVisibilityChanged;
- _GLVisibilityChangedEventSignal = new GLWindowVisibilityChangedEvent(this);
- _GLVisibilityChangedEventSignal.Connect(_GLVisibilityChangedEventCallback);
+ glVisibilityChangedEventCallback = OnVisibilityChanged;
+ glVisibilityChangedEventSignal = new GLWindowVisibilityChangedEvent(this);
+ glVisibilityChangedEventSignal.Connect(glVisibilityChangedEventCallback);
}
- VisibilityChangedEventHandler += value;
+ visibilityChangedEventHandler += value;
}
remove
{
- VisibilityChangedEventHandler -= value;
- if (VisibilityChangedEventHandler == null)
+ visibilityChangedEventHandler -= value;
+ if (visibilityChangedEventHandler == null)
{
- if (_GLVisibilityChangedEventSignal != null)
+ if (glVisibilityChangedEventSignal != null)
{
- if (_GLVisibilityChangedEventSignal.Empty() == false)
+ if (glVisibilityChangedEventSignal.Empty() == false)
{
- _GLVisibilityChangedEventSignal.Disconnect(_GLVisibilityChangedEventCallback);
+ glVisibilityChangedEventSignal.Disconnect(glVisibilityChangedEventCallback);
}
}
}
[EditorBrowsable(EditorBrowsableState.Never)]
public void VisibiltyChangedSignalEmit(bool visibility)
{
- if (_GLVisibilityChangedEventSignal == null)
+ if (glVisibilityChangedEventSignal == null)
{
- _GLVisibilityChangedEventSignal = new GLWindowVisibilityChangedEvent(this);
+ glVisibilityChangedEventSignal = new GLWindowVisibilityChangedEvent(this);
}
- _GLVisibilityChangedEventSignal.Emit(this, visibility);
+ glVisibilityChangedEventSignal.Emit(this, visibility);
}
}
}
/*
- * Copyright(c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
extern alias TizenSystemInformation;
using TizenSystemInformation.Tizen.System;
-using global::System;
+
+using System;
using System.ComponentModel;
using System.Collections.Generic;
-using global::System.Runtime.InteropServices;
+using System.Runtime.InteropServices;
+
using Tizen.NUI.BaseComponents;
namespace Tizen.NUI
public partial class Window : BaseHandle
{
private static readonly Window instance = Application.Instance?.GetWindow();
- private global::System.Runtime.InteropServices.HandleRef stageCPtr;
- private Layer _rootLayer;
- private string _windowTitle;
- private List<Layer> _childLayers = new List<Layer>();
+
+ private HandleRef stageCPtr;
+ private Layer rootLayer;
+ private string windowTitle;
+ private List<Layer> childLayers = new List<Layer>();
private LayoutController localController;
private bool IsSupportedMultiWindow()
{
NUILog.Error("This device does not support surfaceless_context. So Window cannot be created. ");
}
- this._windowTitle = name;
+ this.windowTitle = name;
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
{
get
{
- return _windowTitle;
+ return windowTitle;
}
set
{
- _windowTitle = value;
- SetClass(_windowTitle, "");
+ windowTitle = value;
+ SetClass(windowTitle, "");
}
}
{
get
{
- return _childLayers;
+ return childLayers;
}
}
{
// Window.IsInstalled() is actually true only when called from event thread and
// Core has been initialized, not when Stage is ready.
- if (_rootLayer == null && Window.IsInstalled())
+ if (rootLayer == null && Window.IsInstalled())
{
- _rootLayer = new Layer(Interop.Window.GetRootLayer(SwigCPtr), true);
+ rootLayer = new Layer(Interop.Window.GetRootLayer(SwigCPtr), true);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- LayersChildren?.Add(_rootLayer);
- _rootLayer.SetWindow(this);
+ LayersChildren?.Add(rootLayer);
+ rootLayer.SetWindow(this);
}
- return _rootLayer;
+ return rootLayer;
}
internal void SetBackgroundColor(Vector4 color)
//Release your own managed resources here.
//You should release all of your own disposable objects here.
- if (_rootLayer != null)
+ if (rootLayer != null)
{
- _rootLayer.Dispose();
+ rootLayer.Dispose();
}
localController?.Dispose();
- foreach (var layer in _childLayers)
+ foreach (var layer in childLayers)
{
if (layer != null)
{
}
}
- _childLayers.Clear();
+ childLayers.Clear();
}
this.DisconnectNativeSignals();
/*
- * Copyright(c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
/// <since_tizen> 3 </since_tizen>
public partial class Window
{
- private WindowFocusChangedEventCallbackType _windowFocusChangedEventCallback;
- private RootLayerTouchDataCallbackType _rootLayerTouchDataCallback;
- private WheelEventCallbackType _wheelEventCallback;
- private EventCallbackDelegateType1 _stageKeyCallbackDelegate;
- private EventCallbackDelegateType0 _stageEventProcessingFinishedEventCallbackDelegate;
- private EventHandler _stageContextLostEventHandler;
- private EventCallbackDelegateType0 _stageContextLostEventCallbackDelegate;
- private EventHandler _stageContextRegainedEventHandler;
- private EventCallbackDelegateType0 _stageContextRegainedEventCallbackDelegate;
- private EventHandler _stageSceneCreatedEventHandler;
- private EventCallbackDelegateType0 _stageSceneCreatedEventCallbackDelegate;
- private WindowResizeEventCallbackType _windowResizeEventCallback;
- private WindowFocusChangedEventCallbackType _windowFocusChangedEventCallback2;
+ private WindowFocusChangedEventCallbackType windowFocusChangedEventCallback;
+ private RootLayerTouchDataCallbackType rootLayerTouchDataCallback;
+ private WheelEventCallbackType wheelEventCallback;
+ private EventCallbackDelegateType1 stageKeyCallbackDelegate;
+ private EventCallbackDelegateType0 stageEventProcessingFinishedEventCallbackDelegate;
+ private EventHandler stageContextLostEventHandler;
+ private EventCallbackDelegateType0 stageContextLostEventCallbackDelegate;
+ private EventHandler stageContextRegainedEventHandler;
+ private EventCallbackDelegateType0 stageContextRegainedEventCallbackDelegate;
+ private EventHandler stageSceneCreatedEventHandler;
+ private EventCallbackDelegateType0 stageSceneCreatedEventCallbackDelegate;
+ private WindowResizeEventCallbackType windowResizeEventCallback;
+ private WindowFocusChangedEventCallbackType windowFocusChangedEventCallback2;
private TransitionEffectEventCallbackType transitionEffectEventCallback;
private WindowTransitionEffectSignal transitionEffectSignal;
private KeyboardRepeatSettingsChangedEventCallbackType keyboardRepeatSettingsChangedEventCallback;
{
add
{
- if (_windowFocusChangedEventHandler == null)
+ if (windowFocusChangedEventHandler == null)
{
- _windowFocusChangedEventCallback = OnWindowFocusedChanged;
+ windowFocusChangedEventCallback = OnWindowFocusedChanged;
windowFocusChangedSignal = WindowFocusChangedSignal();
- windowFocusChangedSignal?.Connect(_windowFocusChangedEventCallback);
+ windowFocusChangedSignal?.Connect(windowFocusChangedEventCallback);
}
- _windowFocusChangedEventHandler += value;
+ windowFocusChangedEventHandler += value;
}
remove
{
- _windowFocusChangedEventHandler -= value;
+ windowFocusChangedEventHandler -= value;
- if (_windowFocusChangedEventHandler == null && windowFocusChangedSignal?.Empty() == false && _windowFocusChangedEventCallback != null)
+ if (windowFocusChangedEventHandler == null && windowFocusChangedSignal?.Empty() == false && windowFocusChangedEventCallback != null)
{
- windowFocusChangedSignal?.Disconnect(_windowFocusChangedEventCallback);
+ windowFocusChangedSignal?.Disconnect(windowFocusChangedEventCallback);
}
}
}
{
add
{
- if (_rootLayerTouchDataEventHandler == null)
+ if (rootLayerTouchDataEventHandler == null)
{
- _rootLayerTouchDataCallback = OnWindowTouch;
+ rootLayerTouchDataCallback = OnWindowTouch;
touchDataSignal = this.TouchDataSignal();
- touchDataSignal?.Connect(_rootLayerTouchDataCallback);
+ touchDataSignal?.Connect(rootLayerTouchDataCallback);
}
- _rootLayerTouchDataEventHandler += value;
+ rootLayerTouchDataEventHandler += value;
}
remove
{
- _rootLayerTouchDataEventHandler -= value;
+ rootLayerTouchDataEventHandler -= value;
touchSignal = TouchSignal();
- if (_rootLayerTouchDataEventHandler == null && touchSignal?.Empty() == false && _rootLayerTouchDataCallback != null)
+ if (rootLayerTouchDataEventHandler == null && touchSignal?.Empty() == false && rootLayerTouchDataCallback != null)
{
- touchDataSignal?.Disconnect(_rootLayerTouchDataCallback);
+ touchDataSignal?.Disconnect(rootLayerTouchDataCallback);
}
}
}
{
add
{
- if (_stageWheelHandler == null)
+ if (stageWheelHandler == null)
{
- _wheelEventCallback = OnStageWheel;
+ wheelEventCallback = OnStageWheel;
wheelSignal = WheelEventSignal();
- wheelSignal?.Connect(_wheelEventCallback);
+ wheelSignal?.Connect(wheelEventCallback);
}
- _stageWheelHandler += value;
+ stageWheelHandler += value;
if (DetentEventHandler == null)
{
}
remove
{
- _stageWheelHandler -= value;
- if (_stageWheelHandler == null && wheelSignal?.Empty() == false)
+ stageWheelHandler -= value;
+ if (stageWheelHandler == null && wheelSignal?.Empty() == false)
{
- wheelSignal?.Disconnect(_wheelEventCallback);
+ wheelSignal?.Disconnect(wheelEventCallback);
}
DetentEventHandler -= value;
{
add
{
- if (_stageKeyHandler == null)
+ if (stageKeyHandler == null)
{
- _stageKeyCallbackDelegate = OnStageKey;
+ stageKeyCallbackDelegate = OnStageKey;
keyEventSignal = KeyEventSignal();
- keyEventSignal?.Connect(_stageKeyCallbackDelegate);
+ keyEventSignal?.Connect(stageKeyCallbackDelegate);
}
- _stageKeyHandler += value;
+ stageKeyHandler += value;
}
remove
{
- _stageKeyHandler -= value;
- if (_stageKeyHandler == null && keyEventSignal?.Empty() == false)
+ stageKeyHandler -= value;
+ if (stageKeyHandler == null && keyEventSignal?.Empty() == false)
{
- keyEventSignal?.Disconnect(_stageKeyCallbackDelegate);
+ keyEventSignal?.Disconnect(stageKeyCallbackDelegate);
}
}
}
{
add
{
- if (_windowResizeEventHandler == null)
+ if (windowResizeEventHandler == null)
{
- _windowResizeEventCallback = OnResized;
+ windowResizeEventCallback = OnResized;
resizeSignal = ResizeSignal();
- resizeSignal?.Connect(_windowResizeEventCallback);
+ resizeSignal?.Connect(windowResizeEventCallback);
}
- _windowResizeEventHandler += value;
+ windowResizeEventHandler += value;
}
remove
{
- _windowResizeEventHandler -= value;
+ windowResizeEventHandler -= value;
- if (_windowResizeEventHandler == null && resizeSignal?.Empty() == false && _windowResizeEventCallback != null)
+ if (windowResizeEventHandler == null && resizeSignal?.Empty() == false && windowResizeEventCallback != null)
{
- resizeSignal?.Disconnect(_windowResizeEventCallback);
+ resizeSignal?.Disconnect(windowResizeEventCallback);
}
}
}
{
add
{
- if (_windowFocusChangedEventHandler2 == null)
+ if (windowFocusChangedEventHandler2 == null)
{
- _windowFocusChangedEventCallback2 = OnWindowFocusedChanged2;
+ windowFocusChangedEventCallback2 = OnWindowFocusedChanged2;
windowFocusChangedSignal2 = WindowFocusChangedSignal();
- windowFocusChangedSignal2?.Connect(_windowFocusChangedEventCallback2);
+ windowFocusChangedSignal2?.Connect(windowFocusChangedEventCallback2);
}
- _windowFocusChangedEventHandler2 += value;
+ windowFocusChangedEventHandler2 += value;
}
remove
{
- _windowFocusChangedEventHandler2 -= value;
+ windowFocusChangedEventHandler2 -= value;
- if (_windowFocusChangedEventHandler2 == null && windowFocusChangedSignal2?.Empty() == false && _windowFocusChangedEventCallback2 != null)
+ if (windowFocusChangedEventHandler2 == null && windowFocusChangedSignal2?.Empty() == false && windowFocusChangedEventCallback2 != null)
{
- windowFocusChangedSignal2?.Disconnect(_windowFocusChangedEventCallback2);
+ windowFocusChangedSignal2?.Disconnect(windowFocusChangedEventCallback2);
}
}
}
/// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
public event EventHandler ViewAdded;
- private event EventHandler<FocusChangedEventArgs> _windowFocusChangedEventHandler;
- private event EventHandler<TouchEventArgs> _rootLayerTouchDataEventHandler;
- private event EventHandler<WheelEventArgs> _stageWheelHandler;
- private event EventHandler<KeyEventArgs> _stageKeyHandler;
- private event EventHandler _stageEventProcessingFinishedEventHandler;
- private event EventHandler<ResizedEventArgs> _windowResizeEventHandler;
- private event EventHandler<FocusChangedEventArgs> _windowFocusChangedEventHandler2;
+ private event EventHandler<FocusChangedEventArgs> windowFocusChangedEventHandler;
+ private event EventHandler<TouchEventArgs> rootLayerTouchDataEventHandler;
+ private event EventHandler<WheelEventArgs> stageWheelHandler;
+ private event EventHandler<KeyEventArgs> stageKeyHandler;
+ private event EventHandler stageEventProcessingFinishedEventHandler;
+ private event EventHandler<ResizedEventArgs> windowResizeEventHandler;
+ private event EventHandler<FocusChangedEventArgs> windowFocusChangedEventHandler2;
private event EventHandler<TransitionEffectEventArgs> transitionEffectHandler;
private event EventHandler keyboardRepeatSettingsChangedHandler;
{
add
{
- if (_stageEventProcessingFinishedEventHandler == null)
+ if (stageEventProcessingFinishedEventHandler == null)
{
- _stageEventProcessingFinishedEventCallbackDelegate = OnEventProcessingFinished;
+ stageEventProcessingFinishedEventCallbackDelegate = OnEventProcessingFinished;
eventProcessingFinishedSignal = EventProcessingFinishedSignal();
- eventProcessingFinishedSignal?.Connect(_stageEventProcessingFinishedEventCallbackDelegate);
+ eventProcessingFinishedSignal?.Connect(stageEventProcessingFinishedEventCallbackDelegate);
}
- _stageEventProcessingFinishedEventHandler += value;
+ stageEventProcessingFinishedEventHandler += value;
}
remove
{
- _stageEventProcessingFinishedEventHandler -= value;
- if (_stageEventProcessingFinishedEventHandler == null && eventProcessingFinishedSignal?.Empty() == false)
+ stageEventProcessingFinishedEventHandler -= value;
+ if (stageEventProcessingFinishedEventHandler == null && eventProcessingFinishedSignal?.Empty() == false)
{
- eventProcessingFinishedSignal?.Disconnect(_stageEventProcessingFinishedEventCallbackDelegate);
+ eventProcessingFinishedSignal?.Disconnect(stageEventProcessingFinishedEventCallbackDelegate);
}
}
}
{
add
{
- if (_stageContextLostEventHandler == null)
+ if (stageContextLostEventHandler == null)
{
- _stageContextLostEventCallbackDelegate = OnContextLost;
+ stageContextLostEventCallbackDelegate = OnContextLost;
contextLostSignal = ContextLostSignal();
- contextLostSignal?.Connect(_stageContextLostEventCallbackDelegate);
+ contextLostSignal?.Connect(stageContextLostEventCallbackDelegate);
}
- _stageContextLostEventHandler += value;
+ stageContextLostEventHandler += value;
}
remove
{
- _stageContextLostEventHandler -= value;
- if (_stageContextLostEventHandler == null && contextLostSignal?.Empty() == false)
+ stageContextLostEventHandler -= value;
+ if (stageContextLostEventHandler == null && contextLostSignal?.Empty() == false)
{
- contextLostSignal?.Disconnect(_stageContextLostEventCallbackDelegate);
+ contextLostSignal?.Disconnect(stageContextLostEventCallbackDelegate);
}
}
}
{
add
{
- if (_stageContextRegainedEventHandler == null)
+ if (stageContextRegainedEventHandler == null)
{
- _stageContextRegainedEventCallbackDelegate = OnContextRegained;
+ stageContextRegainedEventCallbackDelegate = OnContextRegained;
contextRegainedSignal = ContextRegainedSignal();
- contextRegainedSignal?.Connect(_stageContextRegainedEventCallbackDelegate);
+ contextRegainedSignal?.Connect(stageContextRegainedEventCallbackDelegate);
}
- _stageContextRegainedEventHandler += value;
+ stageContextRegainedEventHandler += value;
}
remove
{
- _stageContextRegainedEventHandler -= value;
- if (_stageContextRegainedEventHandler == null && contextRegainedSignal?.Empty() == false)
+ stageContextRegainedEventHandler -= value;
+ if (stageContextRegainedEventHandler == null && contextRegainedSignal?.Empty() == false)
{
- contextRegainedSignal?.Disconnect(_stageContextRegainedEventCallbackDelegate);
+ contextRegainedSignal?.Disconnect(stageContextRegainedEventCallbackDelegate);
}
}
}
{
add
{
- if (_stageSceneCreatedEventHandler == null)
+ if (stageSceneCreatedEventHandler == null)
{
- _stageSceneCreatedEventCallbackDelegate = OnSceneCreated;
+ stageSceneCreatedEventCallbackDelegate = OnSceneCreated;
sceneCreatedSignal = SceneCreatedSignal();
- sceneCreatedSignal?.Connect(_stageSceneCreatedEventCallbackDelegate);
+ sceneCreatedSignal?.Connect(stageSceneCreatedEventCallbackDelegate);
}
- _stageSceneCreatedEventHandler += value;
+ stageSceneCreatedEventHandler += value;
}
remove
{
- _stageSceneCreatedEventHandler -= value;
- if (_stageSceneCreatedEventHandler == null && sceneCreatedSignal?.Empty() == false)
+ stageSceneCreatedEventHandler -= value;
+ if (stageSceneCreatedEventHandler == null && sceneCreatedSignal?.Empty() == false)
{
- sceneCreatedSignal?.Disconnect(_stageSceneCreatedEventCallbackDelegate);
+ sceneCreatedSignal?.Disconnect(stageSceneCreatedEventCallbackDelegate);
}
}
}
/// <since_tizen> 5 </since_tizen>
internal void DisconnectNativeSignals()
{
- if (_windowFocusChangedEventCallback != null)
+ if (windowFocusChangedEventCallback != null)
{
- windowFocusChangedSignal?.Disconnect(_windowFocusChangedEventCallback);
+ windowFocusChangedSignal?.Disconnect(windowFocusChangedEventCallback);
}
- if (_rootLayerTouchDataCallback != null)
+ if (rootLayerTouchDataCallback != null)
{
- touchDataSignal?.Disconnect(_rootLayerTouchDataCallback);
+ touchDataSignal?.Disconnect(rootLayerTouchDataCallback);
}
- if (_wheelEventCallback != null)
+ if (wheelEventCallback != null)
{
- wheelSignal?.Disconnect(_wheelEventCallback);
+ wheelSignal?.Disconnect(wheelEventCallback);
}
if (DetentEventCallback != null)
stageWheelSignal?.Disconnect(DetentEventCallback);
}
- if (_stageKeyCallbackDelegate != null)
+ if (stageKeyCallbackDelegate != null)
{
- keyEventSignal?.Disconnect(_stageKeyCallbackDelegate);
+ keyEventSignal?.Disconnect(stageKeyCallbackDelegate);
}
- if (_stageEventProcessingFinishedEventCallbackDelegate != null)
+ if (stageEventProcessingFinishedEventCallbackDelegate != null)
{
- eventProcessingFinishedSignal?.Disconnect(_stageEventProcessingFinishedEventCallbackDelegate);
+ eventProcessingFinishedSignal?.Disconnect(stageEventProcessingFinishedEventCallbackDelegate);
}
- if (_stageContextLostEventCallbackDelegate != null)
+ if (stageContextLostEventCallbackDelegate != null)
{
- contextLostSignal?.Disconnect(_stageContextLostEventCallbackDelegate);
+ contextLostSignal?.Disconnect(stageContextLostEventCallbackDelegate);
}
- if (_stageContextRegainedEventCallbackDelegate != null)
+ if (stageContextRegainedEventCallbackDelegate != null)
{
- contextRegainedSignal?.Disconnect(_stageContextRegainedEventCallbackDelegate);
+ contextRegainedSignal?.Disconnect(stageContextRegainedEventCallbackDelegate);
}
- if (_stageSceneCreatedEventCallbackDelegate != null)
+ if (stageSceneCreatedEventCallbackDelegate != null)
{
- sceneCreatedSignal?.Disconnect(_stageSceneCreatedEventCallbackDelegate);
+ sceneCreatedSignal?.Disconnect(stageSceneCreatedEventCallbackDelegate);
}
- if (_windowResizeEventCallback != null)
+ if (windowResizeEventCallback != null)
{
- resizeSignal?.Disconnect(_windowResizeEventCallback);
+ resizeSignal?.Disconnect(windowResizeEventCallback);
}
- if (_windowFocusChangedEventCallback2 != null)
+ if (windowFocusChangedEventCallback2 != null)
{
- windowFocusChangedSignal2?.Disconnect(_windowFocusChangedEventCallback2);
+ windowFocusChangedSignal2?.Disconnect(windowFocusChangedEventCallback2);
}
if (transitionEffectSignal != null)
return;
}
- FocusChangedEventArgs e = new FocusChangedEventArgs();
-
- e.FocusGained = focusGained;
-
- if (_windowFocusChangedEventHandler != null)
+ if (windowFocusChangedEventHandler != null)
{
- _windowFocusChangedEventHandler(this, e);
+ FocusChangedEventArgs e = new FocusChangedEventArgs();
+ e.FocusGained = focusGained;
+ windowFocusChangedEventHandler(this, e);
}
}
return false;
}
- TouchEventArgs e = new TouchEventArgs();
-
- e.Touch = Tizen.NUI.Touch.GetTouchFromPtr(touchData);
-
- if (_rootLayerTouchDataEventHandler != null)
+ if (rootLayerTouchDataEventHandler != null)
{
- _rootLayerTouchDataEventHandler(this, e);
+ TouchEventArgs e = new TouchEventArgs();
+ e.Touch = Tizen.NUI.Touch.GetTouchFromPtr(touchData);
+ rootLayerTouchDataEventHandler(this, e);
}
return false;
}
return true;
}
- WheelEventArgs e = new WheelEventArgs();
-
- e.Wheel = Tizen.NUI.Wheel.GetWheelFromPtr(wheelEvent);
-
- if (_stageWheelHandler != null)
+ if (stageWheelHandler != null)
{
- _stageWheelHandler(this, e);
+ WheelEventArgs e = new WheelEventArgs();
+ e.Wheel = Tizen.NUI.Wheel.GetWheelFromPtr(wheelEvent);
+ stageWheelHandler(this, e);
}
return true;
}
// Callback for Stage KeyEventsignal
private void OnStageKey(IntPtr data)
{
- KeyEventArgs e = new KeyEventArgs();
- e.Key = Tizen.NUI.Key.GetKeyFromPtr(data);
-
-
- if (_stageKeyHandler != null)
+ if (stageKeyHandler != null)
{
+ KeyEventArgs e = new KeyEventArgs();
+ e.Key = Tizen.NUI.Key.GetKeyFromPtr(data);
//here we send all data to user event handlers
- _stageKeyHandler(this, e);
+ stageKeyHandler(this, e);
}
}
// Callback for Stage EventProcessingFinishedSignal
private void OnEventProcessingFinished()
{
- if (_stageEventProcessingFinishedEventHandler != null)
- {
- _stageEventProcessingFinishedEventHandler(this, null);
- }
+ stageEventProcessingFinishedEventHandler?.Invoke(this, null);
}
// Callback for Stage ContextLostSignal
private void OnContextLost()
{
- if (_stageContextLostEventHandler != null)
- {
- _stageContextLostEventHandler(this, null);
- }
+ stageContextLostEventHandler?.Invoke(this, null);
}
// Callback for Stage ContextRegainedSignal
private void OnContextRegained()
{
- if (_stageContextRegainedEventHandler != null)
- {
- _stageContextRegainedEventHandler(this, null);
- }
+ stageContextRegainedEventHandler?.Invoke(this, null);
}
// Callback for Stage SceneCreatedSignal
private void OnSceneCreated()
{
- if (_stageSceneCreatedEventHandler != null)
- {
- _stageSceneCreatedEventHandler(this, null);
- }
+ stageSceneCreatedEventHandler?.Invoke(this, null);
}
private void OnResized(IntPtr window, IntPtr windowSize)
return;
}
- ResizedEventArgs e = new ResizedEventArgs();
- // var val = new Uint16Pair(windowSize, false);
- // e.WindowSize = new Size2D(val.GetWidth(), val.GetHeight());
- // val.Dispose();
-
- // Workaround : windowSize should be valid pointer from dali,
- // but currenlty it is fixed and is not Uint16Pair class.
- // will be fixed later.
- e.WindowSize = this.WindowSize;
-
- if (_windowResizeEventHandler != null)
+ if (windowResizeEventHandler != null)
{
- _windowResizeEventHandler(this, e);
+ ResizedEventArgs e = new ResizedEventArgs();
+ // var val = new Uint16Pair(windowSize, false);
+ // e.WindowSize = new Size2D(val.GetWidth(), val.GetHeight());
+ // val.Dispose();
+
+ // Workaround : windowSize should be valid pointer from dali,
+ // but currenlty it is fixed and is not Uint16Pair class.
+ // will be fixed later.
+ e.WindowSize = this.WindowSize;
+ windowResizeEventHandler(this, e);
}
}
return;
}
- FocusChangedEventArgs e = new FocusChangedEventArgs();
-
- e.FocusGained = focusGained;
-
- if (_windowFocusChangedEventHandler2 != null)
+ if (windowFocusChangedEventHandler2 != null)
{
- _windowFocusChangedEventHandler2(this, e);
+ FocusChangedEventArgs e = new FocusChangedEventArgs();
+ e.FocusGained = focusGained;
+ windowFocusChangedEventHandler2(this, e);
}
}
return;
}
- TransitionEffectEventArgs e = new TransitionEffectEventArgs();
-
- e.State = (EffectState)state;
-
- e.Type = (EffectType)type;
-
if (transitionEffectHandler != null)
{
+ TransitionEffectEventArgs e = new TransitionEffectEventArgs();
+ e.State = (EffectState)state;
+ e.Type = (EffectType)type;
transitionEffectHandler(this, e);
}
return;
private void OnKeyboardRepeatSettingsChanged()
{
- if (keyboardRepeatSettingsChangedHandler != null)
- {
- keyboardRepeatSettingsChangedHandler(this, null);
- }
+ keyboardRepeatSettingsChangedHandler?.Invoke(this, null);
return;
}
/// <since_tizen> 3 </since_tizen>
public class TouchEventArgs : EventArgs
{
- private Touch _touch;
+ private Touch touch;
/// <summary>
/// Touch.
{
get
{
- return _touch;
+ return touch;
}
set
{
- _touch = value;
+ touch = value;
}
}
}
/// <since_tizen> 3 </since_tizen>
public class WheelEventArgs : EventArgs
{
- private Wheel _wheel;
+ private Wheel wheel;
/// <summary>
/// Wheel.
{
get
{
- return _wheel;
+ return wheel;
}
set
{
- _wheel = value;
+ wheel = value;
}
}
}
/// <since_tizen> 3 </since_tizen>
public class KeyEventArgs : EventArgs
{
- private Key _key;
+ private Key key;
/// <summary>
/// Key.
{
get
{
- return _key;
+ return key;
}
set
{
- _key = value;
+ key = value;
}
}
}
/// <since_tizen> 3 </since_tizen>
public class ResizedEventArgs : EventArgs
{
- Size2D _windowSize;
+ Size2D windowSize;
/// <summary>
/// This window size.
{
get
{
- return _windowSize;
+ return windowSize;
}
set
{
- _windowSize = value;
+ windowSize = value;
}
}
}
}
VisibilityChangedEventSignal.Emit(this, visibility);
}
-
-
-
}
}
-using System;
+/*
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+using System;
using System.ComponentModel;
namespace Tizen.NUI.Xaml
+/*
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
using System.ComponentModel;
namespace Tizen.NUI.Xaml
-using System.ComponentModel;
+/*
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+using System.ComponentModel;
namespace Tizen.NUI.Xaml
{
+/*
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
using System.ComponentModel;
namespace Tizen.NUI.Xaml
+/*
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
using System;
using System.ComponentModel;
+/*
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
using System;
using System.ComponentModel;
+/*
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
using System.ComponentModel;
using System.Xml;
+/*
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
using System;
using System.ComponentModel;
using Tizen.NUI.Binding;
+/*
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
using System;
using System.Collections;
using System.Collections.Generic;
+/*
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
using System;
using Tizen.NUI.Binding.Internals;
using Tizen.NUI.Binding;
+/*
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
using System;
using System.ComponentModel;
using Tizen.NUI.Binding;
+/*
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
using System;
using System.ComponentModel;
using Tizen.NUI.Binding;
-using System;
+/*
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+using System;
using System.ComponentModel;
namespace Tizen.NUI.Xaml
+/*
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
using System;
+using System.ComponentModel;
+
using Tizen.NUI.Binding.Internals;
-using Tizen.NUI.Xaml.Internals;
using Tizen.NUI.Binding;
-using System.ComponentModel;
namespace Tizen.NUI.Xaml
{
+/*
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
using System;
using System.ComponentModel;
using System.Linq;
+/*
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
using System;
using System.ComponentModel;
using Tizen.NUI.Binding;
{
return new TemplateBinding(Path, Mode, Converter, ConverterParameter, StringFormat);
}
-
object IMarkupExtension.ProvideValue(IServiceProvider serviceProvider)
{
return (this as IMarkupExtension<BindingBase>).ProvideValue(serviceProvider);
+/*
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
using System;
using Tizen.NUI.Binding;
-using System;
+/*
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+using System;
namespace Tizen.NUI.Xaml
{
+/*
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
using System;
using System.Xml;
using System.Reflection;
-using System;
+/*
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+using System;
using System.ComponentModel;
namespace Tizen.NUI.Xaml
+/*
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
//
// ViewExtensions.cs
//
// THE SOFTWARE.
using System;
-using System.Reflection;
using System.ComponentModel;
-using Tizen.NUI.Binding;
using System.Diagnostics.CodeAnalysis;
namespace Tizen.NUI.Xaml
XamlLoader.Load(view, xamlScript);
return view;
}
-
}
}
-using System;
+/*
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+using System;
using System.ComponentModel;
using System.Reflection;
-using System.Runtime.CompilerServices;
namespace Tizen.NUI.Xaml
{
+/*
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
using System;
using System.ComponentModel;
using System.Runtime.CompilerServices;
+/*
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
using System;
using System.ComponentModel;
using System.Diagnostics;
[EditorBrowsable(EditorBrowsableState.Never)]
public class XamlParseException : Exception
{
- readonly string _unformattedMessage;
+ readonly string unformattedMessage;
static private StringBuilder GetStackInfo()
{
[EditorBrowsable(EditorBrowsableState.Never)]
public XamlParseException(string message) : base(message)
{
- _unformattedMessage = message;
+ unformattedMessage = message;
}
/// <summary> Initializes a new instance with message and inner exception. </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
public XamlParseException(string message, Exception innerException = null) : base(message, innerException)
{
- _unformattedMessage = message;
+ unformattedMessage = message;
}
/// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
public XamlParseException(string message, IXmlLineInfo xmlInfo, Exception innerException = null) : base(FormatMessage(message + GetStackInfo(), xmlInfo), innerException)
{
- _unformattedMessage = message;
+ unformattedMessage = message;
XmlInfo = xmlInfo;
}
internal string UnformattedMessage
{
- get { return _unformattedMessage ?? Message; }
+ get { return unformattedMessage ?? Message; }
}
static string FormatMessage(string message, IXmlLineInfo xmlinfo)
-using System;
+/*
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+using System;
using System.ComponentModel;
using System.Reflection;
-using System;
+/*
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Reflection;
using System.Xml;
+
using Tizen.NUI.Binding;
using Tizen.NUI.Binding.Internals;
-using System.ComponentModel;
+/*
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+using System.ComponentModel;
using System.Xml;
namespace Tizen.NUI.Xaml
[EditorBrowsable(EditorBrowsableState.Never)]
public class XmlLineInfo : IXmlLineInfo
{
- readonly bool _hasLineInfo;
+ readonly bool hasLineInfo;
/// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
[EditorBrowsable(EditorBrowsableState.Never)]
public XmlLineInfo(int linenumber, int lineposition)
{
- _hasLineInfo = true;
+ hasLineInfo = true;
LineNumber = linenumber;
LinePosition = lineposition;
}
[EditorBrowsable(EditorBrowsableState.Never)]
public bool HasLineInfo()
{
- return _hasLineInfo;
+ return hasLineInfo;
}
/// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
-using System;
+/*
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
BindableProperty.Create(nameof(BindingContext), typeof(object), typeof(BindableObject), default(object),
BindingMode.OneWay, null, BindingContextPropertyChanged, null, null, BindingContextPropertyBindingChanging);
- readonly List<BindablePropertyContext> _properties = new List<BindablePropertyContext>(4);
+ readonly List<BindablePropertyContext> properties = new List<BindablePropertyContext>(4);
- bool _applying;
- object _inheritedContext;
+ bool applying;
+ object inheritedContext;
/// <summary>
/// Gets or sets object that contains the properties that will be targeted by the bound properties that belong to this BindableObject.
[EditorBrowsable(EditorBrowsableState.Never)]
public object BindingContext
{
- get { return _inheritedContext ?? GetValue(BindingContextProperty); }
+ get { return inheritedContext ?? GetValue(BindingContextProperty); }
set { SetValue(BindingContextProperty, value); }
}
if (bpContext != null && ((bpContext.Attributes & BindableContextAttributes.IsManuallySet) != 0))
return;
- object oldContext = bindable._inheritedContext;
+ object oldContext = bindable.inheritedContext;
if (ReferenceEquals(oldContext, value))
return;
if (bpContext != null && bpContext.Binding != null)
{
bpContext.Binding.Context = value;
- bindable._inheritedContext = null;
+ bindable.inheritedContext = null;
}
else
{
- bindable._inheritedContext = value;
+ bindable.inheritedContext = value;
}
bindable.ApplyBindings(skipBindingContext: false, fromBindingContextChanged: true);
[EditorBrowsable(EditorBrowsableState.Never)]
protected void UnapplyBindings()
{
- for (int i = 0, _propertiesCount = _properties.Count; i < _propertiesCount; i++)
+ for (int i = 0, _propertiesCount = properties.Count; i < _propertiesCount; i++)
{
- BindablePropertyContext context = _properties[i];
+ BindablePropertyContext context = properties[i];
if (context.Binding == null)
continue;
{
var values = new object[2];
- for (var i = 0; i < _properties.Count; i++)
+ for (var i = 0; i < properties.Count; i++)
{
- BindablePropertyContext context = _properties[i];
+ BindablePropertyContext context = properties[i];
if (ReferenceEquals(context.Property, property0))
{
{
var values = new object[3];
- for (var i = 0; i < _properties.Count; i++)
+ for (var i = 0; i < properties.Count; i++)
{
- BindablePropertyContext context = _properties[i];
+ BindablePropertyContext context = properties[i];
if (ReferenceEquals(context.Property, property0))
{
internal object[] GetValues(params BindableProperty[] properties)
{
var values = new object[properties.Length];
- for (var i = 0; i < _properties.Count; i++)
+ for (var i = 0; i < this.properties.Count; i++)
{
- var context = _properties[i];
+ var context = this.properties[i];
var index = properties.IndexOf(context.Property);
if (index < 0)
continue;
context.Attributes |= BindableContextAttributes.IsSetFromStyle;
// else omitted on purpose
- bool currentlyApplying = _applying;
+ bool currentlyApplying = applying;
if ((context.Attributes & BindableContextAttributes.IsBeingSet) != 0)
{
internal void ApplyBindings(bool skipBindingContext, bool fromBindingContextChanged)
{
- var prop = _properties.ToArray();
+ var prop = properties.ToArray();
for (int i = 0, propLength = prop.Length; i < propLength; i++)
{
BindablePropertyContext context = prop[i];
static void BindingContextPropertyBindingChanging(BindableObject bindable, BindingBase oldBindingBase, BindingBase newBindingBase)
{
- object context = bindable._inheritedContext;
+ object context = bindable.inheritedContext;
var oldBinding = oldBindingBase as Binding;
var newBinding = newBindingBase as Binding;
static void BindingContextPropertyChanged(BindableObject bindable, object oldvalue, object newvalue)
{
- bindable._inheritedContext = null;
+ bindable.inheritedContext = null;
bindable.ApplyBindings(skipBindingContext: true, fromBindingContextChanged: true);
bindable.OnBindingContextChanged();
}
else
context.Attributes = BindableContextAttributes.IsDefaultValueCreated;
- _properties.Add(context);
+ properties.Add(context);
return context;
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
BindablePropertyContext GetContext(BindableProperty property)
{
- List<BindablePropertyContext> properties = _properties;
+ List<BindablePropertyContext> propertyList = properties;
- for (var i = 0; i < properties.Count; i++)
+ for (var i = 0; i < propertyList.Count; i++)
{
- BindablePropertyContext context = properties[i];
+ BindablePropertyContext context = propertyList[i];
if (ReferenceEquals(context.Property, property))
return context;
}
if (binding != null && !currentlyApplying)
{
- _applying = true;
+ applying = true;
binding.Apply(true);
- _applying = false;
+ applying = false;
}
OnPropertyChanged(property.PropertyName);
{
if (binding != null && !currentlyApplying)
{
- _applying = true;
+ applying = true;
binding.Apply(true);
- _applying = false;
+ applying = false;
}
OnPropertyChanged(property.PropertyName);
-using System;
+/*
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+using System;
using System.ComponentModel;
using System.Linq.Expressions;
+/*
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
using System;
using System.Collections.Generic;
using System.Diagnostics;
+/*
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
using System;
-using System.Collections.Generic;
using System.ComponentModel;
-using System.Diagnostics;
using System.Globalization;
using System.Linq;
using System.Reflection;
+/*
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
using System;
using System.ComponentModel;
+/*
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq.Expressions;
using System.Reflection;
using System.Text;
-using Tizen.NUI.Binding.Internals;
using System.Diagnostics.CodeAnalysis;
namespace Tizen.NUI.Binding
public sealed class Binding : BindingBase
{
internal const string SelfPath = ".";
- IValueConverter _converter;
- object _converterParameter;
+ IValueConverter converter;
+ object converterParameter;
- BindingExpression _expression;
- string _path;
- object _source;
- string _updateSourceEventName;
+ BindingExpression expression;
+ string path;
+ object source;
+ string updateSourceEventName;
/// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
[EditorBrowsable(EditorBrowsableState.Never)]
public IValueConverter Converter
{
- get { return _converter; }
+ get { return converter; }
set
{
ThrowIfApplied();
- _converter = value;
+ converter = value;
}
}
[EditorBrowsable(EditorBrowsableState.Never)]
public object ConverterParameter
{
- get { return _converterParameter; }
+ get { return converterParameter; }
set
{
ThrowIfApplied();
- _converterParameter = value;
+ converterParameter = value;
}
}
[EditorBrowsable(EditorBrowsableState.Never)]
public string Path
{
- get { return _path; }
+ get { return path; }
set
{
ThrowIfApplied();
- _path = value;
- _expression = new BindingExpression(this, !string.IsNullOrWhiteSpace(value) ? value : SelfPath);
+ path = value;
+ expression = new BindingExpression(this, !string.IsNullOrWhiteSpace(value) ? value : SelfPath);
}
}
[EditorBrowsable(EditorBrowsableState.Never)]
public object Source
{
- get { return _source; }
+ get { return source; }
set
{
ThrowIfApplied();
- _source = value;
+ source = value;
}
}
[EditorBrowsable(EditorBrowsableState.Never)]
public string UpdateSourceEventName
{
- get { return _updateSourceEventName; }
+ get { return updateSourceEventName; }
set
{
ThrowIfApplied();
- _updateSourceEventName = value;
+ updateSourceEventName = value;
}
}
{
base.Apply(fromTarget);
- if (_expression == null)
- _expression = new BindingExpression(this, SelfPath);
+ if (expression == null)
+ expression = new BindingExpression(this, SelfPath);
- _expression.Apply(fromTarget);
+ expression.Apply(fromTarget);
}
internal override void Apply(object newContext, BindableObject bindObj, BindableProperty targetProperty, bool fromBindingContextChanged = false)
{
- object src = _source;
+ object src = source;
var isApplied = IsApplied;
base.Apply(src ?? newContext, bindObj, targetProperty, fromBindingContextChanged: fromBindingContextChanged);
return;
object bindingContext = src ?? Context ?? newContext;
- if (_expression == null && bindingContext != null)
- _expression = new BindingExpression(this, SelfPath);
+ if (expression == null && bindingContext != null)
+ expression = new BindingExpression(this, SelfPath);
- _expression?.Apply(bindingContext, bindObj, targetProperty);
+ expression?.Apply(bindingContext, bindObj, targetProperty);
}
internal override BindingBase Clone()
base.Unapply(fromBindingContextChanged: fromBindingContextChanged);
- if (_expression != null)
- _expression.Unapply();
+ if (expression != null)
+ expression.Unapply();
}
[Obsolete]
+/*
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
using System;
using System.Collections;
using System.Runtime.CompilerServices;
{
static readonly ConditionalWeakTable<IEnumerable, CollectionSynchronizationContext> SynchronizedCollections = new ConditionalWeakTable<IEnumerable, CollectionSynchronizationContext>();
- BindingMode _mode = BindingMode.Default;
- string _stringFormat;
- object _targetNullValue;
- object _fallbackValue;
+ BindingMode mode = BindingMode.Default;
+ string stringFormat;
+ object targetNullValue;
+ object fallbackValue;
internal BindingBase()
{
[EditorBrowsable(EditorBrowsableState.Never)]
public BindingMode Mode
{
- get { return _mode; }
+ get { return mode; }
set
{
if (value != BindingMode.Default
ThrowIfApplied();
- _mode = value;
+ mode = value;
}
}
[EditorBrowsable(EditorBrowsableState.Never)]
public string StringFormat
{
- get { return _stringFormat; }
+ get { return stringFormat; }
set
{
ThrowIfApplied();
- _stringFormat = value;
+ stringFormat = value;
}
}
[EditorBrowsable(EditorBrowsableState.Never)]
public object TargetNullValue
{
- get { return _targetNullValue; }
+ get { return targetNullValue; }
set
{
ThrowIfApplied();
- _targetNullValue = value;
+ targetNullValue = value;
}
}
[EditorBrowsable(EditorBrowsableState.Never)]
public object FallbackValue
{
- get => _fallbackValue;
+ get => fallbackValue;
set
{
ThrowIfApplied();
- _fallbackValue = value;
+ fallbackValue = value;
}
}
+/*
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
using System.ComponentModel;
namespace Tizen.NUI.Binding
-using System.ComponentModel;
+/*
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+using System.ComponentModel;
using Tizen.NUI.Xaml;
namespace Tizen.NUI.Binding
+/*
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
using System;
using System.Collections;
using System.ComponentModel;
+/*
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
using System;
using System.ComponentModel;
using System.Globalization;
+/*
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
using System;
using System.Reflection;
using System.Windows.Input;
+/*
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
-using System.Collections.Specialized;
using System.ComponentModel;
using System.Runtime.CompilerServices;
using System.Xml;
/// </summary>
internal static readonly BindableProperty ClassIdProperty = BindableProperty.Create(nameof(ClassId), typeof(string), typeof(Tizen.NUI.BaseComponents.View), null);
- string _automationId;
+ string automationId;
- IList<BindableObject> _bindableResources;
+ IList<BindableObject> bindableResources;
- List<Action<object, ResourcesChangedEventArgs>> _changeHandlers;
+ List<Action<object, ResourcesChangedEventArgs>> changeHandlers;
- Dictionary<BindableProperty, string> _dynamicResources;
+ Dictionary<BindableProperty, string> dynamicResources;
- Guid? _id;
+ Guid? id;
- Element _parentOverride;
+ Element parentOverride;
- string _styleId;
+ string styleId;
/// <summary>
/// Gets or sets a value that allows the automation framework to find and interact with this element.
[EditorBrowsable(EditorBrowsableState.Never)]
public string AutomationId
{
- get { return _automationId; }
+ get { return automationId; }
set
{
- if (_automationId != null)
+ if (automationId != null)
throw new InvalidOperationException("AutomationId may only be set one time");
- _automationId = value;
+ automationId = value;
}
}
{
get
{
- if (!_id.HasValue)
- _id = Guid.NewGuid();
- return _id.Value;
+ if (!id.HasValue)
+ id = Guid.NewGuid();
+ return id.Value;
}
}
[EditorBrowsable(EditorBrowsableState.Never)]
public string StyleId
{
- get { return _styleId; }
+ get { return styleId; }
set
{
- if (_styleId == value)
+ if (styleId == value)
return;
OnPropertyChanging();
- _styleId = value;
+ styleId = value;
OnPropertyChanged();
}
}
internal Element ParentOverride
{
- get { return _parentOverride; }
+ get { return parentOverride; }
set
{
- if (_parentOverride == value)
+ if (parentOverride == value)
return;
bool emitChange = Parent != value;
if (emitChange)
OnPropertyChanging(nameof(Parent));
- _parentOverride = value;
+ parentOverride = value;
if (emitChange)
OnPropertyChanged(nameof(Parent));
Dictionary<BindableProperty, string> DynamicResources
{
- get { return _dynamicResources ?? (_dynamicResources = new Dictionary<BindableProperty, string>()); }
+ get { return dynamicResources ?? (dynamicResources = new Dictionary<BindableProperty, string>()); }
}
void IElement.AddResourcesChangedListener(Action<object, ResourcesChangedEventArgs> onchanged)
{
- _changeHandlers = _changeHandlers ?? new List<Action<object, ResourcesChangedEventArgs>>(2);
- _changeHandlers.Add(onchanged);
+ changeHandlers = changeHandlers ?? new List<Action<object, ResourcesChangedEventArgs>>(2);
+ changeHandlers.Add(onchanged);
}
/// <summary>
[EditorBrowsable(EditorBrowsableState.Never)]
public Element Parent
{
- get { return _parentOverride ?? RealParent; }
+ get { return parentOverride ?? RealParent; }
set
{
if (RealParent == value)
void IElement.RemoveResourcesChangedListener(Action<object, ResourcesChangedEventArgs> onchanged)
{
- if (_changeHandlers == null)
+ if (changeHandlers == null)
return;
- _changeHandlers.Remove(onchanged);
+ changeHandlers.Remove(onchanged);
}
//void IElementController.SetValueFromRenderer(BindableProperty property, object value) => SetValueFromRenderer(property, value);
SetChildInheritedBindingContext(child, bc);
}
- if (_bindableResources != null)
- foreach (BindableObject item in _bindableResources)
+ if (bindableResources != null)
+ foreach (BindableObject item in bindableResources)
{
SetInheritedBindingContext(item, BindingContext);
}
DynamicResources.Remove(property);
if (DynamicResources.Count == 0)
- _dynamicResources = null;
+ dynamicResources = null;
base.OnRemoveDynamicResource(property);
}
{
if (values == null)
return;
- if (_changeHandlers != null)
- foreach (Action<object, ResourcesChangedEventArgs> handler in _changeHandlers)
+ if (changeHandlers != null)
+ foreach (Action<object, ResourcesChangedEventArgs> handler in changeHandlers)
handler(this, new ResourcesChangedEventArgs(values));
- if (_dynamicResources == null)
+ if (dynamicResources == null)
return;
- if (_bindableResources == null)
- _bindableResources = new List<BindableObject>();
+ if (bindableResources == null)
+ bindableResources = new List<BindableObject>();
foreach (KeyValuePair<string, object> value in values)
{
List<BindableProperty> changedResources = null;
var bindableObject = value.Value as BindableObject;
if (bindableObject != null && (bindableObject as Element)?.Parent == null)
{
- if (!_bindableResources.Contains(bindableObject))
- _bindableResources.Add(bindableObject);
+ if (!bindableResources.Contains(bindableObject))
+ bindableResources.Add(bindableObject);
SetInheritedBindingContext(bindableObject, BindingContext);
}
}
-using System;
+/*
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+using System;
using System.ComponentModel;
namespace Tizen.NUI.Binding
+/*
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
using System.ComponentModel;
namespace Tizen.NUI.Binding
-using System;
+/*
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+using System;
using System.Globalization;
using System.ComponentModel;
-using System;
+/*
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+using System;
using System.ComponentModel;
using System.Reflection;
+/*
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
using System;
using System.ComponentModel;
using Tizen.NUI.Xaml;
[AcceptEmptyServiceProvider]
public sealed class BindingCondition : Condition, IValueProvider
{
- readonly BindableProperty _boundProperty;
+ readonly BindableProperty boundProperty;
- BindingBase _binding;
- object _triggerValue;
+ BindingBase binding;
+ object triggerValue;
/// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
public BindingCondition()
{
- _boundProperty = BindableProperty.CreateAttached("Bound", typeof(object), typeof(BindingCondition), null, propertyChanged: OnBoundPropertyChanged);
+ boundProperty = BindableProperty.CreateAttached("Bound", typeof(object), typeof(BindingCondition), null, propertyChanged: OnBoundPropertyChanged);
}
/// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
public BindingBase Binding
{
- get { return _binding; }
+ get { return binding; }
set
{
- if (_binding == value)
+ if (binding == value)
return;
if (IsSealed)
throw new InvalidOperationException("Can not change Binding once the Condition has been applied.");
- _binding = value;
+ binding = value;
}
}
[EditorBrowsable(EditorBrowsableState.Never)]
public object Value
{
- get { return _triggerValue; }
+ get { return triggerValue; }
set
{
- if (_triggerValue == value)
+ if (triggerValue == value)
return;
if (IsSealed)
throw new InvalidOperationException("Can not change Value once the Condition has been applied.");
- _triggerValue = value;
+ triggerValue = value;
}
}
internal override bool GetState(BindableObject bindable)
{
- object newValue = bindable.GetValue(_boundProperty);
+ object newValue = bindable.GetValue(boundProperty);
return EqualsToValue(newValue);
}
internal override void SetUp(BindableObject bindable)
{
if (Binding != null)
- bindable.SetBinding(_boundProperty, Binding.Clone());
+ bindable.SetBinding(boundProperty, Binding.Clone());
}
internal override void TearDown(BindableObject bindable)
{
- bindable.RemoveBinding(_boundProperty);
- bindable.ClearValue(_boundProperty);
+ bindable.RemoveBinding(boundProperty);
+ bindable.ClearValue(boundProperty);
}
static IValueConverterProvider s_valueConverter = DependencyService.Get<IValueConverterProvider>();
+/*
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
using System;
using System.ComponentModel;
[EditorBrowsable(EditorBrowsableState.Never)]
public abstract class Condition
{
- Action<BindableObject, bool, bool> _conditionChanged;
+ Action<BindableObject, bool, bool> conditionChanged;
- bool _isSealed;
+ bool isSealed;
internal Condition()
{
internal Action<BindableObject, bool, bool> ConditionChanged
{
- get { return _conditionChanged; }
+ get { return conditionChanged; }
set
{
- if (_conditionChanged == value)
+ if (conditionChanged == value)
return;
- if (_conditionChanged != null)
+ if (conditionChanged != null)
throw new InvalidOperationException("The same condition instance can not be reused");
- _conditionChanged = value;
+ conditionChanged = value;
}
}
internal bool IsSealed
{
- get { return _isSealed; }
+ get { return isSealed; }
set
{
- if (_isSealed == value)
+ if (isSealed == value)
return;
if (!value)
throw new InvalidOperationException("What is sealed can not be unsealed.");
- _isSealed = value;
+ isSealed = value;
OnSealed();
}
}
-using System;
+/*
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+using System;
using System.Collections.Generic;
using System.ComponentModel;
using Tizen.NUI.Xaml;
+/*
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Reflection;
-using Tizen.NUI.Binding.Internals;
namespace Tizen.NUI.Binding
{
public sealed class EventTrigger : TriggerBase
{
static readonly MethodInfo s_handlerinfo = typeof(EventTrigger).GetRuntimeMethods().Single(mi => mi.Name == "OnEventTriggered" && mi.IsPublic == false);
- readonly List<BindableObject> _associatedObjects = new List<BindableObject>();
+ readonly List<BindableObject> associatedObjects = new List<BindableObject>();
- EventInfo _eventinfo;
+ EventInfo eventinfo;
- string _eventname;
- Delegate _handlerdelegate;
+ string eventname;
+ Delegate handlerdelegate;
/// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
[EditorBrowsable(EditorBrowsableState.Never)]
public string Event
{
- get { return _eventname; }
+ get { return eventname; }
set
{
- if (_eventname == value)
+ if (eventname == value)
return;
if (IsSealed)
throw new InvalidOperationException("Event cannot be changed once the Trigger has been applied");
OnPropertyChanging();
- _eventname = value;
+ eventname = value;
OnPropertyChanged();
}
}
base.OnAttachedTo(bindable);
if (!string.IsNullOrEmpty(Event))
AttachHandlerTo(bindable);
- _associatedObjects.Add(bindable);
+ associatedObjects.Add(bindable);
}
internal override void OnDetachingFrom(BindableObject bindable)
{
- _associatedObjects.Remove(bindable);
+ associatedObjects.Remove(bindable);
DetachHandlerFrom(bindable);
base.OnDetachingFrom(bindable);
}
{
try
{
- _eventinfo = bindable.GetType().GetRuntimeEvent(Event);
- _handlerdelegate = s_handlerinfo.CreateDelegate(_eventinfo?.EventHandlerType, this);
+ eventinfo = bindable.GetType().GetRuntimeEvent(Event);
+ handlerdelegate = s_handlerinfo.CreateDelegate(eventinfo?.EventHandlerType, this);
}
catch (Exception)
{
Console.WriteLine($"EventTrigger", "Can not attach EventTrigger to {binding.GetType()}.{Evnet}. Check if the handler exists and if the signature is right.");
}
- if (_eventinfo != null && _handlerdelegate != null)
- _eventinfo.AddEventHandler(bindable, _handlerdelegate);
+ if (eventinfo != null && handlerdelegate != null)
+ eventinfo.AddEventHandler(bindable, handlerdelegate);
}
void DetachHandlerFrom(BindableObject bindable)
{
- if (_eventinfo != null && _handlerdelegate != null)
- _eventinfo.RemoveEventHandler(bindable, _handlerdelegate);
+ if (eventinfo != null && handlerdelegate != null)
+ eventinfo.RemoveEventHandler(bindable, handlerdelegate);
}
// [Preserve]
+/*
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
using System;
using System.Collections.Generic;
using System.ComponentModel;
+/*
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
using System;
using System.ComponentModel;
using System.Reflection;
[AcceptEmptyServiceProvider]
public sealed class XamlPropertyCondition : Condition, IValueProvider
{
- readonly BindableProperty _stateProperty;
+ readonly BindableProperty stateProperty;
- BindableProperty _property;
- object _triggerValue;
+ BindableProperty property;
+ object triggerValue;
/// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
public XamlPropertyCondition()
{
- _stateProperty = BindableProperty.CreateAttached("State", typeof(bool), typeof(XamlPropertyCondition), false, propertyChanged: OnStatePropertyChanged);
+ stateProperty = BindableProperty.CreateAttached("State", typeof(bool), typeof(XamlPropertyCondition), false, propertyChanged: OnStatePropertyChanged);
}
/// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
public BindableProperty Property
{
- get { return _property; }
+ get { return property; }
set
{
- if (_property == value)
+ if (property == value)
return;
if (IsSealed)
throw new InvalidOperationException("Can not change Property once the Trigger has been applied.");
- _property = value;
+ property = value;
//convert the value
- if (_property != null && s_valueConverter != null)
+ if (property != null && s_valueConverter != null)
{
- Func<MemberInfo> minforetriever = () => _property.DeclaringType.GetRuntimeProperty(_property.PropertyName);
- Value = s_valueConverter.Convert(Value, _property.ReturnType, minforetriever, null);
+ Func<MemberInfo> minforetriever = () => property.DeclaringType.GetRuntimeProperty(property.PropertyName);
+ Value = s_valueConverter.Convert(Value, property.ReturnType, minforetriever, null);
}
}
}
[EditorBrowsable(EditorBrowsableState.Never)]
public object Value
{
- get { return _triggerValue; }
+ get { return triggerValue; }
set
{
- if (_triggerValue == value)
+ if (triggerValue == value)
return;
if (IsSealed)
throw new InvalidOperationException("Can not change Value once the Trigger has been applied.");
//convert the value
- if (_property != null && s_valueConverter != null)
+ if (property != null && s_valueConverter != null)
{
- Func<MemberInfo> minforetriever = () => _property.DeclaringType.GetRuntimeProperty(_property.PropertyName);
- _triggerValue = s_valueConverter.Convert(value, _property.ReturnType, minforetriever, null);
+ Func<MemberInfo> minforetriever = () => property.DeclaringType.GetRuntimeProperty(property.PropertyName);
+ triggerValue = s_valueConverter.Convert(value, property.ReturnType, minforetriever, null);
}
else
{
- _triggerValue = value;
+ triggerValue = value;
}
}
internal override bool GetState(BindableObject bindable)
{
- return (bool)bindable.GetValue(_stateProperty);
+ return (bool)bindable.GetValue(stateProperty);
}
static IValueConverterProvider s_valueConverter = DependencyService.Get<IValueConverterProvider>();
{
object newvalue = bindable.GetValue(Property);
bool newState = (newvalue == Value) || (newvalue != null && newvalue.Equals(Value));
- bindable.SetValue(_stateProperty, newState);
+ bindable.SetValue(stateProperty, newState);
bindable.PropertyChanged += OnAttachedObjectPropertyChanged;
}
internal override void TearDown(BindableObject bindable)
{
- bindable.ClearValue(_stateProperty);
+ bindable.ClearValue(stateProperty);
bindable.PropertyChanged -= OnAttachedObjectPropertyChanged;
}
void OnAttachedObjectPropertyChanged(object sender, PropertyChangedEventArgs e)
{
var bindable = (BindableObject)sender;
- var oldState = (bool)bindable.GetValue(_stateProperty);
+ var oldState = (bool)bindable.GetValue(stateProperty);
if (Property == null)
return;
object newvalue = bindable.GetValue(Property);
bool newstate = (newvalue == Value) || (newvalue != null && newvalue.Equals(Value));
if (oldState != newstate)
- bindable.SetValue(_stateProperty, newstate);
+ bindable.SetValue(stateProperty, newstate);
}
void OnStatePropertyChanged(BindableObject bindable, object oldValue, object newValue)
+/*
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
using System.ComponentModel;
namespace Tizen.NUI.Binding.Internals
+/*
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
using System.ComponentModel;
using Tizen.NUI.Binding;
+/*
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
using System;
using System.ComponentModel;
using System.Xml;
+/*
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
using System;
using System.Collections.Generic;
using System.ComponentModel;
[EditorBrowsable(EditorBrowsableState.Never)]
public static readonly BindableProperty NameScopeProperty = BindableProperty.CreateAttached("NameScope", typeof(INameScope), typeof(NameScope), default(INameScope));
- readonly Dictionary<string, object> _names = new Dictionary<string, object>();
+ readonly Dictionary<string, object> names = new Dictionary<string, object>();
object INameScope.FindByName(string name)
{
- if (_names.ContainsKey(name))
- return _names[name];
+ if (names.ContainsKey(name))
+ return names[name];
return null;
}
void INameScope.RegisterName(string name, object scopedElement)
{
- if (_names.ContainsKey(name))
+ if (names.ContainsKey(name))
throw new ArgumentException("An element with the same key already exists in NameScope", nameof(name));
- _names[name] = scopedElement;
+ names[name] = scopedElement;
}
[ObsoleteAttribute(" ", false)]
void INameScope.UnregisterName(string name)
{
- _names.Remove(name);
+ names.Remove(name);
}
/// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+/*
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
using System.Collections.Generic;
using System.ComponentModel;
using Tizen.NUI.Binding.Internals;
+/*
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
using System;
using System.Collections.Generic;
using System.ComponentModel;
-using System.Linq;
using System.Reflection;
-using Tizen.NUI.Binding;
namespace Tizen.NUI.Binding.Internals
{
+/*
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
using System;
using System.Collections;
using System.Collections.Generic;
public class ResourceDictionary : IResourceDictionary, IDictionary<string, object>
{
static ConditionalWeakTable<Type, ResourceDictionary> s_instances = new ConditionalWeakTable<Type, ResourceDictionary>();
- readonly Dictionary<string, object> _innerDictionary = new Dictionary<string, object>();
- ResourceDictionary _mergedInstance;
- Type _mergedWith;
- Uri _source;
+ readonly Dictionary<string, object> innerDictionary = new Dictionary<string, object>();
+ ResourceDictionary mergedInstance;
+ Type mergedWith;
+ Uri source;
/// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
[Obsolete("Use Source")]
public Type MergedWith
{
- get { return _mergedWith; }
+ get { return mergedWith; }
set
{
- if (_mergedWith == value)
+ if (mergedWith == value)
return;
- if (_source != null)
+ if (source != null)
throw new ArgumentException("MergedWith can not be used with Source");
if (!typeof(ResourceDictionary).GetTypeInfo().IsAssignableFrom(value.GetTypeInfo()))
throw new ArgumentException("MergedWith should inherit from ResourceDictionary");
- _mergedWith = value;
- if (_mergedWith == null)
+ mergedWith = value;
+ if (mergedWith == null)
return;
- _mergedInstance = s_instances.GetValue(_mergedWith, (key) => (ResourceDictionary)Activator.CreateInstance(key));
- OnValuesChanged(_mergedInstance.ToArray());
+ mergedInstance = s_instances.GetValue(mergedWith, (key) => (ResourceDictionary)Activator.CreateInstance(key));
+ OnValuesChanged(mergedInstance.ToArray());
}
}
[TypeConverter(typeof(RDSourceTypeConverter))]
public Uri Source
{
- get { return _source; }
+ get { return source; }
set
{
- if (_source == value)
+ if (source == value)
return;
throw new InvalidOperationException("Source can only be set from XAML."); //through the RDSourceTypeConverter
}
[EditorBrowsable(EditorBrowsableState.Never)]
public void SetAndLoadSource(Uri value, string resourcePath, Assembly assembly, System.Xml.IXmlLineInfo lineInfo)
{
- _source = value;
- if (_mergedWith != null)
+ source = value;
+ if (mergedWith != null)
throw new ArgumentException("Source can not be used with MergedWith");
//this will return a type if the RD as an x:Class element, and codebehind
var type = XamlResourceIdAttribute.GetTypeForPath(assembly, resourcePath);
if (type != null)
- _mergedInstance = s_instances.GetValue(type, (key) => (ResourceDictionary)Activator.CreateInstance(key));
+ mergedInstance = s_instances.GetValue(type, (key) => (ResourceDictionary)Activator.CreateInstance(key));
else
- _mergedInstance = DependencyService.Get<IResourcesLoader>()?.CreateFromResource<ResourceDictionary>(resourcePath, assembly, lineInfo);
- OnValuesChanged(_mergedInstance.ToArray());
+ mergedInstance = DependencyService.Get<IResourcesLoader>()?.CreateFromResource<ResourceDictionary>(resourcePath, assembly, lineInfo);
+ OnValuesChanged(mergedInstance.ToArray());
}
ICollection<ResourceDictionary> _mergedDictionaries;
void ICollection<KeyValuePair<string, object>>.Add(KeyValuePair<string, object> item)
{
- ((ICollection<KeyValuePair<string, object>>)_innerDictionary).Add(item);
+ ((ICollection<KeyValuePair<string, object>>)innerDictionary).Add(item);
OnValuesChanged(item);
}
[EditorBrowsable(EditorBrowsableState.Never)]
public void Clear()
{
- _innerDictionary.Clear();
+ innerDictionary.Clear();
}
bool ICollection<KeyValuePair<string, object>>.Contains(KeyValuePair<string, object> item)
{
- return ((ICollection<KeyValuePair<string, object>>)_innerDictionary).Contains(item)
- || (_mergedInstance != null && _mergedInstance.Contains(item));
+ return ((ICollection<KeyValuePair<string, object>>)innerDictionary).Contains(item)
+ || (mergedInstance != null && mergedInstance.Contains(item));
}
void ICollection<KeyValuePair<string, object>>.CopyTo(KeyValuePair<string, object>[] array, int arrayIndex)
{
- ((ICollection<KeyValuePair<string, object>>)_innerDictionary).CopyTo(array, arrayIndex);
+ ((ICollection<KeyValuePair<string, object>>)innerDictionary).CopyTo(array, arrayIndex);
}
/// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
public int Count
{
- get { return _innerDictionary.Count; }
+ get { return innerDictionary.Count; }
}
bool ICollection<KeyValuePair<string, object>>.IsReadOnly
{
- get { return ((ICollection<KeyValuePair<string, object>>)_innerDictionary).IsReadOnly; }
+ get { return ((ICollection<KeyValuePair<string, object>>)innerDictionary).IsReadOnly; }
}
bool ICollection<KeyValuePair<string, object>>.Remove(KeyValuePair<string, object> item)
{
- return ((ICollection<KeyValuePair<string, object>>)_innerDictionary).Remove(item);
+ return ((ICollection<KeyValuePair<string, object>>)innerDictionary).Remove(item);
}
/// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
{
if (ContainsKey(key))
throw new ArgumentException($"A resource with the key '{key}' is already present in the ResourceDictionary.");
- _innerDictionary.Add(key, value);
+ innerDictionary.Add(key, value);
OnValueChanged(key, value);
}
[EditorBrowsable(EditorBrowsableState.Never)]
public bool ContainsKey(string key)
{
- return _innerDictionary.ContainsKey(key);
+ return innerDictionary.ContainsKey(key);
}
/// <summary>
{
get
{
- if (_innerDictionary.ContainsKey(index))
- return _innerDictionary[index];
- if (_mergedInstance != null && _mergedInstance.ContainsKey(index))
- return _mergedInstance[index];
+ if (innerDictionary.ContainsKey(index))
+ return innerDictionary[index];
+ if (mergedInstance != null && mergedInstance.ContainsKey(index))
+ return mergedInstance[index];
if (MergedDictionaries != null)
foreach (var dict in MergedDictionaries.Reverse())
if (dict.ContainsKey(index))
}
set
{
- _innerDictionary[index] = value;
+ innerDictionary[index] = value;
OnValueChanged(index, value);
}
}
[EditorBrowsable(EditorBrowsableState.Never)]
public ICollection<string> Keys
{
- get { return _innerDictionary.Keys; }
+ get { return innerDictionary.Keys; }
}
/// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
public bool Remove(string key)
{
- return _innerDictionary.Remove(key);
+ return innerDictionary.Remove(key);
}
/// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
public ICollection<object> Values
{
- get { return _innerDictionary.Values; }
+ get { return innerDictionary.Values; }
}
IEnumerator IEnumerable.GetEnumerator()
[EditorBrowsable(EditorBrowsableState.Never)]
public IEnumerator<KeyValuePair<string, object>> GetEnumerator()
{
- return _innerDictionary.GetEnumerator();
+ return innerDictionary.GetEnumerator();
}
internal IEnumerable<KeyValuePair<string, object>> MergedResources
if (MergedDictionaries != null)
foreach (var r in MergedDictionaries.Reverse().SelectMany(x => x.MergedResources))
yield return r;
- if (_mergedInstance != null)
- foreach (var r in _mergedInstance.MergedResources)
+ if (mergedInstance != null)
+ foreach (var r in mergedInstance.MergedResources)
yield return r;
- foreach (var r in _innerDictionary)
+ foreach (var r in innerDictionary)
yield return r;
}
}
[EditorBrowsable(EditorBrowsableState.Never)]
public bool TryGetValue(string key, out object value)
{
- return _innerDictionary.TryGetValue(key, out value)
- || (_mergedInstance != null && _mergedInstance.TryGetValue(key, out value))
+ return innerDictionary.TryGetValue(key, out value)
+ || (mergedInstance != null && mergedInstance.TryGetValue(key, out value))
|| (MergedDictionaries != null && TryGetMergedDictionaryValue(key, out value));
}
+/*
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
using System;
using System.Collections.Generic;
using System.ComponentModel;
[ProvideCompiled("Tizen.NUI.Core.XamlC.SetterValueProvider")]
public sealed class Setter : IValueProvider
{
- readonly ConditionalWeakTable<BindableObject, object> _originalValues = new ConditionalWeakTable<BindableObject, object>();
+ readonly ConditionalWeakTable<BindableObject, object> originalValues = new ConditionalWeakTable<BindableObject, object>();
/// <since_tizen> 6 </since_tizen>
/// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
object originalValue = target.GetValue(Property);
if (!Equals(originalValue, Property.DefaultValue))
{
- _originalValues.Remove(target);
- _originalValues.Add(target, originalValue);
+ originalValues.Remove(target);
+ originalValues.Add(target, originalValue);
}
var dynamicResource = Value as DynamicResource;
if (!Equals(actual, Value) && !(Value is Tizen.NUI.Binding.Binding) && !(Value is DynamicResource))
{
//Do not reset default value if the value has been changed
- _originalValues.Remove(target);
+ originalValues.Remove(target);
return;
}
object defaultValue;
- if (_originalValues.TryGetValue(target, out defaultValue))
+ if (originalValues.TryGetValue(target, out defaultValue))
{
//reset default value, unapply bindings and dynamicResource
target.SetValue(Property, defaultValue, fromStyle);
- _originalValues.Remove(target);
+ originalValues.Remove(target);
}
else
target.ClearValue(Property);
+/*
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
using System;
using System.Linq;
using System.Reflection;
-using System.Collections;
+/*
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
using System.Collections.Generic;
using System.ComponentModel;
-using System.IO;
using System.Linq;
using System.Reflection;
using Tizen.NUI.BaseComponents;
-using Tizen.NUI.Binding;
using Tizen.NUI.Xaml;
-using static Tizen.NUI.Animation;
namespace Tizen.NUI
{
[EditorBrowsable(EditorBrowsableState.Never)]
public class AnimationBehavior
{
- private string _key = null;
+ private string key = null;
/// <since_tizen> 5 </since_tizen>
[EditorBrowsable(EditorBrowsableState.Never)]
public string Key
{
get
{
- return _key;
+ return key;
}
set
{
- _key = value;
+ key = value;
}
}
- private string _property = null;
+ private string property = null;
/// <since_tizen> 5 </since_tizen>
[EditorBrowsable(EditorBrowsableState.Never)]
{
get
{
- return _property;
+ return property;
}
set
{
- _property = value;
+ property = value;
}
}
- private string _destValue = null;
+ private string destValue = null;
/// <since_tizen> 5 </since_tizen>
[EditorBrowsable(EditorBrowsableState.Never)]
{
get
{
- return _destValue;
+ return destValue;
}
set
{
- _destValue = value;
+ destValue = value;
}
}
- private int _startTime = -1;
+ private int startTime = -1;
/// <since_tizen> 5 </since_tizen>
[EditorBrowsable(EditorBrowsableState.Never)]
{
get
{
- return _startTime;
+ return startTime;
}
set
{
- _startTime = value;
+ startTime = value;
}
}
- private int _endTime = -1;
+ private int endTime = -1;
/// <since_tizen> 5 </since_tizen>
[EditorBrowsable(EditorBrowsableState.Never)]
{
get
{
- return _endTime;
+ return endTime;
}
set
{
- _endTime = value;
+ endTime = value;
}
}
}
+/*
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
using System;
using System.Collections.Generic;
using System.ComponentModel;
-using System.Reflection;
using Tizen.NUI.Xaml;
+/*
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
using System;
using System.ComponentModel;
-using System;
+/*
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+using System;
using System.ComponentModel;
using System.Globalization;
+/*
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
#define DO_NOT_CHECK_FOR_BINDING_REUSE
using System;
using System.ComponentModel;
using System.Globalization;
using System.Collections.Generic;
-using Tizen.NUI.Binding;
namespace Tizen.NUI.Binding.Internals
{
[EditorBrowsable(EditorBrowsableState.Never)]
public abstract class TypedBindingBase : BindingBase
{
- IValueConverter _converter;
- object _converterParameter;
- object _source;
- string _updateSourceEventName;
+ IValueConverter converter;
+ object converterParameter;
+ object source;
+ string updateSourceEventName;
/// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
public IValueConverter Converter
{
- get { return _converter; }
+ get { return converter; }
set
{
ThrowIfApplied();
- _converter = value;
+ converter = value;
}
}
[EditorBrowsable(EditorBrowsableState.Never)]
public object ConverterParameter
{
- get { return _converterParameter; }
+ get { return converterParameter; }
set
{
ThrowIfApplied();
- _converterParameter = value;
+ converterParameter = value;
}
}
[EditorBrowsable(EditorBrowsableState.Never)]
public object Source
{
- get { return _source; }
+ get { return source; }
set
{
ThrowIfApplied();
- _source = value;
+ source = value;
}
}
internal string UpdateSourceEventName
{
- get { return _updateSourceEventName; }
+ get { return updateSourceEventName; }
set
{
ThrowIfApplied();
- _updateSourceEventName = value;
+ updateSourceEventName = value;
}
}
internal sealed class TypedBinding<TSource, TProperty> : TypedBindingBase
{
- readonly Func<TSource, TProperty> _getter;
- readonly Action<TSource, TProperty> _setter;
- readonly PropertyChangedProxy[] _handlers;
+ readonly Func<TSource, TProperty> getter;
+ readonly Action<TSource, TProperty> setter;
+ readonly PropertyChangedProxy[] proxyHandlers;
public TypedBinding(Func<TSource, TProperty> getter, Action<TSource, TProperty> setter, Tuple<Func<TSource, object>, string>[] handlers)
{
if (getter == null)
throw new ArgumentNullException(nameof(getter));
- _getter = getter;
- _setter = setter;
+ this.getter = getter;
+ this.setter = setter;
if (handlers == null)
return;
- _handlers = new PropertyChangedProxy[handlers.Length];
+ proxyHandlers = new PropertyChangedProxy[handlers.Length];
for (var i = 0; i < handlers.Length; i++)
- _handlers[i] = new PropertyChangedProxy(handlers[i].Item1, handlers[i].Item2, this);
+ proxyHandlers[i] = new PropertyChangedProxy(handlers[i].Item1, handlers[i].Item2, this);
}
- readonly WeakReference<object> _weakSource = new WeakReference<object>(null);
- readonly WeakReference<BindableObject> _weakTarget = new WeakReference<BindableObject>(null);
- BindableProperty _targetProperty;
+ readonly WeakReference<object> weakSource = new WeakReference<object>(null);
+ readonly WeakReference<BindableObject> weakTarget = new WeakReference<BindableObject>(null);
+ BindableProperty targetProperty;
// Applies the binding to a previously set source and target.
internal override void Apply(bool fromTarget = false)
BindableObject target;
#if DO_NOT_CHECK_FOR_BINDING_REUSE
- if (!_weakTarget.TryGetTarget(out target))
+ if (!weakTarget.TryGetTarget(out target))
throw new InvalidOperationException();
#else
if (!_weakTarget.TryGetTarget(out target) || target == null) {
}
#endif
object source;
- if (_weakSource.TryGetTarget(out source) && source != null)
- ApplyCore(source, target, _targetProperty, fromTarget);
+ if (weakSource.TryGetTarget(out source) && source != null)
+ ApplyCore(source, target, targetProperty, fromTarget);
}
// Applies the binding to a new source or target.
internal override void Apply(object context, BindableObject bindObj, BindableProperty targetProperty, bool fromBindingContextChanged = false)
{
- _targetProperty = targetProperty;
+ this.targetProperty = targetProperty;
var source = Source ?? Context ?? context;
var isApplied = IsApplied;
if (_weakSource.TryGetTarget(out previousSource) && !ReferenceEquals(previousSource, source))
throw new InvalidOperationException("Binding instances can not be reused");
#endif
- _weakSource.SetTarget(source);
- _weakTarget.SetTarget(bindObj);
+ weakSource.SetTarget(source);
+ weakTarget.SetTarget(bindObj);
ApplyCore(source, bindObj, targetProperty);
}
internal override BindingBase Clone()
{
- Tuple<Func<TSource, object>, string>[] handlers = _handlers == null ? null : new Tuple<Func<TSource, object>, string>[_handlers.Length];
+ Tuple<Func<TSource, object>, string>[] handlers = proxyHandlers == null ? null : new Tuple<Func<TSource, object>, string>[proxyHandlers.Length];
if (handlers != null)
{
- for (var i = 0; i < _handlers.Length; i++)
- handlers[i] = new Tuple<Func<TSource, object>, string>(_handlers[i].PartGetter, _handlers[i].PropertyName);
+ for (var i = 0; i < proxyHandlers.Length; i++)
+ handlers[i] = new Tuple<Func<TSource, object>, string>(proxyHandlers[i].PartGetter, proxyHandlers[i].PropertyName);
}
- return new TypedBinding<TSource, TProperty>(_getter, _setter, handlers)
+ return new TypedBinding<TSource, TProperty>(getter, setter, handlers)
{
Mode = Mode,
Converter = Converter,
#if (!DO_NOT_CHECK_FOR_BINDING_REUSE)
base.Unapply(fromBindingContextChanged:fromBindingContextChanged);
#endif
- if (_handlers != null)
+ if (proxyHandlers != null)
Unsubscribe();
#if (!DO_NOT_CHECK_FOR_BINDING_REUSE)
var needsGetter = (mode == BindingMode.TwoWay && !fromTarget) || mode == BindingMode.OneWay || mode == BindingMode.OneTime;
- if (isTSource && (mode == BindingMode.OneWay || mode == BindingMode.TwoWay) && _handlers != null)
+ if (isTSource && (mode == BindingMode.OneWay || mode == BindingMode.TwoWay) && proxyHandlers != null)
Subscribe((TSource)sourceObject);
if (needsGetter)
{
try
{
- value = GetSourceValue(_getter((TSource)sourceObject), property.ReturnType);
+ value = GetSourceValue(getter((TSource)sourceObject), property.ReturnType);
}
catch (Exception ex) when (ex is NullReferenceException || ex is KeyNotFoundException)
{
}
var needsSetter = (mode == BindingMode.TwoWay && fromTarget) || mode == BindingMode.OneWayToSource;
- if (needsSetter && _setter != null && isTSource)
+ if (needsSetter && setter != null && isTSource)
{
var value = GetTargetValue(target.GetValue(property), typeof(TProperty));
if (!TryConvert(ref value, property, typeof(TProperty), false))
// Log.Warning("Binding", "{0} can not be converted to type '{1}'", value, typeof(TProperty));
return;
}
- _setter((TSource)sourceObject, (TProperty)value);
+ setter((TSource)sourceObject, (TProperty)value);
}
}
public Func<TSource, object> PartGetter { get; }
public string PropertyName { get; }
public BindingExpression.WeakPropertyChangedProxy Listener { get; }
- WeakReference<INotifyPropertyChanged> _weakPart = new WeakReference<INotifyPropertyChanged>(null);
- readonly BindingBase _binding;
+ WeakReference<INotifyPropertyChanged> weakPart = new WeakReference<INotifyPropertyChanged>(null);
+ readonly BindingBase binding;
public INotifyPropertyChanged Part
{
get
{
INotifyPropertyChanged target;
- if (_weakPart.TryGetTarget(out target))
+ if (weakPart.TryGetTarget(out target))
return target;
return null;
}
set
{
- _weakPart.SetTarget(value);
+ weakPart.SetTarget(value);
Listener.SubscribeTo(value, OnPropertyChanged);
}
}
{
PartGetter = partGetter;
PropertyName = propertyName;
- _binding = binding;
+ this.binding = binding;
Listener = new BindingExpression.WeakPropertyChangedProxy();
}
{
if (!string.IsNullOrEmpty(e.PropertyName) && string.CompareOrdinal(e.PropertyName, PropertyName) != 0)
return;
- Device.BeginInvokeOnMainThread(() => _binding.Apply(false));
+ Device.BeginInvokeOnMainThread(() => binding.Apply(false));
}
}
void Subscribe(TSource sourceObject)
{
- for (var i = 0; i < _handlers.Length; i++)
+ for (var i = 0; i < proxyHandlers.Length; i++)
{
- var part = _handlers[i].PartGetter(sourceObject);
+ var part = proxyHandlers[i].PartGetter(sourceObject);
if (part == null)
break;
var inpc = part as INotifyPropertyChanged;
if (inpc == null)
continue;
- _handlers[i].Part = (inpc);
+ proxyHandlers[i].Part = (inpc);
}
}
void Unsubscribe()
{
- for (var i = 0; i < _handlers.Length; i++)
- _handlers[i].Listener.Unsubscribe();
+ for (var i = 0; i < proxyHandlers.Length; i++)
+ proxyHandlers[i].Listener.Unsubscribe();
}
}
}
-using System;
+/*
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+using System;
using System.Diagnostics;
using System.ComponentModel;