if (btGroup.itemGroup != null && newValue != null)
{
foreach (Button btn in btGroup.itemGroup)
- {
+ {
btn.BackgroundImage = (string)newValue;
}
btGroup.itemBackgroundImageUrl = (string)newValue;
if (btGroup.itemGroup != null && newValue != null)
{
foreach (Button btn in btGroup.itemGroup)
- {
+ {
btn.BackgroundImageBorder = (Rectangle)newValue;
}
btGroup.itemBackgroundBorder = (Rectangle)newValue;
[EditorBrowsable(EditorBrowsableState.Never)]
public void AddItem(DropDownDataItem itemData)
{
- // Add item to adaptor, will be added to list via AddItemAt during OnUpdate()
- int insertionPosition = adapter.GetItemCount();
- adapter.InsertData(insertionPosition, itemData);
+ // Add item to adaptor, will be added to list via AddItemAt during OnUpdate()
+ int insertionPosition = adapter.GetItemCount();
+ adapter.InsertData(insertionPosition, itemData);
}
/// <summary>
{
dropDownStyle.SelectedItemIndex = -1;
}
- else if(dropDownStyle.SelectedItemIndex > index)
+ else if (dropDownStyle.SelectedItemIndex > index)
{
dropDownStyle.SelectedItemIndex--;
}
adapter?.RemoveData(index);
- if(index < dropDownMenuFullList.ChildCount)
+ if (index < dropDownMenuFullList.ChildCount)
{
View childToRemove = dropDownMenuFullList.GetChildAt((uint)index);
if (childToRemove)
{
return;
}
- Tizen.Log.Error("DropDown","Feature unsupported");
+ Tizen.Log.Error("DropDown", "Feature unsupported");
}
/// <summary>
{
return;
}
- Tizen.Log.Error("DropDown","Feature unsupported");
+ Tizen.Log.Error("DropDown", "Feature unsupported");
}
/// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
return new DropDownStyle();
}
- private void AddItemAt(DropDownDataItem itemData,int index)
+ private void AddItemAt(DropDownDataItem itemData, int index)
{
ViewHolder viewHolder = adapter.OnCreateViewHolder();
if (!viewHolder.IsBound)
private View GetViewFromIndex(uint index)
{
- if ((index < dropDownMenuFullList.ChildCount) && (index >=0) )
+ if ((index < dropDownMenuFullList.ChildCount) && (index >= 0))
{
return dropDownMenuFullList.GetChildAt(index);
}
mLayoutManager = layoutManager;
}
- // Call this method after onLayout method is complete if state is NOT pre-layout.
- // This method records information like layout bounds that might be useful in the next layout
- // calculations.
+ // Call this method after onLayout method is complete if state is NOT pre-layout.
+ // This method records information like layout bounds that might be useful in the next layout
+ // calculations.
public void OnLayoutComplete()
{
mLastTotalSpace = GetTotalSpace();
}
- // Returns the layout space change between the previous layout pass and current layout pass.
- // Make sure you call {@link #onLayoutComplete()} at the end of your LayoutManager's
- // {@link FlexibleViewRecyclerView.LayoutManager#onLayoutChildren(FlexibleViewRecyclerView.Recycler,
- // FlexibleViewRecyclerView.State)} method.
- //
- // @return The difference between the current total space and previous layout's total space.
- // @see #onLayoutComplete()
+ // Returns the layout space change between the previous layout pass and current layout pass.
+ // Make sure you call {@link #onLayoutComplete()} at the end of your LayoutManager's
+ // {@link FlexibleViewRecyclerView.LayoutManager#onLayoutChildren(FlexibleViewRecyclerView.Recycler,
+ // FlexibleViewRecyclerView.State)} method.
+ //
+ // @return The difference between the current total space and previous layout's total space.
+ // @see #onLayoutComplete()
public float GetTotalSpaceChange()
{
return INVALID_SIZE == mLastTotalSpace ? 0 : GetTotalSpace() - mLastTotalSpace;
}
- // Returns the start of the view including its decoration and margin.
- // For example, for the horizontal helper, if a View's left is at pixel 20, has 2px left
- // decoration and 3px left margin, returned value will be 15px.
- //
- // @param view The view element to check
- // @return The first pixel of the element
- // @see #getDecoratedEnd(android.view.View)
+ // Returns the start of the view including its decoration and margin.
+ // For example, for the horizontal helper, if a View's left is at pixel 20, has 2px left
+ // decoration and 3px left margin, returned value will be 15px.
+ //
+ // @param view The view element to check
+ // @return The first pixel of the element
+ // @see #getDecoratedEnd(android.view.View)
public abstract float GetViewHolderStart(FlexibleViewViewHolder holder);
- // Returns the end of the view including its decoration and margin.
- // For example, for the horizontal helper, if a View's right is at pixel 200, has 2px right
- // decoration and 3px right margin, returned value will be 205.
- //
- // @param view The view element to check
- // @return The last pixel of the element
- // @see #getDecoratedStart(android.view.View)
+ // Returns the end of the view including its decoration and margin.
+ // For example, for the horizontal helper, if a View's right is at pixel 200, has 2px right
+ // decoration and 3px right margin, returned value will be 205.
+ //
+ // @param view The view element to check
+ // @return The last pixel of the element
+ // @see #getDecoratedStart(android.view.View)
public abstract float GetViewHolderEnd(FlexibleViewViewHolder holder);
// Returns the space occupied by this View in the current orientation including decorations and
{
return CreateVerticalHelper(layoutManager);
}
-
+
throw new ArgumentException("invalid orientation");
}
}
- // Creates a vertical OrientationHelper for the given LayoutManager.
- //
- // @param layoutManager The LayoutManager to attach to.
- // @return A new OrientationHelper
+ // Creates a vertical OrientationHelper for the given LayoutManager.
+ //
+ // @param layoutManager The LayoutManager to attach to.
+ // @return A new OrientationHelper
public static OrientationHelper CreateVerticalHelper(FlexibleViewLayoutManager layoutManager)
{
return new VerticalHelper(layoutManager);
internal class HorizontalHelper : OrientationHelper
{
- public HorizontalHelper(FlexibleViewLayoutManager layoutManager): base(layoutManager)
+ public HorizontalHelper(FlexibleViewLayoutManager layoutManager) : base(layoutManager)
{
}
}
set
{
- if(null != Style?.Thumb)
+ if (null != Style?.Thumb)
{
Style.Thumb.BackgroundColor = value;
RelayoutRequest();
});
/// 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 new static readonly BindableProperty SizeProperty = BindableProperty.Create(nameof(Size), typeof(Size), typeof(Loading), new Size(0,0), propertyChanged: (bindable, oldValue, newValue) =>
- {
- var instance = (Loading)bindable;
- if (newValue != null)
- {
- Size size = (Size)newValue;
- ((View)bindable).Size = size;
- instance.loadingStyle.LoadingSize = size;
- }
- },
+ public new static readonly BindableProperty SizeProperty = BindableProperty.Create(nameof(Size), typeof(Size), typeof(Loading), new Size(0, 0), propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var instance = (Loading)bindable;
+ if (newValue != null)
+ {
+ Size size = (Size)newValue;
+ ((View)bindable).Size = size;
+ instance.loadingStyle.LoadingSize = size;
+ }
+ },
defaultValueCreator: (bindable) =>
{
var instance = (View)bindable;
});
/// 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 static readonly BindableProperty FrameRateProperty = BindableProperty.Create(nameof(FrameRate), typeof(int), typeof(Loading), (int)(1000/16.6f), propertyChanged: (bindable, oldValue, newValue) =>
- {
- var instance = (Loading)bindable;
- if (newValue != null)
- {
- int frameRate = (int)newValue;
- if (0 != frameRate) //It will crash if 0
+ public static readonly BindableProperty FrameRateProperty = BindableProperty.Create(nameof(FrameRate), typeof(int), typeof(Loading), (int)(1000 / 16.6f), propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var instance = (Loading)bindable;
+ if (newValue != null)
+ {
+ int frameRate = (int)newValue;
+ if (0 != frameRate) //It will crash if 0
{
- instance.loadingStyle.FrameRate = frameRate;
- instance.imageVisual.FrameDelay = 1000.0f / frameRate;
- }
- }
- },
+ instance.loadingStyle.FrameRate = frameRate;
+ instance.imageVisual.FrameDelay = 1000.0f / frameRate;
+ }
+ }
+ },
defaultValueCreator: (bindable) =>
{
var instance = (Loading)bindable;
- return instance.loadingStyle.FrameRate?.All ?? (int)(1000/16.6f);
+ return instance.loadingStyle.FrameRate?.All ?? (int)(1000 / 16.6f);
});
private AnimatedImageVisual imageVisual = null;
}
set
{
- if (_content)
- {
- if (_content != value)
- {
- Remove(_content);
- _content = value;
- Add(value);
- }
- }
- else
- {
- _content = value;
- Add(value);
- }
+ if (_content)
+ {
+ if (_content != value)
+ {
+ Remove(_content);
+ _content = value;
+ Add(value);
+ }
+ }
+ else
+ {
+ _content = value;
+ Add(value);
+ }
}
}
/// Pagination shows the number of pages available and the currently active page.
/// </summary>
/// <since_tizen> 8 </since_tizen>
- public class Pagination: Control
+ public class Pagination : Control
{
private VisualView container;
this.Add(container);
//TODO: Apply color properties from PaginationStyle class.
- indicatorColor = new Color(1.0f, 1.0f, 1.0f, 0.5f);
- selectedIndicatorColor = new Color(1.0f, 1.0f, 1.0f, 1.0f);
+ indicatorColor = new Color(1.0f, 1.0f, 1.0f, 0.5f);
+ selectedIndicatorColor = new Color(1.0f, 1.0f, 1.0f, 1.0f);
}
private void CreateIndicator()
public static readonly BindableProperty ButtonHeightProperty = BindableProperty.Create(nameof(ButtonHeight), typeof(int), typeof(Popup), default(int), propertyChanged: (bindable, oldValue, newValue) =>
{
var instance = (Popup)bindable;
- if (newValue != null && instance?.popupStyle?.Buttons?.Size != null )
+ if (newValue != null && instance?.popupStyle?.Buttons?.Size != null)
{
instance.popupStyle.Buttons.Size.Height = (int)newValue;
instance.btGroup.Itemheight = (int)newValue;
{
var instance = (Popup)bindable;
if (newValue != null)
- {
+ {
if (instance.popupStyle?.Buttons?.Text != null)
{
instance.popupStyle.Buttons.Text.TextColor = (Color)newValue;
public string ButtonFontFamily
{
get
- {
+ {
return (string)GetValue(ButtonFontFamilyProperty);
}
set
public HorizontalAlignment ButtonTextAlignment
{
get
- {
+ {
return (HorizontalAlignment)GetValue(ButtonTextAlignmentProperty);
}
set
public string ButtonBackground
{
get
- {
+ {
return (string)GetValue(ButtonBackgroundProperty);
}
set
{
get
{
-
+
return (Rectangle)GetValue(ButtonBackgroundBorderProperty);
}
set
titleY = (int)Title.Position.Y;
}
- if (btGroup.Count != 0 && popupStyle?.Buttons?.Size != null )
+ if (btGroup.Count != 0 && popupStyle?.Buttons?.Size != null)
{
buttonH = (int)popupStyle.Buttons.Size.Height;
}
int targetSibling = -1;
bool isHorizontal = LayoutOrientation == Orientation.Horizontal;
- switch(direction)
+ switch (direction)
{
- case View.FocusDirection.Left :
- {
- targetSibling = isHorizontal ? currentFocusedView.SiblingOrder - 1 : currentFocusedView.SiblingOrder - Rows;
- break;
- }
- case View.FocusDirection.Right :
- {
- targetSibling = isHorizontal ? currentFocusedView.SiblingOrder + 1 : currentFocusedView.SiblingOrder + Rows;
- break;
- }
- case View.FocusDirection.Up :
- {
- targetSibling = isHorizontal ? currentFocusedView.SiblingOrder - Columns : currentFocusedView.SiblingOrder - 1;
- break;
- }
- case View.FocusDirection.Down :
- {
- targetSibling = isHorizontal ? currentFocusedView.SiblingOrder + Columns : currentFocusedView.SiblingOrder + 1;
- break;
- }
+ case View.FocusDirection.Left:
+ {
+ targetSibling = isHorizontal ? currentFocusedView.SiblingOrder - 1 : currentFocusedView.SiblingOrder - Rows;
+ break;
+ }
+ case View.FocusDirection.Right:
+ {
+ targetSibling = isHorizontal ? currentFocusedView.SiblingOrder + 1 : currentFocusedView.SiblingOrder + Rows;
+ break;
+ }
+ case View.FocusDirection.Up:
+ {
+ targetSibling = isHorizontal ? currentFocusedView.SiblingOrder - Columns : currentFocusedView.SiblingOrder - 1;
+ break;
+ }
+ case View.FocusDirection.Down:
+ {
+ targetSibling = isHorizontal ? currentFocusedView.SiblingOrder + Columns : currentFocusedView.SiblingOrder + 1;
+ break;
+ }
}
- if(targetSibling > -1 && targetSibling < Container.Children.Count)
+ if (targetSibling > -1 && targetSibling < Container.Children.Count)
{
RecycleItem candidate = Container.Children[targetSibling] as RecycleItem;
- if(candidate != null && candidate.DataIndex >= 0 && candidate.DataIndex < DataCount)
+ if (candidate != null && candidate.DataIndex >= 0 && candidate.DataIndex < DataCount)
{
nextFocusedView = candidate;
}
return result;
}
- Vector2 visibleArea = new Vector2( Math.Abs(scrollPosition),
- Math.Abs(scrollPosition) + (LayoutOrientation == Orientation.Horizontal?
- list.Size.Width:list.Size.Height)
+ Vector2 visibleArea = new Vector2(Math.Abs(scrollPosition),
+ Math.Abs(scrollPosition) + (LayoutOrientation == Orientation.Horizontal ?
+ list.Size.Width : list.Size.Height)
);
- float firstCheckPoint = LayoutOrientation == Orientation.Horizontal? item.Position.X:item.Position.Y;
- float secondCheckPoint = LayoutOrientation == Orientation.Horizontal?
- firstCheckPoint + item.Size.Width:
+ float firstCheckPoint = LayoutOrientation == Orientation.Horizontal ? item.Position.X : item.Position.Y;
+ float secondCheckPoint = LayoutOrientation == Orientation.Horizontal ?
+ firstCheckPoint + item.Size.Width :
firstCheckPoint + item.Size.Height;
// Tizen.Log.Error("NUI", "[1p] "+visibleArea.X+ " =< "+firstCheckPoint+" =< "+visibleArea.Y+" ==== \n");
RecycleItem previousItem = null;
- for(int i = 0 ; i < Container.Children.Count ; i++)
+ for (int i = 0; i < Container.Children.Count; i++)
{
RecycleItem item = Container.Children[i] as RecycleItem;
- if(previousItem != null && item != null)
+ if (previousItem != null && item != null)
{
- item.Position = LayoutOrientation == Orientation.Horizontal?
+ item.Position = LayoutOrientation == Orientation.Horizontal ?
new Position(
previousItem.Position.X + (previousItem.CurrentSize.Width != 0 ?
- previousItem.CurrentSize.Width:
+ previousItem.CurrentSize.Width :
previousItem.Size.Width),
item.PositionY
- ):
+ ) :
new Position(
item.PositionX,
- previousItem.Position.Y + (previousItem.CurrentSize.Height != 0 ?
- previousItem.CurrentSize.Height:
+ previousItem.Position.Y + (previousItem.CurrentSize.Height != 0 ?
+ previousItem.CurrentSize.Height :
previousItem.Size.Height)
);
}
bool isVisible = IsItemVisible(scrollPosition, item);
- if(isVisible)
+ if (isVisible)
{
- firstVisibleItemIndex = firstVisibleItemIndex == -1? i : firstVisibleItemIndex;
+ firstVisibleItemIndex = firstVisibleItemIndex == -1 ? i : firstVisibleItemIndex;
lastVisibleItemIndex = i;
}
// Tizen.Log.Error("NUI","["+item.DataIndex+"] "+item.Position.Y+" ==== \n");
}
- if(StepSize == 0)
+ if (StepSize == 0)
{
- StepSize = LayoutOrientation == Orientation.Horizontal?ItemSize.Width:ItemSize.Height;
+ StepSize = LayoutOrientation == Orientation.Horizontal ? ItemSize.Width : ItemSize.Height;
}
}
public override List<RecycleItem> Recycle(float scrollPosition)
{
List<RecycleItem> result = new List<RecycleItem>();
-
+
bool checkFront = (PrevScrollPosition - scrollPosition) > 0;
- if(checkFront)
+ if (checkFront)
{
- if(firstVisibleItemIndex > 3)
+ if (firstVisibleItemIndex > 3)
{
// Too many item is in front!!! move first item to back!!!!
RecycleItem target = Container.Children[0] as RecycleItem;
}
else
{
- if(lastVisibleItemIndex < Container.Children.Count - 3)
+ if (lastVisibleItemIndex < Container.Children.Count - 3)
{
RecycleItem prevFirstItem = Container.Children[0] as RecycleItem;
RecycleItem target = Container.Children[Container.Children.Count - 1] as RecycleItem;
int targetSibling = -1;
bool isHorizontal = LayoutOrientation == Orientation.Horizontal;
- switch(direction)
+ switch (direction)
{
- case View.FocusDirection.Left :
- {
- targetSibling = isHorizontal ? currentFocusedView.SiblingOrder - 1 : targetSibling;
- break;
- }
- case View.FocusDirection.Right :
- {
- targetSibling = isHorizontal ? currentFocusedView.SiblingOrder + 1 : targetSibling;
- break;
- }
- case View.FocusDirection.Up :
- {
- targetSibling = isHorizontal ? targetSibling : currentFocusedView.SiblingOrder - 1;
- break;
- }
- case View.FocusDirection.Down :
- {
- targetSibling = isHorizontal ? targetSibling : currentFocusedView.SiblingOrder + 1;
- break;
- }
+ case View.FocusDirection.Left:
+ {
+ targetSibling = isHorizontal ? currentFocusedView.SiblingOrder - 1 : targetSibling;
+ break;
+ }
+ case View.FocusDirection.Right:
+ {
+ targetSibling = isHorizontal ? currentFocusedView.SiblingOrder + 1 : targetSibling;
+ break;
+ }
+ case View.FocusDirection.Up:
+ {
+ targetSibling = isHorizontal ? targetSibling : currentFocusedView.SiblingOrder - 1;
+ break;
+ }
+ case View.FocusDirection.Down:
+ {
+ targetSibling = isHorizontal ? targetSibling : currentFocusedView.SiblingOrder + 1;
+ break;
+ }
}
- if(targetSibling > -1 && targetSibling < Container.Children.Count)
+ if (targetSibling > -1 && targetSibling < Container.Children.Count)
{
RecycleItem candidate = Container.Children[targetSibling] as RecycleItem;
- if(candidate != null && candidate.DataIndex >= 0 && candidate.DataIndex < DataCount)
+ if (candidate != null && candidate.DataIndex >= 0 && candidate.DataIndex < DataCount)
{
nextFocusedView = candidate;
}
/// <since_tizen> 8 </since_tizen>
/// This may be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API
[EditorBrowsable(EditorBrowsableState.Never)]
- public List<object> Data{
+ public List<object> Data
+ {
get
{
return mData;
/// <since_tizen> 8 </since_tizen>
/// This may be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API
[EditorBrowsable(EditorBrowsableState.Never)]
- public View Container{get;set;}
-
+ public View Container { get; set; }
+
/// <summary>
/// Size of RecycleItem.
/// </summary>
/// <since_tizen> 8 </since_tizen>
/// This may be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API
[EditorBrowsable(EditorBrowsableState.Never)]
- public Size ItemSize{get;set;} = new Size();
-
+ public Size ItemSize { get; set; } = new Size();
+
/// <summary>
/// Get/Set the orientation in the layout.
/// </summary>
/// <since_tizen> 8 </since_tizen>
/// This may be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API
[EditorBrowsable(EditorBrowsableState.Never)]
- public Orientation LayoutOrientation{get;set;} = Orientation.Vertical;
+ public Orientation LayoutOrientation { get; set; } = Orientation.Vertical;
/// <summary>
/// How far can you reach the next item.
/// <since_tizen> 8 </since_tizen>
/// This may be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API
[EditorBrowsable(EditorBrowsableState.Never)]
- public int DataCount{get; set;}
+ public int DataCount { get; set; }
/// <summary>
/// The last scrolled position which is calculated by ScrollableBase. The value should be updated in the Recycle() method.
[EditorBrowsable(EditorBrowsableState.Never)]
public virtual void Layout(float scrollPosition)
{
-
+
}
/// <summary>
if (LayoutManager != null)
{
nextFocusedView = LayoutManager.RequestNextFocusableView(currentFocusedView, direction, loopEnabled);
- }
+ }
}
if (nextFocusedView)
{
prevFocusedDataIndex = (nextFocusedView as RecycleItem).DataIndex;
}
-
+
ScrollTo(targetPosition, true);
}
else
switch (direction)
{
case View.FocusDirection.Left:
- {
- nextFocusedView = LeftFocusableView;
- break;
- }
+ {
+ nextFocusedView = LeftFocusableView;
+ break;
+ }
case View.FocusDirection.Right:
- {
- nextFocusedView = RightFocusableView;
- break;
- }
+ {
+ nextFocusedView = RightFocusableView;
+ break;
+ }
case View.FocusDirection.Up:
- {
- nextFocusedView = UpFocusableView;
- break;
- }
+ {
+ nextFocusedView = UpFocusableView;
+ break;
+ }
case View.FocusDirection.Down:
- {
- nextFocusedView = DownFocusableView;
- break;
- }
+ {
+ nextFocusedView = DownFocusableView;
+ break;
+ }
}
- if(nextFocusedView)
+ if (nextFocusedView)
{
focusedView = null;
}
return;
}
- trackVisual.Size = calculator.CalculateTrackSize(TrackThickness, containerSize, trackPadding);
+ trackVisual.Size = calculator.CalculateTrackSize(TrackThickness, containerSize, trackPadding);
trackVisual.Position = calculator.CalculateTrackPosition(trackPadding);
thumbVisual.Size = calculator.CalculateThumbSize(ThumbThickness, trackVisual.Size);
thumbVisual.Position = calculator.CalculateThumbPaddingPosition(trackVisual.Size, thumbVisual.Size, thumbVisual.Position, trackPadding);
public override Size CalculateTrackSize(float thickness, Size containerSize, Extents trackPadding)
{
- return new Size(containerSize.Width - trackPadding?.Start??0 - trackPadding?.End??0, thickness);
+ return new Size(containerSize.Width - trackPadding?.Start ?? 0 - trackPadding?.End ?? 0, thickness);
}
public override Vector2 CalculateTrackPosition(Extents trackPadding)
{
- return new Vector2(0, -trackPadding?.Bottom??0);
+ return new Vector2(0, -trackPadding?.Bottom ?? 0);
}
public override Size CalculateThumbSize(float thickness, Size trackSize)
public override Vector2 CalculateThumbPosition(Size trackSize, Size thumbSize, Extents trackPadding)
{
- float padding = ((trackSize.Height - thumbSize.Height) / 2.0f) + trackPadding?.Bottom??0;
+ float padding = ((trackSize.Height - thumbSize.Height) / 2.0f) + trackPadding?.Bottom ?? 0;
float pos = Math.Min(Math.Max(currentPosition, 0.0f), contentLength - visibleLength);
- return new Vector2(trackPadding?.Start??0 + trackSize.Width * pos / contentLength, -padding);
+ return new Vector2(trackPadding?.Start ?? 0 + trackSize.Width * pos / contentLength, -padding);
}
public override Vector2 CalculateThumbPaddingPosition(Size trackSize, Size thumbSize, Vector2 thumbCurrentPosition, Extents trackPadding)
{
- float padding = ((trackSize.Height - thumbSize.Height) / 2.0f) + trackPadding?.Bottom??0;
+ float padding = ((trackSize.Height - thumbSize.Height) / 2.0f) + trackPadding?.Bottom ?? 0;
return new Vector2(thumbCurrentPosition.X, -padding);
}
public override Vector2 CalculateThumbScrollPosition(Size trackSize, Vector2 thumbCurrentPosition, Extents trackPadding)
{
float pos = Math.Min(Math.Max(currentPosition, 0.0f), contentLength - visibleLength);
- return new Vector2(trackPadding?.Start??0 + trackSize.Width * pos / contentLength, thumbCurrentPosition.Y);
+ return new Vector2(trackPadding?.Start ?? 0 + trackSize.Width * pos / contentLength, thumbCurrentPosition.Y);
}
}
public override Size CalculateTrackSize(float thickness, Size containerSize, Extents trackPadding)
{
- return new Size(thickness, containerSize.Height - trackPadding?.Top??0 - trackPadding?.Bottom??0);
+ return new Size(thickness, containerSize.Height - trackPadding?.Top ?? 0 - trackPadding?.Bottom ?? 0);
}
public override Vector2 CalculateTrackPosition(Extents trackPadding)
{
- return new Vector2(-trackPadding?.End??0, 0);
+ return new Vector2(-trackPadding?.End ?? 0, 0);
}
public override Size CalculateThumbSize(float thickness, Size trackSize)
public override Vector2 CalculateThumbPosition(Size trackSize, Size thumbSize, Extents trackPadding)
{
- float padding = ((trackSize.Width - thumbSize.Width) / 2.0f) + trackPadding?.End??0;
+ float padding = ((trackSize.Width - thumbSize.Width) / 2.0f) + trackPadding?.End ?? 0;
float pos = Math.Min(Math.Max(currentPosition, 0.0f), contentLength - visibleLength);
- return new Vector2(-padding, trackPadding?.Top??0 + trackSize.Height * pos / contentLength);
+ return new Vector2(-padding, trackPadding?.Top ?? 0 + trackSize.Height * pos / contentLength);
}
public override Vector2 CalculateThumbPaddingPosition(Size trackSize, Size thumbSize, Vector2 thumbCurrentPosition, Extents trackPadding)
{
- float padding = ((trackSize.Width - thumbSize.Width) / 2.0f) + trackPadding?.End??0;
+ float padding = ((trackSize.Width - thumbSize.Width) / 2.0f) + trackPadding?.End ?? 0;
return new Vector2(-padding, thumbCurrentPosition.Y);
}
public override Vector2 CalculateThumbScrollPosition(Size trackSize, Vector2 thumbPosition, Extents trackPadding)
{
float pos = Math.Min(Math.Max(currentPosition, 0.0f), contentLength - visibleLength);
- return new Vector2(thumbPosition.X, trackPadding?.Top??0 + trackSize.Height * pos / contentLength);
+ return new Vector2(thumbPosition.X, trackPadding?.Top ?? 0 + trackSize.Height * pos / contentLength);
}
}
}
private void OnSelect()
- {
+ {
OnSelectedChanged();
if (SelectedChanged != null)
/// The constructor of the Slider class.
/// </summary>
/// <since_tizen> 6 </since_tizen>
- public Slider()
+ public Slider()
{
Initialize();
}
{
if (null != lowIndicatorText)
{
- lowIndicatorText.Text= value;
- sliderStyle.LowIndicator.Text= value;
+ lowIndicatorText.Text = value;
+ sliderStyle.LowIndicator.Text = value;
}
}
}
slidingFinishedHandler(this, args);
}
- if (null !=sliderSlidingFinishedHandler)
+ if (null != sliderSlidingFinishedHandler)
{
SliderSlidingFinishedEventArgs args = new SliderSlidingFinishedEventArgs();
args.CurrentValue = curValue;
}
set
{
- if(null != value && null != tabStyle?.ItemPadding)
+ if (null != value && null != tabStyle?.ItemPadding)
{
tabStyle.ItemPadding.CopyFrom(value);
if (null != tabStyle?.Text)
{
tabStyle.Text.FontFamily = value;
- RelayoutRequest();
+ RelayoutRequest();
}
}
}
if (null != tabStyle?.Text)
{
tabStyle.Text.TextColor = value;
- RelayoutRequest();
+ RelayoutRequest();
}
}
}
[Obsolete("Deprecated in API8; Will be removed in API10")]
public void DeleteItem(int itemIndex)
{
- if(itemList == null || itemIndex < 0 || itemIndex >= itemList.Count)
+ if (itemList == null || itemIndex < 0 || itemIndex >= itemList.Count)
{
return;
}
if (type == DisposeTypes.Explicit)
{
- if(underlineAni != null)
+ if (underlineAni != null)
{
- if(underlineAni.State == Animation.States.Playing)
+ if (underlineAni.State == Animation.States.Playing)
{
underlineAni.Stop();
}
underlineAni = null;
}
Utility.Dispose(underline);
- if(itemList != null)
+ if (itemList != null)
{
- for(int i = 0; i < itemList.Count; i++)
+ for (int i = 0; i < itemList.Count; i++)
{
Remove(itemList[i]);
itemList[i].Dispose();
underlineAni = new Animation(aniTime);
}
}
-
+
private void UpdateUnderLinePos()
{
if (underline == null || Underline.Size == null || itemList == null || itemList.Count <= 0)
private void UpdateSelectedItem(TabItem item)
{
- if(item == null || curIndex == item.Index)
+ if (item == null || curIndex == item.Index)
{
return;
}
private bool ItemTouchEvent(object source, TouchEventArgs e)
{
TabItem item = source as TabItem;
- if(item == null)
+ if (item == null)
{
return false;
}
/// 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 static Toast FromText(string text, uint duration)
+ public static Toast FromText(string text, uint duration)
{
Toast toast = new Toast();
toast.Message = text;
}
if (PressAnimation.State == Animation.States.Playing)
- {
- PressAnimation.Stop();
- }
- PressAnimation.Dispose();
- PressAnimation = null;
+ {
+ PressAnimation.Stop();
+ }
+ PressAnimation.Dispose();
+ PressAnimation = null;
}
}
}
/// <since_tizen> 8 </since_tizen>
public Extents TextPadding
{
- get => ((Extents)GetValue(TextPaddingProperty)) ?? (textPadding = new Extents());
+ get => ((Extents)GetValue(TextPaddingProperty)) ?? (textPadding = new Extents());
set => SetValue(TextPaddingProperty, value);
}
private bool isDisposeQueued = false;
- static ControlStyle () { }
+ static ControlStyle() { }
/// <summary>
/// Creates a new instance of a ControlStyle.
if (Activator.CreateInstance(style) as StyleBase != null)
{
ThemeMap[key].AddStyleWithoutClone(component.FullName, (Activator.CreateInstance(style) as StyleBase).GetViewStyle());
- }
+ }
}
/// <summary>
public static void Dispose(View child)
{
View parent = child?.GetParent() as View;
- if(child != null)
+ if (child != null)
{
- if(parent != null)
+ if (parent != null)
{
parent.Remove(child);
-
+
}
child.Dispose();
{
return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
}
-
+
/// <since_tizen> 3 </since_tizen>
protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
{
{
// register all Views with the type registry, so that can be created / styled via JSON
//ViewRegistryHelper.Initialize(); //moved to Application side.
- if(_instance)
+ if (_instance)
{
return _instance;
}
public Window GetWindow()
{
Window ret = Registry.GetManagedBaseHandleFromNativePtr(Interop.Application.Application_GetWindow(swigCPtr)) as Window;
- if(ret == null)
+ if (ret == null)
{
ret = new Window(Interop.Application.Application_GetWindow(swigCPtr), true);
}
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
List<Window> WindowList = new List<Window>();
- for( uint i = 0; i < ListSize; ++i )
+ for (uint i = 0; i < ListSize; ++i)
{
Window currWin = Registry.GetManagedBaseHandleFromNativePtr(Interop.Application.Application_GetWindowsFromList(i)) as Window;
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- if(currWin)
+ if (currWin)
{
WindowList.Add(currWin);
}
/// Subscriber.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
- public List<View> Subscriber{get; set;} = new List<View>();
+ public List<View> Subscriber { get; set; } = new List<View>();
/// <summary>
/// BackKeyManager static instance.
Container parent1 = comparison1?.GetParent();
Container parent2 = comparison2?.GetParent();
- if((parent1 == null && parent2 != null) || (parent2 == null && parent1 != null))
+ if ((parent1 == null && parent2 != null) || (parent2 == null && parent1 != null))
{
// One is in DefaultLayer but the other is not
- if(parent2 == null)
+ if (parent2 == null)
{
// parent1 is in DefaultLayer.
Layer comparison2AsLayer = comparison2 as Layer;
- if(comparison2AsLayer != null)
+ if (comparison2AsLayer != null)
{
result = comparison2AsLayer.Depth > NUIApplication.GetDefaultWindow().GetDefaultLayer().Depth;
- }
+ }
}
else
{
else
{
// If they have same parent, ready to compare!
- if(parent1 == parent2)
+ if (parent1 == parent2)
{
- if(comparison1.GetType().FullName.Contains("Layer"))
+ if (comparison1.GetType().FullName.Contains("Layer"))
{
// If comparison1 is Layer, comparison2 is also Layer because only window can have Layer as child in NUI.
// Compare Depth
if (comparison1AsLayer != null && comparison2AsLayer != null)
{
result = comparison1AsLayer.Depth < comparison2AsLayer.Depth;
- }
+ }
}
else
{
if (comparison1AsView != null && comparison2AsView != null)
{
result = comparison1AsView.SiblingOrder < comparison2AsView.SiblingOrder;
- }
+ }
}
}
else
private void OnWindowKeyEvent(object source, Window.KeyEventArgs args)
{
- if(args.Key.State == Key.StateType.Up && (args.Key.KeyPressedName == "Back" || args.Key.KeyPressedName == "XF86Back"))
+ if (args.Key.State == Key.StateType.Up && (args.Key.KeyPressedName == "Back" || args.Key.KeyPressedName == "XF86Back"))
{
View top = null;
for (int i = 0; i < Subscriber.Count; i++)
{
// Check visibility
- if(Subscriber[i].Visibility && Subscriber[i].IsOnWindow)
+ if (Subscriber[i].Visibility && Subscriber[i].IsOnWindow)
{
// Initialize first top
- if(top == null)
+ if (top == null)
{
top = Subscriber[i];
continue;
}
else
{
- if(top.HierarchyDepth != Subscriber[i].HierarchyDepth)
+ if (top.HierarchyDepth != Subscriber[i].HierarchyDepth)
{
Container compare1 = top;
Container compare2 = Subscriber[i];
// If their depth is different, sync.
- if(top.HierarchyDepth > Subscriber[i].HierarchyDepth)
+ if (top.HierarchyDepth > Subscriber[i].HierarchyDepth)
{
compare1 = FindParent(compare1, top.HierarchyDepth - Subscriber[i].HierarchyDepth);
}
compare2 = FindParent(compare2, Subscriber[i].HierarchyDepth - top.HierarchyDepth);
}
- if(compare1 == compare2)
+ if (compare1 == compare2)
{
// One is descendant of the other. Descendant is above ancestor.
- top = top.HierarchyDepth > Subscriber[i].HierarchyDepth? top : Subscriber[i];
+ top = top.HierarchyDepth > Subscriber[i].HierarchyDepth ? top : Subscriber[i];
}
else
{
public static CustomActor DownCast(BaseHandle handle)
{
- CustomActor ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as CustomActor;
+ CustomActor ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as CustomActor;
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
}
catch (global::System.Exception ex)
{
- Tizen.Log.Error("NUI","Registry Error: "+ ex);
+ Tizen.Log.Error("NUI", "Registry Error: " + ex);
}
return global::System.IntPtr.Zero;
}
private bool _isCalled = false;
public void Initialize()
{
- if(_isCalled == false)
+ if (_isCalled == false)
{
- _disposeQueueProcessDisposablesDelegate = new EventThreadCallback.CallbackDelegate(ProcessDisposables);
- _eventThreadCallback = new EventThreadCallback(_disposeQueueProcessDisposablesDelegate);
+ _disposeQueueProcessDisposablesDelegate = new EventThreadCallback.CallbackDelegate(ProcessDisposables);
+ _eventThreadCallback = new EventThreadCallback(_disposeQueueProcessDisposablesDelegate);
_isCalled = true;
}
}
{
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_GetEnvironmentVariable")]
private static extern string EnvironmentVariable_GetEnvironmentVariable(string jarg1);
-
+
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_SetEnvironmentVariable")]
private static extern bool EnvironmentVariable_SetEnvironmentVariable(string jarg1, string jarg2);
return ret;
}
- public static string GetValueString(this PropertyInfo property, object obj, Type propertyType)
+ public static string GetValueString(this PropertyInfo property, object obj, Type propertyType)
{
string ret = "";
object value = property.GetValue(obj);
protected override void OnFrameResumed(FrameData frame)
{
- if(isAnimating)
+ if (isAnimating)
{
return;
}
private TransitionAnimation forwardAnimation;
- internal TransitionAnimation ForwardAnimation
- {
+ internal TransitionAnimation ForwardAnimation
+ {
get
{
return forwardAnimation;
internal TransitionAnimation BackwardAnimation
{
get
- {
+ {
return backwardAnimation;
}
set
// friend assembly setting
// compile with: /target:Tizen.NUI.ExtTEST /keyfile:FriendAssemblies.snk
-using System;
+using System;
using System.Collections.Generic;
using System.Text;
[assembly: InternalsVisibleTo("NuiSample, " + Tizen.NUI.PublicKey.Sample)]
-namespace Tizen.NUI {
+namespace Tizen.NUI
+{
internal static class PublicKey
{
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_delete_AnimationSignal")]
public static extern void delete_AnimationSignal(global::System.Runtime.InteropServices.HandleRef jarg1);
-
+
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Animation_SWIGUpcast")]
public static extern global::System.IntPtr Animation_SWIGUpcast(global::System.IntPtr jarg1);
}
internal static partial class Interop
{
internal static partial class BaseObject
- {
+ {
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_BaseObject_DoAction")]
public static extern bool BaseObject_DoAction(global::System.Runtime.InteropServices.HandleRef jarg1, string jarg2, global::System.Runtime.InteropServices.HandleRef jarg3);
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_CameraActor_SetOrthographicProjection__SWIG_1")]
public static extern void CameraActor_SetOrthographicProjection__SWIG_1(global::System.Runtime.InteropServices.HandleRef jarg1, float jarg2, float jarg3, float jarg4, float jarg5, float jarg6, float jarg7);
-
+
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_CameraActor_SWIGUpcast")]
public static extern global::System.IntPtr CameraActor_SWIGUpcast(global::System.IntPtr jarg1);
}
[DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Capture_Start_4")]
public static extern void Start4(HandleRef capture, HandleRef source, HandleRef position, HandleRef size, string path, HandleRef clearColor);
-
+
[DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Capture_SetImageQuality")]
public static extern void SetImageQuality(HandleRef capture, uint quality);
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
+
using System;
using System.Collections.Generic;
using System.Text;
{
internal static partial class ComponentApplication
{
-
- [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_new_ComponentApplication")]
- public static extern global::System.IntPtr ComponentApplication_New(int argc, string argv, string styleSheet);
-
- [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_new_ComponentApplication_SWIG1")]
- public static extern global::System.IntPtr new_ComponentApplication__SWIG_1(global::System.Runtime.InteropServices.HandleRef swigCPtr);
-
- [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_assign_ComponentApplication")]
- public static extern global::System.IntPtr ComponentApplication_Assign(global::System.Runtime.InteropServices.HandleRef swigCPtr, global::System.Runtime.InteropServices.HandleRef swigCPtr2);
-
- [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_delete_ComponentApplication")]
- public static extern global::System.IntPtr delete_ComponentApplication(global::System.Runtime.InteropServices.HandleRef swigCPtr);
-
- [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_ComponentApplication_CreateNativeSignal")]
- public static extern global::System.IntPtr ComponentApplication_CreateNativeSignal(global::System.Runtime.InteropServices.HandleRef swigCPtr);
-
- [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_ComponentApplication_CreateNativeSignal_Connect")]
- public static extern global::System.IntPtr ComponentApplication_CreateNativeSignal_Connect(global::System.Runtime.InteropServices.HandleRef swigCPtr, global::System.Runtime.InteropServices.HandleRef func);
-
- [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_ComponentApplication_CreateNativeSignal_Disconnect")]
- public static extern global::System.IntPtr ComponentApplication_CreateNativeSignal_Disconnect(global::System.Runtime.InteropServices.HandleRef swigCPtr, global::System.Runtime.InteropServices.HandleRef func);
+
+ [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_new_ComponentApplication")]
+ public static extern global::System.IntPtr ComponentApplication_New(int argc, string argv, string styleSheet);
+
+ [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_new_ComponentApplication_SWIG1")]
+ public static extern global::System.IntPtr new_ComponentApplication__SWIG_1(global::System.Runtime.InteropServices.HandleRef swigCPtr);
+
+ [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_assign_ComponentApplication")]
+ public static extern global::System.IntPtr ComponentApplication_Assign(global::System.Runtime.InteropServices.HandleRef swigCPtr, global::System.Runtime.InteropServices.HandleRef swigCPtr2);
+
+ [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_delete_ComponentApplication")]
+ public static extern global::System.IntPtr delete_ComponentApplication(global::System.Runtime.InteropServices.HandleRef swigCPtr);
+
+ [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_ComponentApplication_CreateNativeSignal")]
+ public static extern global::System.IntPtr ComponentApplication_CreateNativeSignal(global::System.Runtime.InteropServices.HandleRef swigCPtr);
+
+ [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_ComponentApplication_CreateNativeSignal_Connect")]
+ public static extern global::System.IntPtr ComponentApplication_CreateNativeSignal_Connect(global::System.Runtime.InteropServices.HandleRef swigCPtr, global::System.Runtime.InteropServices.HandleRef func);
+
+ [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_ComponentApplication_CreateNativeSignal_Disconnect")]
+ public static extern global::System.IntPtr ComponentApplication_CreateNativeSignal_Disconnect(global::System.Runtime.InteropServices.HandleRef swigCPtr, global::System.Runtime.InteropServices.HandleRef func);
}
}
}
public static extern global::System.IntPtr GlWindow_New__SWIG_0();
[DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_GlWindow_New__SWIG_1")]
- public static extern global::System.IntPtr GlWindow_New__SWIG_1(HandleRef jarg1, string jarg2, string jarg3, bool jarg4 );
+ public static extern global::System.IntPtr GlWindow_New__SWIG_1(HandleRef jarg1, string jarg2, string jarg3, bool jarg4);
[DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_new_GlWindow__SWIG_0")]
public static extern global::System.IntPtr new_GlWindow__SWIG_0();
public static extern void GlWindow_SetPreferredOrientation(HandleRef jarg1, int jarg2);
[DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_GlWindow_RegisterGlCallback")]
- public static extern void GlWindow_RegisterGlCallback(HandleRef jarg1, HandleRef jarg2, HandleRef jarg3, HandleRef jarg4);
+ public static extern void GlWindow_RegisterGlCallback(HandleRef jarg1, HandleRef jarg2, HandleRef jarg3, HandleRef jarg4);
[DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_GlWindow_RenderOnce")]
public static extern void GlWindow_RenderOnce(HandleRef jarg1);
public static extern void Geometry_RemoveVertexBuffer(global::System.Runtime.InteropServices.HandleRef jarg1, uint jarg2);
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Geometry_SetIndexBuffer")]
- public static extern void Geometry_SetIndexBuffer(global::System.Runtime.InteropServices.HandleRef jarg1, [global::System.Runtime.InteropServices.In, global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPArray)]ushort[] jarg2, uint jarg3);
+ public static extern void Geometry_SetIndexBuffer(global::System.Runtime.InteropServices.HandleRef jarg1, [global::System.Runtime.InteropServices.In, global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPArray)] ushort[] jarg2, uint jarg3);
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Geometry_SetType")]
public static extern void Geometry_SetType(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2);
public static extern uint GestureDetector_GetAttachedActorCount(global::System.Runtime.InteropServices.HandleRef jarg1);
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_GestureDetector_GetAttachedActor")]
- public static extern global::System.IntPtr GestureDetector_GetAttachedActor(global::System.Runtime.InteropServices.HandleRef jarg1, uint jarg2);
+ public static extern global::System.IntPtr GestureDetector_GetAttachedActor(global::System.Runtime.InteropServices.HandleRef jarg1, uint jarg2);
}
}
}
\ No newline at end of file
public static extern float GlyphInfo_scaleFactor_get(global::System.Runtime.InteropServices.HandleRef jarg1);
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_delete_GlyphInfo")]
- public static extern void delete_GlyphInfo(global::System.Runtime.InteropServices.HandleRef jarg1);
+ public static extern void delete_GlyphInfo(global::System.Runtime.InteropServices.HandleRef jarg1);
}
}
}
\ No newline at end of file
public static extern global::System.IntPtr new_Matrix__SWIG_1(bool jarg1);
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_new_Matrix__SWIG_2")]
- public static extern global::System.IntPtr new_Matrix__SWIG_2([global::System.Runtime.InteropServices.In, global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPArray)]float[] jarg1);
+ public static extern global::System.IntPtr new_Matrix__SWIG_2([global::System.Runtime.InteropServices.In, global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPArray)] float[] jarg1);
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_new_Matrix__SWIG_3")]
public static extern global::System.IntPtr new_Matrix__SWIG_3(global::System.Runtime.InteropServices.HandleRef jarg1);
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Model3dView_DownCast")]
public static extern global::System.IntPtr Model3dView_DownCast(global::System.Runtime.InteropServices.HandleRef jarg1);
-
+
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Model3dView_SWIGUpcast")]
public static extern global::System.IntPtr Model3dView_SWIGUpcast(global::System.IntPtr jarg1);
}
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_LowerBelow")]
public static extern void LowerBelow(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
-
+
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_GetImplementation__SWIG_0")]
public static extern global::System.IntPtr GetImplementation__SWIG_0(global::System.Runtime.InteropServices.HandleRef jarg1);
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_SetCustomAlgorithm")]
public static extern void SetCustomAlgorithm(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
-
+
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_EqualTo__SWIG_5")]
public static extern bool EqualTo__SWIG_5(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
-
+
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_NotEqualTo__SWIG_4")]
public static extern bool NotEqualTo__SWIG_4(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
-
+
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Clamp__SWIG_3")]
public static extern global::System.IntPtr Clamp__SWIG_3(global::System.Runtime.InteropServices.HandleRef jarg1, float jarg2, float jarg3);
-
+
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_EqualTo__SWIG_6")]
public static extern bool EqualTo__SWIG_6(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
-
+
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_NotEqualTo__SWIG_5")]
public static extern bool NotEqualTo__SWIG_5(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
-
+
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_EqualTo__SWIG_7")]
public static extern bool EqualTo__SWIG_7(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
-
+
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_NotEqualTo__SWIG_6")]
public static extern bool NotEqualTo__SWIG_6(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
-
+
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_EqualTo__SWIG_8")]
public static extern bool EqualTo__SWIG_8(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
-
+
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_NotEqualTo__SWIG_7")]
public static extern bool NotEqualTo__SWIG_7(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
-
+
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_GreaterThan__SWIG_0")]
public static extern bool GreaterThan__SWIG_0(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
-
+
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_GreaterThan__SWIG_1")]
public static extern bool GreaterThan__SWIG_1(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
-
+
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_GreaterThan__SWIG_2")]
public static extern bool GreaterThan__SWIG_2(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
-
+
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_LessThan__SWIG_0")]
public static extern bool LessThan__SWIG_0(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
-
+
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_LessThan__SWIG_1")]
public static extern bool LessThan__SWIG_1(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
-
+
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_LessThan__SWIG_2")]
public static extern bool LessThan__SWIG_2(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
-
+
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Multiply")]
public static extern global::System.IntPtr Multiply(global::System.Runtime.InteropServices.HandleRef jarg1, float jarg2);
-
+
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Subtract")]
public static extern global::System.IntPtr Subtract(global::System.Runtime.InteropServices.HandleRef jarg1);
-
+
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Clamp__SWIG_4")]
public static extern global::System.IntPtr Clamp__SWIG_4(global::System.Runtime.InteropServices.HandleRef jarg1, float jarg2, float jarg3);
-
+
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Range")]
public static extern float Range(float jarg1, float jarg2);
-
+
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Axis")]
public static extern global::System.IntPtr Axis();
-
+
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_LessThan__SWIG_3")]
public static extern bool LessThan__SWIG_3(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
-
+
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_New")]
public static extern global::System.IntPtr New();
-
+
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_new_SignalConnectorType")]
public static extern global::System.IntPtr new_SignalConnectorType(global::System.Runtime.InteropServices.HandleRef jarg1, string jarg2, global::System.Runtime.InteropServices.HandleRef jarg3);
-
+
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_delete_SignalConnectorType")]
public static extern void delete_SignalConnectorType(global::System.Runtime.InteropServices.HandleRef jarg1);
-
+
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_new_TypeAction")]
public static extern global::System.IntPtr new_TypeAction(global::System.Runtime.InteropServices.HandleRef jarg1, string jarg2, global::System.Runtime.InteropServices.HandleRef jarg3);
-
+
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_delete_TypeAction")]
public static extern void delete_TypeAction(global::System.Runtime.InteropServices.HandleRef jarg1);
-
+
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_new_PropertyRegistration")]
public static extern global::System.IntPtr new_PropertyRegistration(global::System.Runtime.InteropServices.HandleRef jarg1, string jarg2, int jarg3, int jarg4, global::System.Runtime.InteropServices.HandleRef jarg5, global::System.Runtime.InteropServices.HandleRef jarg6);
-
+
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_delete_PropertyRegistration")]
public static extern void delete_PropertyRegistration(global::System.Runtime.InteropServices.HandleRef jarg1);
-
+
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_new_AnimatablePropertyRegistration__SWIG_0")]
public static extern global::System.IntPtr new_AnimatablePropertyRegistration__SWIG_0(global::System.Runtime.InteropServices.HandleRef jarg1, string jarg2, int jarg3, int jarg4);
-
+
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_new_AnimatablePropertyRegistration__SWIG_1")]
public static extern global::System.IntPtr new_AnimatablePropertyRegistration__SWIG_1(global::System.Runtime.InteropServices.HandleRef jarg1, string jarg2, int jarg3, global::System.Runtime.InteropServices.HandleRef jarg4);
-
+
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_delete_AnimatablePropertyRegistration")]
public static extern void delete_AnimatablePropertyRegistration(global::System.Runtime.InteropServices.HandleRef jarg1);
-
+
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_new_AnimatablePropertyComponentRegistration")]
public static extern global::System.IntPtr new_AnimatablePropertyComponentRegistration(global::System.Runtime.InteropServices.HandleRef jarg1, string jarg2, int jarg3, int jarg4, uint jarg5);
-
+
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_delete_AnimatablePropertyComponentRegistration")]
public static extern void delete_AnimatablePropertyComponentRegistration(global::System.Runtime.InteropServices.HandleRef jarg1);
-
+
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_new_ChildPropertyRegistration")]
public static extern global::System.IntPtr new_ChildPropertyRegistration(global::System.Runtime.InteropServices.HandleRef jarg1, string jarg2, int jarg3, int jarg4);
-
+
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_delete_ChildPropertyRegistration")]
public static extern void delete_ChildPropertyRegistration(global::System.Runtime.InteropServices.HandleRef jarg1);
-
+
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_PI_get")]
public static extern float PI_get();
-
+
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_PI_2_get")]
public static extern float PI_2_get();
-
+
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_PI_4_get")]
public static extern float PI_4_get();
-
+
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_PI_OVER_180_get")]
public static extern float PI_OVER_180_get();
-
+
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_ONE80_OVER_PI_get")]
public static extern float ONE80_OVER_PI_get();
-
+
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_ResizePolicyDefault_get")]
public static extern int ResizePolicyDefault_get();
-
+
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_UnparentAndReset")]
public static extern void UnparentAndReset(global::System.Runtime.InteropServices.HandleRef jarg1);
-
+
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_VisibilityChangedSignal")]
public static extern global::System.IntPtr VisibilityChangedSignal(global::System.Runtime.InteropServices.HandleRef jarg1);
-
+
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_delete_RelayoutContainer")]
public static extern void delete_RelayoutContainer(global::System.Runtime.InteropServices.HandleRef jarg1);
-
+
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_RelayoutContainer_Add")]
public static extern void RelayoutContainer_Add(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2, global::System.Runtime.InteropServices.HandleRef jarg3);
-
+
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_FittingModeDefault_get")]
public static extern int FittingModeDefault_get();
-
+
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_DEFAULT_get")]
public static extern int DEFAULT_get();
-
+
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_IsVertical")]
public static extern bool IsVertical(int jarg1);
-
+
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_IsHorizontal")]
public static extern bool IsHorizontal(int jarg1);
-
+
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_MoveActorConstraint")]
public static extern void MoveActorConstraint(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
-
+
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WrapActorConstraint")]
public static extern void WrapActorConstraint(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
}
internal static partial class Interop
{
internal static partial class PanGestureDetector
- {
+ {
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_PanGesture_SWIGUpcast")]
public static extern global::System.IntPtr PanGesture_SWIGUpcast(global::System.IntPtr jarg1);
public static extern global::System.IntPtr PixelData_SWIGUpcast(global::System.IntPtr jarg1);
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_PixelData_New")]
- public static extern global::System.IntPtr PixelData_New([global::System.Runtime.InteropServices.In, global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPArray)]byte[] jarg1, uint jarg2, uint jarg3, uint jarg4, int jarg5, int jarg6);
+ public static extern global::System.IntPtr PixelData_New([global::System.Runtime.InteropServices.In, global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPArray)] byte[] jarg1, uint jarg2, uint jarg3, uint jarg4, int jarg5, int jarg6);
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_new_PixelData__SWIG_0")]
public static extern global::System.IntPtr new_PixelData__SWIG_0();
internal static partial class Interop
{
internal static partial class ProgressBar
- {
+ {
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_ProgressBar_SWIGUpcast")]
public static extern global::System.IntPtr ProgressBar_SWIGUpcast(global::System.IntPtr jarg1);
internal static partial class Interop
{
internal static partial class RefObject
- {
+ {
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_RefObject_Reference")]
public static extern void RefObject_Reference(global::System.Runtime.InteropServices.HandleRef jarg1);
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_TableView_SetCellAlignment")]
public static extern void TableView_SetCellAlignment(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2, int jarg3, int jarg4);
-
+
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_TableView_SWIGUpcast")]
public static extern global::System.IntPtr TableView_SWIGUpcast(global::System.IntPtr jarg1);
}
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_TextField_Property_ELLIPSIS_get")]
public static extern int TextField_Property_ELLIPSIS_get();
-
+
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_TextField_SelectWholeText")]
public static extern void TextField_SelectWholeText(global::System.Runtime.InteropServices.HandleRef jarg1);
-
+
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_TextField_Property_ENABLE_GRAB_HANDLE_get")]
public static extern int TextField_Property_ENABLE_GRAB_HANDLE_get();
-
+
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_TextField_Property_ENABLE_GRAB_HANDLE_POPUP_get")]
public static extern int TextField_Property_ENABLE_GRAB_HANDLE_POPUP_get();
namespace Tizen.NUI
{
-
+
internal static partial class Interop
{
internal static partial class Util
public static extern global::System.IntPtr new_Vector2__SWIG_1(float jarg1, float jarg2);
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_new_Vector2__SWIG_2")]
- public static extern global::System.IntPtr new_Vector2__SWIG_2([global::System.Runtime.InteropServices.In, global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPArray)]float[] jarg1);
+ public static extern global::System.IntPtr new_Vector2__SWIG_2([global::System.Runtime.InteropServices.In, global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPArray)] float[] jarg1);
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_new_Vector2__SWIG_3")]
public static extern global::System.IntPtr new_Vector2__SWIG_3(global::System.Runtime.InteropServices.HandleRef jarg1);
public static extern global::System.IntPtr Vector2_ZERO_get();
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Vector2_Assign__SWIG_0")]
- public static extern global::System.IntPtr Vector2_Assign__SWIG_0(global::System.Runtime.InteropServices.HandleRef jarg1, [global::System.Runtime.InteropServices.In, global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPArray)]float[] jarg2);
+ public static extern global::System.IntPtr Vector2_Assign__SWIG_0(global::System.Runtime.InteropServices.HandleRef jarg1, [global::System.Runtime.InteropServices.In, global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPArray)] float[] jarg2);
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Vector2_Assign__SWIG_1")]
public static extern global::System.IntPtr Vector2_Assign__SWIG_1(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
using System.Text;
namespace Tizen.NUI
-{
+{
internal static partial class Interop
{
internal static partial class Vector3
public static extern global::System.IntPtr new_Vector3__SWIG_1(float jarg1, float jarg2, float jarg3);
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_new_Vector3__SWIG_2")]
- public static extern global::System.IntPtr new_Vector3__SWIG_2([global::System.Runtime.InteropServices.In, global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPArray)]float[] jarg1);
+ public static extern global::System.IntPtr new_Vector3__SWIG_2([global::System.Runtime.InteropServices.In, global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPArray)] float[] jarg1);
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_new_Vector3__SWIG_3")]
public static extern global::System.IntPtr new_Vector3__SWIG_3(global::System.Runtime.InteropServices.HandleRef jarg1);
public static extern global::System.IntPtr Vector3_ZERO_get();
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Vector3_Assign__SWIG_0")]
- public static extern global::System.IntPtr Vector3_Assign__SWIG_0(global::System.Runtime.InteropServices.HandleRef jarg1, [global::System.Runtime.InteropServices.In, global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPArray)]float[] jarg2);
+ public static extern global::System.IntPtr Vector3_Assign__SWIG_0(global::System.Runtime.InteropServices.HandleRef jarg1, [global::System.Runtime.InteropServices.In, global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPArray)] float[] jarg2);
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Vector3_Assign__SWIG_1")]
public static extern global::System.IntPtr Vector3_Assign__SWIG_1(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
public static extern global::System.IntPtr new_Vector4__SWIG_1(float jarg1, float jarg2, float jarg3, float jarg4);
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_new_Vector4__SWIG_2")]
- public static extern global::System.IntPtr new_Vector4__SWIG_2([global::System.Runtime.InteropServices.In, global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPArray)]float[] jarg1);
+ public static extern global::System.IntPtr new_Vector4__SWIG_2([global::System.Runtime.InteropServices.In, global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPArray)] float[] jarg1);
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_new_Vector4__SWIG_3")]
public static extern global::System.IntPtr new_Vector4__SWIG_3(global::System.Runtime.InteropServices.HandleRef jarg1);
public static extern global::System.IntPtr Vector4_ZERO_get();
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Vector4_Assign__SWIG_0")]
- public static extern global::System.IntPtr Vector4_Assign__SWIG_0(global::System.Runtime.InteropServices.HandleRef jarg1, [global::System.Runtime.InteropServices.In, global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPArray)]float[] jarg2);
+ public static extern global::System.IntPtr Vector4_Assign__SWIG_0(global::System.Runtime.InteropServices.HandleRef jarg1, [global::System.Runtime.InteropServices.In, global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPArray)] float[] jarg2);
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Vector4_Assign__SWIG_1")]
public static extern global::System.IntPtr Vector4_Assign__SWIG_1(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
public static extern void VectorUnsignedChar_PushBack(global::System.Runtime.InteropServices.HandleRef jarg1, byte jarg2);
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_VectorUnsignedChar_Insert__SWIG_0")]
- public static extern void VectorUnsignedChar_Insert__SWIG_0(global::System.Runtime.InteropServices.HandleRef jarg1, [global::System.Runtime.InteropServices.In, global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPArray)]byte[] jarg2, byte jarg3);
+ public static extern void VectorUnsignedChar_Insert__SWIG_0(global::System.Runtime.InteropServices.HandleRef jarg1, [global::System.Runtime.InteropServices.In, global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPArray)] byte[] jarg2, byte jarg3);
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_VectorUnsignedChar_Insert__SWIG_1")]
- public static extern void VectorUnsignedChar_Insert__SWIG_1(global::System.Runtime.InteropServices.HandleRef jarg1, [global::System.Runtime.InteropServices.In, global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPArray)]byte[] jarg2, global::System.Runtime.InteropServices.HandleRef jarg3, global::System.Runtime.InteropServices.HandleRef jarg4);
+ public static extern void VectorUnsignedChar_Insert__SWIG_1(global::System.Runtime.InteropServices.HandleRef jarg1, [global::System.Runtime.InteropServices.In, global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPArray)] byte[] jarg2, global::System.Runtime.InteropServices.HandleRef jarg3, global::System.Runtime.InteropServices.HandleRef jarg4);
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_VectorUnsignedChar_Reserve")]
public static extern void VectorUnsignedChar_Reserve(global::System.Runtime.InteropServices.HandleRef jarg1, uint jarg2);
public static extern void VectorUnsignedChar_Resize__SWIG_1(global::System.Runtime.InteropServices.HandleRef jarg1, uint jarg2, byte jarg3);
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_VectorUnsignedChar_Erase__SWIG_0")]
- public static extern global::System.IntPtr VectorUnsignedChar_Erase__SWIG_0(global::System.Runtime.InteropServices.HandleRef jarg1, [global::System.Runtime.InteropServices.In, global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPArray)]byte[] jarg2);
+ public static extern global::System.IntPtr VectorUnsignedChar_Erase__SWIG_0(global::System.Runtime.InteropServices.HandleRef jarg1, [global::System.Runtime.InteropServices.In, global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPArray)] byte[] jarg2);
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_VectorUnsignedChar_Erase__SWIG_1")]
- public static extern global::System.IntPtr VectorUnsignedChar_Erase__SWIG_1(global::System.Runtime.InteropServices.HandleRef jarg1, [global::System.Runtime.InteropServices.In, global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPArray)]byte[] jarg2, global::System.Runtime.InteropServices.HandleRef jarg3);
+ public static extern global::System.IntPtr VectorUnsignedChar_Erase__SWIG_1(global::System.Runtime.InteropServices.HandleRef jarg1, [global::System.Runtime.InteropServices.In, global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPArray)] byte[] jarg2, global::System.Runtime.InteropServices.HandleRef jarg3);
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_VectorUnsignedChar_Remove")]
- public static extern void VectorUnsignedChar_Remove(global::System.Runtime.InteropServices.HandleRef jarg1, [global::System.Runtime.InteropServices.In, global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPArray)]byte[] jarg2);
+ public static extern void VectorUnsignedChar_Remove(global::System.Runtime.InteropServices.HandleRef jarg1, [global::System.Runtime.InteropServices.In, global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPArray)] byte[] jarg2);
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_VectorUnsignedChar_Swap")]
public static extern void VectorUnsignedChar_Swap(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
namespace Tizen.NUI
{
- internal static partial class Interop
+ internal static partial class Interop
{
internal static partial class View
{
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WidgetImpl_director_connect")]
public static extern void WidgetImpl_director_connect(global::System.Runtime.InteropServices.HandleRef jarg1, Tizen.NUI.WidgetImpl.SwigDelegateWidgetImpl_0 delegate0, Tizen.NUI.WidgetImpl.SwigDelegateWidgetImpl_1 delegate1,
Tizen.NUI.WidgetImpl.SwigDelegateWidgetImpl_2 delegate2, Tizen.NUI.WidgetImpl.SwigDelegateWidgetImpl_3 delegate3, Tizen.NUI.WidgetImpl.SwigDelegateWidgetImpl_4 delegate4, Tizen.NUI.WidgetImpl.SwigDelegateWidgetImpl_5 delegate5,
- Tizen.NUI.WidgetImpl.SwigDelegateWidgetImpl_6 delegate6, Tizen.NUI.WidgetImpl.SwigDelegateWidgetImpl_7 delegate7);
+ Tizen.NUI.WidgetImpl.SwigDelegateWidgetImpl_6 delegate6, Tizen.NUI.WidgetImpl.SwigDelegateWidgetImpl_7 delegate7);
}
}
}
\ No newline at end of file
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Window_New_Root_Layout")]
public static extern global::System.IntPtr Window_NewRootLayout();
-
+
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Window_SetClass")]
public static extern void Window_SetClass(global::System.Runtime.InteropServices.HandleRef jarg1, string jarg2, string jarg3);
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Window_SetAvailableOrientations")]
public static extern void Window_SetAvailableOrientations(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
-
+
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Window_SetPositionSize")]
public static extern void Window_SetPositionSize(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
-
+
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Window_SWIGUpcast")]
public static extern global::System.IntPtr Window_SWIGUpcast(global::System.IntPtr jarg1);
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_GetBrightness")]
public static extern int GetBrightness(global::System.Runtime.InteropServices.HandleRef jarg1);
-
+
// For windows resized signal
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Window_ResizeSignal")]
public static extern global::System.IntPtr Window_ResizeSignal(global::System.Runtime.InteropServices.HandleRef jarg1);
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_HIDDENINPUT_PROPERTY_SHOW_LAST_CHARACTER_DURATION_get")]
public static extern int HIDDENINPUT_PROPERTY_SHOW_LAST_CHARACTER_DURATION_get();
-
+
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_LINE_MUST_BREAK_get")]
public static extern int LINE_MUST_BREAK_get();
{
public const string Lib = "libdali2-csharp-binder.so";
protected class SWIGExceptionHelper
- {
- /// <since_tizen> 3 </since_tizen>
- public delegate void ExceptionDelegate(string message);
- /// <since_tizen> 3 </since_tizen>
- public delegate void ExceptionArgumentDelegate(string message, string paramName);
- static ExceptionDelegate applicationDelegate = new ExceptionDelegate(SetPendingApplicationException);
- static ExceptionDelegate arithmeticDelegate = new ExceptionDelegate(SetPendingArithmeticException);
- static ExceptionDelegate divideByZeroDelegate = new ExceptionDelegate(SetPendingDivideByZeroException);
- static ExceptionDelegate indexOutOfRangeDelegate = new ExceptionDelegate(SetPendingIndexOutOfRangeException);
- static ExceptionDelegate invalidCastDelegate = new ExceptionDelegate(SetPendingInvalidCastException);
- static ExceptionDelegate invalidOperationDelegate = new ExceptionDelegate(SetPendingInvalidOperationException);
- static ExceptionDelegate ioDelegate = new ExceptionDelegate(SetPendingIOException);
- static ExceptionDelegate nullReferenceDelegate = new ExceptionDelegate(SetPendingNullReferenceException);
- static ExceptionDelegate outOfMemoryDelegate = new ExceptionDelegate(SetPendingOutOfMemoryException);
- static ExceptionDelegate overflowDelegate = new ExceptionDelegate(SetPendingOverflowException);
- static ExceptionDelegate systemDelegate = new ExceptionDelegate(SetPendingSystemException);
- static ExceptionArgumentDelegate argumentDelegate = new ExceptionArgumentDelegate(SetPendingArgumentException);
- static ExceptionArgumentDelegate argumentNullDelegate = new ExceptionArgumentDelegate(SetPendingArgumentNullException);
- static ExceptionArgumentDelegate argumentOutOfRangeDelegate = new ExceptionArgumentDelegate(SetPendingArgumentOutOfRangeException);
-
- [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "SWIGRegisterExceptionCallbacks_NDalic")]
- public static extern void SWIGRegisterExceptionCallbacks_NDalic(
- ExceptionDelegate applicationDelegate,
- ExceptionDelegate arithmeticDelegate,
- ExceptionDelegate divideByZeroDelegate,
- ExceptionDelegate indexOutOfRangeDelegate,
- ExceptionDelegate invalidCastDelegate,
- ExceptionDelegate invalidOperationDelegate,
- ExceptionDelegate ioDelegate,
- ExceptionDelegate nullReferenceDelegate,
- ExceptionDelegate outOfMemoryDelegate,
- ExceptionDelegate overflowDelegate,
- ExceptionDelegate systemExceptionDelegate);
-
- [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "SWIGRegisterExceptionArgumentCallbacks_NDalic")]
- public static extern void SWIGRegisterExceptionCallbacksArgument_NDalic(
- ExceptionArgumentDelegate argumentDelegate,
- ExceptionArgumentDelegate argumentNullDelegate,
- ExceptionArgumentDelegate argumentOutOfRangeDelegate);
- static void SetPendingApplicationException(string message)
- {
- SWIGPendingException.Set(new global::System.ApplicationException(message, SWIGPendingException.Retrieve()));
- }
- static void SetPendingArithmeticException(string message)
- {
- SWIGPendingException.Set(new global::System.ArithmeticException(message, SWIGPendingException.Retrieve()));
- }
- static void SetPendingDivideByZeroException(string message)
- {
- SWIGPendingException.Set(new global::System.DivideByZeroException(message, SWIGPendingException.Retrieve()));
- }
- static void SetPendingIndexOutOfRangeException(string message)
- {
- SWIGPendingException.Set(new global::System.IndexOutOfRangeException(message, SWIGPendingException.Retrieve()));
- }
- static void SetPendingInvalidCastException(string message)
- {
- SWIGPendingException.Set(new global::System.InvalidCastException(message, SWIGPendingException.Retrieve()));
- }
- static void SetPendingInvalidOperationException(string message)
- {
- SWIGPendingException.Set(new global::System.InvalidOperationException(message, SWIGPendingException.Retrieve()));
- }
- static void SetPendingIOException(string message)
- {
- SWIGPendingException.Set(new global::System.IO.IOException(message, SWIGPendingException.Retrieve()));
- }
- static void SetPendingNullReferenceException(string message)
- {
- SWIGPendingException.Set(new global::System.NullReferenceException(message, SWIGPendingException.Retrieve()));
- }
- static void SetPendingOutOfMemoryException(string message)
- {
- SWIGPendingException.Set(new global::System.OutOfMemoryException(message, SWIGPendingException.Retrieve()));
- }
- static void SetPendingOverflowException(string message)
- {
- SWIGPendingException.Set(new global::System.OverflowException(message, SWIGPendingException.Retrieve()));
- }
- static void SetPendingSystemException(string message)
- {
- SWIGPendingException.Set(new global::System.SystemException(message, SWIGPendingException.Retrieve()));
- }
-
- static void SetPendingArgumentException(string message, string paramName)
- {
- SWIGPendingException.Set(new global::System.ArgumentException(message, paramName, SWIGPendingException.Retrieve()));
- }
- static void SetPendingArgumentNullException(string message, string paramName)
- {
- global::System.Exception e = SWIGPendingException.Retrieve();
- if (e != null) message = message + " Inner Exception: " + e.Message;
- SWIGPendingException.Set(new global::System.ArgumentNullException(message, paramName));
- }
- static void SetPendingArgumentOutOfRangeException(string message, string paramName)
- {
- global::System.Exception e = SWIGPendingException.Retrieve();
- if (e != null) message = message + " Inner Exception: " + e.Message;
- SWIGPendingException.Set(new global::System.ArgumentOutOfRangeException(paramName, message));
- }
- static SWIGExceptionHelper()
- {
- SWIGRegisterExceptionCallbacks_NDalic(
- applicationDelegate,
- arithmeticDelegate,
- divideByZeroDelegate,
- indexOutOfRangeDelegate,
- invalidCastDelegate,
- invalidOperationDelegate,
- ioDelegate,
- nullReferenceDelegate,
- outOfMemoryDelegate,
- overflowDelegate,
- systemDelegate);
-
- SWIGRegisterExceptionCallbacksArgument_NDalic(
- argumentDelegate,
- argumentNullDelegate,
- argumentOutOfRangeDelegate);
- }
- }
- protected static SWIGExceptionHelper swigExceptionHelper = new SWIGExceptionHelper();
+ {
+ /// <since_tizen> 3 </since_tizen>
+ public delegate void ExceptionDelegate(string message);
+ /// <since_tizen> 3 </since_tizen>
+ public delegate void ExceptionArgumentDelegate(string message, string paramName);
+ static ExceptionDelegate applicationDelegate = new ExceptionDelegate(SetPendingApplicationException);
+ static ExceptionDelegate arithmeticDelegate = new ExceptionDelegate(SetPendingArithmeticException);
+ static ExceptionDelegate divideByZeroDelegate = new ExceptionDelegate(SetPendingDivideByZeroException);
+ static ExceptionDelegate indexOutOfRangeDelegate = new ExceptionDelegate(SetPendingIndexOutOfRangeException);
+ static ExceptionDelegate invalidCastDelegate = new ExceptionDelegate(SetPendingInvalidCastException);
+ static ExceptionDelegate invalidOperationDelegate = new ExceptionDelegate(SetPendingInvalidOperationException);
+ static ExceptionDelegate ioDelegate = new ExceptionDelegate(SetPendingIOException);
+ static ExceptionDelegate nullReferenceDelegate = new ExceptionDelegate(SetPendingNullReferenceException);
+ static ExceptionDelegate outOfMemoryDelegate = new ExceptionDelegate(SetPendingOutOfMemoryException);
+ static ExceptionDelegate overflowDelegate = new ExceptionDelegate(SetPendingOverflowException);
+ static ExceptionDelegate systemDelegate = new ExceptionDelegate(SetPendingSystemException);
+ static ExceptionArgumentDelegate argumentDelegate = new ExceptionArgumentDelegate(SetPendingArgumentException);
+ static ExceptionArgumentDelegate argumentNullDelegate = new ExceptionArgumentDelegate(SetPendingArgumentNullException);
+ static ExceptionArgumentDelegate argumentOutOfRangeDelegate = new ExceptionArgumentDelegate(SetPendingArgumentOutOfRangeException);
+
+ [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "SWIGRegisterExceptionCallbacks_NDalic")]
+ public static extern void SWIGRegisterExceptionCallbacks_NDalic(
+ ExceptionDelegate applicationDelegate,
+ ExceptionDelegate arithmeticDelegate,
+ ExceptionDelegate divideByZeroDelegate,
+ ExceptionDelegate indexOutOfRangeDelegate,
+ ExceptionDelegate invalidCastDelegate,
+ ExceptionDelegate invalidOperationDelegate,
+ ExceptionDelegate ioDelegate,
+ ExceptionDelegate nullReferenceDelegate,
+ ExceptionDelegate outOfMemoryDelegate,
+ ExceptionDelegate overflowDelegate,
+ ExceptionDelegate systemExceptionDelegate);
+
+ [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "SWIGRegisterExceptionArgumentCallbacks_NDalic")]
+ public static extern void SWIGRegisterExceptionCallbacksArgument_NDalic(
+ ExceptionArgumentDelegate argumentDelegate,
+ ExceptionArgumentDelegate argumentNullDelegate,
+ ExceptionArgumentDelegate argumentOutOfRangeDelegate);
+ static void SetPendingApplicationException(string message)
+ {
+ SWIGPendingException.Set(new global::System.ApplicationException(message, SWIGPendingException.Retrieve()));
+ }
+ static void SetPendingArithmeticException(string message)
+ {
+ SWIGPendingException.Set(new global::System.ArithmeticException(message, SWIGPendingException.Retrieve()));
+ }
+ static void SetPendingDivideByZeroException(string message)
+ {
+ SWIGPendingException.Set(new global::System.DivideByZeroException(message, SWIGPendingException.Retrieve()));
+ }
+ static void SetPendingIndexOutOfRangeException(string message)
+ {
+ SWIGPendingException.Set(new global::System.IndexOutOfRangeException(message, SWIGPendingException.Retrieve()));
+ }
+ static void SetPendingInvalidCastException(string message)
+ {
+ SWIGPendingException.Set(new global::System.InvalidCastException(message, SWIGPendingException.Retrieve()));
+ }
+ static void SetPendingInvalidOperationException(string message)
+ {
+ SWIGPendingException.Set(new global::System.InvalidOperationException(message, SWIGPendingException.Retrieve()));
+ }
+ static void SetPendingIOException(string message)
+ {
+ SWIGPendingException.Set(new global::System.IO.IOException(message, SWIGPendingException.Retrieve()));
+ }
+ static void SetPendingNullReferenceException(string message)
+ {
+ SWIGPendingException.Set(new global::System.NullReferenceException(message, SWIGPendingException.Retrieve()));
+ }
+ static void SetPendingOutOfMemoryException(string message)
+ {
+ SWIGPendingException.Set(new global::System.OutOfMemoryException(message, SWIGPendingException.Retrieve()));
+ }
+ static void SetPendingOverflowException(string message)
+ {
+ SWIGPendingException.Set(new global::System.OverflowException(message, SWIGPendingException.Retrieve()));
+ }
+ static void SetPendingSystemException(string message)
+ {
+ SWIGPendingException.Set(new global::System.SystemException(message, SWIGPendingException.Retrieve()));
+ }
+
+ static void SetPendingArgumentException(string message, string paramName)
+ {
+ SWIGPendingException.Set(new global::System.ArgumentException(message, paramName, SWIGPendingException.Retrieve()));
+ }
+ static void SetPendingArgumentNullException(string message, string paramName)
+ {
+ global::System.Exception e = SWIGPendingException.Retrieve();
+ if (e != null) message = message + " Inner Exception: " + e.Message;
+ SWIGPendingException.Set(new global::System.ArgumentNullException(message, paramName));
+ }
+ static void SetPendingArgumentOutOfRangeException(string message, string paramName)
+ {
+ global::System.Exception e = SWIGPendingException.Retrieve();
+ if (e != null) message = message + " Inner Exception: " + e.Message;
+ SWIGPendingException.Set(new global::System.ArgumentOutOfRangeException(paramName, message));
+ }
+ static SWIGExceptionHelper()
+ {
+ SWIGRegisterExceptionCallbacks_NDalic(
+ applicationDelegate,
+ arithmeticDelegate,
+ divideByZeroDelegate,
+ indexOutOfRangeDelegate,
+ invalidCastDelegate,
+ invalidOperationDelegate,
+ ioDelegate,
+ nullReferenceDelegate,
+ outOfMemoryDelegate,
+ overflowDelegate,
+ systemDelegate);
+
+ SWIGRegisterExceptionCallbacksArgument_NDalic(
+ argumentDelegate,
+ argumentNullDelegate,
+ argumentOutOfRangeDelegate);
+ }
+ }
+ protected static SWIGExceptionHelper swigExceptionHelper = new SWIGExceptionHelper();
/// <since_tizen> 3 </since_tizen>
public class SWIGPendingException
Tizen.Log.Error("NUI", "Create NDalicPINVOKE");
}
- [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_delete_BaseHandle")]
- public static extern void delete_BaseHandle(global::System.Runtime.InteropServices.HandleRef jarg1);
+ [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_delete_BaseHandle")]
+ public static extern void delete_BaseHandle(global::System.Runtime.InteropServices.HandleRef jarg1);
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Application_SWIGUpcast")]
public static extern global::System.IntPtr Application_SWIGUpcast(global::System.IntPtr jarg1);
internal static ItemView DownCast(BaseHandle handle)
{
- ItemView ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as ItemView;
+ ItemView ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as ItemView;
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
/// KeyboardTypeSignalType
/// </summary>
/// <since_tizen> 4 </since_tizen>
- [Obsolete("Deprecated in API6, Will be removed in API9, " +
+ [Obsolete("Deprecated in API6, Will be removed in API9, " +
"Please use InputMethodContext.KeyboardTypeChanged event instead!")]
[EditorBrowsable(EditorBrowsableState.Never)]
public class KeyboardTypeSignalType : Disposable
/// </summary>
/// <returns>True if there are any slots connected to the signal</returns>
/// <since_tizen> 4 </since_tizen>
- [Obsolete("Deprecated in API6, Will be removed in API9, " +
+ [Obsolete("Deprecated in API6, Will be removed in API9, " +
"Please use InputMethodContext.KeyboardTypeChanged event instead!")]
[EditorBrowsable(EditorBrowsableState.Never)]
public bool Empty()
/// </summary>
/// <returns>The number of slots connected to this signal</returns>
/// <since_tizen> 4 </since_tizen>
- [Obsolete("Deprecated in API6, Will be removed in API9, " +
+ [Obsolete("Deprecated in API6, Will be removed in API9, " +
"Please use InputMethodContext.KeyboardTypeChanged event instead!")]
[EditorBrowsable(EditorBrowsableState.Never)]
public uint GetConnectionCount()
/// </summary>
/// <param name="func">The function to connect</param>
/// <since_tizen> 4 </since_tizen>
- [Obsolete("Deprecated in API6, Will be removed in API9, " +
+ [Obsolete("Deprecated in API6, Will be removed in API9, " +
"Please use InputMethodContext.KeyboardTypeChanged event instead!")]
[EditorBrowsable(EditorBrowsableState.Never)]
public void Connect(System.Delegate func)
/// </summary>
/// <param name="func">The function to disconnect</param>
/// <since_tizen> 4 </since_tizen>
- [Obsolete("Deprecated in API6, Will be removed in API9, " +
+ [Obsolete("Deprecated in API6, Will be removed in API9, " +
"Please use InputMethodContext.KeyboardTypeChanged event instead!")]
[EditorBrowsable(EditorBrowsableState.Never)]
public void Disconnect(System.Delegate func)
/// </summary>
/// <param name="arg">The member function to connect</param>
/// <since_tizen> 5 </since_tizen>
- [Obsolete("Deprecated in API6, Will be removed in API9, " +
+ [Obsolete("Deprecated in API6, Will be removed in API9, " +
"Please use InputMethodContext.KeyboardTypeChanged event instead!")]
[EditorBrowsable(EditorBrowsableState.Never)]
public void Emit(InputMethodContext.KeyboardType arg)
/// The contructor.
/// </summary>
/// <since_tizen> 4 </since_tizen>
- [Obsolete("Deprecated in API6, Will be removed in API9, " +
+ [Obsolete("Deprecated in API6, Will be removed in API9, " +
"Please use InputMethodContext.KeyboardTypeChanged event instead!")]
[EditorBrowsable(EditorBrowsableState.Never)]
public KeyboardTypeSignalType() : this(Interop.KeyboardTypeSignalType.new_KeyboardTypeSignalType(), true)
public static extern global::System.IntPtr FlexLayout_New();
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_FlexLayout_SetContext")]
- public static extern global::System.IntPtr FlexLayout_SetContext( global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
+ public static extern global::System.IntPtr FlexLayout_SetContext(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_FlexLayout_SetMeasureFunction")]
- public static extern global::System.IntPtr FlexLayout_SetMeasureFunction( global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
+ public static extern global::System.IntPtr FlexLayout_SetMeasureFunction(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_FlexLayout_AddChildWithMargin")]
- public static extern global::System.IntPtr FlexLayout_AddChildWithMargin( global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2, global::System.Runtime.InteropServices.HandleRef jarg3, Tizen.NUI.FlexLayout.ChildMeasureCallback jarg4, int jarg5);
+ public static extern global::System.IntPtr FlexLayout_AddChildWithMargin(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2, global::System.Runtime.InteropServices.HandleRef jarg3, Tizen.NUI.FlexLayout.ChildMeasureCallback jarg4, int jarg5);
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_FlexLayout_RemoveChild")]
- public static extern global::System.IntPtr FlexLayout_RemoveChild( global::System.Runtime.InteropServices.HandleRef jarg1, LayoutItem jarg2);
+ public static extern global::System.IntPtr FlexLayout_RemoveChild(global::System.Runtime.InteropServices.HandleRef jarg1, LayoutItem jarg2);
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_FlexLayout_CalculateLayout")]
- public static extern global::System.IntPtr FlexLayout_CalculateLayout( global::System.Runtime.InteropServices.HandleRef jarg1, float jarg2, float jarg3, bool jarg4);
+ public static extern global::System.IntPtr FlexLayout_CalculateLayout(global::System.Runtime.InteropServices.HandleRef jarg1, float jarg2, float jarg3, bool jarg4);
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_FlexLayout_GetWidth")]
public static extern float FlexLayout_GetWidth(global::System.Runtime.InteropServices.HandleRef jarg1);
public static extern global::System.IntPtr FlexLayout_GetNodeFrame(global::System.Runtime.InteropServices.HandleRef jarg1, int index);
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_FlexLayout_MarkDirty")]
- public static extern global::System.IntPtr FlexLayout_MarkDirty (global::System.Runtime.InteropServices.HandleRef jarg1);
+ public static extern global::System.IntPtr FlexLayout_MarkDirty(global::System.Runtime.InteropServices.HandleRef jarg1);
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_FlexLayout_SetMargin")]
- public static extern global::System.IntPtr FlexLayout_SetMargin( global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
+ public static extern global::System.IntPtr FlexLayout_SetMargin(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_FlexLayout_SetPadding")]
- public static extern global::System.IntPtr FlexLayout_SetPadding( global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
+ public static extern global::System.IntPtr FlexLayout_SetPadding(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_FlexLayout_DownCast")]
public static extern global::System.IntPtr FlexLayout_DownCast(global::System.Runtime.InteropServices.HandleRef jarg1);
ILayoutParent layoutParent = layoutItem.GetParent();
if (layoutParent != null)
{
- LayoutGroup layoutGroup = layoutParent as LayoutGroup;
- if(layoutGroup != null && !layoutGroup.LayoutRequested)
- {
+ LayoutGroup layoutGroup = layoutParent as LayoutGroup;
+ if (layoutGroup != null && !layoutGroup.LayoutRequested)
+ {
layoutGroup.RequestLayout();
- }
+ }
}
}
/// Reset to False if explicit control no longer required.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
- public bool OverrideCoreAnimation {get;set;} = false;
+ public bool OverrideCoreAnimation { get; set; } = false;
/// <summary>
/// Add transition data for a LayoutItem to the transition stack.
/// </summary>
/// <param name="transitionDataEntry">Transition data for a LayoutItem.</param>
- internal void AddTransitionDataEntry( LayoutData transitionDataEntry)
+ internal void AddTransitionDataEntry(LayoutData transitionDataEntry)
{
_layoutTransitionDataQueue.Add(transitionDataEntry);
}
/// Add LayoutItem to a removal stack for removal after transitions finish.
/// </summary>
/// <param name="itemToRemove">LayoutItem to remove.</param>
- internal void AddToRemovalStack( LayoutItem itemToRemove)
+ internal void AddToRemovalStack(LayoutItem itemToRemove)
{
if (_itemRemovalQueue == null)
{
{
if (rootNode.Layout != null)
{
- Debug.WriteLineIf( LayoutDebugController, "LayoutController Root found:" + rootNode.Name);
+ Debug.WriteLineIf(LayoutDebugController, "LayoutController Root found:" + rootNode.Name);
// rootNode has a layout, start measuring and layouting from here.
MeasureAndLayout(rootNode);
}
// Can be called from multiple starting roots but in series.
void MeasureAndLayout(View root)
{
- if (root !=null)
+ if (root != null)
{
// Get parent MeasureSpecification, this could be the Window or View with an exact size.
Container parentNode = root.GetParent();
MeasureSpecification.ModeType widthMode = MeasureSpecification.ModeType.Unspecified;
MeasureSpecification.ModeType heightMode = MeasureSpecification.ModeType.Unspecified;
- if ( root.WidthSpecification >= 0 )
+ if (root.WidthSpecification >= 0)
{
// exact size provided so match width exactly
width = new LayoutLength(root.WidthSpecification);
widthMode = MeasureSpecification.ModeType.Exactly;
}
- if (root.HeightSpecification >= 0 )
+ if (root.HeightSpecification >= 0)
{
// exact size provided so match height exactly
height = new LayoutLength(root.HeightSpecification);
}
MeasureSpecification parentWidthSpecification =
- new MeasureSpecification( width, widthMode);
+ new MeasureSpecification(width, widthMode);
MeasureSpecification parentHeightSpecification =
- new MeasureSpecification( height, heightMode);
+ new MeasureSpecification(height, heightMode);
// Start at root with it's parent's widthSpecification and heightSpecification
MeasureHierarchy(root, parentWidthSpecification, parentHeightSpecification);
// Start at root which was just measured.
- PerformLayout( root, new LayoutLength(rootPosition.X),
+ PerformLayout(root, new LayoutLength(rootPosition.X),
new LayoutLength(rootPosition.Y),
new LayoutLength(rootPosition.X) + root.Layout.MeasuredWidth.Size,
- new LayoutLength(rootPosition.Y) + root.Layout.MeasuredHeight.Size );
+ new LayoutLength(rootPosition.Y) + root.Layout.MeasuredHeight.Size);
bool readyToPlay = SetupCoreAnimation();
- if (readyToPlay && OverrideCoreAnimation==false)
+ if (readyToPlay && OverrideCoreAnimation == false)
{
PlayAnimation();
}
/// </summary>
private void PerformLayout(View root, LayoutLength left, LayoutLength top, LayoutLength right, LayoutLength bottom)
{
- if(root.Layout != null)
+ if (root.Layout != null)
{
root.Layout.Layout(left, top, right, bottom);
}
/// </summary>
private void PlayAnimation()
{
- Debug.WriteLineIf( LayoutDebugController, "LayoutController Playing, Core Duration:" + _coreAnimation.Duration);
+ Debug.WriteLineIf(LayoutDebugController, "LayoutController Playing, Core Duration:" + _coreAnimation.Duration);
_coreAnimation.Play();
}
// Check again incase the parent has already been removed.
ILayoutParent layoutParent = item.GetParent();
LayoutGroup layoutGroup = layoutParent as LayoutGroup;
- if (layoutGroup !=null)
+ if (layoutGroup != null)
{
layoutGroup.Owner?.RemoveChild(item.Owner);
}
// of the other stack. Then the main removal stack iterated when AnimationFinished
// occurs again.
}
- Debug.WriteLineIf( LayoutDebugController, "LayoutController AnimationFinished");
+ Debug.WriteLineIf(LayoutDebugController, "LayoutController AnimationFinished");
_coreAnimation?.Clear();
}
// Initialize animation for this layout run.
bool animationPending = false;
- Debug.WriteLineIf( LayoutDebugController,
+ Debug.WriteLineIf(LayoutDebugController,
"LayoutController SetupCoreAnimation for:" + _layoutTransitionDataQueue.Count);
- if (_layoutTransitionDataQueue.Count > 0 ) // Something to animate
+ if (_layoutTransitionDataQueue.Count > 0) // Something to animate
{
if (!_coreAnimation)
{
private void SetupAnimationForPosition(LayoutData layoutPositionData, TransitionComponents positionTransitionComponents)
{
// A removed item does not have a valid target position within the layout so don't try to position.
- if( layoutPositionData.ConditionForAnimation != TransitionCondition.Remove )
+ if (layoutPositionData.ConditionForAnimation != TransitionCondition.Remove)
{
_coreAnimation.AnimateTo(layoutPositionData.Item.Owner, "Position",
new Vector3(layoutPositionData.Left,
layoutPositionData.Item.Owner.Position.Z),
positionTransitionComponents.Delay,
positionTransitionComponents.Duration,
- positionTransitionComponents.AlphaFunction );
+ positionTransitionComponents.AlphaFunction);
- Debug.WriteLineIf( LayoutDebugController,
+ Debug.WriteLineIf(LayoutDebugController,
"LayoutController SetupAnimationForPosition View:" + layoutPositionData.Item.Owner.Name +
" left:" + layoutPositionData.Left +
" top:" + layoutPositionData.Top +
" delay:" + positionTransitionComponents.Delay +
- " duration:" + positionTransitionComponents.Duration );
+ " duration:" + positionTransitionComponents.Duration);
}
}
// It is due to the internals of the Text not being able to recalculate fast enough.
if (layoutPositionData.Item.Owner is TextLabel || layoutPositionData.Item.Owner is TextField)
{
- float itemWidth = layoutPositionData.Right-layoutPositionData.Left;
- float itemHeight = layoutPositionData.Bottom-layoutPositionData.Top;
+ float itemWidth = layoutPositionData.Right - layoutPositionData.Left;
+ float itemHeight = layoutPositionData.Bottom - layoutPositionData.Top;
// Set size directly.
layoutPositionData.Item.Owner.Size2D = new Size2D((int)itemWidth, (int)itemHeight);
}
else
{
_coreAnimation.AnimateTo(layoutPositionData.Item.Owner, "Size",
- new Vector3(layoutPositionData.Right-layoutPositionData.Left,
- layoutPositionData.Bottom-layoutPositionData.Top,
+ new Vector3(layoutPositionData.Right - layoutPositionData.Left,
+ layoutPositionData.Bottom - layoutPositionData.Top,
layoutPositionData.Item.Owner.Position.Z),
sizeTransitionComponents.Delay,
sizeTransitionComponents.Duration,
sizeTransitionComponents.AlphaFunction);
- Debug.WriteLineIf( LayoutDebugController,
+ Debug.WriteLineIf(LayoutDebugController,
"LayoutController SetupAnimationForSize View:" + layoutPositionData.Item.Owner.Name +
- " width:" + (layoutPositionData.Right-layoutPositionData.Left) +
- " height:" + (layoutPositionData.Bottom-layoutPositionData.Top) +
+ " width:" + (layoutPositionData.Right - layoutPositionData.Left) +
+ " height:" + (layoutPositionData.Bottom - layoutPositionData.Top) +
" delay:" + sizeTransitionComponents.Delay +
- " duration:" + sizeTransitionComponents.Duration );
+ " duration:" + sizeTransitionComponents.Duration);
}
}
- void SetupAnimationForCustomTransitions(TransitionList transitionsToAnimate, View view )
+ void SetupAnimationForCustomTransitions(TransitionList transitionsToAnimate, View view)
{
if (transitionsToAnimate?.Count > 0)
{
foreach (LayoutTransition transition in transitionsToAnimate)
{
- if ( transition.AnimatableProperty != AnimatableProperties.Position &&
- transition.AnimatableProperty != AnimatableProperties.Size )
+ if (transition.AnimatableProperty != AnimatableProperties.Position &&
+ transition.AnimatableProperty != AnimatableProperties.Size)
{
_coreAnimation.AnimateTo(view,
transition.AnimatableProperty.ToString(),
transition.TargetValue,
transition.Animator.Delay,
transition.Animator.Duration,
- transition.Animator.AlphaFunction );
+ transition.Animator.AlphaFunction);
- Debug.WriteLineIf( LayoutDebugController,
+ Debug.WriteLineIf(LayoutDebugController,
"LayoutController SetupAnimationForCustomTransitions View:" + view.Name +
" Property:" + transition.AnimatableProperty.ToString() +
" delay:" + transition.Animator.Delay +
- " duration:" + transition.Animator.Duration );
+ " duration:" + transition.Animator.Duration);
}
}
}
AnimatableProperties propertyToMatch,
ref TransitionComponents transitionComponentToUpdate)
{
- foreach( LayoutTransition transition in sourceTransitionList)
+ foreach (LayoutTransition transition in sourceTransitionList)
{
if (transition.AnimatableProperty == propertyToMatch)
{
}
}
- private TransitionComponents CreateDefaultTransitionComponent( int delay, int duration )
+ private TransitionComponents CreateDefaultTransitionComponent(int delay, int duration)
{
AlphaFunction alphaFunction = new AlphaFunction(AlphaFunction.BuiltinFunctions.Linear);
return new TransitionComponents(delay, duration, alphaFunction);
/// <summary>
/// Sets up the main animation with the animators for each item (each layoutPositionData structure)
/// </summary>
- private void AddAnimatorsToAnimation( LayoutData layoutPositionData )
+ private void AddAnimatorsToAnimation(LayoutData layoutPositionData)
{
LayoutTransition positionTransition = new LayoutTransition();
LayoutTransition sizeTransition = new LayoutTransition();
{
// Inherit parent transitions as none already set on View for the condition.
ILayoutParent layoutParent = layoutPositionData.Item.GetParent();
- if (layoutParent !=null)
+ if (layoutParent != null)
{
// Item doesn't have it's own transitions for this condition so copy parents if
// has a parent with transitions.
LayoutGroup layoutGroup = layoutParent as LayoutGroup;
TransitionList parentTransitionList;
// Note TryGetValue returns null if key not matched.
- if (layoutGroup !=null && layoutGroup.Owner.LayoutTransitions.TryGetValue(conditionForAnimators, out parentTransitionList))
+ if (layoutGroup != null && layoutGroup.Owner.LayoutTransitions.TryGetValue(conditionForAnimators, out parentTransitionList))
{
// Copy parent transitions to temporary TransitionList. List contains transitions for the current condition.
LayoutTransitionsHelper.CopyTransitions(parentTransitionList,
/// <param name="top">Top position.</param>
/// <param name="right">Right position.</param>
/// <param name="bottom">Bottom position.</param>
- public LayoutData( LayoutItem item, TransitionCondition condition, float left, float top, float right, float bottom )
+ public LayoutData(LayoutItem item, TransitionCondition condition, float left, float top, float right, float bottom)
{
Item = item;
ConditionForAnimation = condition;
Bottom = bottom;
}
- public LayoutItem Item{ get;}
+ public LayoutItem Item { get; }
- public TransitionCondition ConditionForAnimation{get;}
+ public TransitionCondition ConditionForAnimation { get; }
- public float Left{get;}
- public float Top{get;}
- public float Right{get;}
- public float Bottom{get;}
+ public float Left { get; }
+ public float Top { get; }
+ public float Right { get; }
+ public float Bottom { get; }
};
internal static LinearConstrainer DownCast(BaseHandle handle)
{
- LinearConstrainer ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as LinearConstrainer;
+ LinearConstrainer ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as LinearConstrainer;
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
* limitations under the License.
*
*/
-
+
namespace Tizen.NUI
{
internal class LowMemorySignalType : Disposable
public static Model3dView DownCast(BaseHandle handle)
{
- Model3dView ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as Model3dView;
+ Model3dView ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as Model3dView;
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
class NUIComponentCoreBackend : ICoreBackend
{
private Dictionary<Type, ComponentStateManger> _componentFactories;
- public Dictionary<Type, ComponentStateManger> ComponentFactories
+ public Dictionary<Type, ComponentStateManger> ComponentFactories
{
set
{
args[0] = Tizen.Applications.Application.Current.ApplicationInfo.ExecutablePath;
_application = ComponentApplication.NewComponentApplication(args, _stylesheet);
-
+
_application.Initialized += OnInitialized;
_application.CreateNative += OnCreateNative;
_application.Terminating += OnTerminated;
var handler = Handlers[EventType.Terminated] as Action;
handler?.Invoke();
}
-
+
}
}
/// </summary>
public void Dispose()
{
- if(_application != null)
+ if (_application != null)
{
_application.Dispose();
}
/// </summary>
public void Exit()
{
- if(_application != null)
+ if (_application != null)
{
_application.Quit();
}
{
if (_windowSize != null)
{
- _application = Application.NewApplication(args, _stylesheet, (Application.WindowMode)_windowMode, new Rectangle(_windowPosition.X, _windowPosition.Y, _windowSize.Width, _windowSize.Height));
+ _application = Application.NewApplication(args, _stylesheet, (Application.WindowMode)_windowMode, new Rectangle(_windowPosition.X, _windowPosition.Y, _windowSize.Width, _windowSize.Height));
}
else
{
- _application = Application.NewApplication(args, _stylesheet, (Application.WindowMode)_windowMode);
+ _application = Application.NewApplication(args, _stylesheet, (Application.WindowMode)_windowMode);
}
}
{
Log.Info("NUI", "NUICorebackend OnRegionChanged Called");
var handler = Handlers[EventType.RegionFormatChanged] as Action<RegionFormatChangedEventArgs>;
- handler?.Invoke( new RegionFormatChangedEventArgs((source as Application)?.GetRegion()));
+ handler?.Invoke(new RegionFormatChangedEventArgs((source as Application)?.GetRegion()));
}
/// <summary>
Log.Info("NUI", "NUICorebackend OnMemoryLow Called");
var handler = Handlers[EventType.LowMemory] as Action<LowMemoryEventArgs>;
- switch ( e.MemoryStatus )
+ switch (e.MemoryStatus)
{
case Application.MemoryStatus.Normal:
- {
- handler?.Invoke( new LowMemoryEventArgs(LowMemoryStatus.None));
- break;
- }
+ {
+ handler?.Invoke(new LowMemoryEventArgs(LowMemoryStatus.None));
+ break;
+ }
case Application.MemoryStatus.Low:
- {
- handler?.Invoke(new LowMemoryEventArgs(LowMemoryStatus.SoftWarning));
- break;
- }
+ {
+ handler?.Invoke(new LowMemoryEventArgs(LowMemoryStatus.SoftWarning));
+ break;
+ }
case Application.MemoryStatus.CriticallyLow:
- {
- handler?.Invoke(new LowMemoryEventArgs(LowMemoryStatus.HardWarning));
- break;
- }
+ {
+ handler?.Invoke(new LowMemoryEventArgs(LowMemoryStatus.HardWarning));
+ break;
+ }
}
}
{
Log.Info("NUI", "NUICorebackend OnLanguageChanged Called");
var handler = Handlers[EventType.LocaleChanged] as Action<LocaleChangedEventArgs>;
- handler?.Invoke( new LocaleChangedEventArgs((source as Application)?.GetLanguage()));
+ handler?.Invoke(new LocaleChangedEventArgs((source as Application)?.GetLanguage()));
}
/// <summary>
{
Log.Info("NUI", "NUICorebackend OnBatteryLow Called");
var handler = Handlers[EventType.LowBattery] as Action<LowBatteryEventArgs>;
- switch( e.BatteryStatus )
+ switch (e.BatteryStatus)
{
case Application.BatteryStatus.Normal:
- {
- handler?.Invoke(new LowBatteryEventArgs(LowBatteryStatus.None));
- break;
- }
+ {
+ handler?.Invoke(new LowBatteryEventArgs(LowBatteryStatus.None));
+ break;
+ }
case Application.BatteryStatus.CriticallyLow:
- {
- handler?.Invoke(new LowBatteryEventArgs(LowBatteryStatus.CriticalLow));
- break;
- }
+ {
+ handler?.Invoke(new LowBatteryEventArgs(LowBatteryStatus.CriticalLow));
+ break;
+ }
case Application.BatteryStatus.PowerOff:
- {
- handler?.Invoke(new LowBatteryEventArgs(LowBatteryStatus.PowerOff));
- break;
- }
+ {
+ handler?.Invoke(new LowBatteryEventArgs(LowBatteryStatus.PowerOff));
+ break;
+ }
}
}
{
Log.Info("NUI", "NUICorebackend OnAppControl Called");
var handler = Handlers[EventType.AppControlReceived] as Action<AppControlReceivedEventArgs>;
- SafeAppControlHandle handle = new SafeAppControlHandle(e.VoidP,false);
- handler?.Invoke( new AppControlReceivedEventArgs(new ReceivedAppControl(handle)) );
+ SafeAppControlHandle handle = new SafeAppControlHandle(e.VoidP, false);
+ handler?.Invoke(new AppControlReceivedEventArgs(new ReceivedAppControl(handle)));
}
/// <summary>
{
if (_application != null)
{
- _application.AddWidgetInfo( widgetInfo );
+ _application.AddWidgetInfo(widgetInfo);
}
}
switch (e.MemoryStatus)
{
case Application.MemoryStatus.Normal:
- {
- handler?.Invoke(new LowMemoryEventArgs(LowMemoryStatus.None));
- break;
- }
+ {
+ handler?.Invoke(new LowMemoryEventArgs(LowMemoryStatus.None));
+ break;
+ }
case Application.MemoryStatus.Low:
- {
- handler?.Invoke(new LowMemoryEventArgs(LowMemoryStatus.SoftWarning));
- break;
- }
+ {
+ handler?.Invoke(new LowMemoryEventArgs(LowMemoryStatus.SoftWarning));
+ break;
+ }
case Application.MemoryStatus.CriticallyLow:
- {
- handler?.Invoke(new LowMemoryEventArgs(LowMemoryStatus.HardWarning));
- break;
- }
+ {
+ handler?.Invoke(new LowMemoryEventArgs(LowMemoryStatus.HardWarning));
+ break;
+ }
}
}
switch (e.BatteryStatus)
{
case Application.BatteryStatus.Normal:
- {
- handler?.Invoke(new LowBatteryEventArgs(LowBatteryStatus.None));
- break;
- }
+ {
+ handler?.Invoke(new LowBatteryEventArgs(LowBatteryStatus.None));
+ break;
+ }
case Application.BatteryStatus.CriticallyLow:
- {
- handler?.Invoke(new LowBatteryEventArgs(LowBatteryStatus.CriticalLow));
- break;
- }
+ {
+ handler?.Invoke(new LowBatteryEventArgs(LowBatteryStatus.CriticalLow));
+ break;
+ }
case Application.BatteryStatus.PowerOff:
- {
- handler?.Invoke(new LowBatteryEventArgs(LowBatteryStatus.PowerOff));
- break;
- }
+ {
+ handler?.Invoke(new LowBatteryEventArgs(LowBatteryStatus.PowerOff));
+ break;
+ }
}
}
{
public static PropertyValue GetProperty(global::System.Runtime.InteropServices.HandleRef handle, int index)
{
- if(handle.Handle == System.IntPtr.Zero)
+ if (handle.Handle == System.IntPtr.Zero)
{
throw new System.InvalidOperationException("Error! NUI's native dali object is already disposed. OR the native dali object handle of NUI becomes null!");
}
public new static PageTurnLandscapeView DownCast(BaseHandle handle)
{
- PageTurnLandscapeView ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as PageTurnLandscapeView;
+ PageTurnLandscapeView ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as PageTurnLandscapeView;
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
public new static PageTurnPortraitView DownCast(BaseHandle handle)
{
- PageTurnPortraitView ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as PageTurnPortraitView;
+ PageTurnPortraitView ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as PageTurnPortraitView;
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
public static PageTurnView DownCast(BaseHandle handle)
{
- PageTurnView ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as PageTurnView;
+ PageTurnView ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as PageTurnView;
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
}
public static PathConstrainer DownCast(BaseHandle handle)
{
- PathConstrainer ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as PathConstrainer;
+ PathConstrainer ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as PathConstrainer;
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
private static void RegistryCurrentThreadCheck()
{
-
+
if (savedApplicationThread == null)
{
Tizen.Log.Fatal("NUI", $"Error! maybe main thread is created by other process\n");
[EditorBrowsable(EditorBrowsableState.Never)]
public static RenderTask DownCast(BaseHandle handle)
{
- RenderTask ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as RenderTask;
+ RenderTask ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as RenderTask;
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
public static RenderTaskList DownCast(BaseHandle handle)
{
- RenderTaskList ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as RenderTaskList;
+ RenderTaskList ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as RenderTaskList;
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
[EditorBrowsable(EditorBrowsableState.Never)]
protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
{
- throw new global::System.MethodAccessException("C++ destructor does not have public access");
+ throw new global::System.MethodAccessException("C++ destructor does not have public access");
}
/// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
/// This should be internal, please do not use.
/// </summary>
/// <since_tizen> 4 </since_tizen>
- [Obsolete("Deprecated in API6, Will be removed in API9, " +
+ [Obsolete("Deprecated in API6, Will be removed in API9, " +
"Please do not use!" +
"IntPtr(native integer pointer) is supposed to be not used in Application!")]
[EditorBrowsable(EditorBrowsableState.Never)]
* limitations under the License.
*
*/
-
+
namespace Tizen.NUI
{
internal class SWIGTYPE_p_tm
public const int nuiAPIVer = 505;
public const int reservedVer1 = 0;
public const int reservedVer2 = 0;
-
+
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_NativeVersionCheck")]
public static extern bool NativeVersionCheck(ref int ver1, ref int ver2, ref int ver3);
-
+
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_NUI_InternalAPIVersionCheck")]
public static extern bool InternalAPIVersionCheck(ref int ver1, ref int ver2, ref int ver3);
using Tizen.NUI.BaseComponents;
-namespace Tizen.NUI {
+namespace Tizen.NUI
+{
internal class VideoViewSignal : Disposable
{
* limitations under the License.
*
*/
-
+
using System;
using System.Runtime.InteropServices;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
private delegate void TimeTickCallbackType(IntPtr application, IntPtr watchTime);
private TimeTickCallbackType _timeTickCallback;
- private DaliEventHandler<object,TimeTickEventArgs> _timeTickEventHandler;
+ private DaliEventHandler<object, TimeTickEventArgs> _timeTickEventHandler;
/// <summary>
/// TimeTick event.
{
if (_timeTickEventHandler == null)
{
- _timeTickCallback = new TimeTickCallbackType( OnTimeTick);
+ _timeTickCallback = new TimeTickCallbackType(OnTimeTick);
TimeTickSignal().Connect(_timeTickCallback);
}
if (_timeTickEventHandler == null && TimeTickSignal().Empty() == false)
{
- TimeTickSignal().Disconnect(_timeTickCallback);
+ TimeTickSignal().Disconnect(_timeTickCallback);
}
}
}
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
private delegate void AmbientTickCallbackType(IntPtr application, IntPtr watchTime);
private AmbientTickCallbackType _ambientTickCallback;
- private DaliEventHandler<object,AmbientTickEventArgs> _ambientTickEventHandler;
+ private DaliEventHandler<object, AmbientTickEventArgs> _ambientTickEventHandler;
/// <summary>
/// AmbientTick event.
{
if (_ambientTickEventHandler == null)
{
- _ambientTickCallback = new AmbientTickCallbackType( OnAmbientTick);
+ _ambientTickCallback = new AmbientTickCallbackType(OnAmbientTick);
AmbientTickSignal().Connect(_ambientTickCallback);
}
if (_ambientTickEventHandler == null && AmbientTickSignal().Empty() == false)
{
- AmbientTickSignal().Disconnect(_ambientTickCallback);
+ AmbientTickSignal().Disconnect(_ambientTickCallback);
}
}
}
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
private delegate void AmbientChangedCallbackType(IntPtr application, bool changed);
private AmbientChangedCallbackType _ambientChangedCallback;
- private DaliEventHandler<object,AmbientChangedEventArgs> _ambientChangedEventHandler;
+ private DaliEventHandler<object, AmbientChangedEventArgs> _ambientChangedEventHandler;
/// <summary>
/// AmbientChanged event.
{
if (_ambientChangedEventHandler == null)
{
- _ambientChangedCallback = new AmbientChangedCallbackType( OnAmbientChanged);
+ _ambientChangedCallback = new AmbientChangedCallbackType(OnAmbientChanged);
AmbientChangedSignal().Connect(_ambientChangedCallback);
}
if (_ambientChangedEventHandler == null && AmbientChangedSignal().Empty() == false)
{
- AmbientChangedSignal().Disconnect(_ambientChangedCallback);
+ AmbientChangedSignal().Disconnect(_ambientChangedCallback);
}
}
}
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
- public void AddWidgetInstance( Widget widget )
+ public void AddWidgetInstance(Widget widget)
{
_widgetList.Add(widget);
}
public void AddWidgetInfo(Dictionary<Type, string> newWidgetInfo)
{
- foreach (KeyValuePair<Type, string> widgetInfo in newWidgetInfo )
+ foreach (KeyValuePair<Type, string> widgetInfo in newWidgetInfo)
{
- if ( _widgetInfo.ContainsKey(widgetInfo.Key) == false )
+ if (_widgetInfo.ContainsKey(widgetInfo.Key) == false)
{
- _widgetInfo.Add(widgetInfo.Key, widgetInfo.Value );
+ _widgetInfo.Add(widgetInfo.Key, widgetInfo.Value);
string widgetName = widgetInfo.Value;
RegisterWidgetCreatingFunction(ref widgetName);
}
internal class WidgetImpl : BaseObject
{
- internal WidgetImpl() : this( Interop.WidgetImpl.WidgetImpl_New(), true )
+ internal WidgetImpl() : this(Interop.WidgetImpl.WidgetImpl_New(), true)
{
SwigDirectorConnect();
}
WIdgetInstanceOnDestroyArgs args = new WIdgetInstanceOnDestroyArgs();
args.ContentInfo = contentInfo;
args.TerminateType = type;
- _widgetInstanceOnDestroyEventHandler?.Invoke(this,args);
+ _widgetInstanceOnDestroyEventHandler?.Invoke(this, args);
}
public virtual void OnPause()
/// WidgetViewSignal
/// </summary>
/// <since_tizen> 3 </since_tizen>
- [Obsolete("Deprecated in API6, Will be removed in API9, " +
+ [Obsolete("Deprecated in API6, Will be removed in API9, " +
"Please use WidgetView.WidgetAdded, WidgetDeleted events instead!")]
[EditorBrowsable(EditorBrowsableState.Never)]
public class WidgetViewSignal : Disposable
/// </summary>
/// <returns>True if there are any slots connected to the signal</returns>
/// <since_tizen> 3 </since_tizen>
- [Obsolete("Deprecated in API6, Will be removed in API9, " +
+ [Obsolete("Deprecated in API6, Will be removed in API9, " +
"Please use WidgetView.WidgetAdded, WidgetDeleted events instead!")]
[EditorBrowsable(EditorBrowsableState.Never)]
public bool Empty()
/// </summary>
/// <returns>The number of slots connected to this signal</returns>
/// <since_tizen> 3 </since_tizen>
- [Obsolete("Deprecated in API6, Will be removed in API9, " +
+ [Obsolete("Deprecated in API6, Will be removed in API9, " +
"Please use WidgetView.WidgetAdded, WidgetDeleted events instead!")]
[EditorBrowsable(EditorBrowsableState.Never)]
public uint GetConnectionCount()
/// </summary>
/// <param name="func">The function to connect</param>
/// <since_tizen> 3 </since_tizen>
- [Obsolete("Deprecated in API6, Will be removed in API9, " +
+ [Obsolete("Deprecated in API6, Will be removed in API9, " +
"Please use WidgetView.WidgetAdded, WidgetDeleted events instead!")]
[EditorBrowsable(EditorBrowsableState.Never)]
public void Connect(System.Delegate func)
/// </summary>
/// <param name="func">The function to disconnect</param>
/// <since_tizen> 3 </since_tizen>
- [Obsolete("Deprecated in API6, Will be removed in API9, " +
+ [Obsolete("Deprecated in API6, Will be removed in API9, " +
"Please use WidgetView.WidgetAdded, WidgetDeleted events instead!")]
[EditorBrowsable(EditorBrowsableState.Never)]
public void Disconnect(System.Delegate func)
/// </summary>
/// <param name="arg">The member function to connect</param>
/// <since_tizen> 3 </since_tizen>
- [Obsolete("Deprecated in API6, Will be removed in API9, " +
+ [Obsolete("Deprecated in API6, Will be removed in API9, " +
"Please use WidgetView.WidgetAdded, WidgetDeleted events instead!")]
[EditorBrowsable(EditorBrowsableState.Never)]
public void Emit(WidgetView arg)
/// The contructor.
/// </summary>
/// <since_tizen> 3 </since_tizen>
- [Obsolete("Deprecated in API6, Will be removed in API9, " +
+ [Obsolete("Deprecated in API6, Will be removed in API9, " +
"Please use WidgetView.WidgetAdded, WidgetDeleted events instead!")]
[EditorBrowsable(EditorBrowsableState.Never)]
public WidgetViewSignal() : this(Interop.WidgetView.new_WidgetViewSignal(), true)
public void Visit(ValueNode node, INode parentNode)
{
var parentElement = parentNode as IElementNode;
- var value = Values [node];
- var source = Values [parentNode];
+ var value = Values[node];
+ var source = Values[parentNode];
XmlName propertyName;
- if (TryGetPropertyName(node, parentNode, out propertyName)) {
+ if (TryGetPropertyName(node, parentNode, out propertyName))
+ {
if (TrySetRuntimeName(propertyName, source, value, node))
return;
if (Skips.Contains(propertyName))
if (propertyName.Equals(XamlParser.McUri, "Ignorable"))
return;
SetPropertyValue(source, propertyName, value, Context.RootElement, node, Context, node);
- } else if (IsCollectionItem(node, parentNode) && parentNode is IElementNode) {
+ }
+ else if (IsCollectionItem(node, parentNode) && parentNode is IElementNode)
+ {
// Collection element, implicit content, or implicit collection element.
var contentProperty = GetContentPropertyName(Context.Types[parentElement].GetTypeInfo());
- if (contentProperty != null) {
+ if (contentProperty != null)
+ {
var name = new XmlName(((ElementNode)parentNode).NamespaceURI, contentProperty);
if (Skips.Contains(name))
return;
public void Visit(ElementNode node, INode parentNode)
{
XmlName propertyName;
- if (TryGetPropertyName(node, parentNode, out propertyName) && propertyName == XmlName._CreateContent) {
+ if (TryGetPropertyName(node, parentNode, out propertyName) && propertyName == XmlName._CreateContent)
+ {
var s0 = Values[parentNode];
- if (s0 is ElementTemplate) {
+ if (s0 is ElementTemplate)
+ {
SetTemplate(s0 as ElementTemplate, node);
return;
}
//Simplify ListNodes with single elements
var pList = parentNode as ListNode;
- if (pList != null && pList.CollectionItems.Count == 1) {
+ if (pList != null && pList.CollectionItems.Count == 1)
+ {
propertyName = pList.XmlName;
parentNode = parentNode.Parent;
parentElement = parentNode as IElementNode;
var value = Values[node];
- if (propertyName != XmlName.Empty || TryGetPropertyName(node, parentNode, out propertyName)) {
+ if (propertyName != XmlName.Empty || TryGetPropertyName(node, parentNode, out propertyName))
+ {
if (Skips.Contains(propertyName))
return;
if (parentElement == null)
ProvideValue(ref value, node, source, propertyName);
SetPropertyValue(source, propertyName, value, Context.RootElement, node, Context, node);
}
- else if (IsCollectionItem(node, parentNode) && parentNode is IElementNode) {
+ else if (IsCollectionItem(node, parentNode) && parentNode is IElementNode)
+ {
var source = Values[parentNode];
ProvideValue(ref value, node, source, XmlName.Empty);
string contentProperty;
//ResourceDictionary
if (xpe == null && TryAddToResourceDictionary(source as ResourceDictionary, value, xKey, node, out xpe))
return;
-
+
// Dictionary with string key
if (xpe == null && xKey != null)
{
}
// Collection element, implicit content, or implicit collection element.
- if (xpe == null && typeof(IEnumerable).IsAssignableFrom(Context.Types[parentElement]) && Context.Types[parentElement].GetRuntimeMethods().Any(mi => mi.Name == "Add" && mi.GetParameters().Length == 1)) {
+ if (xpe == null && typeof(IEnumerable).IsAssignableFrom(Context.Types[parentElement]) && Context.Types[parentElement].GetRuntimeMethods().Any(mi => mi.Name == "Add" && mi.GetParameters().Length == 1))
+ {
var addMethod =
Context.Types[parentElement].GetRuntimeMethods().First(mi => mi.Name == "Add" && mi.GetParameters().Length == 1);
if (addMethod != null) addMethod.Invoke(source, new[] { value });
return;
}
- if (xpe == null && (contentProperty = GetContentPropertyName(Context.Types[parentElement].GetTypeInfo())) != null) {
+ if (xpe == null && (contentProperty = GetContentPropertyName(Context.Types[parentElement].GetTypeInfo())) != null)
+ {
var name = new XmlName(node.NamespaceURI, contentProperty);
if (Skips.Contains(name))
return;
SetPropertyValue(source, name, value, Context.RootElement, node, Context, node);
return;
- }
-
+ }
+
xpe = xpe ?? new XamlParseException($"Can not set the content of {((IElementNode)parentNode).XmlType.Name} as it doesn't have a ContentPropertyAttribute", node);
if (Context.ExceptionHandler != null)
Context.ExceptionHandler(xpe);
throw xpe;
}
- else if (IsCollectionItem(node, parentNode) && parentNode is ListNode) {
+ else if (IsCollectionItem(node, parentNode) && parentNode is ListNode)
+ {
var source = Values[parentNode.Parent];
ProvideValue(ref value, node, source, XmlName.Empty);
var parentList = (ListNode)parentNode;
return;
MethodInfo addMethod;
- if (xpe == null && (addMethod = collection.GetType().GetRuntimeMethods().First(mi => mi.Name == "Add" && mi.GetParameters().Length == 1)) != null) {
+ if (xpe == null && (addMethod = collection.GetType().GetRuntimeMethods().First(mi => mi.Name == "Add" && mi.GetParameters().Length == 1)) != null)
+ {
addMethod.Invoke(collection, new[] { Values[node] });
return;
}
}
}
-
+
public void Visit(RootNode node, INode parentNode)
{
var parentElement = parentNode as IElementNode;
if (parentElement == null)
return false;
- foreach (var kvp in parentElement.Properties) {
+ foreach (var kvp in parentElement.Properties)
+ {
if (kvp.Value != node)
continue;
name = kvp.Key;
internal static string GetContentPropertyName(System.Reflection.TypeInfo typeInfo)
{
- while (typeInfo != null) {
+ while (typeInfo != null)
+ {
var propName = GetContentPropertyName(typeInfo.CustomAttributes);
if (propName != null)
return propName;
if (value.GetType().GetTypeInfo().GetCustomAttribute<AcceptEmptyServiceProviderAttribute>() == null)
serviceProvider = new XamlServiceProvider(node, Context);
- if (serviceProvider != null && serviceProvider.IProvideValueTarget is XamlValueTargetProvider && propertyName != XmlName.Empty) {
+ if (serviceProvider != null && serviceProvider.IProvideValueTarget is XamlValueTargetProvider && propertyName != XmlName.Empty)
+ {
(serviceProvider.IProvideValueTarget as XamlValueTargetProvider).TargetProperty = GetTargetProperty(source, propertyName, Context, node);
}
attributes.FirstOrDefault(cad => ContentPropertyAttribute.ContentPropertyTypes.Contains(cad.AttributeType.FullName));
if (contentAttribute == null || contentAttribute.ConstructorArguments.Count != 1)
return null;
- if (contentAttribute.ConstructorArguments [0].ArgumentType == typeof(string))
- return (string)contentAttribute.ConstructorArguments [0].Value;
+ if (contentAttribute.ConstructorArguments[0].ArgumentType == typeof(string))
+ return (string)contentAttribute.ConstructorArguments[0].Value;
return null;
}
HydrationContext context, IXmlLineInfo lineInfo)
{
var dotIdx = localname.IndexOf('.');
- if (dotIdx > 0) {
+ if (dotIdx > 0)
+ {
var typename = localname.Substring(0, dotIdx);
localname = localname.Substring(dotIdx + 1);
XamlParseException xpe;
#if NETSTANDARD1_0
var bindableFieldInfo = elementType.GetFields().FirstOrDefault(fi => fi.Name == localName + "Property");
#else
- var bindableFieldInfo = elementType.GetFields(BindingFlags.Static | BindingFlags.NonPublic|BindingFlags.FlattenHierarchy).FirstOrDefault(fi => fi.Name == localName + "Property");
+ var bindableFieldInfo = elementType.GetFields(BindingFlags.Static | BindingFlags.NonPublic | BindingFlags.FlattenHierarchy).FirstOrDefault(fi => fi.Name == localName + "Property");
if (null == bindableFieldInfo)
{
}
#endif
Exception exception = null;
- if (exception == null && bindableFieldInfo == null) {
+ if (exception == null && bindableFieldInfo == null)
+ {
exception =
new XamlParseException(
Format("BindableProperty {0} not found on {1}", localName + "Property", elementType.Name), lineInfo);
if (property != null)
return property;
-
+
var elementType = xamlelement.GetType();
var propertyInfo = elementType.GetRuntimeProperties().FirstOrDefault(p => p.Name == localName);
return propertyInfo;
return false;
var methodInfo = rootElement.GetType().GetRuntimeMethods().FirstOrDefault(mi => mi.Name == (string)value);
- if (methodInfo == null) {
+ if (methodInfo == null)
+ {
exception = new XamlParseException($"No method {value} found on type {rootElement.GetType()}", lineInfo);
return false;
}
- try {
+ try
+ {
eventInfo.AddEventHandler(element, methodInfo.CreateDelegate(eventInfo.EventHandlerType, rootElement));
return true;
- } catch (ArgumentException ae) {
+ }
+ catch (ArgumentException ae)
+ {
exception = new XamlParseException($"Method {stringValue} does not have the correct signature", lineInfo, ae);
}
return false;
if (dynamicResource == null || property == null)
return false;
- if (bindable == null) {
+ if (bindable == null)
+ {
exception = new XamlParseException($"{elementType.Name} is not a BindableObject", lineInfo);
return false;
}
exception = null;
var elementType = element.GetType();
- var binding = value.ConvertTo(typeof(BindingBase),pinfoRetriever:null,serviceProvider:null) as BindingBase;
+ var binding = value.ConvertTo(typeof(BindingBase), pinfoRetriever: null, serviceProvider: null) as BindingBase;
var bindable = element as BindableObject;
if (binding == null)
return false;
- if (bindable != null && property != null) {
+ if (bindable != null && property != null)
+ {
bindable.SetBinding(property, binding);
return true;
}
Func<MemberInfo> minforetriever;
if (attached)
- minforetriever = () => property.DeclaringType.GetRuntimeMethod("Get" + property.PropertyName, new [] { typeof(BindableObject) });
+ minforetriever = () => property.DeclaringType.GetRuntimeMethod("Get" + property.PropertyName, new[] { typeof(BindableObject) });
else
{
minforetriever = () => property.DeclaringType.GetRuntimeProperties().LastOrDefault(p => p.Name == property.PropertyName);
//minforetriever = () => property.DeclaringType.GetRuntimeProperty(property.PropertyName);
var convertedValue = value.ConvertTo(property.ReturnType, minforetriever, serviceProvider);
- if (bindable != null) {
+ if (bindable != null)
+ {
//SetValue doesn't throw on mismatching type, so check before to get a chance to try the property setting or the collection adding
var nullable = property.ReturnTypeInfo.IsGenericType &&
property.ReturnTypeInfo.GetGenericTypeDefinition() == typeof(Nullable<>);
if ((convertedValue == null && (!property.ReturnTypeInfo.IsValueType || nullable)) ||
- (property.ReturnType.IsInstanceOfType(convertedValue))) {
+ (property.ReturnType.IsInstanceOfType(convertedValue)))
+ {
bindable.SetValue(property, convertedValue);
return true;
}
value = null;
var elementType = element.GetType();
PropertyInfo propertyInfo = null;
- try {
+ try
+ {
propertyInfo = elementType.GetRuntimeProperty(localName);
- } catch (AmbiguousMatchException) {
+ }
+ catch (AmbiguousMatchException)
+ {
// Get most derived instance of property
- foreach (var property in elementType.GetRuntimeProperties().Where(prop => prop.Name == localName)) {
+ foreach (var property in elementType.GetRuntimeProperties().Where(prop => prop.Name == localName))
+ {
if (propertyInfo == null || propertyInfo.DeclaringType.IsAssignableFrom(property.DeclaringType))
propertyInfo = property;
}
if (serviceProvider != null && serviceProvider.IProvideValueTarget != null)
((XamlValueTargetProvider)serviceProvider.IProvideValueTarget).TargetProperty = targetProperty;
- addMethod.Invoke(collection, new [] { value.ConvertTo(addMethod.GetParameters() [0].ParameterType, (Func<TypeConverter>)null, serviceProvider) });
+ addMethod.Invoke(collection, new[] { value.ConvertTo(addMethod.GetParameters()[0].ParameterType, (Func<TypeConverter>)null, serviceProvider) });
return true;
}
resourceDictionary.Add((ResourceDictionary)value);
else if (value is StyleSheets.StyleSheet)
resourceDictionary.Add((StyleSheets.StyleSheet)value);
- else {
+ else
+ {
exception = new XamlParseException("resources in ResourceDictionary require a x:Key attribute", lineInfo);
return false;
}
void SetTemplate(ElementTemplate dt, INode node)
{
#pragma warning disable 0612
- ((IDataTemplate)dt).LoadTemplate = () => {
+ ((IDataTemplate)dt).LoadTemplate = () =>
+ {
#pragma warning restore 0612
var cnode = node.Clone();
var context = new HydrationContext { ParentContext = Context, RootElement = Context.RootElement };
cnode.Accept(new RegisterXNamesVisitor(context), null);
cnode.Accept(new FillResourceDictionariesVisitor(context), null);
cnode.Accept(new ApplyPropertiesVisitor(context, true), null);
- return context.Values [cnode];
+ return context.Values[cnode];
};
}
static bool TryAddValue(BindableObject bindable, BindableProperty property, object value, XamlServiceProvider serviceProvider)
{
- if(property?.ReturnTypeInfo?.GenericTypeArguments == null){
+ if (property?.ReturnTypeInfo?.GenericTypeArguments == null)
+ {
return false;
}
- if(property.ReturnType == null){
+ if (property.ReturnType == null)
+ {
return false;
}
// If there's an add method, get the collection
var collection = bindable.GetValue(property);
-
+
// And add the new value to it
addMethod.Invoke(collection, new[] { value.ConvertTo(addMethod.GetParameters()[0].ParameterType, (Func<TypeConverter>)null, serviceProvider) });
return true;
return true;
}
- private PropertyInfo GetIndexer(object source, Type keyType, Type valueType) => source.GetType().GetProperties(BindingFlags.Instance|BindingFlags.Public|BindingFlags.NonPublic).FirstOrDefault(p => p.Name == "Item" && p.PropertyType.IsAssignableFrom(valueType) && p.GetIndexParameters().Length != 0 && p.GetIndexParameters()[0].ParameterType == keyType);
+ private PropertyInfo GetIndexer(object source, Type keyType, Type valueType) => source.GetType().GetProperties(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic).FirstOrDefault(p => p.Name == "Item" && p.PropertyType.IsAssignableFrom(valueType) && p.GetIndexParameters().Length != 0 && p.GetIndexParameters()[0].ParameterType == keyType);
}
}
.DeclaredConstructors.Any(
ci =>
ci.IsPublic && ci.GetParameters().Length != 0 &&
- ci.GetParameters().All(pi => pi.CustomAttributes.Any(attr => attr.AttributeType == typeof (ParameterAttribute)))) &&
+ ci.GetParameters().All(pi => pi.CustomAttributes.Any(attr => attr.AttributeType == typeof(ParameterAttribute)))) &&
ValidateCtorArguments(type, node, out ctorargname))
value = CreateFromParameterizedConstructor(type, node);
else if (!type.GetTypeInfo().DeclaredConstructors.Any(ci => ci.IsPublic && ci.GetParameters().Length == 0) &&
//this is a trick as the DataTemplate parameterless ctor is internal, and we can't CreateInstance(..., false) on WP7
try
{
- if (type == typeof (DataTemplate))
+ if (type == typeof(DataTemplate))
value = new DataTemplate();
- if (type == typeof (ControlTemplate))
+ if (type == typeof(ControlTemplate))
value = new ControlTemplate();
if (value == null && node.CollectionItems.Any() && node.CollectionItems.First() is ValueNode)
{
.DeclaredConstructors.FirstOrDefault(
ci =>
ci.GetParameters().Length != 0 && ci.IsPublic &&
- ci.GetParameters().All(pi => pi.CustomAttributes.Any(attr => attr.AttributeType == typeof (ParameterAttribute))));
+ ci.GetParameters().All(pi => pi.CustomAttributes.Any(attr => attr.AttributeType == typeof(ParameterAttribute))));
if (ctorInfo == null)
return true;
foreach (var parameter in ctorInfo.GetParameters())
.DeclaredConstructors.FirstOrDefault(
ci =>
ci.GetParameters().Length != 0 && ci.IsPublic &&
- ci.GetParameters().All(pi => pi.CustomAttributes.Any(attr => attr.AttributeType == typeof (ParameterAttribute))));
+ ci.GetParameters().All(pi => pi.CustomAttributes.Any(attr => attr.AttributeType == typeof(ParameterAttribute))));
object[] arguments = CreateArgumentsArray(node, ctorInfo);
if (arguments != null)
var factoryMethod = ((string)((ValueNode)node.Properties[XmlName.xFactoryMethod]).Value);
Type[] types = arguments == null ? new Type[0] : arguments.Select(a => a.GetType()).ToArray();
- Func<MethodInfo, bool> isMatch = m => {
+ Func<MethodInfo, bool> isMatch = m =>
+ {
if (m.Name != factoryMethod)
return false;
var p = m.GetParameters();
return false;
if (!m.IsStatic)
return false;
- for (var i = 0; i < p.Length; i++) {
- if ((p [i].ParameterType.IsAssignableFrom(types [i])))
+ for (var i = 0; i < p.Length; i++)
+ {
+ if ((p[i].ParameterType.IsAssignableFrom(types[i])))
continue;
- var op_impl = p[i].ParameterType.GetImplicitConversionOperator(fromType: types[i], toType: p[i].ParameterType)
+ var op_impl = p[i].ParameterType.GetImplicitConversionOperator(fromType: types[i], toType: p[i].ParameterType)
?? types[i].GetImplicitConversionOperator(fromType: types[i], toType: p[i].ParameterType);
if (op_impl == null)
return false;
- arguments [i] = op_impl.Invoke(null, new [] { arguments [i]});
+ arguments[i] = op_impl.Invoke(null, new[] { arguments[i] });
}
return true;
};
public object[] CreateArgumentsArray(IElementNode enode, ConstructorInfo ctorInfo)
{
- if( ctorInfo != null )
+ if (ctorInfo != null)
{
var n = ctorInfo.GetParameters().Length;
var array = new object[n];
{
var parameter = ctorInfo.GetParameters()[i];
var propname =
- parameter?.CustomAttributes?.First(attr => attr.AttributeType == typeof (ParameterAttribute))?
+ parameter?.CustomAttributes?.First(attr => attr.AttributeType == typeof(ParameterAttribute))?
.ConstructorArguments.First()
.Value as string;
var name = new XmlName("", propname);
{
var valuestring = ((ValueNode)node.CollectionItems[0]).Value as string;
- if (nodeType == typeof(SByte)) {
+ if (nodeType == typeof(SByte))
+ {
sbyte retval;
if (sbyte.TryParse(valuestring, NumberStyles.Number, CultureInfo.InvariantCulture, out retval))
return retval;
}
- if (nodeType == typeof(Int16)) {
+ if (nodeType == typeof(Int16))
+ {
short retval;
if (short.TryParse(valuestring, NumberStyles.Number, CultureInfo.InvariantCulture, out retval))
return retval;
}
- if (nodeType == typeof(Int32)) {
+ if (nodeType == typeof(Int32))
+ {
int retval;
if (int.TryParse(valuestring, NumberStyles.Number, CultureInfo.InvariantCulture, out retval))
return retval;
}
- if (nodeType == typeof(Int64)) {
+ if (nodeType == typeof(Int64))
+ {
long retval;
if (long.TryParse(valuestring, NumberStyles.Number, CultureInfo.InvariantCulture, out retval))
return retval;
}
- if (nodeType == typeof(Byte)) {
+ if (nodeType == typeof(Byte))
+ {
byte retval;
if (byte.TryParse(valuestring, NumberStyles.Number, CultureInfo.InvariantCulture, out retval))
return retval;
}
- if (nodeType == typeof(UInt16)) {
+ if (nodeType == typeof(UInt16))
+ {
ushort retval;
if (ushort.TryParse(valuestring, NumberStyles.Number, CultureInfo.InvariantCulture, out retval))
return retval;
}
- if (nodeType == typeof(UInt32)) {
+ if (nodeType == typeof(UInt32))
+ {
uint retval;
if (uint.TryParse(valuestring, NumberStyles.Number, CultureInfo.InvariantCulture, out retval))
return retval;
}
- if (nodeType == typeof(UInt64)) {
+ if (nodeType == typeof(UInt64))
+ {
ulong retval;
if (ulong.TryParse(valuestring, NumberStyles.Number, CultureInfo.InvariantCulture, out retval))
return retval;
}
- if (nodeType == typeof(Single)) {
+ if (nodeType == typeof(Single))
+ {
float retval;
if (float.TryParse(valuestring, NumberStyles.Number, CultureInfo.InvariantCulture, out retval))
return retval;
}
- if (nodeType == typeof(Double)) {
+ if (nodeType == typeof(Double))
+ {
double retval;
if (double.TryParse(valuestring, NumberStyles.Number, CultureInfo.InvariantCulture, out retval))
return retval;
}
- if (nodeType == typeof (Boolean))
+ if (nodeType == typeof(Boolean))
{
bool outbool;
if (bool.TryParse(valuestring, out outbool))
return outbool;
}
- if (nodeType == typeof(TimeSpan)) {
+ if (nodeType == typeof(TimeSpan))
+ {
TimeSpan retval;
if (TimeSpan.TryParse(valuestring, CultureInfo.InvariantCulture, out retval))
return retval;
}
- if (nodeType == typeof (char))
+ if (nodeType == typeof(char))
{
char retval;
if (char.TryParse(valuestring, out retval))
return retval;
}
- if (nodeType == typeof (string))
+ if (nodeType == typeof(string))
return valuestring;
- if (nodeType == typeof (decimal))
+ if (nodeType == typeof(decimal))
{
decimal retval;
if (decimal.TryParse(valuestring, NumberStyles.Number, CultureInfo.InvariantCulture, out retval))
return retval;
}
- else if (nodeType == typeof (Uri))
+ else if (nodeType == typeof(Uri))
{
Uri retval;
if (Uri.TryCreate(valuestring, UriKind.RelativeOrAbsolute, out retval))
throw new Exception("Expression did not end in '}'");
var serviceProvider = new XamlServiceProvider(node, Context);
- serviceProvider.Add(typeof (IXmlNamespaceResolver), nsResolver);
+ serviceProvider.Add(typeof(IXmlNamespaceResolver), nsResolver);
return new MarkupExpansionParser().Parse(match, ref expression, serviceProvider);
}
public INode Parse(string match, ref string remaining, IServiceProvider serviceProvider)
{
- var nsResolver = serviceProvider.GetService(typeof (IXmlNamespaceResolver)) as IXmlNamespaceResolver;
+ var nsResolver = serviceProvider.GetService(typeof(IXmlNamespaceResolver)) as IXmlNamespaceResolver;
if (nsResolver == null)
throw new ArgumentException(nameof(nsResolver));
IXmlLineInfo xmlLineInfo = null;
- var xmlLineInfoProvider = serviceProvider.GetService(typeof (IXmlLineInfoProvider)) as IXmlLineInfoProvider;
+ var xmlLineInfoProvider = serviceProvider.GetService(typeof(IXmlLineInfoProvider)) as IXmlLineInfoProvider;
if (xmlLineInfoProvider != null)
xmlLineInfo = xmlLineInfoProvider.XmlLineInfo;
}
Type type;
- var typeResolver = serviceProvider.GetService(typeof (IXamlTypeResolver)) as IXamlTypeResolver;
+ var typeResolver = serviceProvider.GetService(typeof(IXamlTypeResolver)) as IXamlTypeResolver;
if (typeResolver == null)
type = null;
// Add Binding and StaticResource support, The ordinal code can't find BindingExtension for Binding
//The order of lookup is to look for the Extension-suffixed class name first and then look for the class name without the Extension suffix.
if (!typeResolver.TryResolve(match + "Extension", out type) && !typeResolver.TryResolve(match, out type))
{
- var lineInfoProvider = serviceProvider.GetService(typeof (IXmlLineInfoProvider)) as IXmlLineInfoProvider;
+ var lineInfoProvider = serviceProvider.GetService(typeof(IXmlLineInfoProvider)) as IXmlLineInfoProvider;
var lineInfo = (lineInfoProvider != null) ? lineInfoProvider.XmlLineInfo : new XmlLineInfo();
throw new XamlParseException(String.Format("MarkupExtension not found for {0}", match), lineInfo);
}
protected override void SetPropertyValue(string prop, string strValue, object value, IServiceProvider serviceProvider)
{
- var nsResolver = serviceProvider.GetService(typeof (IXmlNamespaceResolver)) as IXmlNamespaceResolver;
+ var nsResolver = serviceProvider.GetService(typeof(IXmlNamespaceResolver)) as IXmlNamespaceResolver;
var childnode = value as INode ?? new ValueNode(strValue, nsResolver);
childnode.Parent = node;
var value = Values[node];
XmlName propertyName;
//Set RD to VE
- if (typeof(ResourceDictionary).IsAssignableFrom(Context.Types[node]) && ApplyPropertiesVisitor.TryGetPropertyName(node, parentNode, out propertyName)) {
+ if (typeof(ResourceDictionary).IsAssignableFrom(Context.Types[node]) && ApplyPropertiesVisitor.TryGetPropertyName(node, parentNode, out propertyName))
+ {
if ((propertyName.LocalName == "Resources" ||
- propertyName.LocalName.EndsWith(".Resources", StringComparison.Ordinal)) && value is ResourceDictionary) {
+ propertyName.LocalName.EndsWith(".Resources", StringComparison.Ordinal)) && value is ResourceDictionary)
+ {
var source = Values[parentNode];
ApplyPropertiesVisitor.SetPropertyValue(source, propertyName, value, Context.RootElement, node, Context, node);
return;
}
//Only proceed further if the node is a keyless RD
- if ( parentNode is IElementNode
+ if (parentNode is IElementNode
&& typeof(ResourceDictionary).IsAssignableFrom(Context.Types[((IElementNode)parentNode)])
&& !((IElementNode)parentNode).Properties.ContainsKey(XmlName.xKey))
node.Accept(new ApplyPropertiesVisitor(Context, stopOnResourceDictionary: false), parentNode);
- else if ( parentNode is ListNode
+ else if (parentNode is ListNode
&& typeof(ResourceDictionary).IsAssignableFrom(Context.Types[((IElementNode)parentNode.Parent)])
&& !((IElementNode)parentNode.Parent).Properties.ContainsKey(XmlName.xKey))
node.Accept(new ApplyPropertiesVisitor(Context, stopOnResourceDictionary: false), parentNode);
var enode = node as ElementNode;
if (enode is null)
return false;
- if ( parentNode is IElementNode
+ if (parentNode is IElementNode
&& typeof(ResourceDictionary).IsAssignableFrom(Context.Types[((IElementNode)parentNode)])
&& !((IElementNode)parentNode).Properties.ContainsKey(XmlName.xKey))
return true;
- if ( parentNode is ListNode
+ if (parentNode is ListNode
&& typeof(ResourceDictionary).IsAssignableFrom(Context.Types[((IElementNode)parentNode.Parent)])
&& !((IElementNode)parentNode.Parent).Properties.ContainsKey(XmlName.xKey))
return true;
if (remaining[end] == stringTerminator)
{
inString = false;
- end ++;
+ end++;
break;
}
}
{
inString = true;
stringTerminator = remaining[end];
- end ++;
+ end++;
continue;
}
}
// If this is an escape char, consume it and append the next char to our piece.
if (remaining[end] == '\\')
{
- end ++;
+ end++;
if (end == remaining.Length)
break;
}
// Whitespace is trimmed from the end of the piece before stripping
// quote chars from the start/end of the string.
while (piece.Length > 0 && char.IsWhiteSpace(piece[piece.Length - 1]))
- piece.Length --;
+ piece.Length--;
if (piece.Length >= 2)
{
public object Parse(string match, ref string remaining, IServiceProvider serviceProvider)
{
- var typeResolver = serviceProvider.GetService(typeof (IXamlTypeResolver)) as IXamlTypeResolver;
+ var typeResolver = serviceProvider.GetService(typeof(IXamlTypeResolver)) as IXamlTypeResolver;
//shortcut for Binding and StaticResource, to avoid too many reflection calls.
if (match == "Binding")
//The order of lookup is to look for the Extension-suffixed class name first and then look for the class name without the Extension suffix.
if (!typeResolver.TryResolve(match + "Extension", out type) && !typeResolver.TryResolve(match, out type))
{
- var lineInfoProvider = serviceProvider.GetService(typeof (IXmlLineInfoProvider)) as IXmlLineInfoProvider;
+ var lineInfoProvider = serviceProvider.GetService(typeof(IXmlLineInfoProvider)) as IXmlLineInfoProvider;
var lineInfo = (lineInfoProvider != null) ? lineInfoProvider.XmlLineInfo : new XmlLineInfo();
throw new XamlParseException(String.Format("MarkupExtension not found for {0}", match), lineInfo);
}
if (markupExtension == null)
{
- var lineInfoProvider = serviceProvider.GetService(typeof (IXmlLineInfoProvider)) as IXmlLineInfoProvider;
+ var lineInfoProvider = serviceProvider.GetService(typeof(IXmlLineInfoProvider)) as IXmlLineInfoProvider;
var lineInfo = (lineInfoProvider != null) ? lineInfoProvider.XmlLineInfo : new XmlLineInfo();
throw new XamlParseException(String.Format("Missing public default constructor for MarkupExtension {0}", match),
lineInfo);
static bool IsVisualStateGroupList(ElementNode node)
{
- return node != null && node.XmlType.Name == "VisualStateGroup" && node.Parent is IListNode;
+ return node != null && node.XmlType.Name == "VisualStateGroup" && node.Parent is IListNode;
}
}
}
\ No newline at end of file
{
internal class ResourcesLoader : IResourcesLoader
{
- public T CreateFromResource<T>(string resourcePath, Assembly assembly, IXmlLineInfo lineInfo) where T: new()
+ public T CreateFromResource<T>(string resourcePath, Assembly assembly, IXmlLineInfo lineInfo) where T : new()
{
var alternateResource = ResourceLoader.ResourceProvider?.Invoke(assembly.GetName(), resourcePath);
- if (alternateResource != null) {
+ if (alternateResource != null)
+ {
var rd = new T();
rd.LoadFromXaml(alternateResource);
return rd;
if (resourceId == null)
throw new XamlParseException($"Resource '{resourcePath}' not found.", lineInfo);
- using (var stream = assembly.GetManifestResourceStream(resourceId)) {
+ using (var stream = assembly.GetManifestResourceStream(resourceId))
+ {
if (stream == null)
throw new XamlParseException($"No resource found for '{resourceId}'.", lineInfo);
- using (var reader = new StreamReader(stream)) {
+ using (var reader = new StreamReader(stream))
+ {
var rd = new T();
rd.LoadFromXaml(reader.ReadToEnd());
return rd;
if (resourceId == null)
throw new XamlParseException($"Resource '{resourcePath}' not found.", lineInfo);
- using (var stream = assembly.GetManifestResourceStream(resourceId)) {
+ using (var stream = assembly.GetManifestResourceStream(resourceId))
+ {
if (stream == null)
throw new XamlParseException($"No resource found for '{resourceId}'.", lineInfo);
using (var reader = new StreamReader(stream))
return null;
string prefix, name;
- if (split.Length == 2) {
- prefix = split [0];
- name = split [1];
- } else {
+ if (split.Length == 2)
+ {
+ prefix = split[0];
+ name = split[1];
+ }
+ else
+ {
prefix = "";
- name = split [0];
+ name = split[0];
}
var namespaceuri = resolver.LookupNamespace(prefix);
attributes.FirstOrDefault(cad => TypeConverterAttribute.TypeConvertersType.Contains(cad.AttributeType.FullName));
if (converterAttribute == null)
return null;
- if (converterAttribute.ConstructorArguments[0].ArgumentType == typeof (string))
+ if (converterAttribute.ConstructorArguments[0].ArgumentType == typeof(string))
return (string)converterAttribute.ConstructorArguments[0].Value;
- if (converterAttribute.ConstructorArguments[0].ArgumentType == typeof (Type))
+ if (converterAttribute.ConstructorArguments[0].ArgumentType == typeof(Type))
return ((Type)converterAttribute.ConstructorArguments[0].Value).AssemblyQualifiedName;
return null;
}
var ignoreCase = (serviceProvider?.GetService(typeof(IConverterOptions)) as IConverterOptions)?.IgnoreCase ?? false;
//If the type is nullable, as the value is not null, it's safe to assume we want the built-in conversion
- if (toType.GetTypeInfo().IsGenericType && toType.GetGenericTypeDefinition() == typeof (Nullable<>))
+ if (toType.GetTypeInfo().IsGenericType && toType.GetGenericTypeDefinition() == typeof(Nullable<>))
toType = Nullable.GetUnderlyingType(toType);
//Obvious Built-in conversions
return UInt32.Parse(str, CultureInfo.InvariantCulture);
if (toType == typeof(UInt64))
return UInt64.Parse(str, CultureInfo.InvariantCulture);
- if (toType == typeof (Single))
+ if (toType == typeof(Single))
return Single.Parse(str, CultureInfo.InvariantCulture);
- if (toType == typeof (Double))
+ if (toType == typeof(Double))
return Double.Parse(str, CultureInfo.InvariantCulture);
- if (toType == typeof (Boolean))
+ if (toType == typeof(Boolean))
return Boolean.Parse(str);
- if (toType == typeof (TimeSpan))
+ if (toType == typeof(TimeSpan))
return TimeSpan.Parse(str, CultureInfo.InvariantCulture);
- if (toType == typeof (DateTime))
+ if (toType == typeof(DateTime))
return DateTime.Parse(str, CultureInfo.InvariantCulture);
- if (toType == typeof(Char)) {
+ if (toType == typeof(Char))
+ {
char c = '\0';
Char.TryParse(str, out c);
return c;
}
- if (toType == typeof (String) && str.StartsWith("{}", StringComparison.Ordinal))
+ if (toType == typeof(String) && str.StartsWith("{}", StringComparison.Ordinal))
return str.Substring(2);
- if (toType == typeof (String))
+ if (toType == typeof(String))
return value;
if (toType == typeof(Decimal))
return Decimal.Parse(str, CultureInfo.InvariantCulture);
}
//if the value is not assignable and there's an implicit conversion, convert
- if (value != null && !toType.IsAssignableFrom(value.GetType())) {
- var opImplicit = value.GetType().GetImplicitConversionOperator(fromType: value.GetType(), toType: toType)
+ if (value != null && !toType.IsAssignableFrom(value.GetType()))
+ {
+ var opImplicit = value.GetType().GetImplicitConversionOperator(fromType: value.GetType(), toType: toType)
?? toType.GetImplicitConversionOperator(fromType: value.GetType(), toType: toType);
- if (opImplicit != null) {
+ if (opImplicit != null)
+ {
value = opImplicit.Invoke(null, new[] { value });
return value;
}
}
public static readonly BindableProperty VisualStateGroupsProperty =
- BindableProperty.CreateAttached("VisualStateGroups", typeof(VisualStateGroupList), typeof(/*VisualElement*/BaseHandle),
- defaultValue: null, propertyChanged: VisualStateGroupsPropertyChanged,
+ BindableProperty.CreateAttached("VisualStateGroups", typeof(VisualStateGroupList), typeof(/*VisualElement*/BaseHandle),
+ defaultValue: null, propertyChanged: VisualStateGroupsPropertyChanged,
defaultValueCreator: bindable => new VisualStateGroupList());
static void VisualStateGroupsPropertyChanged(BindableObject bindable, object oldValue, object newValue)
readonly IList<VisualStateGroup> _internalList;
void Validate(IList<VisualStateGroup> groups)
- {
+ {
// If we have 1 group, no need to worry about duplicate group names
if (groups.Count > 1)
{
}
}
- public VisualStateGroupList()
+ public VisualStateGroupList()
{
_internalList = new WatchAddList<VisualStateGroup>(Validate);
}
[RuntimeNameProperty(nameof(Name))]
[ContentProperty(nameof(States))]
- internal sealed class VisualStateGroup
+ internal sealed class VisualStateGroup
{
public VisualStateGroup()
{
internal VisualStateGroup Clone()
{
- var clone = new VisualStateGroup {TargetType = TargetType, Name = Name, CurrentState = CurrentState};
+ var clone = new VisualStateGroup { TargetType = TargetType, Name = Name, CurrentState = CurrentState };
foreach (VisualState state in States)
{
clone.States.Add(state.Clone());
}
[RuntimeNameProperty(nameof(Name))]
- internal sealed class VisualState
+ internal sealed class VisualState
{
public VisualState()
{
}
public string Name { get; set; }
- public IList<Setter> Setters { get;}
+ public IList<Setter> Setters { get; }
public Type TargetType { get; set; }
internal VisualState Clone()
{
/// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- [Obsolete ("Replaced by ResourceLoader")]
+ [Obsolete("Replaced by ResourceLoader")]
public static class XamlLoader
{
static Func<Type, string> xamlFileProvider;
/// 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 static Func<Type, string> XamlFileProvider {
+ public static Func<Type, string> XamlFileProvider
+ {
get { return xamlFileProvider; }
internal set
{
visitor.Visit(this, parentNode);
}
- public override INode Clone() => new ValueNode(Value, NamespaceResolver, LineNumber, LinePosition) {
+ public override INode Clone() => new ValueNode(Value, NamespaceResolver, LineNumber, LinePosition)
+ {
IgnorablePrefixes = IgnorablePrefixes
};
}
visitor.Visit(this, parentNode);
}
- public override INode Clone() => new MarkupNode(MarkupString, NamespaceResolver, LineNumber, LinePosition) {
+ public override INode Clone() => new MarkupNode(MarkupString, NamespaceResolver, LineNumber, LinePosition)
+ {
IgnorablePrefixes = IgnorablePrefixes
};
}
if (!SkipVisitNode(visitor, parentNode) && visitor.VisitingMode == TreeVisitingMode.TopDown)
visitor.Visit(this, parentNode);
- if (!SkipChildren(visitor, this, parentNode)) {
+ if (!SkipChildren(visitor, this, parentNode))
+ {
foreach (var node in Properties.Values.ToList())
node.Accept(visitor, this);
foreach (var node in CollectionItems)
public override INode Clone()
{
- var clone = new ElementNode(XmlType, NamespaceURI, NamespaceResolver, LineNumber, LinePosition) {
+ var clone = new ElementNode(XmlType, NamespaceURI, NamespaceResolver, LineNumber, LinePosition)
+ {
IgnorablePrefixes = IgnorablePrefixes
};
foreach (var kvp in Properties)
if (!SkipVisitNode(visitor, parentNode) && visitor.VisitingMode == TreeVisitingMode.TopDown)
visitor.Visit(this, parentNode);
- if (!SkipChildren(visitor, this, parentNode)) {
+ if (!SkipChildren(visitor, this, parentNode))
+ {
foreach (var node in Properties.Values.ToList())
node.Accept(visitor, this);
foreach (var node in CollectionItems)
var items = new List<INode>();
foreach (var p in CollectionItems)
items.Add(p.Clone());
- return new ListNode(items, NamespaceResolver, LineNumber, LinePosition) {
+ return new ListNode(items, NamespaceResolver, LineNumber, LinePosition)
+ {
IgnorablePrefixes = IgnorablePrefixes
};
}
{
public static bool SkipPrefix(this INode node, string prefix)
{
- do {
+ do
+ {
if (node.IgnorablePrefixes != null && node.IgnorablePrefixes.Contains(prefix))
return true;
node = node.Parent;
bool IsResourceDictionary(ElementNode node);
}
- internal enum TreeVisitingMode {
+ internal enum TreeVisitingMode
+ {
TopDown,
BottomUp
}
IList<KeyValuePair<string, string>> xmlns;
var attributes = ParseXamlAttributes(reader, out xmlns);
var prefixes = PrefixesToIgnore(xmlns);
- (rootNode.IgnorablePrefixes ?? (rootNode.IgnorablePrefixes=new List<string>())).AddRange(prefixes);
+ (rootNode.IgnorablePrefixes ?? (rootNode.IgnorablePrefixes = new List<string>())).AddRange(prefixes);
rootNode.Properties.AddRange(attributes);
ParseXamlElementFor(rootNode, reader);
}
throw new XamlParseException("Closing PropertyElement expected", (IXmlLineInfo)reader);
}
- static IList<KeyValuePair<XmlName, INode>> ParseXamlAttributes(XmlReader reader, out IList<KeyValuePair<string,string>> xmlns)
+ static IList<KeyValuePair<XmlName, INode>> ParseXamlAttributes(XmlReader reader, out IList<KeyValuePair<string, string>> xmlns)
{
Debug.Assert(reader.NodeType == XmlNodeType.Element);
var attributes = new List<KeyValuePair<XmlName, INode>>();
reader.MoveToAttribute(i);
//skip xmlns
- if (reader.NamespaceURI == "http://www.w3.org/2000/xmlns/") {
+ if (reader.NamespaceURI == "http://www.w3.org/2000/xmlns/")
+ {
xmlns.Add(new KeyValuePair<string, string>(reader.LocalName, reader.Value));
continue;
}
if (reader.NamespaceURI == X2006Uri)
{
- switch (reader.Name) {
- case "x:Key":
- propertyName = XmlName.xKey;
- break;
- case "x:Name":
- propertyName = XmlName.xName;
- break;
- case "x:Class":
- case "x:FieldModifier":
- continue;
- default:
- Debug.WriteLine("Unhandled attribute {0}", reader.Name);
- continue;
+ switch (reader.Name)
+ {
+ case "x:Key":
+ propertyName = XmlName.xKey;
+ break;
+ case "x:Name":
+ propertyName = XmlName.xName;
+ break;
+ case "x:Class":
+ case "x:FieldModifier":
+ continue;
+ default:
+ Debug.WriteLine("Unhandled attribute {0}", reader.Name);
+ continue;
}
}
if (reader.NamespaceURI == X2009Uri)
{
- switch (reader.Name) {
- case "x:Key":
- propertyName = XmlName.xKey;
- break;
- case "x:Name":
- propertyName = XmlName.xName;
- break;
- case "x:TypeArguments":
- propertyName = XmlName.xTypeArguments;
- value = TypeArgumentsParser.ParseExpression((string)value, (IXmlNamespaceResolver)reader, (IXmlLineInfo)reader);
- break;
- case "x:DataType":
- propertyName = XmlName.xDataType;
- break;
- case "x:Class":
- case "x:FieldModifier":
- continue;
- case "x:FactoryMethod":
- propertyName = XmlName.xFactoryMethod;
- break;
- case "x:Arguments":
- propertyName = XmlName.xArguments;
- break;
- default:
- Debug.WriteLine("Unhandled attribute {0}", reader.Name);
- continue;
+ switch (reader.Name)
+ {
+ case "x:Key":
+ propertyName = XmlName.xKey;
+ break;
+ case "x:Name":
+ propertyName = XmlName.xName;
+ break;
+ case "x:TypeArguments":
+ propertyName = XmlName.xTypeArguments;
+ value = TypeArgumentsParser.ParseExpression((string)value, (IXmlNamespaceResolver)reader, (IXmlLineInfo)reader);
+ break;
+ case "x:DataType":
+ propertyName = XmlName.xDataType;
+ break;
+ case "x:Class":
+ case "x:FieldModifier":
+ continue;
+ case "x:FactoryMethod":
+ propertyName = XmlName.xFactoryMethod;
+ break;
+ case "x:Arguments":
+ propertyName = XmlName.xArguments;
+ break;
+ default:
+ Debug.WriteLine("Unhandled attribute {0}", reader.Name);
+ continue;
}
}
static IList<string> PrefixesToIgnore(IList<KeyValuePair<string, string>> xmlns)
{
var prefixes = new List<string>();
- foreach (var kvp in xmlns) {
+ foreach (var kvp in xmlns)
+ {
var prefix = kvp.Key;
string typeName = null, ns = null, asm = null;
s_xmlnsDefinitions = new List<XmlnsDefinitionAttribute>();
foreach (var assembly in s_assemblies)
- foreach (XmlnsDefinitionAttribute attribute in assembly.GetCustomAttributes(typeof(XmlnsDefinitionAttribute))) {
+ foreach (XmlnsDefinitionAttribute attribute in assembly.GetCustomAttributes(typeof(XmlnsDefinitionAttribute)))
+ {
s_xmlnsDefinitions.Add(attribute);
attribute.AssemblyName = attribute.AssemblyName ?? assembly.FullName;
}
var lookupAssemblies = new List<XmlnsDefinitionAttribute>();
var lookupNames = new List<string>();
- foreach (var xmlnsDef in s_xmlnsDefinitions) {
+ foreach (var xmlnsDef in s_xmlnsDefinitions)
+ {
if (xmlnsDef.XmlNamespace != namespaceURI)
continue;
lookupAssemblies.Add(xmlnsDef);
}
- if (lookupAssemblies.Count == 0) {
+ if (lookupAssemblies.Count == 0)
+ {
string ns, asmstring, _;
XmlnsHelper.ParseXmlns(namespaceURI, out _, out ns, out asmstring);
- lookupAssemblies.Add(new XmlnsDefinitionAttribute(namespaceURI, ns) {
+ lookupAssemblies.Add(new XmlnsDefinitionAttribute(namespaceURI, ns)
+ {
AssemblyName = asmstring ?? currentAssembly.FullName
});
}
}
Type type = null;
- foreach (var asm in lookupAssemblies) {
+ foreach (var asm in lookupAssemblies)
+ {
foreach (var name in lookupNames)
{
if ((type = Type.GetType($"{asm.ClrNamespace}.{name}, {asm.AssemblyName}")) != null)
if (type != null && typeArguments != null)
{
XamlParseException innerexception = null;
- var args = typeArguments.Select(delegate(XmlType xmltype)
+ var args = typeArguments.Select(delegate (XmlType xmltype)
{
XamlParseException xpe;
var t = GetElementType(xmltype, xmlInfo, currentAssembly, out xpe);
{
if (obj == null)
return false;
- if (obj.GetType() != typeof (XmlName))
+ if (obj.GetType() != typeof(XmlName))
return false;
var other = (XmlName)obj;
return NamespaceURI == other.NamespaceURI && LocalName == other.LocalName;
=> x1.NamespaceURI == x2.NamespaceURI && x1.LocalName == x2.LocalName;
public static bool operator !=(XmlName x1, XmlName x2)
- => !(x1 == x2);
+ => !(x1 == x2);
}
}
\ No newline at end of file
xmlns = xmlns.Trim();
- if (xmlns.StartsWith("using:", StringComparison.Ordinal)) {
+ if (xmlns.StartsWith("using:", StringComparison.Ordinal))
+ {
ParseUsing(xmlns, out typeName, out ns, out asm);
return;
}
{
typeName = ns = asm = null;
- foreach (var decl in xmlns.Split(';')) {
- if (decl.StartsWith("using:", StringComparison.Ordinal)) {
+ foreach (var decl in xmlns.Split(';'))
+ {
+ if (decl.StartsWith("using:", StringComparison.Ordinal))
+ {
ns = decl.Substring(6, decl.Length - 6);
continue;
}
part.IndexerName = indexerName;
#if NETSTANDARD2_0
- try {
+ try
+ {
property = sourceType.GetDeclaredProperty(indexerName);
}
- catch (AmbiguousMatchException) {
+ catch (AmbiguousMatchException)
+ {
// Get most derived instance of property
- foreach (var p in sourceType.GetProperties().Where(prop => prop.Name == indexerName)) {
+ foreach (var p in sourceType.GetProperties().Where(prop => prop.Name == indexerName))
+ {
if (property == null || property.DeclaringType.IsAssignableFrom(property.DeclaringType))
property = p;
}
}
if (property.CanWrite && property.SetMethod != null)
{
- if(property.SetMethod.IsPublic && !property.SetMethod.IsStatic)
+ if (property.SetMethod.IsPublic && !property.SetMethod.IsStatic)
{
part.LastSetter = property.SetMethod;
part.SetterType = part.LastSetter.GetParameters().Last().ParameterType;
return Activator.CreateInstance(type, args);
}
}
-
+
return Activator.CreateInstance(type);
}
}
Tizen.Log.Fatal("NUI", "Could not load assembly: {0} for Attibute {1} | Some renderers may not be loaded", assembly.FullName, targetAttrType.FullName);
continue;
}
-
+
if (attributes.Length == 0)
continue;
{
return new Extents(ushort.Parse(parts[0].Trim(), CultureInfo.InvariantCulture),
ushort.Parse(parts[1].Trim(), CultureInfo.InvariantCulture),
- ushort.Parse(parts[2].Trim(), CultureInfo.InvariantCulture),
+ ushort.Parse(parts[2].Trim(), CultureInfo.InvariantCulture),
ushort.Parse(parts[3].Trim(), CultureInfo.InvariantCulture));
}
else if (parts.Length == 1)
{
public override object ConvertFromInvariantString(string value)
{
- if (value != null) {
+ if (value != null)
+ {
if (Enum.TryParse(value, out FlowDirection direction))
return direction;
namespace Tizen.NUI.Binding.Internals
{
- [AttributeUsage(AttributeTargets.All)]
+ [AttributeUsage(AttributeTargets.All)]
internal class PreserveAttribute : Attribute
- {
- public bool AllMembers;
- public bool Conditional;
+ {
+ public bool AllMembers;
+ public bool Conditional;
- public PreserveAttribute(bool allMembers, bool conditional)
- {
- AllMembers = allMembers;
- Conditional = conditional;
- }
+ public PreserveAttribute(bool allMembers, bool conditional)
+ {
+ AllMembers = allMembers;
+ Conditional = conditional;
+ }
- public PreserveAttribute()
- {
- }
- }
+ public PreserveAttribute()
+ {
+ }
+ }
}
\ No newline at end of file
};
//takes a resource path, returns string content
- public static Func<AssemblyName, string, string> ResourceProvider {
+ public static Func<AssemblyName, string, string> ResourceProvider
+ {
get => resourceProvider;
- internal set {
+ internal set
+ {
DesignMode.IsDesignModeEnabled = true;
resourceProvider = value;
}
{
if (value == null)
return null;
-
- return value.Split(new [] { ',' }, StringSplitOptions.RemoveEmptyEntries).Select(s => s.Trim()).ToList();
+
+ return value.Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries).Select(s => s.Trim()).ToList();
}
}
}
\ No newline at end of file
_styleClass = value;
- if (_styleClass != null) {
- _classStyleProperties = new List<BindableProperty> ();
- foreach (var styleClass in _styleClass) {
- var classStyleProperty = BindableProperty.Create ("ClassStyle", typeof(IList<Style>), typeof(View), default(IList<Style>),
+ if (_styleClass != null)
+ {
+ _classStyleProperties = new List<BindableProperty>();
+ foreach (var styleClass in _styleClass)
+ {
+ var classStyleProperty = BindableProperty.Create("ClassStyle", typeof(IList<Style>), typeof(View), default(IList<Style>),
propertyChanged: (bindable, oldvalue, newvalue) => ((View)bindable)._mergedStyle.OnClassStyleChanged());
- _classStyleProperties.Add (classStyleProperty);
- Target.OnSetDynamicResource (classStyleProperty, Tizen.NUI.Binding.Style.StyleClassPrefix + styleClass);
+ _classStyleProperties.Add(classStyleProperty);
+ Target.OnSetDynamicResource(classStyleProperty, Tizen.NUI.Binding.Style.StyleClassPrefix + styleClass);
}
}
}
void OnClassStyleChanged()
{
- ClassStyles = _classStyleProperties.Select (p => (Target.GetValue (p) as IList<Style>)?.FirstOrDefault (s => s.CanBeAppliedTo (TargetType))).ToList ();
+ ClassStyles = _classStyleProperties.Select(p => (Target.GetValue(p) as IList<Style>)?.FirstOrDefault(s => s.CanBeAppliedTo(TargetType))).ToList();
}
void OnImplicitStyleChanged()
{
return;
}
- while (true) {
+ while (true)
+ {
BindableProperty implicitStyleProperty = BindableProperty.Create(nameof(ImplicitStyle), typeof(Style), typeof(View), default(Style),
propertyChanged: (bindable, oldvalue, newvalue) => OnImplicitStyleChanged());
_implicitStyles.Add(implicitStyleProperty);
SVG = Visual.Type.SVG,
AnimatedImage = Visual.Type.AnimatedImage
}
-
+
internal enum VisualAlignTypeExtension
{
TopBegin = Visual.AlignType.TopBegin,
public T Phone { get; set; }
public T Tablet { get; set; }
-
+
public T Desktop { get; set; }
public T TV { get; set; }
bool useLegacyFallback;
T android;
[Obsolete]
- public T Android {
+ public T Android
+ {
get { return android; }
- set {
+ set
+ {
useLegacyFallback = true;
android = value;
}
T ios;
[Obsolete]
- public T iOS {
+ public T iOS
+ {
get { return ios; }
- set {
+ set
+ {
useLegacyFallback = true;
ios = value;
}
T winPhone;
[Obsolete]
- public T WinPhone {
+ public T WinPhone
+ {
get { return winPhone; }
- set {
+ set
+ {
useLegacyFallback = true;
winPhone = value;
}
bool hasDefault;
T @default;
- public T Default {
+ public T Default
+ {
get { return @default; }
- set {
+ set
+ {
hasDefault = true;
@default = value;
}
public static implicit operator T(OnPlatform<T> onPlatform)
{
- foreach (var onPlat in onPlatform.Platforms) {
+ foreach (var onPlat in onPlatform.Platforms)
+ {
if (onPlat.Platform == null)
continue;
if (null != Device.RuntimePlatform && !onPlat.Platform.Contains(Device.RuntimePlatform))
if (value != null)
{
string[] parts = value.Split('.');
- if (parts.Length == 1 || ( parts.Length == 2 && (parts[0].Trim() == "ParentOrigin" || parts[0].Trim() == "PivotPoint") ))
+ if (parts.Length == 1 || (parts.Length == 2 && (parts[0].Trim() == "ParentOrigin" || parts[0].Trim() == "PivotPoint")))
{
string position = parts[parts.Length - 1].Trim();
- switch(position)
+ switch (position)
{
case "Top":
return ParentOrigin.Top;
public override string ConvertToString(object value)
{
Position2D position = (Position2D)value;
- return position.X.ToString() + " " + position.Y.ToString();
+ return position.X.ToString() + " " + position.Y.ToString();
}
}
}
public override string ConvertToString(object value)
{
Rectangle rec = (Rectangle)value;
- return rec.X.ToString() + " " + rec.Y.ToString() + " " + rec.Width.ToString() + " " + rec.Height.ToString();
+ return rec.X.ToString() + " " + rec.Y.ToString() + " " + rec.Width.ToString() + " " + rec.Height.ToString();
}
}
}
{
useDefault = false;
string radianOrDegree = head[0].Trim().ToLowerInvariant();
- if(radianOrDegree == "d" || radianOrDegree == "degree")
+ if (radianOrDegree == "d" || radianOrDegree == "degree")
{
// Oritation="D:23, 0, 0, 1"
- radian = new Radian( new Degree( Single.Parse( head[1].Trim(), CultureInfo.InvariantCulture ) ) );
+ radian = new Radian(new Degree(Single.Parse(head[1].Trim(), CultureInfo.InvariantCulture)));
}
else if (radianOrDegree == "r" || radianOrDegree == "radian")
{
// Oritation="R:23, 0, 0, 1"
- radian = new Radian( Single.Parse( head[1].Trim(), CultureInfo.InvariantCulture ) );
+ radian = new Radian(Single.Parse(head[1].Trim(), CultureInfo.InvariantCulture));
}
else
{
if (useDefault)
{
// Default: <View Orientation="45.0,12,13,0" />
- radian = new Radian( Single.Parse( parts[0].Trim(), CultureInfo.InvariantCulture ) );
+ radian = new Radian(Single.Parse(parts[0].Trim(), CultureInfo.InvariantCulture));
}
Vector3 vector3 = new Vector3(Single.Parse(parts[1].Trim(), CultureInfo.InvariantCulture),
_reader.Read(); //consume the '*'
bool hasStar = false;
- while (true) {
+ while (true)
+ {
var next = _reader.Read();
if (next <= 0)
return next;
_reader.Read(); //consume the '*'
bool hasStar = false;
- while (true) {
+ while (true)
+ {
var next = _reader.Read();
if (next <= 0)
return next;
int p;
reader.SkipWhiteSpaces();
- while ((p = reader.Peek()) > 0) {
- switch (unchecked((char)p)) {
- case '*':
- setCurrentSelector(new And(), All);
- reader.Read();
- break;
- case '.':
- reader.Read();
- var className = reader.ReadIdent();
- if (className == null)
- return Invalid;
- setCurrentSelector(new And(), new Class(className));
- break;
- case '#':
- reader.Read();
- var id = reader.ReadName();
- if (id == null)
- return Invalid;
- setCurrentSelector(new And(), new Id(id));
- break;
- case '[':
- throw new NotImplementedException("Attributes not implemented");
- case ',':
- reader.Read();
- setCurrentSelector(new Or(), All);
- reader.SkipWhiteSpaces();
- break;
- case '+':
- reader.Read();
- setCurrentSelector(new Adjacent(), All);
- reader.SkipWhiteSpaces();
- break;
- case '~':
- reader.Read();
- setCurrentSelector(new Sibling(), All);
- reader.SkipWhiteSpaces();
- break;
- case '>':
- reader.Read();
- setCurrentSelector(new Child(), All);
- reader.SkipWhiteSpaces();
- break;
- case '^': //not in CSS spec
- reader.Read();
- var element = reader.ReadIdent();
- if (element == null) return Invalid;
- setCurrentSelector(new And(), new Base(element));
- break;
- case ' ':
- case '\t':
- case '\n':
- case '\r':
- case '\f':
- reader.Read();
- bool processWs = false;
- while ((p = reader.Peek()) > 0) {
- var c = unchecked((char)p);
- if (char.IsWhiteSpace(c)) {
- reader.Read();
- continue;
+ while ((p = reader.Peek()) > 0)
+ {
+ switch (unchecked((char)p))
+ {
+ case '*':
+ setCurrentSelector(new And(), All);
+ reader.Read();
+ break;
+ case '.':
+ reader.Read();
+ var className = reader.ReadIdent();
+ if (className == null)
+ return Invalid;
+ setCurrentSelector(new And(), new Class(className));
+ break;
+ case '#':
+ reader.Read();
+ var id = reader.ReadName();
+ if (id == null)
+ return Invalid;
+ setCurrentSelector(new And(), new Id(id));
+ break;
+ case '[':
+ throw new NotImplementedException("Attributes not implemented");
+ case ',':
+ reader.Read();
+ setCurrentSelector(new Or(), All);
+ reader.SkipWhiteSpaces();
+ break;
+ case '+':
+ reader.Read();
+ setCurrentSelector(new Adjacent(), All);
+ reader.SkipWhiteSpaces();
+ break;
+ case '~':
+ reader.Read();
+ setCurrentSelector(new Sibling(), All);
+ reader.SkipWhiteSpaces();
+ break;
+ case '>':
+ reader.Read();
+ setCurrentSelector(new Child(), All);
+ reader.SkipWhiteSpaces();
+ break;
+ case '^': //not in CSS spec
+ reader.Read();
+ var element = reader.ReadIdent();
+ if (element == null) return Invalid;
+ setCurrentSelector(new And(), new Base(element));
+ break;
+ case ' ':
+ case '\t':
+ case '\n':
+ case '\r':
+ case '\f':
+ reader.Read();
+ bool processWs = false;
+ while ((p = reader.Peek()) > 0)
+ {
+ var c = unchecked((char)p);
+ if (char.IsWhiteSpace(c))
+ {
+ reader.Read();
+ continue;
+ }
+ processWs = (c != '+'
+ && c != '>'
+ && c != ','
+ && c != '~'
+ && c != '^'
+ && c != stopChar);
+ break;
}
- processWs = (c != '+'
- && c != '>'
- && c != ','
- && c != '~'
- && c != '^'
- && c != stopChar);
+ if (!processWs)
+ break;
+ setCurrentSelector(new Descendent(), All);
+ reader.SkipWhiteSpaces();
break;
- }
- if (!processWs)
+ default:
+ if (unchecked((char)p) == stopChar)
+ return root;
+
+ var elementName = reader.ReadIdent();
+ if (elementName == null)
+ return Invalid;
+ setCurrentSelector(new And(), new Element(elementName));
break;
- setCurrentSelector(new Descendent(), All);
- reader.SkipWhiteSpaces();
- break;
- default:
- if (unchecked((char)p) == stopChar)
- return root;
-
- var elementName = reader.ReadIdent();
- if (elementName == null)
- return Invalid;
- setCurrentSelector(new And(), new Element(elementName));
- break;
}
}
return root;
if (updateRoot)
root = workingRoot;
- if (workingRoot is Or) {
+ if (workingRoot is Or)
+ {
workingRootParent = (Operator)workingRoot;
workingRoot = sel;
}
}
public string ElementName { get; }
- public override bool Matches(IStyleSelectable styleable) {
+ public override bool Matches(IStyleSelectable styleable)
+ {
for (var i = 0; i < styleable.NameAndBases.Length; i++)
if (string.Equals(styleable.NameAndBases[i], ElementName, StringComparison.OrdinalIgnoreCase))
return true;
if (!Right.Matches(styleable))
return false;
var parent = styleable.Parent;
- while (parent != null) {
+ while (parent != null)
+ {
if (Left.Matches(parent))
return true;
parent = parent.Parent;
return false;
IStyleSelectable prev = null;
- foreach (var elem in styleable.Parent.Children) {
+ foreach (var elem in styleable.Parent.Children)
+ {
if (elem == styleable && prev != null)
return Left.Matches(prev);
prev = elem;
int selfIndex = 0;
bool foundSelfInParent = false;
- foreach (var elem in styleable.Parent.Children) {
- if (elem == styleable) {
+ foreach (var elem in styleable.Parent.Children)
+ {
+ if (elem == styleable)
+ {
foundSelfInParent = true;
break;
}
return false;
int index = 0;
- foreach (var elem in styleable.Parent.Children) {
+ foreach (var elem in styleable.Parent.Children)
+ {
if (index >= selfIndex)
return false;
if (Left.Matches(elem))
int p;
reader.SkipWhiteSpaces();
bool readingName = true;
- while ((p = reader.Peek()) > 0) {
- switch (unchecked((char)p)) {
- case ':':
- reader.Read();
- readingName = false;
- reader.SkipWhiteSpaces();
- break;
- case ';':
- reader.Read();
- if (!string.IsNullOrEmpty(propertyName) && !string.IsNullOrEmpty(propertyValue))
- style.Declarations.Add(propertyName, propertyValue);
- propertyName = propertyValue = null;
- readingName = true;
- reader.SkipWhiteSpaces();
- break;
- default:
- if ((char)p == stopChar)
- return style;
+ while ((p = reader.Peek()) > 0)
+ {
+ switch (unchecked((char)p))
+ {
+ case ':':
+ reader.Read();
+ readingName = false;
+ reader.SkipWhiteSpaces();
+ break;
+ case ';':
+ reader.Read();
+ if (!string.IsNullOrEmpty(propertyName) && !string.IsNullOrEmpty(propertyValue))
+ style.Declarations.Add(propertyName, propertyValue);
+ propertyName = propertyValue = null;
+ readingName = true;
+ reader.SkipWhiteSpaces();
+ break;
+ default:
+ if ((char)p == stopChar)
+ return style;
- if (readingName) {
- propertyName = reader.ReadIdent();
- if (propertyName == null)
- throw new Exception();
- } else
- propertyValue = reader.ReadUntil(stopChar, ';', ':');
- break;
+ if (readingName)
+ {
+ propertyName = reader.ReadIdent();
+ if (propertyName == null)
+ throw new Exception();
+ }
+ else
+ propertyValue = reader.ReadUntil(stopChar, ';', ':');
+ break;
}
}
return style;
if (styleable == null)
throw new ArgumentNullException(nameof(styleable));
- foreach (var decl in Declarations) {
+ foreach (var decl in Declarations)
+ {
var property = ((IStylable)styleable).GetProperty(decl.Key, inheriting);
if (property == null)
continue;
if (string.Equals(decl.Value, "initial", StringComparison.OrdinalIgnoreCase))
styleable.ClearValue(property, fromStyle: true);
- else {
+ else
+ {
object value;
if (!convertedValues.TryGetValue(decl, out value))
convertedValues[decl] = (value = Convert(styleable, decl.Value, property));
}
}
- foreach (var child in styleable.LogicalChildrenInternal) {
+ foreach (var child in styleable.LogicalChildrenInternal)
+ {
var ve = child as /*VisualElement*/BaseHandle;
if (ve == null)
continue;
// [MethodImpl(MethodImplOptions.AggressiveInlining)]
static object Convert(object target, object value, BindableProperty property)
{
- Func<MemberInfo> minforetriever = () => property.DeclaringType.GetRuntimeProperty(property.PropertyName) as MemberInfo
+ Func<MemberInfo> minforetriever = () => property.DeclaringType.GetRuntimeProperty(property.PropertyName) as MemberInfo
?? property.DeclaringType.GetRuntimeMethod("Get" + property.PropertyName, new[] { typeof(BindableObject) }) as MemberInfo;
var serviceProvider = new StyleSheetServiceProvider(target, property);
// return value.ConvertTo(property.ReturnType, minforetriever, serviceProvider);
public static StyleSheet FromAssemblyResource(Assembly assembly, string resourceId, IXmlLineInfo lineInfo = null)
{
- using (var stream = assembly.GetManifestResourceStream(resourceId)) {
+ using (var stream = assembly.GetManifestResourceStream(resourceId))
+ {
if (stream == null)
throw new XamlParseException($"No resource found for '{resourceId}'.", lineInfo);
- using (var reader = new StreamReader(stream)) {
+ using (var reader = new StreamReader(stream))
+ {
return FromReader(reader);
}
}
int p;
bool inStyle = false;
reader.SkipWhiteSpaces();
- while ((p = reader.Peek()) > 0) {
- switch ((char)p) {
- case '@':
- throw new NotSupportedException("AT-rules not supported");
- case '{':
- reader.Read();
- style = Style.Parse(reader, '}');
- inStyle = true;
- break;
- case '}':
- reader.Read();
- if (!inStyle)
- throw new Exception();
- inStyle = false;
- sheet.Styles.Add(selector, style);
- style = null;
- selector = Selector.All;
- break;
- default:
- selector = Selector.Parse(reader, '{');
- break;
+ while ((p = reader.Peek()) > 0)
+ {
+ switch ((char)p)
+ {
+ case '@':
+ throw new NotSupportedException("AT-rules not supported");
+ case '{':
+ reader.Read();
+ style = Style.Parse(reader, '}');
+ inStyle = true;
+ break;
+ case '}':
+ reader.Read();
+ if (!inStyle)
+ throw new Exception();
+ inStyle = false;
+ sheet.Styles.Add(selector, style);
+ style = null;
+ selector = Selector.All;
+ break;
+ default:
+ selector = Selector.Parse(reader, '{');
+ break;
}
}
return sheet;
var visualStylable = styleable as /*VisualElement*/BaseHandle;
if (visualStylable == null)
return;
- foreach (var kvp in Styles) {
+ foreach (var kvp in Styles)
+ {
var selector = kvp.Key;
var style = kvp.Value;
// if (!selector.Matches(styleable))
public StyleSheetServiceProvider(object targetObject, object targetProperty)
{
- vtProvider = new ValueTargetProvider {
+ vtProvider = new ValueTargetProvider
+ {
TargetObject = targetObject,
TargetProperty = targetProperty
};
bool first = true;
bool hasLeadingDash = false;
int p;
- while ((p = reader.Peek()) > 0) {
+ while ((p = reader.Peek()) > 0)
+ {
var c = unchecked((char)p);
- if (first && !hasLeadingDash && c == '-') {
+ if (first && !hasLeadingDash && c == '-')
+ {
sb.Append((char)reader.Read());
hasLeadingDash = true;
- } else if (first && c.IsNmStart()) {
+ }
+ else if (first && c.IsNmStart())
+ {
sb.Append((char)reader.Read());
first = false;
- } else if (first) { //a nmstart is expected
+ }
+ else if (first)
+ { //a nmstart is expected
throw new Exception();
- } else if (c.IsNmChar())
+ }
+ else if (c.IsNmChar())
sb.Append((char)reader.Read());
else
break;
{
var sb = new StringBuilder();
int p;
- while ((p = reader.Peek()) > 0) {
+ while ((p = reader.Peek()) > 0)
+ {
var c = unchecked((char)p);
if (c.IsNmChar())
sb.Append((char)reader.Read());
{
var sb = new StringBuilder();
int p;
- while ((p = reader.Peek()) > 0) {
+ while ((p = reader.Peek()) > 0)
+ {
var c = unchecked((char)p);
if (limit != null && limit.Contains(c))
break;
public static void SkipWhiteSpaces(this TextReader reader)
{
int p;
- while ((p = reader.Peek()) > 0) {
+ while ((p = reader.Peek()) > 0)
+ {
var c = unchecked((char)p);
if (!c.IsW())
break;
public int Count
{
- get
+ get
{
lock (_list)
- return _list.Count;
+ return _list.Count;
}
}
if (value != null)
{
string[] parts = value.Split(',');
- if (parts.Length == 2 )
+ if (parts.Length == 2)
{
return new Vector2(Single.Parse(parts[0].Trim(), CultureInfo.InvariantCulture),
Single.Parse(parts[1].Trim(), CultureInfo.InvariantCulture));
if (value != null)
{
string[] parts = value.Split(',');
- if (parts.Length == 3 )
+ if (parts.Length == 3)
{
return new Vector3(Single.Parse(parts[0].Trim(), CultureInfo.InvariantCulture),
Single.Parse(parts[1].Trim(), CultureInfo.InvariantCulture),
if (value != null)
{
string[] parts = value.Split(',');
- if (parts.Length == 4 )
+ if (parts.Length == 4)
{
return new Vector4(Single.Parse(parts[0].Trim(), CultureInfo.InvariantCulture),
Single.Parse(parts[1].Trim(), CultureInfo.InvariantCulture),
if (value != null)
{
string[] parts = value.Split(',');
- if (parts.Length == 2 )
+ if (parts.Length == 2)
{
return new RelativeVector2(Single.Parse(parts[0].Trim(), CultureInfo.InvariantCulture),
Single.Parse(parts[1].Trim(), CultureInfo.InvariantCulture));
if (value != null)
{
string[] parts = value.Split(',');
- if (parts.Length == 3 )
+ if (parts.Length == 3)
{
return new RelativeVector3(Single.Parse(parts[0].Trim(), CultureInfo.InvariantCulture),
Single.Parse(parts[1].Trim(), CultureInfo.InvariantCulture),
if (value != null)
{
string[] parts = value.Split(',');
- if (parts.Length == 4 )
+ if (parts.Length == 4)
{
return new RelativeVector4(Single.Parse(parts[0].Trim(), CultureInfo.InvariantCulture),
Single.Parse(parts[1].Trim(), CultureInfo.InvariantCulture),
[EditorBrowsable(EditorBrowsableState.Never)]
protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
{
- if(swigCPtr.Handle == IntPtr.Zero || this.HasBody() == false)
+ if (swigCPtr.Handle == IntPtr.Zero || this.HasBody() == false)
{
Tizen.Log.Fatal("NUI", $"[ERROR] Animation ReleaseSwigCPtr()! IntPtr=0x{swigCPtr.Handle:X} HasBody={this.HasBody()}");
return;
/// <param name="name"> The AutofillContainer name</param>
/// 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 AutofillContainer(string name) : this(Interop.AutofillContainer.AutofillContainer_New( name ), true)
+ public AutofillContainer(string name) : this(Interop.AutofillContainer.AutofillContainer_New(name), true)
{
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
namespace Tizen.NUI.BaseComponents
{
- #if (NUI_DEBUG_ON)
+#if (NUI_DEBUG_ON)
using tlog = Tizen.Log;
- #endif
+#endif
/// <summary>
/// AnimatedVectorImageView is a class for displaying a vector resource.
{
return ReferenceEquals(lhs, rhs) ? Normal : lhs;
}
-
+
var rest = lhs.stateList.Except(rhs.stateList);
if (rest.Count() == 0)
{
var imageView = (ImageView)bindable;
string ret = "";
-
+
PropertyMap imageMap = new PropertyMap();
Tizen.NUI.Object.GetProperty(imageView.swigCPtr, ImageView.Property.IMAGE).Get(imageMap);
imageMap.Find(ImageVisualProperty.URL)?.Get(out ret);
public static readonly BindableProperty BorderProperty = BindableProperty.Create(nameof(Border), typeof(Rectangle), typeof(ImageView), null, propertyChanged: (bindable, oldValue, newValue) =>
{
var imageView = (ImageView)bindable;
- if(newValue != null)
+ if (newValue != null)
{
imageView._border = new Rectangle((Rectangle)newValue);
imageView.UpdateImage(NpatchImageVisualProperty.Border, new PropertyValue(imageView._border));
var imageView = (ImageView)bindable;
if (newValue != null)
{
- imageView._synchronosLoading = (bool) newValue;
+ imageView._synchronosLoading = (bool)newValue;
imageView.UpdateImage(NpatchImageVisualProperty.SynchronousLoading, new PropertyValue((bool)newValue));
}
},
defaultValueCreator: (bindable) =>
{
var imageView = (ImageView)bindable;
-
+
bool ret = false;
PropertyMap imageMap = new PropertyMap();
Tizen.NUI.Object.GetProperty(imageView.swigCPtr, ImageView.Property.IMAGE).Get(imageMap);
{
SetValue(ResourceUrlProperty, value);
resourceUrlSelector.UpdateIfNeeds(this, value);
- NotifyPropertyChanged();
+ NotifyPropertyChanged();
}
}
/// <since_tizen> 3 </since_tizen>
public void SetImage(string url)
{
- if(url.Contains(".json"))
+ if (url.Contains(".json"))
{
Tizen.Log.Fatal("NUI", "[ERROR] Please DO NOT set lottie file in ImageView! This is temporary checking, will be removed soon!");
return;
internal VisualFittingModeType CovertFittingModetoVisualFittingMode(FittingModeType value)
{
- switch(value)
+ switch (value)
{
case FittingModeType.ShrinkToFit:
return VisualFittingModeType.FitKeepAspectRatio;
internal FittingModeType ConvertVisualFittingModetoFittingMode(VisualFittingModeType value)
{
- switch(value)
+ switch (value)
{
case VisualFittingModeType.FitKeepAspectRatio:
return FittingModeType.ShrinkToFit;
set
{
VisualFittingModeType ret = CovertFittingModetoVisualFittingMode(value);
- UpdateImage(Visual.Property.VisualFittingMode, new PropertyValue((int) ret));
+ UpdateImage(Visual.Property.VisualFittingMode, new PropertyValue((int)ret));
}
}
UpdateImage(ImageVisualProperty.ReleasePolicy, new PropertyValue((int)value));
}
}
-
+
/// <summary>
/// Gets or sets the wrap mode for the u coordinate.<br />
/// It decides how the texture should be sampled when the u coordinate exceeds the range of 0.0 to 1.0.<br />
internal void SetImage(string url, Uint16Pair size)
{
- if(url.Contains(".json"))
+ if (url.Contains(".json"))
{
Tizen.Log.Fatal("NUI", "[ERROR] Please DO NOT set lottie file in ImageView! This is temporary checking, will be removed soon!");
return;
Interop.ImageView.ImageView_SetImage__SWIG_2(swigCPtr, url, Uint16Pair.getCPtr(size));
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-
+
ResourceUrl = url;
}
PropertyMap imageMap = new PropertyMap();
Tizen.NUI.Object.GetProperty(swigCPtr, ImageView.Property.IMAGE).Get(imageMap);
imageMap.Merge(fromMap);
-
+
SetProperty(ImageView.Property.IMAGE, new PropertyValue(imageMap));
}
-
+
private void UpdateImage(int key, PropertyValue value)
{
PropertyMap temp = new PropertyMap();
- if(_alphaMaskUrl != null)
+ if (_alphaMaskUrl != null)
{
temp.Insert(ImageVisualProperty.AlphaMaskURL, new PropertyValue(_alphaMaskUrl));
}
}
// Do Fitting Buffer when desired dimension is set
- if( _desired_width != -1 && _desired_height != -1)
+ if (_desired_width != -1 && _desired_height != -1)
{
- if(_resourceUrl != null)
+ if (_resourceUrl != null)
{
- Size2D imageSize = ImageLoading.GetOriginalImageSize(_resourceUrl);
-
- int ret_width,ret_height;
- if( imageSize.Width > imageSize.Height)
- {
- ret_width = _desired_width;
- ret_height = imageSize.Height * _desired_height /(imageSize.Width);
- }
- else
- {
- ret_width = imageSize.Width*_desired_width/(imageSize.Height);
- ret_height = _desired_height;
-
- }
- temp.Insert(ImageVisualProperty.DesiredWidth, new PropertyValue((int)ret_width));
- temp.Insert(ImageVisualProperty.DesiredHeight, new PropertyValue((int)ret_height));
- temp.Insert(ImageVisualProperty.FittingMode, new PropertyValue((int) FittingModeType.ShrinkToFit));
+ Size2D imageSize = ImageLoading.GetOriginalImageSize(_resourceUrl);
+
+ int ret_width, ret_height;
+ if (imageSize.Width > imageSize.Height)
+ {
+ ret_width = _desired_width;
+ ret_height = imageSize.Height * _desired_height / (imageSize.Width);
+ }
+ else
+ {
+ ret_width = imageSize.Width * _desired_width / (imageSize.Height);
+ ret_height = _desired_height;
+
+ }
+ temp.Insert(ImageVisualProperty.DesiredWidth, new PropertyValue((int)ret_width));
+ temp.Insert(ImageVisualProperty.DesiredHeight, new PropertyValue((int)ret_height));
+ temp.Insert(ImageVisualProperty.FittingMode, new PropertyValue((int)FittingModeType.ShrinkToFit));
}
}
namespace Tizen.NUI.BaseComponents
{
- #if (NUI_DEBUG_ON)
+#if (NUI_DEBUG_ON)
using tlog = Tizen.Log;
- #endif
+#endif
/// <summary>
/// LottieAnimationView renders an animated vector image (Lottie file).
private bool BeReadyToShow(LottieAnimationView lottieView)
{
// Validate input lottieView
- if (null== lottieView || lottieView.PlayState == LottieAnimationView.PlayStateType.Invalid)
+ if (null == lottieView || lottieView.PlayState == LottieAnimationView.PlayStateType.Invalid)
{
return false;
}
// To prevent a state from having multiple values, remove existing state-value pair.
int index = ((List<StateValuePair<T>>)StateValueList).FindIndex(x => x.State == stateValuePair.State);
if (index != -1)
- StateValueList.RemoveAt(index);
+ StateValueList.RemoveAt(index);
StateValueList.Add(stateValuePair);
}
private Selector<Rectangle> backgroundImageBorderSelector;
private Selector<Color> colorSelector;
- static ViewStyle() {}
+ static ViewStyle() { }
/// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
{
if (view == null) return;
- BindableProperty.GetBindablePropertysOfType(GetType(), out var styleProperties);
+ BindableProperty.GetBindablePropertysOfType(GetType(), out var styleProperties);
BindableProperty.GetBindablePropertysOfType(view.GetType(), out var viewProperties);
-
+
if (styleProperties == null || viewProperties == null) return;
public static readonly BindableProperty BackgroundColorSelectorProperty = BindableProperty.Create("BackgroundColorSelector", typeof(Selector<Color>), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
{
var viewStyle = (ViewStyle)bindable;
-
+
if (newValue == null)
{
viewStyle.backgroundColorSelector = null;
viewStyle.backgroundColorSelector = ((Selector<Color>)newValue).Clone();
viewStyle.backgroundImageSelector = null;
}
-
+
},
defaultValueCreator: (bindable) =>
{
if (this.HasBody())
{
- if(_textEditorTextChangedCallbackDelegate != null)
+ if (_textEditorTextChangedCallbackDelegate != null)
{
TextChangedSignal().Disconnect(_textEditorTextChangedCallbackDelegate);
}
- if(_textEditorMaxLengthReachedCallbackDelegate != null)
+ if (_textEditorMaxLengthReachedCallbackDelegate != null)
{
this.MaxLengthReachedSignal().Disconnect(_textEditorMaxLengthReachedCallbackDelegate);
}
Text = NUIApplication.MultilingualResourceManager?.GetString(textLabelSid, new CultureInfo(e.Value.Replace("_", "-")));
}
- private void NotifyPropertyChangedAndRequestLayout()
+ private void NotifyPropertyChangedAndRequestLayout()
{
NotifyPropertyChanged();
Layout?.RequestLayout();
set
{
string alignment = "begin";
- switch(value)
+ switch (value)
{
- case HorizontalAlignment.Begin: {
- alignment = "begin";
- break;
- }
- case HorizontalAlignment.Center: {
- alignment = "center";
- break;
- }
- case HorizontalAlignment.End: {
- alignment = "end";
- break;
- }
- default : {
- break;
- }
+ case HorizontalAlignment.Begin:
+ {
+ alignment = "begin";
+ break;
+ }
+ case HorizontalAlignment.Center:
+ {
+ alignment = "center";
+ break;
+ }
+ case HorizontalAlignment.End:
+ {
+ alignment = "end";
+ break;
+ }
+ default:
+ {
+ break;
+ }
}
Interop.RendererParameters.RendererParameters_horizontalAlignment_set(swigCPtr, alignment);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
string ret = Interop.RendererParameters.RendererParameters_horizontalAlignment_get(swigCPtr);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
HorizontalAlignment alignment = HorizontalAlignment.Begin;
- switch(ret)
+ switch (ret)
{
- case "begin": {
- alignment = HorizontalAlignment.Begin;
- break;
- }
- case "center": {
- alignment = HorizontalAlignment.Center;
- break;
- }
- case "end": {
- alignment = HorizontalAlignment.End;
- break;
- }
- default : {
- break;
- }
+ case "begin":
+ {
+ alignment = HorizontalAlignment.Begin;
+ break;
+ }
+ case "center":
+ {
+ alignment = HorizontalAlignment.Center;
+ break;
+ }
+ case "end":
+ {
+ alignment = HorizontalAlignment.End;
+ break;
+ }
+ default:
+ {
+ break;
+ }
}
return alignment;
}
set
{
string alignment = "top";
- switch(value)
+ switch (value)
{
- case VerticalAlignment.Top: {
- alignment = "top";
- break;
- }
- case VerticalAlignment.Center: {
- alignment = "center";
- break;
- }
- case VerticalAlignment.Bottom: {
- alignment = "bottom";
- break;
- }
- default : {
- break;
- }
+ case VerticalAlignment.Top:
+ {
+ alignment = "top";
+ break;
+ }
+ case VerticalAlignment.Center:
+ {
+ alignment = "center";
+ break;
+ }
+ case VerticalAlignment.Bottom:
+ {
+ alignment = "bottom";
+ break;
+ }
+ default:
+ {
+ break;
+ }
}
Interop.RendererParameters.RendererParameters_verticalAlignment_set(swigCPtr, alignment);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
string ret = Interop.RendererParameters.RendererParameters_verticalAlignment_get(swigCPtr);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
VerticalAlignment alignment = VerticalAlignment.Top;
- switch(ret)
+ switch (ret)
{
- case "top": {
- alignment = VerticalAlignment.Top;
- break;
- }
- case "center": {
- alignment = VerticalAlignment.Center;
- break;
- }
- case "bottom": {
- alignment = VerticalAlignment.Bottom;
- break;
- }
- default : {
- break;
- }
+ case "top":
+ {
+ alignment = VerticalAlignment.Top;
+ break;
+ }
+ case "center":
+ {
+ alignment = VerticalAlignment.Center;
+ break;
+ }
+ case "bottom":
+ {
+ alignment = VerticalAlignment.Bottom;
+ break;
+ }
+ default:
+ {
+ break;
+ }
}
return alignment;
}
set
{
string textLayout = "singleLine";
- switch(value)
+ switch (value)
{
- case TextLayout.SingleLine: {
- textLayout = "singleLine";
- break;
- }
- case TextLayout.MultiLine: {
- textLayout = "multiLine";
- break;
- }
- case TextLayout.Circular: {
- textLayout = "circular";
- break;
- }
- default : {
- break;
- }
+ case TextLayout.SingleLine:
+ {
+ textLayout = "singleLine";
+ break;
+ }
+ case TextLayout.MultiLine:
+ {
+ textLayout = "multiLine";
+ break;
+ }
+ case TextLayout.Circular:
+ {
+ textLayout = "circular";
+ break;
+ }
+ default:
+ {
+ break;
+ }
}
Interop.RendererParameters.RendererParameters_layout_set(swigCPtr, textLayout);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
string ret = Interop.RendererParameters.RendererParameters_layout_get(swigCPtr);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
TextLayout textLayout = TextLayout.SingleLine;
- switch(ret)
+ switch (ret)
{
- case "singleLine": {
- textLayout = TextLayout.SingleLine;
- break;
- }
- case "multiLine": {
- textLayout = TextLayout.MultiLine;
- break;
- }
- case "circular": {
- textLayout = TextLayout.Circular;
- break;
- }
- default : {
- break;
- }
+ case "singleLine":
+ {
+ textLayout = TextLayout.SingleLine;
+ break;
+ }
+ case "multiLine":
+ {
+ textLayout = TextLayout.MultiLine;
+ break;
+ }
+ case "circular":
+ {
+ textLayout = TextLayout.Circular;
+ break;
+ }
+ default:
+ {
+ break;
+ }
}
return textLayout;
}
set
{
string alignment = "begin";
- switch(value)
+ switch (value)
{
- case CircularAlignment.Begin: {
- alignment = "begin";
- break;
- }
- case CircularAlignment.Center: {
- alignment = "center";
- break;
- }
- case CircularAlignment.End: {
- alignment = "end";
- break;
- }
- default : {
- break;
- }
+ case CircularAlignment.Begin:
+ {
+ alignment = "begin";
+ break;
+ }
+ case CircularAlignment.Center:
+ {
+ alignment = "center";
+ break;
+ }
+ case CircularAlignment.End:
+ {
+ alignment = "end";
+ break;
+ }
+ default:
+ {
+ break;
+ }
}
Interop.RendererParameters.RendererParameters_circularAlignment_set(swigCPtr, alignment);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
string ret = Interop.RendererParameters.RendererParameters_circularAlignment_get(swigCPtr);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
CircularAlignment alignment = CircularAlignment.Begin;
- switch(ret)
+ switch (ret)
{
- case "begin": {
- alignment = CircularAlignment.Begin;
- break;
- }
- case "center": {
- alignment = CircularAlignment.Center;
- break;
- }
- case "end": {
- alignment = CircularAlignment.End;
- break;
- }
- default : {
- break;
- }
+ case "begin":
+ {
+ alignment = CircularAlignment.Begin;
+ break;
+ }
+ case "center":
+ {
+ alignment = CircularAlignment.Center;
+ break;
+ }
+ case "end":
+ {
+ alignment = CircularAlignment.End;
+ break;
+ }
+ default:
+ {
+ break;
+ }
}
return alignment;
}
PixelBuffer ret = new PixelBuffer(Interop.TextUtils.TextUtils_Render(RendererParameters.getCPtr(textParameters), ref returnItem, ref count, ref length), true);
embeddedItemLayout = new EmbeddedItemInfo[count];
- for(int i=0; i< count; i++) {
+ for (int i = 0; i < count; i++)
+ {
IntPtr p = new IntPtr((returnItem.ToInt32() + i * length));
embeddedItemLayout[i] = new EmbeddedItemInfo(p, false);
}
[EditorBrowsable(EditorBrowsableState.Never)]
public SafeNativePlayerHandle(VideoView videoView) : base(global::System.IntPtr.Zero, false)
{
- if(videoView != null)
+ if (videoView != null)
{
SetHandle(videoView.GetNativePlayerHandle());
}
/// </summary>
/// 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 static bool layoutingDisabled{get; set;} = true;
+ public static bool layoutingDisabled { get; set; } = true;
private LayoutItem _layout; // Exclusive layout assigned to this View.
internal Size2D sizeSetExplicitly = new Size2D(); // Store size set by API, will be used in place of NaturalSize if not set.
internal BackgroundExtraData backgroundExtraData;
- static View() {}
+ static View() { }
/// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
internal View(View uiControl, bool shown = true) : this(Interop.View.new_View__SWIG_1(View.getCPtr(uiControl)), true)
{
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- if(!shown)
+ if (!shown)
{
SetVisible(false);
}
set
{
excludeLayouting = value;
- if(Layout != null && Layout.SetPositionByLayout != value)
+ if (Layout != null && Layout.SetPositionByLayout != value)
{
Layout.SetPositionByLayout = value;
Layout.RequestLayout();
// If View stores the Margin too then the Legacy Size Negotiation will
// overwrite the position and size values measured in the Layouting.
Layout.Margin = value;
- SetValue(MarginProperty, new Extents(0,0,0,0));
+ SetValue(MarginProperty, new Extents(0, 0, 0, 0));
_layout?.RequestLayout();
}
else
set
{
_widthPolicy = value;
- if( _oldWidthPolicy != _widthPolicy )
+ if (_oldWidthPolicy != _widthPolicy)
{
if (_widthPolicy >= 0)
{
- _measureSpecificationWidth = new MeasureSpecification( new LayoutLength(value), MeasureSpecification.ModeType.Exactly );
+ _measureSpecificationWidth = new MeasureSpecification(new LayoutLength(value), MeasureSpecification.ModeType.Exactly);
- if(_heightPolicy>=0) // Policy an exact value
+ if (_heightPolicy >= 0) // Policy an exact value
{
// Create Size2D only both _widthPolicy and _heightPolicy are set.
- Size2D = new Size2D(_widthPolicy,_heightPolicy);
+ Size2D = new Size2D(_widthPolicy, _heightPolicy);
}
}
_layout?.RequestLayout();
set
{
_heightPolicy = value;
- if( _oldHeightPolicy != _heightPolicy )
+ if (_oldHeightPolicy != _heightPolicy)
{
if (_heightPolicy >= 0)
{
- _measureSpecificationHeight = new MeasureSpecification( new LayoutLength(value), MeasureSpecification.ModeType.Exactly );
+ _measureSpecificationHeight = new MeasureSpecification(new LayoutLength(value), MeasureSpecification.ModeType.Exactly);
- if(_widthPolicy>=0) // Policy an exact value
+ if (_widthPolicy >= 0) // Policy an exact value
{
// Create Size2D only both _widthPolicy and _heightPolicy are set.
- Size2D = new Size2D(_widthPolicy,_heightPolicy);
+ Size2D = new Size2D(_widthPolicy, _heightPolicy);
}
}
{
_layoutTransitions = new Dictionary<TransitionCondition, TransitionList>();
}
- LayoutTransitionsHelper.AddTransitionForCondition(_layoutTransitions,value.Condition,value, true);
+ LayoutTransitionsHelper.AddTransitionForCondition(_layoutTransitions, value.Condition, value, true);
AttachTransitionsToChildren(value);
}
// Copy Margin and Padding to new layout being set or restore padding and margin back to
// View if no replacement. Previously margin and padding values would have been moved from
// the View to the layout.
- if (_layout != null ) // Existing layout
+ if (_layout != null) // Existing layout
{
if (value != null)
{
}
else
{
- // Layout not being replaced so restore margin and padding to View.
- SetValue(MarginProperty, _layout.Margin);
- SetValue(PaddingProperty, _layout.Padding);
- NotifyPropertyChanged();
+ // Layout not being replaced so restore margin and padding to View.
+ SetValue(MarginProperty, _layout.Margin);
+ SetValue(PaddingProperty, _layout.Padding);
+ NotifyPropertyChanged();
}
}
else
// First Layout to be added to the View hence copy
// Do not try to set Margins or Padding on a null Layout (when a layout is being removed from a View)
- if (value !=null)
+ if (value != null)
{
- if (Margin.Top != 0 || Margin.Bottom !=0 || Margin.Start !=0 || Margin.End != 0)
+ if (Margin.Top != 0 || Margin.Bottom != 0 || Margin.Start != 0 || Margin.End != 0)
{
// If View already has a margin set then store it in Layout instead.
value.Margin = Margin;
- SetValue(MarginProperty, new Extents(0,0,0,0));
+ SetValue(MarginProperty, new Extents(0, 0, 0, 0));
NotifyPropertyChanged();
}
- if (Padding.Top != 0 || Padding.Bottom !=0 || Padding.Start !=0 || Padding.End != 0)
+ if (Padding.Top != 0 || Padding.Bottom != 0 || Padding.Start != 0 || Padding.End != 0)
{
// If View already has a padding set then store it in Layout instead.
value.Padding = Padding;
- SetValue(PaddingProperty, new Extents(0,0,0,0));
+ SetValue(PaddingProperty, new Extents(0, 0, 0, 0));
NotifyPropertyChanged();
}
}
}
}
- /// <summary>
+ /// <summary>
/// Whether the actor grab all touches even if touch leaves its boundary.
/// </summary>
/// <returns>true, if it grab all touch after start</returns>
/// <summary>
/// Constant which indicates child size should match parent size
/// </summary>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
+ /// 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 const int MatchParent = -1;
/// <summary>
/// Constant which indicates parent should take the smallest size possible to wrap it's children with their desired size
/// This prevents the parent from interceping touch.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
- public bool DisallowInterceptTouchEvent {get; set;}
+ public bool DisallowInterceptTouchEvent { get; set; }
/// <summary>
[EditorBrowsable(EditorBrowsableState.Never)]
internal void EmitBackKeyPressed()
{
- _backKeyPressed.Invoke(this,null);
+ _backKeyPressed.Invoke(this, null);
}
private EventHandlerWithReturnType<object, WheelEventArgs, bool> WindowWheelEventHandler;
private void OnWindowWheelEvent(object sender, Window.WheelEventArgs e)
{
- if(e != null)
+ if (e != null)
{
- if(e.Wheel.Type == Wheel.WheelType.CustomWheel)
+ if (e.Wheel.Type == Wheel.WheelType.CustomWheel)
{
var arg = new WheelEventArgs()
{
[EditorBrowsable(EditorBrowsableState.Never)]
protected virtual bool HandleControlStateOnTouch(Touch touch)
{
- switch(touch.GetState(0))
+ switch (touch.GetState(0))
{
case PointStateType.Down:
ControlState += ControlState.Pressed;
// If child already has a parent then re-parent child
if (oldParent != null)
{
- if (child.Layout !=null)
+ if (child.Layout != null)
{
child.Layout.SetReplaceFlag();
}
parentChildren.Add(this);
LayoutGroup layout = Layout as LayoutGroup;
- layout?.ChangeLayoutSiblingOrder(parentChildren.Count-1);
+ layout?.ChangeLayoutSiblingOrder(parentChildren.Count - 1);
Interop.NDalic.RaiseToTop(swigCPtr);
if (NDalicPINVOKE.SWIGPendingException.Pending)
[EditorBrowsable(EditorBrowsableState.Never)]
public void ObjectDump()
{
- if ( 0== Children.Count)
+ if (0 == Children.Count)
{
Type type = this.GetType();
PropertyInfo[] properties = type.GetProperties(BindingFlags.Public | BindingFlags.Instance);
- foreach(var property in properties)
+ foreach (var property in properties)
{
if (null != property && property.CanRead)
{
/// </summary>
internal class ViewSelectorData
{
- public TriggerableSelector<Color> BackgroundColor { get; } = new TriggerableSelector<Color>(View.BackgroundColorProperty, delegate(View view)
+ public TriggerableSelector<Color> BackgroundColor { get; } = new TriggerableSelector<Color>(View.BackgroundColorProperty, delegate (View view)
{
var background = view.Background;
int visualType = 0;
}
return null;
});
- public TriggerableSelector<string> BackgroundImage { get; } = new TriggerableSelector<string>(View.BackgroundImageProperty, delegate(View view)
+ public TriggerableSelector<string> BackgroundImage { get; } = new TriggerableSelector<string>(View.BackgroundImageProperty, delegate (View view)
{
string backgroundImage = null;
view.Background.Find(ImageVisualProperty.URL)?.Get(out backgroundImage);
return backgroundImage;
});
public TriggerableSelector<Rectangle> BackgroundImageBorder { get; } = new TriggerableSelector<Rectangle>(View.BackgroundImageBorderProperty);
- public TriggerableSelector<Color> Color { get; } = new TriggerableSelector<Color>(View.ColorProperty, delegate(View view)
+ public TriggerableSelector<Color> Color { get; } = new TriggerableSelector<Color>(View.ColorProperty, delegate (View view)
{
Color color = new Color();
if (view.GetProperty(Interop.ActorProperty.ActorPropertyColorGet()).Get(color))
Registry.Unregister(this);
}
- if(swigCPtr.Handle != IntPtr.Zero)
+ if (swigCPtr.Handle != IntPtr.Zero)
{
if (swigCMemOwn)
{
namespace Tizen.NUI.Events
{
- /// <summary>
- /// This is a class for detects various gestures.
- /// </summary>
- [EditorBrowsable(EditorBrowsableState.Never)]
- public class GestureDetectorManager : Disposable
- {
/// <summary>
- /// This class is used to create a subset of the gestures you only want.
- /// You can inherit this class and implement the callback for gestures what you want to use.
+ /// This is a class for detects various gestures.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
- public class GestureListener
+ public class GestureDetectorManager : Disposable
{
- /// <summary>
- /// TapGestureDetector event callback.
- /// </summary>
- [EditorBrowsable(EditorBrowsableState.Never)]
- public virtual void OnTap(object sender, TapGestureDetector.DetectedEventArgs e, object userData)
- {
- }
-
- /// <summary>
- /// LongPressGestureDetector event callback.
- /// </summary>
- [EditorBrowsable(EditorBrowsableState.Never)]
- public virtual void OnLongPress(object sender, LongPressGestureDetector.DetectedEventArgs e, object userData)
- {
- }
-
- /// <summary>
- /// PanGestureDetector event callback.
- /// </summary>
- [EditorBrowsable(EditorBrowsableState.Never)]
- public virtual void OnPan(object sender, PanGestureDetector.DetectedEventArgs e, object userData)
- {
- }
-
- /// <summary>
- /// PinchGestureDetector event callback.
- /// </summary>
- [EditorBrowsable(EditorBrowsableState.Never)]
- public virtual void OnPinch(object sender, PinchGestureDetector.DetectedEventArgs e, object userData)
- {
- }
+ /// <summary>
+ /// This class is used to create a subset of the gestures you only want.
+ /// You can inherit this class and implement the callback for gestures what you want to use.
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public class GestureListener
+ {
+ /// <summary>
+ /// TapGestureDetector event callback.
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public virtual void OnTap(object sender, TapGestureDetector.DetectedEventArgs e, object userData)
+ {
+ }
+
+ /// <summary>
+ /// LongPressGestureDetector event callback.
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public virtual void OnLongPress(object sender, LongPressGestureDetector.DetectedEventArgs e, object userData)
+ {
+ }
+
+ /// <summary>
+ /// PanGestureDetector event callback.
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public virtual void OnPan(object sender, PanGestureDetector.DetectedEventArgs e, object userData)
+ {
+ }
+
+ /// <summary>
+ /// PinchGestureDetector event callback.
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public virtual void OnPinch(object sender, PinchGestureDetector.DetectedEventArgs e, object userData)
+ {
+ }
+ }
+
+ private GestureListener mListener;
+ private TapGestureDetector mTapGestureDetector;
+ private LongPressGestureDetector mLongGestureDetector;
+ private PinchGestureDetector mPinchGestureDetector;
+ private PanGestureDetector mPanGestureDetector;
+ private object mUserData;
+
+ /// <summary>
+ /// Creates a GestureDetectorManager with the user listener.
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public GestureDetectorManager(View view, GestureListener listener)
+ {
+ if (view == null)
+ {
+ throw new global::System.ArgumentNullException(nameof(view));
+ }
+ if (listener == null)
+ {
+ throw new global::System.ArgumentNullException(nameof(listener));
+ }
+
+ mListener = listener;
+ view.GrabTouchAfterLeave = true;
+ init(view);
+ }
+
+ private void init(View view)
+ {
+ mTapGestureDetector = new TapGestureDetector();
+ mLongGestureDetector = new LongPressGestureDetector();
+ mPanGestureDetector = new PanGestureDetector();
+ mPinchGestureDetector = new PinchGestureDetector();
+
+ mTapGestureDetector.Attach(view);
+ mLongGestureDetector.Attach(view);
+ mPanGestureDetector.Attach(view);
+ mPinchGestureDetector.Attach(view);
+ }
+
+ private void InternalOnTap(object sender, TapGestureDetector.DetectedEventArgs e)
+ {
+ mListener.OnTap(sender, e, mUserData);
+ mTapGestureDetector.Detected -= InternalOnTap;
+ }
+
+ private void InternalOnLongPress(object sender, LongPressGestureDetector.DetectedEventArgs e)
+ {
+ mListener.OnLongPress(sender, e, mUserData);
+ mLongGestureDetector.Detected -= InternalOnLongPress;
+ }
+
+ private void InternalOnPan(object sender, PanGestureDetector.DetectedEventArgs e)
+ {
+ mListener.OnPan(sender, e, mUserData);
+ mPanGestureDetector.Detected -= InternalOnPan;
+ }
+
+ private void InternalOnPinch(object sender, PinchGestureDetector.DetectedEventArgs e)
+ {
+ mListener.OnPinch(sender, e, mUserData);
+ mPinchGestureDetector.Detected -= InternalOnPinch;
+ }
+
+ /// <summary>
+ /// Gestures also work only when there is a touch event.
+ /// </summary>
+ /// <param name="sender">The actor who delivered the touch event.</param>
+ /// <param name="e">The TouchEventArgs</param>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public void FeedTouchEvent(object sender, View.TouchEventArgs e)
+ {
+ FeedTouchEvent(sender, e, null);
+ }
+
+ /// <summary>
+ /// Gestures also work only when there is a touch event.
+ /// </summary>
+ /// <param name="sender">The actor who delivered the touch event.</param>
+ /// <param name="e">The TouchEventArgs</param>
+ /// <param name="userData">The user data object</param>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public void FeedTouchEvent(object sender, View.TouchEventArgs e, object userData)
+ {
+ mUserData = userData;
+ mTapGestureDetector.Detected -= InternalOnTap;
+ mLongGestureDetector.Detected -= InternalOnLongPress;
+ mPanGestureDetector.Detected -= InternalOnPan;
+ mPinchGestureDetector.Detected -= InternalOnPinch;
+
+ if (e != null &&
+ (e.Touch.GetState(0) != PointStateType.Finished ||
+ e.Touch.GetState(0) != PointStateType.Up ||
+ e.Touch.GetState(0) != PointStateType.Interrupted))
+ {
+ mTapGestureDetector.Detected += InternalOnTap;
+ mLongGestureDetector.Detected += InternalOnLongPress;
+ mPanGestureDetector.Detected += InternalOnPan;
+ mPinchGestureDetector.Detected += InternalOnPinch;
+ }
+ }
}
-
- private GestureListener mListener;
- private TapGestureDetector mTapGestureDetector;
- private LongPressGestureDetector mLongGestureDetector;
- private PinchGestureDetector mPinchGestureDetector;
- private PanGestureDetector mPanGestureDetector;
- private object mUserData;
-
- /// <summary>
- /// Creates a GestureDetectorManager with the user listener.
- /// </summary>
- [EditorBrowsable(EditorBrowsableState.Never)]
- public GestureDetectorManager(View view, GestureListener listener)
- {
- if(view == null)
- {
- throw new global::System.ArgumentNullException(nameof(view));
- }
- if(listener == null)
- {
- throw new global::System.ArgumentNullException(nameof(listener));
- }
-
- mListener = listener;
- view.GrabTouchAfterLeave = true;
- init(view);
- }
-
- private void init(View view)
- {
- mTapGestureDetector = new TapGestureDetector();
- mLongGestureDetector = new LongPressGestureDetector();
- mPanGestureDetector = new PanGestureDetector();
- mPinchGestureDetector = new PinchGestureDetector();
-
- mTapGestureDetector.Attach(view);
- mLongGestureDetector.Attach(view);
- mPanGestureDetector.Attach(view);
- mPinchGestureDetector.Attach(view);
- }
-
- private void InternalOnTap(object sender, TapGestureDetector.DetectedEventArgs e)
- {
- mListener.OnTap(sender, e, mUserData);
- mTapGestureDetector.Detected -= InternalOnTap;
- }
-
- private void InternalOnLongPress(object sender, LongPressGestureDetector.DetectedEventArgs e)
- {
- mListener.OnLongPress(sender, e, mUserData);
- mLongGestureDetector.Detected -= InternalOnLongPress;
- }
-
- private void InternalOnPan(object sender, PanGestureDetector.DetectedEventArgs e)
- {
- mListener.OnPan(sender, e, mUserData);
- mPanGestureDetector.Detected -= InternalOnPan;
- }
-
- private void InternalOnPinch(object sender, PinchGestureDetector.DetectedEventArgs e)
- {
- mListener.OnPinch(sender, e, mUserData);
- mPinchGestureDetector.Detected -= InternalOnPinch;
- }
-
- /// <summary>
- /// Gestures also work only when there is a touch event.
- /// </summary>
- /// <param name="sender">The actor who delivered the touch event.</param>
- /// <param name="e">The TouchEventArgs</param>
- [EditorBrowsable(EditorBrowsableState.Never)]
- public void FeedTouchEvent(object sender, View.TouchEventArgs e)
- {
- FeedTouchEvent(sender, e, null);
- }
-
- /// <summary>
- /// Gestures also work only when there is a touch event.
- /// </summary>
- /// <param name="sender">The actor who delivered the touch event.</param>
- /// <param name="e">The TouchEventArgs</param>
- /// <param name="userData">The user data object</param>
- [EditorBrowsable(EditorBrowsableState.Never)]
- public void FeedTouchEvent(object sender, View.TouchEventArgs e, object userData)
- {
- mUserData = userData;
- mTapGestureDetector.Detected -= InternalOnTap;
- mLongGestureDetector.Detected -= InternalOnLongPress;
- mPanGestureDetector.Detected -= InternalOnPan;
- mPinchGestureDetector.Detected -= InternalOnPinch;
-
- if(e != null &&
- (e.Touch.GetState(0) != PointStateType.Finished ||
- e.Touch.GetState(0) != PointStateType.Up ||
- e.Touch.GetState(0) != PointStateType.Interrupted))
- {
- mTapGestureDetector.Detected += InternalOnTap;
- mLongGestureDetector.Detected += InternalOnLongPress;
- mPanGestureDetector.Detected += InternalOnPan;
- mPinchGestureDetector.Detected += InternalOnPinch;
- }
- }
- }
}
/// <since_tizen> 3 </since_tizen>
public void SetCustomAlgorithm(ICustomFocusAlgorithm arg0)
{
- if(arg0 != null)
+ if (arg0 != null)
{
_customAlgorithmInterfaceWrapper = new CustomAlgorithmInterfaceWrapper();
_customAlgorithmInterfaceWrapper.SetFocusAlgorithm(arg0);
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;
* limitations under the License.
*
*/
-
+
using System;
using System.Collections.Generic;
using System.ComponentModel;
/// <param name="isTranslucent">Whether Window is translucent.</param>
/// <returns>A new Window.</returns>
[EditorBrowsable(EditorBrowsableState.Never)]
- public GLWindow(string name, Rectangle windowPosition = null, bool isTranslucent = false) : this(Interop.GLWindow.GlWindow_New__SWIG_1( Rectangle.getCPtr(windowPosition), name, "", isTranslucent), true)
+ public GLWindow(string name, Rectangle windowPosition = null, bool isTranslucent = false) : this(Interop.GLWindow.GlWindow_New__SWIG_1(Rectangle.getCPtr(windowPosition), name, "", isTranslucent), true)
{
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
/// <param name="msaa">The bit of msaa.</param>
/// <param name="version">The GLES version.</param>
[EditorBrowsable(EditorBrowsableState.Never)]
- public void SetEglConfig( bool depth, bool stencil, int msaa, GLESVersion version )
+ public void SetEglConfig(bool depth, bool stencil, int msaa, GLESVersion version)
{
Interop.GLWindow.GlWindow_SetEglConfig(swigCPtr, depth, stencil, msaa, (int)version);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
{
global::System.IntPtr intPtr = Interop.GLWindow.GlWindow_GetPositionSize(swigCPtr);
Rectangle val = new Rectangle(intPtr, true);
- Rectangle ret = new Rectangle(val.X, val.Y, val.Width, val.Height );
+ Rectangle ret = new Rectangle(val.X, val.Y, val.Width, val.Height);
val.Dispose();
return ret;
/// <param name="glRenderFrame">The callback function to render to the frame</param>
/// <param name="glTerminate">The callback function to clean-up application GL resource</param>
[EditorBrowsable(EditorBrowsableState.Never)]
- public void RegisterGlCallback( GLInitializeCallbackType glInit, GLRenderFrameCallbackType glRenderFrame, GLTerminateCallbackType glTerminate )
+ public void RegisterGlCallback(GLInitializeCallbackType glInit, GLRenderFrameCallbackType glRenderFrame, GLTerminateCallbackType glTerminate)
{
GLInitializeCallback = glInit;
InitHandleRef = new HandleRef(this, Marshal.GetFunctionPointerForDelegate<Delegate>(GLInitializeCallback));
public bool Visibility
{
get => _visibility;
- set {
+ set
+ {
_visibility = value;
}
}
VisibilityChangedEventHandler -= value;
if (VisibilityChangedEventHandler == null)
{
- if(_GLVisibilityChangedEventSignal != null)
+ if (_GLVisibilityChangedEventSignal != null)
{
- if(_GLVisibilityChangedEventSignal.Empty() == false)
+ if (_GLVisibilityChangedEventSignal.Empty() == false)
{
_GLVisibilityChangedEventSignal.Disconnect(_GLVisibilityChangedEventCallback);
}
[EditorBrowsable(EditorBrowsableState.Never)]
public void VisibiltyChangedSignalEmit(bool visibility)
{
- if(_GLVisibilityChangedEventSignal == null)
+ if (_GLVisibilityChangedEventSignal == null)
{
_GLVisibilityChangedEventSignal = new GLWindowVisibilityChangedEvent(this);
}
public uint AddVertexBuffer(VertexBuffer vertexBuffer)
{
uint ret = Interop.Geometry.Geometry_AddVertexBuffer(swigCPtr, VertexBuffer.getCPtr(vertexBuffer));
- if (NDalicPINVOKE.SWIGPendingException.Pending)
+ if (NDalicPINVOKE.SWIGPendingException.Pending)
throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
{
get
{
- return (NormalLayoutType) (_variation ?? 0);
+ return (NormalLayoutType)(_variation ?? 0);
}
set
{
{
get
{
- return (NumberOnlyLayoutType) (_variation ?? 0);
+ return (NumberOnlyLayoutType)(_variation ?? 0);
}
set
{
{
get
{
- return (PasswordLayoutType) (_variation ?? 0);
+ return (PasswordLayoutType)(_variation ?? 0);
}
set
{
{
child.InternalParent = this;
}
- Interop.Actor.ActorAdd( swigCPtr , View.getCPtr(child));
+ Interop.Actor.ActorAdd(swigCPtr, View.getCPtr(child));
if (NDalicPINVOKE.SWIGPendingException.Pending)
throw NDalicPINVOKE.SWIGPendingException.Retrieve();
Children.Add(child);
/// <since_tizen> 4 </since_tizen>
public override void Remove(View child)
{
- Interop.Actor.ActorRemove( swigCPtr, View.getCPtr(child));
+ Interop.Actor.ActorRemove(swigCPtr, View.getCPtr(child));
if (NDalicPINVOKE.SWIGPendingException.Pending)
throw NDalicPINVOKE.SWIGPendingException.Retrieve();
Flags = Flags | LayoutFlags.ForceLayout;
if (Parent != null)
{
- LayoutGroup layoutGroup = Parent as LayoutGroup;
+ LayoutGroup layoutGroup = Parent as LayoutGroup;
if (layoutGroup != null && !layoutGroup.LayoutRequested)
{
layoutGroup.RequestLayout();
/// <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 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, LayoutLength arg2)
{
- return new LayoutLength(arg1._value / arg2._value);
+ return new LayoutLength(arg1._value / arg2._value);
}
/// <summary>
/// Define a List of LayoutTransitions
/// </summary>
/// <since_tizen> 6 </since_tizen>
- public class TransitionList : List<LayoutTransition> {}
+ public class TransitionList : List<LayoutTransition> { }
/// <summary>
/// The conditions for transitions.
/// </summary>
/// <since_tizen> 6 </since_tizen>
- [FlagsAttribute] public enum TransitionCondition
+ [FlagsAttribute]
+ public enum TransitionCondition
{
/// <summary>
/// Default when a condition has not been set.
/// <since_tizen> 6 </since_tizen>
public LayoutTransition()
{
- Condition = TransitionCondition.Unspecified;
- AnimatableProperty = AnimatableProperties.Position;
- Animator = null;
- TargetValue = 0;
+ Condition = TransitionCondition.Unspecified;
+ AnimatableProperty = AnimatableProperties.Position;
+ Animator = null;
+ TargetValue = 0;
}
/// <summary>
/// LayoutTransition constructor.
/// <param name="targetValue">target value of the property.</param>
/// <param name="animator">Components to define the animator.</param>
/// <since_tizen> 6 </since_tizen>
- public LayoutTransition( TransitionCondition condition,
+ public LayoutTransition(TransitionCondition condition,
AnimatableProperties animatableProperty,
object targetValue,
TransitionComponents animator)
/// </summary>
/// <since_tizen> 6 </since_tizen>
- public TransitionCondition Condition{get; set;}
+ public TransitionCondition Condition { get; set; }
/// <summary>
/// Property to animate.
/// </summary>
/// <since_tizen> 6 </since_tizen>
- public AnimatableProperties AnimatableProperty{get; set;}
+ public AnimatableProperties AnimatableProperty { get; set; }
/// <summary>
/// Components of the Animator.
/// </summary>
/// <since_tizen> 6 </since_tizen>
- public TransitionComponents Animator{get; set;}
+ public TransitionComponents Animator { get; set; }
/// <summary>
/// Target value to animate to.
/// </summary>
/// <since_tizen> 6 </since_tizen>
- public object TargetValue{get; set;}
+ public object TargetValue { get; set; }
}
{
if (transitionListMatchingCondition != null)
{
- for (var index = 0; index < transitionListMatchingCondition.Count; index++ )
+ for (var index = 0; index < transitionListMatchingCondition.Count; index++)
{
if (transitionListMatchingCondition[index].AnimatableProperty == transition.AnimatableProperty)
{
static public bool GetTransitionsListForCondition(
Dictionary<TransitionCondition, TransitionList> sourceTransitionCollection,
TransitionCondition condition,
- TransitionList transitionsForCondition )
+ TransitionList transitionsForCondition)
{
TransitionCondition resolvedCondition = condition;
bool matched = false;
/// </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)
/// LayoutLength size property
/// </summary>
/// <since_tizen> 6 </since_tizen>
- public LayoutLength Size{ get; set;}
+ public LayoutLength Size { get; set; }
/// <summary>
/// Measured state for this size.
/// </summary>
/// <since_tizen> 6 </since_tizen>
- public StateType State{ get; set; }
+ public StateType State { get; set; }
/// <summary>
/// Measured states for a Size value.
/// </summary>
/// <remarks>Widget ID will be replaced as the application ID.</remarks>
/// <param name="widgetType">Derived widget class type.</param>
- public NUIWidgetApplication( System.Type widgetType ) : base(new NUIWidgetCoreBackend())
+ public NUIWidgetApplication(System.Type widgetType) : base(new NUIWidgetCoreBackend())
{
Registry.Instance.SavedApplicationThread = Thread.CurrentThread;
NUIWidgetCoreBackend core = Backend as NUIWidgetCoreBackend;
/// <param name="widgetTypes">List of derived widget class type.</param>
public NUIWidgetApplication(Dictionary<System.Type, string> widgetTypes) : base(new NUIWidgetCoreBackend())
{
- if( widgetTypes == null )
+ if (widgetTypes == null)
{
- throw new InvalidOperationException("Dictionary is null");
+ throw new InvalidOperationException("Dictionary is null");
}
else
{
/// </summary>
/// <param name="widgetType">Derived widget class type.</param>
[EditorBrowsable(EditorBrowsableState.Never)]
- public void AddWidgetType( System.Type widgetType )
+ public void AddWidgetType(System.Type widgetType)
{
NUIWidgetCoreBackend core = Backend as NUIWidgetCoreBackend;
core?.AddWidgetInfo(new Dictionary<System.Type, string> { { widgetType, ApplicationInfo.ApplicationId } });
/// </summary>
/// <param name="widgetTypes">Derived widget class type.</param>
[EditorBrowsable(EditorBrowsableState.Never)]
- public void AddWidgetType( Dictionary<System.Type, string> widgetTypes )
+ public void AddWidgetType(Dictionary<System.Type, string> widgetTypes)
{
NUIWidgetCoreBackend core = Backend as NUIWidgetCoreBackend;
core?.AddWidgetInfo(widgetTypes);
// This is also required to create DisposeQueue on main thread.
DisposeQueue disposeQ = DisposeQueue.Instance;
disposeQ.Initialize();
- Log.Fatal("NUI","OnCreate() is called!");
+ Log.Fatal("NUI", "OnCreate() is called!");
base.OnCreate();
}
}
}
[EditorBrowsable(EditorBrowsableState.Never)]
- public IntPtr AcquireBuffer(ref int width, ref int height, ref int stride) {
+ public IntPtr AcquireBuffer(ref int width, ref int height, ref int stride)
+ {
IntPtr ret = Interop.NativeImageSource.AcquireBuffer(this.swigCPtr.Handle, ref width, ref height, ref stride);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
[EditorBrowsable(EditorBrowsableState.Never)]
- public bool ReleaseBuffer() {
+ public bool ReleaseBuffer()
+ {
bool ret = Interop.NativeImageSource.ReleaseBuffer(this.swigCPtr.Handle);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
/// <since_tizen> 4 </since_tizen>
public override bool Equals(object o)
{
- if(o == null)
+ if (o == null)
{
return false;
}
- if(!(o is PaddingType))
+ if (!(o is PaddingType))
{
return false;
}
PaddingType p = (PaddingType)o;
// Return true if the fields match:
- return (System.Math.Abs(Start- p.Start) < NDalic.GetRangedEpsilon(Start, p.Start)) &&
+ return (System.Math.Abs(Start - p.Start) < NDalic.GetRangedEpsilon(Start, p.Start)) &&
(System.Math.Abs(End - p.End) < NDalic.GetRangedEpsilon(End, p.End)) &&
(System.Math.Abs(Bottom - p.Bottom) < NDalic.GetRangedEpsilon(Bottom, p.Bottom)) &&
(System.Math.Abs(Top - p.Top) < NDalic.GetRangedEpsilon(Top, p.Top));
internal new static PinchGestureDetector DownCast(BaseHandle handle)
{
- PinchGestureDetector ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as PinchGestureDetector;
+ PinchGestureDetector ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as PinchGestureDetector;
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
set
{
Tizen.Log.Fatal("NUI", "Please do not use this setter, Deprecated in API8, will be removed in API10. please use new Position(...) constructor");
-
+
Interop.Vector3.Vector3_X_set(swigCPtr, value);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
set
{
Tizen.Log.Fatal("NUI", "Please do not use this setter, Deprecated in API8, will be removed in API10. please use new Position(...) constructor");
-
+
Interop.Vector3.Vector3_Y_set(swigCPtr, value);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
set
{
Tizen.Log.Fatal("NUI", "Please do not use this setter, Deprecated in API8, will be removed in API10. please use new Position2D(...) constructor");
-
+
Interop.Vector2.Vector2_X_set(swigCPtr, (float)value);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
/// <param name="cPtr">An object of IntPtr type.</param>
/// <returns>An object of the PropertyNotification type.</returns>
/// <since_tizen> 4 </since_tizen>
- [Obsolete("Deprecated in API6, Will be removed in API9, " +
+ [Obsolete("Deprecated in API6, Will be removed in API9, " +
"Please use Notified event instead!" +
"IntPtr(native integer pointer) is supposed to be not used in Application!")]
[EditorBrowsable(EditorBrowsableState.Never)]
/// <param name="rhs">A reference to the copied handle.</param>
/// <returns>A reference to this.</returns>
/// <since_tizen> 4 </since_tizen>
- [Obsolete("Deprecated in API6, Will be removed in API9, " +
+ [Obsolete("Deprecated in API6, Will be removed in API9, " +
"Please use PropertyNotification() constructor instead!")]
[EditorBrowsable(EditorBrowsableState.Never)]
public PropertyNotification Assign(PropertyNotification rhs)
/// </summary>
/// <returns>A signal object to Connect() with</returns>
/// <since_tizen> 4 </since_tizen>
- [Obsolete("Deprecated in API6, Will be removed in API9, " +
+ [Obsolete("Deprecated in API6, Will be removed in API9, " +
"Please use Notified event instead!")]
[EditorBrowsable(EditorBrowsableState.Never)]
public PropertyNotifySignal NotifySignal()
/// Signal connection class for PropertyNotification
///</summary>
/// <since_tizen> 4 </since_tizen>
- [Obsolete("Deprecated in API6, Will be removed in API9, " +
+ [Obsolete("Deprecated in API6, Will be removed in API9, " +
"Please use PropertyNotification.Notified event instead!")]
[EditorBrowsable(EditorBrowsableState.Never)]
public class PropertyNotifySignal : Disposable
/// The constructor.
/// </summary>
/// <since_tizen> 4 </since_tizen>
- [Obsolete("Deprecated in API6, Will be removed in API9, " +
+ [Obsolete("Deprecated in API6, Will be removed in API9, " +
"Please use PropertyNotification.Notified event instead!")]
[EditorBrowsable(EditorBrowsableState.Never)]
public PropertyNotifySignal() : this(Interop.PropertyNotifySignal.new_PropertyNotifySignal(), true)
/// </summary>
/// <returns>True if there are any slots connected to the signal.</returns>
/// <since_tizen> 4 </since_tizen>
- [Obsolete("Deprecated in API6, Will be removed in API9, " +
+ [Obsolete("Deprecated in API6, Will be removed in API9, " +
"Please use PropertyNotification.Notified event instead!")]
[EditorBrowsable(EditorBrowsableState.Never)]
public bool Empty()
/// </summary>
/// <returns>The number of slots connected to this signal</returns>
/// <since_tizen> 4 </since_tizen>
- [Obsolete("Deprecated in API6, Will be removed in API9, " +
+ [Obsolete("Deprecated in API6, Will be removed in API9, " +
"Please use PropertyNotification.Notified event instead!")]
[EditorBrowsable(EditorBrowsableState.Never)]
public uint GetConnectionCount()
/// </summary>
/// <param name="func">The function to connect</param>
/// <since_tizen> 4 </since_tizen>
- [Obsolete("Deprecated in API6, Will be removed in API9, " +
+ [Obsolete("Deprecated in API6, Will be removed in API9, " +
"Please use PropertyNotification.Notified event instead!")]
[EditorBrowsable(EditorBrowsableState.Never)]
public void Connect(System.Delegate func)
/// </summary>
/// <param name="func">The function to disconnect.</param>
/// <since_tizen> 4 </since_tizen>
- [Obsolete("Deprecated in API6, Will be removed in API9, " +
+ [Obsolete("Deprecated in API6, Will be removed in API9, " +
"Please use PropertyNotification.Notified event instead!")]
[EditorBrowsable(EditorBrowsableState.Never)]
public void Disconnect(System.Delegate func)
/// </summary>
/// <param name="arg">The first value to pass to callbacks.</param>
/// <since_tizen> 4 </since_tizen>
- [Obsolete("Deprecated in API6, Will be removed in API9, " +
+ [Obsolete("Deprecated in API6, Will be removed in API9, " +
"Please use PropertyNotification.Notified event instead!")]
[EditorBrowsable(EditorBrowsableState.Never)]
public void Emit(PropertyNotification arg)
set
{
Tizen.Log.Fatal("NUI", "Please do not use this setter, Deprecated in API8, will be removed in API10. please use new Rectangle(...) constructor");
-
+
height = (value);
callback?.Invoke(X, Y, Width, Height);
/// <since_tizen> 4 </since_tizen>
public override bool Equals(object o)
{
- if(o == null)
+ if (o == null)
{
return false;
}
- if(!(o is Rectangle))
+ if (!(o is Rectangle))
{
return false;
}
set
{
Tizen.Log.Fatal("NUI", "Please do not use this setter, Deprecated in API8, will be removed in API10. please use new RelativeVector2(...) constructor");
-
+
Interop.Vector2.Vector2_Y_set(swigCPtr, value);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
set
{
Tizen.Log.Fatal("NUI", "Please do not use this setter, Deprecated in API8, will be removed in API10. please use new RelativeVector3(...) constructor");
-
+
Interop.Vector3.Vector3_Z_set(swigCPtr, value);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
set
{
Tizen.Log.Fatal("NUI", "Please do not use this setter, Deprecated in API8, will be removed in API10. please use new RelativeVector4(...) constructor");
-
+
Interop.Vector4.Vector4_W_set(swigCPtr, value);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
internal new static RotationGestureDetector DownCast(BaseHandle handle)
{
- RotationGestureDetector ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as RotationGestureDetector;
+ RotationGestureDetector ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as RotationGestureDetector;
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
set
{
Tizen.Log.Fatal("NUI", "Please do not use this setter, Deprecated in API8, will be removed in API10. please use new Size(...) constructor");
-
+
Interop.Vector3.Vector3_Depth_set(swigCPtr, value);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
{
return new Size(size2d.Width, size2d.Height, 0);
}
-
+
internal static Size GetSizeFromPtr(global::System.IntPtr cPtr)
{
private static readonly List<Theme> builtinThemes = new List<Theme>(); // Themes provided by framework.
internal static List<Theme> customThemes = new List<Theme>(); // Themes registered by user.
- static ThemeManager() {}
+ static ThemeManager() { }
/// <summary>
/// An event invoked after the theme has changed by <seealso cref="ApplyTheme(Theme)"/>.
internal static Theme CurrentTheme
{
- get => currentTheme ?? (currentTheme = DefaultTheme);
+ get => currentTheme ?? (currentTheme = DefaultTheme);
set
{
currentTheme = value;
internal uint GetInterval()
{
- if(swigCPtr.Handle == global::System.IntPtr.Zero || disposed)
+ if (swigCPtr.Handle == global::System.IntPtr.Zero || disposed)
{
NUILog.Error("[ERR] already disposed! can not get this done! just return here! please make sure that the handle gets free when using explicit Dispose()! For example, timer.Dispose(); timer = null; this must be done!");
return 0;
}
}
}
-
+
/// <summary>
/// Emits the event when the animation is started.
/// </summary>
Tizen.NUI.Object.SetProperty(button.swigCPtr, Button.Property.UNSELECTED_VISUAL, new Tizen.NUI.PropertyValue((PropertyMap)newValue));
}
},
- defaultValueCreator:(bindable) =>
- {
- var button = (Button)bindable;
- Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap();
- Tizen.NUI.Object.GetProperty(button.swigCPtr, Button.Property.UNSELECTED_VISUAL).Get(temp);
- return temp;
- });
+ defaultValueCreator: (bindable) =>
+ {
+ var button = (Button)bindable;
+ Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap();
+ Tizen.NUI.Object.GetProperty(button.swigCPtr, Button.Property.UNSELECTED_VISUAL).Get(temp);
+ return temp;
+ });
/// This will be deprecated
[Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")]
[EditorBrowsable(EditorBrowsableState.Never)]
Tizen.NUI.Object.SetProperty(button.swigCPtr, Button.Property.SELECTED_VISUAL, new Tizen.NUI.PropertyValue((PropertyMap)newValue));
}
},
- defaultValueCreator:(bindable) =>
- {
- var button = (Button)bindable;
- Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap();
- Tizen.NUI.Object.GetProperty(button.swigCPtr, Button.Property.SELECTED_VISUAL).Get(temp);
- return temp;
- });
+ defaultValueCreator: (bindable) =>
+ {
+ var button = (Button)bindable;
+ Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap();
+ Tizen.NUI.Object.GetProperty(button.swigCPtr, Button.Property.SELECTED_VISUAL).Get(temp);
+ return temp;
+ });
/// This will be deprecated
[Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")]
[EditorBrowsable(EditorBrowsableState.Never)]
Tizen.NUI.Object.SetProperty(button.swigCPtr, Button.Property.DISABLED_SELECTED_VISUAL, new Tizen.NUI.PropertyValue((PropertyMap)newValue));
}
},
- defaultValueCreator:(bindable) =>
- {
- var button = (Button)bindable;
- Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap();
- Tizen.NUI.Object.GetProperty(button.swigCPtr, Button.Property.DISABLED_SELECTED_VISUAL).Get(temp);
- return temp;
- });
+ defaultValueCreator: (bindable) =>
+ {
+ var button = (Button)bindable;
+ Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap();
+ Tizen.NUI.Object.GetProperty(button.swigCPtr, Button.Property.DISABLED_SELECTED_VISUAL).Get(temp);
+ return temp;
+ });
/// This will be deprecated
[Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")]
[EditorBrowsable(EditorBrowsableState.Never)]
Tizen.NUI.Object.SetProperty(button.swigCPtr, Button.Property.DISABLED_UNSELECTED_VISUAL, new Tizen.NUI.PropertyValue((PropertyMap)newValue));
}
},
- defaultValueCreator:(bindable) =>
- {
- var button = (Button)bindable;
- Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap();
- Tizen.NUI.Object.GetProperty(button.swigCPtr, Button.Property.DISABLED_UNSELECTED_VISUAL).Get(temp);
- return temp;
- });
+ defaultValueCreator: (bindable) =>
+ {
+ var button = (Button)bindable;
+ Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap();
+ Tizen.NUI.Object.GetProperty(button.swigCPtr, Button.Property.DISABLED_UNSELECTED_VISUAL).Get(temp);
+ return temp;
+ });
/// This will be deprecated
[Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")]
[EditorBrowsable(EditorBrowsableState.Never)]
Tizen.NUI.Object.SetProperty(button.swigCPtr, Button.Property.UNSELECTED_BACKGROUND_VISUAL, new Tizen.NUI.PropertyValue((PropertyMap)newValue));
}
},
- defaultValueCreator:(bindable) =>
- {
- var button = (Button)bindable;
- Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap();
- Tizen.NUI.Object.GetProperty(button.swigCPtr, Button.Property.UNSELECTED_BACKGROUND_VISUAL).Get(temp);
- return temp;
- });
+ defaultValueCreator: (bindable) =>
+ {
+ var button = (Button)bindable;
+ Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap();
+ Tizen.NUI.Object.GetProperty(button.swigCPtr, Button.Property.UNSELECTED_BACKGROUND_VISUAL).Get(temp);
+ return temp;
+ });
/// This will be deprecated
[Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")]
[EditorBrowsable(EditorBrowsableState.Never)]
Tizen.NUI.Object.SetProperty(button.swigCPtr, Button.Property.SELECTED_BACKGROUND_VISUAL, new Tizen.NUI.PropertyValue((PropertyMap)newValue));
}
},
- defaultValueCreator:(bindable) =>
- {
- var button = (Button)bindable;
- Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap();
- Tizen.NUI.Object.GetProperty(button.swigCPtr, Button.Property.SELECTED_BACKGROUND_VISUAL).Get(temp);
- return temp;
- });
+ defaultValueCreator: (bindable) =>
+ {
+ var button = (Button)bindable;
+ Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap();
+ Tizen.NUI.Object.GetProperty(button.swigCPtr, Button.Property.SELECTED_BACKGROUND_VISUAL).Get(temp);
+ return temp;
+ });
/// This will be deprecated
[EditorBrowsable(EditorBrowsableState.Never)]
[Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")]
Tizen.NUI.Object.SetProperty(button.swigCPtr, Button.Property.DISABLED_UNSELECTED_BACKGROUND_VISUAL, new Tizen.NUI.PropertyValue((PropertyMap)newValue));
}
},
- defaultValueCreator:(bindable) =>
- {
- var button = (Button)bindable;
- Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap();
- Tizen.NUI.Object.GetProperty(button.swigCPtr, Button.Property.DISABLED_UNSELECTED_BACKGROUND_VISUAL).Get(temp);
- return temp;
- });
+ defaultValueCreator: (bindable) =>
+ {
+ var button = (Button)bindable;
+ Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap();
+ Tizen.NUI.Object.GetProperty(button.swigCPtr, Button.Property.DISABLED_UNSELECTED_BACKGROUND_VISUAL).Get(temp);
+ return temp;
+ });
/// This will be deprecated
[Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")]
[EditorBrowsable(EditorBrowsableState.Never)]
Tizen.NUI.Object.SetProperty(button.swigCPtr, Button.Property.DISABLED_SELECTED_BACKGROUND_VISUAL, new Tizen.NUI.PropertyValue((PropertyMap)newValue));
}
},
- defaultValueCreator:(bindable) =>
- {
- var button = (Button)bindable;
- Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap();
- Tizen.NUI.Object.GetProperty(button.swigCPtr, Button.Property.DISABLED_SELECTED_BACKGROUND_VISUAL).Get(temp);
- return temp;
- });
+ defaultValueCreator: (bindable) =>
+ {
+ var button = (Button)bindable;
+ Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap();
+ Tizen.NUI.Object.GetProperty(button.swigCPtr, Button.Property.DISABLED_SELECTED_BACKGROUND_VISUAL).Get(temp);
+ return temp;
+ });
/// This will be deprecated
[Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")]
[EditorBrowsable(EditorBrowsableState.Never)]
case Align.End: { valueToString = "END"; break; }
case Align.Top: { valueToString = "TOP"; break; }
case Align.Bottom: { valueToString = "BOTTOM"; break; }
- default: { valueToString = "END"; break; }
+ default: { valueToString = "END"; break; }
}
Tizen.NUI.Object.SetProperty(button.swigCPtr, Button.Property.LABEL_RELATIVE_ALIGNMENT, new Tizen.NUI.PropertyValue(valueToString));
}
},
- defaultValueCreator:(bindable) =>
- {
- var button = (Button)bindable;
- string temp;
- if (Tizen.NUI.Object.GetProperty(button.swigCPtr, Button.Property.LABEL_RELATIVE_ALIGNMENT).Get(out temp) == false)
- {
- NUILog.Error("LabelRelativeAlignment get error!");
- }
- switch (temp)
- {
- case "BEGIN": return Align.Begin;
- case "END": return Align.End;
- case "TOP": return Align.Top;
- case "BOTTOM": return Align.Bottom;
- default: return Align.End;
- }
- });
+ defaultValueCreator: (bindable) =>
+ {
+ var button = (Button)bindable;
+ string temp;
+ if (Tizen.NUI.Object.GetProperty(button.swigCPtr, Button.Property.LABEL_RELATIVE_ALIGNMENT).Get(out temp) == false)
+ {
+ NUILog.Error("LabelRelativeAlignment get error!");
+ }
+ switch (temp)
+ {
+ case "BEGIN": return Align.Begin;
+ case "END": return Align.End;
+ case "TOP": return Align.Top;
+ case "BOTTOM": return Align.Bottom;
+ default: return Align.End;
+ }
+ });
/// This will be deprecated
[Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")]
[EditorBrowsable(EditorBrowsableState.Never)]
Tizen.NUI.Object.SetProperty(button.swigCPtr, Button.Property.LABEL_PADDING, new Tizen.NUI.PropertyValue((Vector4)newValue));
}
},
- defaultValueCreator:(bindable) =>
- {
- var button = (Button)bindable;
- Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f);
- Tizen.NUI.Object.GetProperty(button.swigCPtr, Button.Property.LABEL_PADDING).Get(temp);
- return temp;
- });
+ defaultValueCreator: (bindable) =>
+ {
+ var button = (Button)bindable;
+ Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f);
+ Tizen.NUI.Object.GetProperty(button.swigCPtr, Button.Property.LABEL_PADDING).Get(temp);
+ return temp;
+ });
/// This will be deprecated
[Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")]
[EditorBrowsable(EditorBrowsableState.Never)]
Tizen.NUI.Object.SetProperty(button.swigCPtr, Button.Property.FOREGROUND_VISUAL_PADDING, new Tizen.NUI.PropertyValue((Vector4)newValue));
}
},
- defaultValueCreator:(bindable) =>
- {
- var button = (Button)bindable;
- Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f);
- Tizen.NUI.Object.GetProperty(button.swigCPtr, Button.Property.FOREGROUND_VISUAL_PADDING).Get(temp);
- return temp;
- });
+ defaultValueCreator: (bindable) =>
+ {
+ var button = (Button)bindable;
+ Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f);
+ Tizen.NUI.Object.GetProperty(button.swigCPtr, Button.Property.FOREGROUND_VISUAL_PADDING).Get(temp);
+ return temp;
+ });
/// This will be deprecated
[Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")]
[EditorBrowsable(EditorBrowsableState.Never)]
Tizen.NUI.Object.SetProperty(button.swigCPtr, Button.Property.AUTO_REPEATING, new Tizen.NUI.PropertyValue((bool)newValue));
}
},
- defaultValueCreator:(bindable) =>
- {
- var button = (Button)bindable;
- bool temp = false;
- Tizen.NUI.Object.GetProperty(button.swigCPtr, Button.Property.AUTO_REPEATING).Get(out temp);
- return temp;
- });
+ defaultValueCreator: (bindable) =>
+ {
+ var button = (Button)bindable;
+ bool temp = false;
+ Tizen.NUI.Object.GetProperty(button.swigCPtr, Button.Property.AUTO_REPEATING).Get(out temp);
+ return temp;
+ });
/// This will be deprecated
[Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")]
[EditorBrowsable(EditorBrowsableState.Never)]
Tizen.NUI.Object.SetProperty(button.swigCPtr, Button.Property.INITIAL_AUTO_REPEATING_DELAY, new Tizen.NUI.PropertyValue((float)newValue));
}
},
- defaultValueCreator:(bindable) =>
- {
- var button = (Button)bindable;
- float temp = 0.0f;
- Tizen.NUI.Object.GetProperty(button.swigCPtr, Button.Property.INITIAL_AUTO_REPEATING_DELAY).Get(out temp);
- return temp;
- });
+ defaultValueCreator: (bindable) =>
+ {
+ var button = (Button)bindable;
+ float temp = 0.0f;
+ Tizen.NUI.Object.GetProperty(button.swigCPtr, Button.Property.INITIAL_AUTO_REPEATING_DELAY).Get(out temp);
+ return temp;
+ });
/// This will be deprecated
[Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")]
[EditorBrowsable(EditorBrowsableState.Never)]
Tizen.NUI.Object.SetProperty(button.swigCPtr, Button.Property.NEXT_AUTO_REPEATING_DELAY, new Tizen.NUI.PropertyValue((float)newValue));
}
},
- defaultValueCreator:(bindable) =>
- {
- var button = (Button)bindable;
- float temp = 0.0f;
- Tizen.NUI.Object.GetProperty(button.swigCPtr, Button.Property.NEXT_AUTO_REPEATING_DELAY).Get(out temp);
- return temp;
- });
+ defaultValueCreator: (bindable) =>
+ {
+ var button = (Button)bindable;
+ float temp = 0.0f;
+ Tizen.NUI.Object.GetProperty(button.swigCPtr, Button.Property.NEXT_AUTO_REPEATING_DELAY).Get(out temp);
+ return temp;
+ });
/// This will be deprecated
[Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")]
[EditorBrowsable(EditorBrowsableState.Never)]
Tizen.NUI.Object.SetProperty(button.swigCPtr, Button.Property.TOGGLABLE, new Tizen.NUI.PropertyValue((bool)newValue));
}
},
- defaultValueCreator:(bindable) =>
- {
- var button = (Button)bindable;
- bool temp = false;
- Tizen.NUI.Object.GetProperty(button.swigCPtr, Button.Property.TOGGLABLE).Get(out temp);
- return temp;
- });
+ defaultValueCreator: (bindable) =>
+ {
+ var button = (Button)bindable;
+ bool temp = false;
+ Tizen.NUI.Object.GetProperty(button.swigCPtr, Button.Property.TOGGLABLE).Get(out temp);
+ return temp;
+ });
/// This will be deprecated
[Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")]
[EditorBrowsable(EditorBrowsableState.Never)]
Tizen.NUI.Object.SetProperty(button.swigCPtr, Button.Property.SELECTED, new Tizen.NUI.PropertyValue((bool)newValue));
}
},
- defaultValueCreator:(bindable) =>
- {
- var button = (Button)bindable;
- bool temp = false;
- Tizen.NUI.Object.GetProperty(button.swigCPtr, Button.Property.SELECTED).Get(out temp);
- return temp;
- });
+ defaultValueCreator: (bindable) =>
+ {
+ var button = (Button)bindable;
+ bool temp = false;
+ Tizen.NUI.Object.GetProperty(button.swigCPtr, Button.Property.SELECTED).Get(out temp);
+ return temp;
+ });
/// This will be deprecated
[Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")]
[EditorBrowsable(EditorBrowsableState.Never)]
if (newValue != null)
{
PropertyMap background = new PropertyMap();
- background.Add( Visual.Property.Type, new PropertyValue((int)Visual.Type.Color) )
- .Add( ColorVisualProperty.MixColor, new PropertyValue((Color)newValue) );
+ background.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.Color))
+ .Add(ColorVisualProperty.MixColor, new PropertyValue((Color)newValue));
Tizen.NUI.Object.SetProperty(button.swigCPtr, Button.Property.UNSELECTED_BACKGROUND_VISUAL, new Tizen.NUI.PropertyValue(background));
}
},
- defaultValueCreator:(bindable) =>
- {
- var button = (Button)bindable;
- Color temp = new Color(0.0f, 0.0f, 0.0f, 0.0f);
- Tizen.NUI.PropertyMap map = new Tizen.NUI.PropertyMap();
- Tizen.NUI.Object.GetProperty(button.swigCPtr, Button.Property.UNSELECTED_BACKGROUND_VISUAL).Get(map);
- Tizen.NUI.PropertyValue value = map.Find( Visual.Property.MixColor);
- value?.Get(temp);
- return temp;
- });
+ defaultValueCreator: (bindable) =>
+ {
+ var button = (Button)bindable;
+ Color temp = new Color(0.0f, 0.0f, 0.0f, 0.0f);
+ Tizen.NUI.PropertyMap map = new Tizen.NUI.PropertyMap();
+ Tizen.NUI.Object.GetProperty(button.swigCPtr, Button.Property.UNSELECTED_BACKGROUND_VISUAL).Get(map);
+ Tizen.NUI.PropertyValue value = map.Find(Visual.Property.MixColor);
+ value?.Get(temp);
+ return temp;
+ });
/// This will be deprecated
[Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")]
[EditorBrowsable(EditorBrowsableState.Never)]
if (newValue != null)
{
PropertyMap background = new PropertyMap();
- background.Add( Visual.Property.Type, new PropertyValue((int)Visual.Type.Color) )
- .Add( ColorVisualProperty.MixColor, new PropertyValue((Color)newValue) );
+ background.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.Color))
+ .Add(ColorVisualProperty.MixColor, new PropertyValue((Color)newValue));
Tizen.NUI.Object.SetProperty(button.swigCPtr, Button.Property.SELECTED_BACKGROUND_VISUAL, new Tizen.NUI.PropertyValue(background));
}
},
- defaultValueCreator:(bindable) =>
- {
- var button = (Button)bindable;
- Color temp = new Color(0.0f, 0.0f, 0.0f, 0.0f);
- Tizen.NUI.PropertyMap map = new Tizen.NUI.PropertyMap();
- Tizen.NUI.Object.GetProperty(button.swigCPtr, Button.Property.SELECTED_BACKGROUND_VISUAL).Get(map);
- Tizen.NUI.PropertyValue value = map.Find( Visual.Property.MixColor);
- value?.Get(temp);
- return temp;
- });
+ defaultValueCreator: (bindable) =>
+ {
+ var button = (Button)bindable;
+ Color temp = new Color(0.0f, 0.0f, 0.0f, 0.0f);
+ Tizen.NUI.PropertyMap map = new Tizen.NUI.PropertyMap();
+ Tizen.NUI.Object.GetProperty(button.swigCPtr, Button.Property.SELECTED_BACKGROUND_VISUAL).Get(map);
+ Tizen.NUI.PropertyValue value = map.Find(Visual.Property.MixColor);
+ value?.Get(temp);
+ return temp;
+ });
/// This will be deprecated
[Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")]
[EditorBrowsable(EditorBrowsableState.Never)]
Tizen.NUI.Object.SetProperty(button.swigCPtr, Button.Property.LABEL, new Tizen.NUI.PropertyValue((PropertyMap)newValue));
}
},
- defaultValueCreator:(bindable) =>
- {
- var button = (Button)bindable;
- Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap();
- Tizen.NUI.Object.GetProperty(button.swigCPtr, Button.Property.LABEL).Get(temp);
- return temp;
- });
+ defaultValueCreator: (bindable) =>
+ {
+ var button = (Button)bindable;
+ Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap();
+ Tizen.NUI.Object.GetProperty(button.swigCPtr, Button.Property.LABEL).Get(temp);
+ return temp;
+ });
/// This will be deprecated
[Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")]
[EditorBrowsable(EditorBrowsableState.Never)]
Tizen.NUI.Object.SetProperty(button.swigCPtr, Button.Property.LABEL, new Tizen.NUI.PropertyValue((string)newValue));
}
},
- defaultValueCreator:(bindable) =>
- {
- var button = (Button)bindable;
- Tizen.NUI.PropertyMap map = new Tizen.NUI.PropertyMap();
- Tizen.NUI.Object.GetProperty(button.swigCPtr, Button.Property.LABEL).Get(map);
- Tizen.NUI.PropertyValue value = map.Find( TextVisualProperty.Text, "Text");
- string str = "";
- value?.Get(out str);
- return str;
- });
+ defaultValueCreator: (bindable) =>
+ {
+ var button = (Button)bindable;
+ Tizen.NUI.PropertyMap map = new Tizen.NUI.PropertyMap();
+ Tizen.NUI.Object.GetProperty(button.swigCPtr, Button.Property.LABEL).Get(map);
+ Tizen.NUI.PropertyValue value = map.Find(TextVisualProperty.Text, "Text");
+ string str = "";
+ value?.Get(out str);
+ return str;
+ });
private EventHandlerWithReturnType<object, EventArgs, bool> _clickedEventHandler;
private ClickedCallbackType _clickedCallback;
/// </summary>
/// <since_tizen> 3 </since_tizen>
/// This will be deprecated
- [Obsolete("Deprecated in API6, Will be removed in API9, " +
+ [Obsolete("Deprecated in API6, Will be removed in API9, " +
"Please use SnapStarted event instead!" +
"IntPtr(native integer pointer) is supposed to be not used in Application!")]
[EditorBrowsable(EditorBrowsableState.Never)]
Tizen.NUI.Object.SetProperty(slider.swigCPtr, Slider.Property.LOWER_BOUND, new Tizen.NUI.PropertyValue((float)newValue));
}
},
- defaultValueCreator:(bindable) =>
- {
- var slider = (Slider)bindable;
- float temp = 0.0f;
- Tizen.NUI.Object.GetProperty(slider.swigCPtr, Slider.Property.LOWER_BOUND).Get(out temp);
- return temp;
- });
+ defaultValueCreator: (bindable) =>
+ {
+ var slider = (Slider)bindable;
+ float temp = 0.0f;
+ Tizen.NUI.Object.GetProperty(slider.swigCPtr, Slider.Property.LOWER_BOUND).Get(out temp);
+ return temp;
+ });
/// This will be deprecated
[Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")]
[EditorBrowsable(EditorBrowsableState.Never)]
- public static readonly BindableProperty UpperBoundProperty = BindableProperty.Create(nameof(UpperBound), typeof(float), typeof(Slider), 1.0f, propertyChanged: (bindable, oldValue, newValue) =>
+ public static readonly BindableProperty UpperBoundProperty = BindableProperty.Create(nameof(UpperBound), typeof(float), typeof(Slider), 1.0f, propertyChanged: (bindable, oldValue, newValue) =>
{
var slider = (Slider)bindable;
if (newValue != null)
Tizen.NUI.Object.SetProperty(slider.swigCPtr, Slider.Property.UPPER_BOUND, new Tizen.NUI.PropertyValue((float)newValue));
}
},
- defaultValueCreator:(bindable) =>
- {
- var slider = (Slider)bindable;
- float temp = 0.0f;
- Tizen.NUI.Object.GetProperty(slider.swigCPtr, Slider.Property.UPPER_BOUND).Get(out temp);
- return temp;
- });
+ defaultValueCreator: (bindable) =>
+ {
+ var slider = (Slider)bindable;
+ float temp = 0.0f;
+ Tizen.NUI.Object.GetProperty(slider.swigCPtr, Slider.Property.UPPER_BOUND).Get(out temp);
+ return temp;
+ });
/// This will be deprecated
[Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")]
[EditorBrowsable(EditorBrowsableState.Never)]
Tizen.NUI.Object.SetProperty(slider.swigCPtr, Slider.Property.VALUE, new Tizen.NUI.PropertyValue((float)newValue));
}
},
- defaultValueCreator:(bindable) =>
- {
- var slider = (Slider)bindable;
- float temp = 0.0f;
- Tizen.NUI.Object.GetProperty(slider.swigCPtr, Slider.Property.VALUE).Get(out temp);
- return temp;
- });
+ defaultValueCreator: (bindable) =>
+ {
+ var slider = (Slider)bindable;
+ float temp = 0.0f;
+ Tizen.NUI.Object.GetProperty(slider.swigCPtr, Slider.Property.VALUE).Get(out temp);
+ return temp;
+ });
/// This will be deprecated
[Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")]
[EditorBrowsable(EditorBrowsableState.Never)]
Tizen.NUI.Object.SetProperty(slider.swigCPtr, Slider.Property.TRACK_VISUAL, new Tizen.NUI.PropertyValue((PropertyMap)newValue));
}
},
- defaultValueCreator:(bindable) =>
- {
- var slider = (Slider)bindable;
- PropertyMap temp = new PropertyMap();
- Tizen.NUI.Object.GetProperty(slider.swigCPtr, Slider.Property.TRACK_VISUAL).Get(temp);
- return temp;
- });
+ defaultValueCreator: (bindable) =>
+ {
+ var slider = (Slider)bindable;
+ PropertyMap temp = new PropertyMap();
+ Tizen.NUI.Object.GetProperty(slider.swigCPtr, Slider.Property.TRACK_VISUAL).Get(temp);
+ return temp;
+ });
/// This will be deprecated
[Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")]
[EditorBrowsable(EditorBrowsableState.Never)]
Tizen.NUI.Object.SetProperty(slider.swigCPtr, Slider.Property.HANDLE_VISUAL, new Tizen.NUI.PropertyValue((PropertyMap)newValue));
}
},
- defaultValueCreator:(bindable) =>
- {
- var slider = (Slider)bindable;
- PropertyMap temp = new PropertyMap();
- Tizen.NUI.Object.GetProperty(slider.swigCPtr, Slider.Property.HANDLE_VISUAL).Get(temp);
- return temp;
- });
+ defaultValueCreator: (bindable) =>
+ {
+ var slider = (Slider)bindable;
+ PropertyMap temp = new PropertyMap();
+ Tizen.NUI.Object.GetProperty(slider.swigCPtr, Slider.Property.HANDLE_VISUAL).Get(temp);
+ return temp;
+ });
/// This will be deprecated
[Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")]
[EditorBrowsable(EditorBrowsableState.Never)]
Tizen.NUI.Object.SetProperty(slider.swigCPtr, Slider.Property.PROGRESS_VISUAL, new Tizen.NUI.PropertyValue((PropertyMap)newValue));
}
},
- defaultValueCreator:(bindable) =>
- {
- var slider = (Slider)bindable;
- PropertyMap temp = new PropertyMap();
- Tizen.NUI.Object.GetProperty(slider.swigCPtr, Slider.Property.PROGRESS_VISUAL).Get(temp);
- return temp;
- });
+ defaultValueCreator: (bindable) =>
+ {
+ var slider = (Slider)bindable;
+ PropertyMap temp = new PropertyMap();
+ Tizen.NUI.Object.GetProperty(slider.swigCPtr, Slider.Property.PROGRESS_VISUAL).Get(temp);
+ return temp;
+ });
/// This will be deprecated
[Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")]
[EditorBrowsable(EditorBrowsableState.Never)]
Tizen.NUI.Object.SetProperty(slider.swigCPtr, Slider.Property.POPUP_VISUAL, new Tizen.NUI.PropertyValue((PropertyMap)newValue));
}
},
- defaultValueCreator:(bindable) =>
- {
- var slider = (Slider)bindable;
- PropertyMap temp = new PropertyMap();
- Tizen.NUI.Object.GetProperty(slider.swigCPtr, Slider.Property.POPUP_VISUAL).Get(temp);
- return temp;
- });
+ defaultValueCreator: (bindable) =>
+ {
+ var slider = (Slider)bindable;
+ PropertyMap temp = new PropertyMap();
+ Tizen.NUI.Object.GetProperty(slider.swigCPtr, Slider.Property.POPUP_VISUAL).Get(temp);
+ return temp;
+ });
/// This will be deprecated
[Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")]
[EditorBrowsable(EditorBrowsableState.Never)]
Tizen.NUI.Object.SetProperty(slider.swigCPtr, Slider.Property.POPUP_ARROW_VISUAL, new Tizen.NUI.PropertyValue((PropertyMap)newValue));
}
},
- defaultValueCreator:(bindable) =>
- {
- var slider = (Slider)bindable;
- PropertyMap temp = new PropertyMap();
- Tizen.NUI.Object.GetProperty(slider.swigCPtr, Slider.Property.POPUP_ARROW_VISUAL).Get(temp);
- return temp;
- });
+ defaultValueCreator: (bindable) =>
+ {
+ var slider = (Slider)bindable;
+ PropertyMap temp = new PropertyMap();
+ Tizen.NUI.Object.GetProperty(slider.swigCPtr, Slider.Property.POPUP_ARROW_VISUAL).Get(temp);
+ return temp;
+ });
/// This will be deprecated
[Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")]
[EditorBrowsable(EditorBrowsableState.Never)]
- public static readonly BindableProperty DisabledColorProperty = BindableProperty.Create(nameof(DisabledColor), typeof(Vector4), typeof(Slider), Vector4.Zero, propertyChanged: (bindable, oldValue, newValue) =>
+ public static readonly BindableProperty DisabledColorProperty = BindableProperty.Create(nameof(DisabledColor), typeof(Vector4), typeof(Slider), Vector4.Zero, propertyChanged: (bindable, oldValue, newValue) =>
{
var slider = (Slider)bindable;
if (newValue != null)
Tizen.NUI.Object.SetProperty(slider.swigCPtr, Slider.Property.DISABLED_COLOR, new Tizen.NUI.PropertyValue((Vector4)newValue));
}
},
- defaultValueCreator:(bindable) =>
- {
- var slider = (Slider)bindable;
- Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f);
- Tizen.NUI.Object.GetProperty(slider.swigCPtr, Slider.Property.DISABLED_COLOR).Get(temp);
- return temp;
- });
+ defaultValueCreator: (bindable) =>
+ {
+ var slider = (Slider)bindable;
+ Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f);
+ Tizen.NUI.Object.GetProperty(slider.swigCPtr, Slider.Property.DISABLED_COLOR).Get(temp);
+ return temp;
+ });
/// This will be deprecated
[Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")]
[EditorBrowsable(EditorBrowsableState.Never)]
Tizen.NUI.Object.SetProperty(slider.swigCPtr, Slider.Property.VALUE_PRECISION, new Tizen.NUI.PropertyValue((int)newValue));
}
},
- defaultValueCreator:(bindable) =>
- {
- var slider = (Slider)bindable;
- int temp = 0;
- Tizen.NUI.Object.GetProperty(slider.swigCPtr, Slider.Property.VALUE_PRECISION).Get(out temp);
- return temp;
- });
+ defaultValueCreator: (bindable) =>
+ {
+ var slider = (Slider)bindable;
+ int temp = 0;
+ Tizen.NUI.Object.GetProperty(slider.swigCPtr, Slider.Property.VALUE_PRECISION).Get(out temp);
+ return temp;
+ });
/// This will be deprecated
[Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")]
[EditorBrowsable(EditorBrowsableState.Never)]
Tizen.NUI.Object.SetProperty(slider.swigCPtr, Slider.Property.SHOW_POPUP, new Tizen.NUI.PropertyValue((bool)newValue));
}
},
- defaultValueCreator:(bindable) =>
- {
- var slider = (Slider)bindable;
- bool temp = false;
- Tizen.NUI.Object.GetProperty(slider.swigCPtr, Slider.Property.SHOW_POPUP).Get(out temp);
- return temp;
- });
+ defaultValueCreator: (bindable) =>
+ {
+ var slider = (Slider)bindable;
+ bool temp = false;
+ Tizen.NUI.Object.GetProperty(slider.swigCPtr, Slider.Property.SHOW_POPUP).Get(out temp);
+ return temp;
+ });
/// This will be deprecated
[Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")]
[EditorBrowsable(EditorBrowsableState.Never)]
Tizen.NUI.Object.SetProperty(slider.swigCPtr, Slider.Property.SHOW_VALUE, new Tizen.NUI.PropertyValue((bool)newValue));
}
},
- defaultValueCreator:(bindable) =>
- {
- var slider = (Slider)bindable;
- bool temp = false;
- Tizen.NUI.Object.GetProperty(slider.swigCPtr, Slider.Property.SHOW_VALUE).Get(out temp);
- return temp;
- });
+ defaultValueCreator: (bindable) =>
+ {
+ var slider = (Slider)bindable;
+ bool temp = false;
+ Tizen.NUI.Object.GetProperty(slider.swigCPtr, Slider.Property.SHOW_VALUE).Get(out temp);
+ return temp;
+ });
/// This will be deprecated
[Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")]
[EditorBrowsable(EditorBrowsableState.Never)]
Tizen.NUI.Object.SetProperty(slider.swigCPtr, Slider.Property.MARKS, new Tizen.NUI.PropertyValue((PropertyArray)newValue));
}
},
- defaultValueCreator:(bindable) =>
- {
- var slider = (Slider)bindable;
- Tizen.NUI.PropertyArray temp = new Tizen.NUI.PropertyArray();
- Tizen.NUI.Object.GetProperty(slider.swigCPtr, Slider.Property.MARKS).Get(temp);
- return temp;
- });
+ defaultValueCreator: (bindable) =>
+ {
+ var slider = (Slider)bindable;
+ Tizen.NUI.PropertyArray temp = new Tizen.NUI.PropertyArray();
+ Tizen.NUI.Object.GetProperty(slider.swigCPtr, Slider.Property.MARKS).Get(temp);
+ return temp;
+ });
/// This will be deprecated
[Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")]
[EditorBrowsable(EditorBrowsableState.Never)]
Tizen.NUI.Object.SetProperty(slider.swigCPtr, Slider.Property.MARK_TOLERANCE, new Tizen.NUI.PropertyValue((float)newValue));
}
},
- defaultValueCreator:(bindable) =>
- {
- var slider = (Slider)bindable;
- float temp = 0.0f;
- Tizen.NUI.Object.GetProperty(slider.swigCPtr, Slider.Property.MARK_TOLERANCE).Get(out temp);
- return temp;
- });
+ defaultValueCreator: (bindable) =>
+ {
+ var slider = (Slider)bindable;
+ float temp = 0.0f;
+ Tizen.NUI.Object.GetProperty(slider.swigCPtr, Slider.Property.MARK_TOLERANCE).Get(out temp);
+ return temp;
+ });
/// This will be deprecated
[Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")]
[EditorBrowsable(EditorBrowsableState.Never)]
- public static readonly BindableProperty SnapToMarksProperty = BindableProperty.Create(nameof(SnapToMarks), typeof(bool), typeof(Slider), false, propertyChanged: (bindable, oldValue, newValue) =>
+ public static readonly BindableProperty SnapToMarksProperty = BindableProperty.Create(nameof(SnapToMarks), typeof(bool), typeof(Slider), false, propertyChanged: (bindable, oldValue, newValue) =>
{
var slider = (Slider)bindable;
if (newValue != null)
Tizen.NUI.Object.SetProperty(slider.swigCPtr, Slider.Property.SNAP_TO_MARKS, new Tizen.NUI.PropertyValue((bool)newValue));
}
},
- defaultValueCreator:(bindable) =>
- {
- var slider = (Slider)bindable;
- bool temp = false;
- Tizen.NUI.Object.GetProperty(slider.swigCPtr, Slider.Property.SNAP_TO_MARKS).Get(out temp);
- return temp;
- });
+ defaultValueCreator: (bindable) =>
+ {
+ var slider = (Slider)bindable;
+ bool temp = false;
+ Tizen.NUI.Object.GetProperty(slider.swigCPtr, Slider.Property.SNAP_TO_MARKS).Get(out temp);
+ return temp;
+ });
private EventHandlerWithReturnType<object, ValueChangedEventArgs, bool> _sliderValueChangedEventHandler;
private ValueChangedCallbackDelegate _sliderValueChangedCallbackDelegate;
if (value == true)
{
- this.ValueChanged += (obj, e) => {
+ this.ValueChanged += (obj, e) =>
+ {
this.Value = e.SlideValue;
return true;
};
namespace Tizen.NUI.Utility
{
- /// <summary>
- /// This is a class for stroing the text of a page.
- /// </summary>
- [EditorBrowsable(EditorBrowsableState.Never)]
- class PageData
- {
- public string previousTag {get; set;}
- public string endTag {get; set;}
- public int startOffset {get; set;}
- public int endOffset {get; set;}
- }
-
- /// <summary>
- /// This is a class that stores information when parsing markup text.
- /// </summary>
- [EditorBrowsable(EditorBrowsableState.Never)]
- class TagData
- {
- public string tagName {get; set;}
- public string attributeName {get; set;}
- public bool isEndTag {get; set;}
- }
-
- /// <summary>
- /// This is utility class for paging very long text.
- /// </summary>
- [EditorBrowsable(EditorBrowsableState.Never)]
- public class TextPageUtil : Disposable
- {
- private static char LESS_THAN = '<';
- private static char GREATER_THAN = '>';
- private static char EQUAL = '=';
- private static char QUOTATION_MARK = '\'';
- private static char SLASH = '/';
- // private static char BACK_SLASH = '\\';
- // private static char AMPERSAND = '&';
- // private static char HASH = '#';
- // private static char SEMI_COLON = ';';
- // private static char CHAR_ARRAY_END = '\0';
- // private static char HEX_CODE = 'x';
- private static byte WHITE_SPACE = 0x20;
-
- private int totalPageCnt;
-
- private List<PageData> pageList;
- private List<TagData> tagList;
- private StringReader stream;
- private List<char> characterList;
- private string pageString;
-
/// <summary>
- /// When text is inputed, the text is paging in the TextLabe size unit.
- /// <returns>The total number of pages.</returns>
+ /// This is a class for stroing the text of a page.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
- public int SetText(TextLabel label, string str)
+ class PageData
{
- if(label == null || str == null) return 0;
-
- // perform this operation to match the utf32 character used in native Dali.
- bool previousMarkup = label.EnableMarkup;
- label.EnableMarkup = false;
- label.Text = str;
- pageString = label.Text;
- label.EnableMarkup = previousMarkup;
- label.MultiLine = true;
- label.Ellipsis = false;
-
- int length = pageString.Length;
- int remainLength = length;
- int offset = 0;
- int cutOffIndex = 0;
-
- // init
- totalPageCnt = 0;
- pageList = new List<PageData>();
- tagList = new List<TagData>();
- characterList = new List<char>();
-
- stream = new StringReader(pageString);
-
- RendererParameters textParameters = new RendererParameters();
- textParameters.Text = pageString;
- textParameters.HorizontalAlignment = label.HorizontalAlignment;
- textParameters.VerticalAlignment = label.VerticalAlignment;
- textParameters.FontFamily = label.FontFamily;
- textParameters.FontWeight = "";
- textParameters.FontWidth = "";
- textParameters.FontSlant = "";
- textParameters.Layout = TextLayout.MultiLine;
- textParameters.TextColor = Color.Black;
- textParameters.FontSize = label.PointSize;
- textParameters.TextWidth = (uint)label.Size.Width;
- textParameters.TextHeight = (uint)label.Size.Height;
- textParameters.EllipsisEnabled = true;
- textParameters.MarkupEnabled = previousMarkup;
- textParameters.MinLineSize = label.MinLineSize;
-
-
- Tizen.NUI.PropertyArray cutOffIndexArray = TextUtils.GetLastCharacterIndex( textParameters );
- uint count = cutOffIndexArray.Count();
- for(uint i=0; i < count; i++)
- {
- cutOffIndexArray.GetElementAt(i).Get(out cutOffIndex); // Gets the last index of text shown on the actual screen.
-
- // If markup is enabled, It should parse markup
- if(label.EnableMarkup)
- {
- int preOffset = offset;
- offset = MarkupProcess( offset, cutOffIndex - preOffset );
- remainLength -= (offset - preOffset);
- }
- //If markup is not enabled, parsing is not required.
- else
- {
- PageData pageData = new PageData();
- pageData.startOffset = offset;
- int cnt = (cutOffIndex - offset ) < remainLength ? (cutOffIndex - offset ) : remainLength;
- remainLength -= cnt;
- offset += cnt;
- pageData.endOffset = offset;
- pageList.Add(pageData);
- }
- totalPageCnt++;
- if(offset <= 0 || remainLength <= 0 ) break;
- }
-
- textParameters.Dispose();
- cutOffIndexArray.Dispose();
- stream = null;
- return totalPageCnt;
+ public string previousTag { get; set; }
+ public string endTag { get; set; }
+ public int startOffset { get; set; }
+ public int endOffset { get; set; }
}
/// <summary>
- /// Input the page number returns the text of the page.
- /// <returns>The text of the page.</returns>
+ /// This is a class that stores information when parsing markup text.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
- public string GetText(int pageNum)
- {
- if( pageNum > totalPageCnt || pageNum < 1 ) {
- Tizen.Log.Error("NUI", $"Out of Range total page count : {totalPageCnt}, input page number : {pageNum}\n");
- return "";
- }
-
- List<PageData> dataList = pageList.GetRange(pageNum-1, 1);
- foreach(PageData data in dataList)
- {
- int cnt = data.endOffset - data.startOffset;
- char[] charArray = new char[cnt];
- pageString.CopyTo(data.startOffset, charArray, 0, cnt);
- string pageText = data.previousTag+new String(charArray)+data.endTag;
- return pageText;
- }
- return "";
- }
-
- private void SkipWhiteSpace(ref int offset)
+ class TagData
{
- int character;
- while( ( character = stream.Read()) != -1)
- {
- offset++;
- if( character == WHITE_SPACE) continue;
- else break;
- }
+ public string tagName { get; set; }
+ public string attributeName { get; set; }
+ public bool isEndTag { get; set; }
}
- private bool IsTag(TagData tag, ref int offset)
+ /// <summary>
+ /// This is utility class for paging very long text.
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public class TextPageUtil : Disposable
{
- List<char> tagChaList = new List<char>();
-
- bool isTag = false;
- bool isQuotationOpen = false;
- bool attributesFound = false;
- tag.isEndTag = false;
- bool isPreviousLessThan = true;
- bool isPreviousSlash = false;
-
- int character;
-
- tag.tagName = "";
- tag.attributeName = "";
- // SkipWhiteSpace(ref offset);
- while((!isTag) && ((character = stream.Read()) != -1)) {
- offset++;
- characterList.Add((char)character);
- if( !isQuotationOpen && ( SLASH == character ) ) // '/'
+ private static char LESS_THAN = '<';
+ private static char GREATER_THAN = '>';
+ private static char EQUAL = '=';
+ private static char QUOTATION_MARK = '\'';
+ private static char SLASH = '/';
+ // private static char BACK_SLASH = '\\';
+ // private static char AMPERSAND = '&';
+ // private static char HASH = '#';
+ // private static char SEMI_COLON = ';';
+ // private static char CHAR_ARRAY_END = '\0';
+ // private static char HEX_CODE = 'x';
+ private static byte WHITE_SPACE = 0x20;
+
+ private int totalPageCnt;
+
+ private List<PageData> pageList;
+ private List<TagData> tagList;
+ private StringReader stream;
+ private List<char> characterList;
+ private string pageString;
+
+ /// <summary>
+ /// When text is inputed, the text is paging in the TextLabe size unit.
+ /// <returns>The total number of pages.</returns>
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public int SetText(TextLabel label, string str)
{
- if (isPreviousLessThan)
- {
- tag.isEndTag = true;
- }
- else
- {
- // if the tag has a '/' it may be an end tag.
- isPreviousSlash = true;
- }
- isPreviousLessThan = false;
- // SkipWhiteSpace(ref offset);
+ if (label == null || str == null) return 0;
+
+ // perform this operation to match the utf32 character used in native Dali.
+ bool previousMarkup = label.EnableMarkup;
+ label.EnableMarkup = false;
+ label.Text = str;
+ pageString = label.Text;
+ label.EnableMarkup = previousMarkup;
+ label.MultiLine = true;
+ label.Ellipsis = false;
+
+ int length = pageString.Length;
+ int remainLength = length;
+ int offset = 0;
+ int cutOffIndex = 0;
+
+ // init
+ totalPageCnt = 0;
+ pageList = new List<PageData>();
+ tagList = new List<TagData>();
+ characterList = new List<char>();
+
+ stream = new StringReader(pageString);
+
+ RendererParameters textParameters = new RendererParameters();
+ textParameters.Text = pageString;
+ textParameters.HorizontalAlignment = label.HorizontalAlignment;
+ textParameters.VerticalAlignment = label.VerticalAlignment;
+ textParameters.FontFamily = label.FontFamily;
+ textParameters.FontWeight = "";
+ textParameters.FontWidth = "";
+ textParameters.FontSlant = "";
+ textParameters.Layout = TextLayout.MultiLine;
+ textParameters.TextColor = Color.Black;
+ textParameters.FontSize = label.PointSize;
+ textParameters.TextWidth = (uint)label.Size.Width;
+ textParameters.TextHeight = (uint)label.Size.Height;
+ textParameters.EllipsisEnabled = true;
+ textParameters.MarkupEnabled = previousMarkup;
+ textParameters.MinLineSize = label.MinLineSize;
+
+
+ Tizen.NUI.PropertyArray cutOffIndexArray = TextUtils.GetLastCharacterIndex(textParameters);
+ uint count = cutOffIndexArray.Count();
+ for (uint i = 0; i < count; i++)
+ {
+ cutOffIndexArray.GetElementAt(i).Get(out cutOffIndex); // Gets the last index of text shown on the actual screen.
+
+ // If markup is enabled, It should parse markup
+ if (label.EnableMarkup)
+ {
+ int preOffset = offset;
+ offset = MarkupProcess(offset, cutOffIndex - preOffset);
+ remainLength -= (offset - preOffset);
+ }
+ //If markup is not enabled, parsing is not required.
+ else
+ {
+ PageData pageData = new PageData();
+ pageData.startOffset = offset;
+ int cnt = (cutOffIndex - offset) < remainLength ? (cutOffIndex - offset) : remainLength;
+ remainLength -= cnt;
+ offset += cnt;
+ pageData.endOffset = offset;
+ pageList.Add(pageData);
+ }
+ totalPageCnt++;
+ if (offset <= 0 || remainLength <= 0) break;
+ }
+
+ textParameters.Dispose();
+ cutOffIndexArray.Dispose();
+ stream = null;
+ return totalPageCnt;
}
- else if( GREATER_THAN == character ) // '>'
+
+ /// <summary>
+ /// Input the page number returns the text of the page.
+ /// <returns>The text of the page.</returns>
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public string GetText(int pageNum)
{
- isTag = true;
- if (isPreviousSlash)
- {
- tag.isEndTag = true;
- }
-
- if(!attributesFound) {
- tag.tagName = new String(tagChaList.ToArray());
- } else {
- tag.attributeName = new String(tagChaList.ToArray());
- }
-
- isPreviousSlash = false;
- isPreviousLessThan = false;
+ if (pageNum > totalPageCnt || pageNum < 1)
+ {
+ Tizen.Log.Error("NUI", $"Out of Range total page count : {totalPageCnt}, input page number : {pageNum}\n");
+ return "";
+ }
+
+ List<PageData> dataList = pageList.GetRange(pageNum - 1, 1);
+ foreach (PageData data in dataList)
+ {
+ int cnt = data.endOffset - data.startOffset;
+ char[] charArray = new char[cnt];
+ pageString.CopyTo(data.startOffset, charArray, 0, cnt);
+ string pageText = data.previousTag + new String(charArray) + data.endTag;
+ return pageText;
+ }
+ return "";
}
- else if( QUOTATION_MARK == character )
- {
- tagChaList.Add((char)character);
- isQuotationOpen = !isQuotationOpen;
- isPreviousSlash = false;
- isPreviousLessThan = false;
- }
- else if( WHITE_SPACE >= character || EQUAL == character ) // ' ', '='
+ private void SkipWhiteSpace(ref int offset)
{
- // Let's save tag name.
- if(!attributesFound) {
- tag.tagName = new String(tagChaList.ToArray());
- tagChaList.Clear();
- }
- tagChaList.Add((char)character);
- // If the tag contains white spaces then it may have attributes.
- if( !isQuotationOpen )
- {
- attributesFound = true;
- }
+ int character;
+ while ((character = stream.Read()) != -1)
+ {
+ offset++;
+ if (character == WHITE_SPACE) continue;
+ else break;
+ }
}
- else
+
+ private bool IsTag(TagData tag, ref int offset)
{
- tagChaList.Add((char)character);
- isPreviousSlash = false;
- isPreviousLessThan = false;
+ List<char> tagChaList = new List<char>();
+
+ bool isTag = false;
+ bool isQuotationOpen = false;
+ bool attributesFound = false;
+ tag.isEndTag = false;
+ bool isPreviousLessThan = true;
+ bool isPreviousSlash = false;
+
+ int character;
+
+ tag.tagName = "";
+ tag.attributeName = "";
+ // SkipWhiteSpace(ref offset);
+ while ((!isTag) && ((character = stream.Read()) != -1))
+ {
+ offset++;
+ characterList.Add((char)character);
+ if (!isQuotationOpen && (SLASH == character)) // '/'
+ {
+ if (isPreviousLessThan)
+ {
+ tag.isEndTag = true;
+ }
+ else
+ {
+ // if the tag has a '/' it may be an end tag.
+ isPreviousSlash = true;
+ }
+ isPreviousLessThan = false;
+ // SkipWhiteSpace(ref offset);
+ }
+ else if (GREATER_THAN == character) // '>'
+ {
+ isTag = true;
+ if (isPreviousSlash)
+ {
+ tag.isEndTag = true;
+ }
+
+ if (!attributesFound)
+ {
+ tag.tagName = new String(tagChaList.ToArray());
+ }
+ else
+ {
+ tag.attributeName = new String(tagChaList.ToArray());
+ }
+
+ isPreviousSlash = false;
+ isPreviousLessThan = false;
+ }
+ else if (QUOTATION_MARK == character)
+ {
+ tagChaList.Add((char)character);
+ isQuotationOpen = !isQuotationOpen;
+
+ isPreviousSlash = false;
+ isPreviousLessThan = false;
+ }
+ else if (WHITE_SPACE >= character || EQUAL == character) // ' ', '='
+ {
+ // Let's save tag name.
+ if (!attributesFound)
+ {
+ tag.tagName = new String(tagChaList.ToArray());
+ tagChaList.Clear();
+ }
+ tagChaList.Add((char)character);
+ // If the tag contains white spaces then it may have attributes.
+ if (!isQuotationOpen)
+ {
+ attributesFound = true;
+ }
+ }
+ else
+ {
+ tagChaList.Add((char)character);
+ isPreviousSlash = false;
+ isPreviousLessThan = false;
+ }
+ }
+ return isTag;
}
- }
- return isTag;
- }
-
-
- private int MarkupProcess(int startOffset, int cutOffIndex)
- {
- int count = 0;
- int offset = startOffset;
- int character = 0;
- characterList.Clear();
- PageData pageData = new PageData();
- pageData.startOffset = offset;
+ private int MarkupProcess(int startOffset, int cutOffIndex)
+ {
- // If the markup was previously open, the markup tag should be attached to the front.
- string tag ="";
- foreach (TagData data in tagList)
- {
- tag += "<"+data.tagName+data.attributeName+">";
- }
- pageData.previousTag = tag;
+ int count = 0;
+ int offset = startOffset;
+ int character = 0;
+ characterList.Clear();
+ PageData pageData = new PageData();
+ pageData.startOffset = offset;
- bool isTag = false;
- while( (character = stream.Read()) != -1 )
- {
- offset++;
- characterList.Add((char)character);
+ // If the markup was previously open, the markup tag should be attached to the front.
+ string tag = "";
+ foreach (TagData data in tagList)
+ {
+ tag += "<" + data.tagName + data.attributeName + ">";
+ }
+ pageData.previousTag = tag;
+
+
+ bool isTag = false;
+ while ((character = stream.Read()) != -1)
+ {
+ offset++;
+ characterList.Add((char)character);
+
+ TagData tagData = new TagData();
+ isTag = false;
+ if (LESS_THAN == character) // '<'
+ {
+ isTag = IsTag(tagData, ref offset);
+ }
+
+ if (isTag)
+ {
+ if (tagData.isEndTag)
+ {
+ int lastIndex = tagList.Count;
+ tagList.RemoveAt(lastIndex - 1);
+ }
+ else
+ {
+ tagList.Add(tagData);
+ }
+ }
+ else
+ {
+ count++;
+ }
+ if (count >= cutOffIndex) break;
+
+ }
+
+ // If the markup was previously open, you should attach the label tag.
+ tag = "";
+ foreach (TagData data in tagList)
+ {
+ tag = "</" + data.tagName + ">" + tag;
+ }
+ pageData.endTag = tag;
- TagData tagData = new TagData();
- isTag = false;
- if( LESS_THAN == character ) // '<'
- {
- isTag = IsTag(tagData, ref offset);
- }
+ pageData.endOffset = offset;
+ pageList.Add(pageData);
- if(isTag) {
- if(tagData.isEndTag) {
- int lastIndex = tagList.Count;
- tagList.RemoveAt(lastIndex-1);
- } else {
- tagList.Add(tagData);
- }
- } else {
- count++;
+ if (character == -1) offset = -1;
+ return offset;
}
- if(count >= cutOffIndex) break;
-
- }
- // If the markup was previously open, you should attach the label tag.
- tag ="";
- foreach (TagData data in tagList)
- {
- tag = "</"+data.tagName+">" + tag;
- }
- pageData.endTag = tag;
-
- pageData.endOffset = offset;
- pageList.Add(pageData);
-
- if(character == -1) offset = -1;
- return offset;
}
-
- }
}
\ No newline at end of file
/// <since_tizen> 8 </since_tizen>
public VertexBuffer(PropertyMap bufferFormat) : this(Interop.VertexBuffer.VertexBuffer_New(PropertyMap.getCPtr(bufferFormat)), true)
{
- if (NDalicPINVOKE.SWIGPendingException.Pending)
+ if (NDalicPINVOKE.SWIGPendingException.Pending)
throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
}
Interop.VertexBuffer.VertexBuffer_SetData(swigCPtr, buffer, (uint)vertices.Length);
- if (NDalicPINVOKE.SWIGPendingException.Pending)
+ if (NDalicPINVOKE.SWIGPendingException.Pending)
throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
public uint GetSize()
{
uint ret = Interop.VertexBuffer.VertexBuffer_GetSize(swigCPtr);
- if (NDalicPINVOKE.SWIGPendingException.Pending)
+ if (NDalicPINVOKE.SWIGPendingException.Pending)
throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
[EditorBrowsable(EditorBrowsableState.Never)]
public override bool Equals(object other)
{
- if ((other == null) || ! GetType().Equals(other.GetType()))
+ if ((other == null) || !GetType().Equals(other.GetType()))
{
return false;
}
private void OnWidgetAdded(IntPtr data)
{
WidgetViewEventArgs e = new WidgetViewEventArgs();
- if(data != null)
+ if (data != null)
{
e.WidgetView = WidgetView.GetWidgetViewFromPtr(data);
}
private void OnWidgetFaulted(IntPtr data)
{
WidgetViewEventArgs e = new WidgetViewEventArgs();
- if(data != null)
+ if (data != null)
{
e.WidgetView = WidgetView.GetWidgetViewFromPtr(data);
}
}
DetentEventHandler -= value;
- if(DetentEventHandler == null && StageWheelEventSignal().Empty() == false)
+ if (DetentEventHandler == null && StageWheelEventSignal().Empty() == false)
{
StageWheelEventSignal().Disconnect(DetentEventCallback);
}
WheelEventSignal().Disconnect(_wheelEventCallback);
}
- if(DetentEventCallback != null)
+ if (DetentEventCallback != null)
{
StageWheelEventSignal().Disconnect(DetentEventCallback);
}
public bool Visibility
{
get => visibility;
- set {
+ set
+ {
visibility = value;
}
}
VisibilityChangedEventHandler -= value;
if (VisibilityChangedEventHandler == null)
{
- if(VisibilityChangedEventSignal != null)
+ if (VisibilityChangedEventSignal != null)
{
- if(VisibilityChangedEventSignal.Empty() == false)
+ if (VisibilityChangedEventSignal.Empty() == false)
{
VisibilityChangedEventSignal.Disconnect(VisibilityChangedEventCallback);
}
[EditorBrowsable(EditorBrowsableState.Never)]
public void VisibiltyChangedSignalEmit(bool visibility)
{
- if(VisibilityChangedEventSignal == null)
+ if (VisibilityChangedEventSignal == null)
{
VisibilityChangedEventSignal = new WindowVisibilityChangedEvent(this);
}
/// 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 interface IReferenceProvider
- {
+ {
/// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
object FindByName(string name);
- }
+ }
}
\ No newline at end of file
{
if (TypedBinding == null)
return new Tizen.NUI.Binding.Binding(Path, Mode, Converter, ConverterParameter, StringFormat, Source)
- {
- UpdateSourceEventName = UpdateSourceEventName,
+ {
+ UpdateSourceEventName = UpdateSourceEventName,
FallbackValue = FallbackValue,
TargetNullValue = TargetNullValue,
- };
+ };
TypedBinding.Mode = Mode;
TypedBinding.Converter = Converter;
{
if (Key == null)
{
- var lineInfoProvider = serviceProvider.GetService(typeof (IXmlLineInfoProvider)) as IXmlLineInfoProvider;
+ var lineInfoProvider = serviceProvider.GetService(typeof(IXmlLineInfoProvider)) as IXmlLineInfoProvider;
var lineInfo = (lineInfoProvider != null) ? lineInfoProvider.XmlLineInfo : new XmlLineInfo();
throw new XamlParseException("DynamicResource markup require a Key", lineInfo);
}
{
if (serviceProvider == null)
throw new ArgumentNullException(nameof(serviceProvider));
- var valueProvider = serviceProvider.GetService(typeof (IProvideValueTarget)) as IProvideParentValues;
+ var valueProvider = serviceProvider.GetService(typeof(IProvideValueTarget)) as IProvideParentValues;
if (valueProvider == null)
throw new ArgumentException("serviceProvider does not provide an IProvideValueTarget");
- var namescopeprovider = serviceProvider.GetService(typeof (INameScopeProvider)) as INameScopeProvider;
+ var namescopeprovider = serviceProvider.GetService(typeof(INameScopeProvider)) as INameScopeProvider;
if (namescopeprovider != null && namescopeprovider.NameScope != null)
{
var value = namescopeprovider.NameScope.FindByName(Name);
if (serviceProvider == null)
throw new ArgumentNullException(nameof(serviceProvider));
- var typeResolver = serviceProvider.GetService(typeof (IXamlTypeResolver)) as IXamlTypeResolver;
+ var typeResolver = serviceProvider.GetService(typeof(IXamlTypeResolver)) as IXamlTypeResolver;
if (typeResolver == null)
throw new ArgumentException("No IXamlTypeResolver in IServiceProvider");
if (string.IsNullOrEmpty(Member) || !Member.Contains("."))
{
- lineInfoProvider = serviceProvider.GetService(typeof (IXmlLineInfoProvider)) as IXmlLineInfoProvider;
+ lineInfoProvider = serviceProvider.GetService(typeof(IXmlLineInfoProvider)) as IXmlLineInfoProvider;
lineInfo = (lineInfoProvider != null) ? lineInfoProvider.XmlLineInfo : new XmlLineInfo();
throw new XamlParseException("Syntax for x:Static is [Member=][prefix:]typeName.staticMemberName", lineInfo);
}
if (finfo != null)
return finfo.GetValue(null);
- lineInfoProvider = serviceProvider.GetService(typeof (IXmlLineInfoProvider)) as IXmlLineInfoProvider;
+ lineInfoProvider = serviceProvider.GetService(typeof(IXmlLineInfoProvider)) as IXmlLineInfoProvider;
lineInfo = (lineInfoProvider != null) ? lineInfoProvider.XmlLineInfo : new XmlLineInfo();
throw new XamlParseException($"No static member found for {Member}", lineInfo);
}
{
IXmlLineInfo lineInfo;
- if (!string.IsNullOrEmpty(Style) && Source != null) {
+ if (!string.IsNullOrEmpty(Style) && Source != null)
+ {
lineInfo = (serviceProvider.GetService(typeof(IXmlLineInfoProvider)) as IXmlLineInfoProvider)?.XmlLineInfo;
throw new XamlParseException($"StyleSheet can not have both a Source and a content", lineInfo);
}
- if (Source != null) {
+ if (Source != null)
+ {
lineInfo = (serviceProvider.GetService(typeof(IXmlLineInfoProvider)) as IXmlLineInfoProvider)?.XmlLineInfo;
if (Source.IsAbsoluteUri)
throw new XamlParseException($"Source only accepts Relative URIs", lineInfo);
return StyleSheet.FromString(resString);
}
- if (!string.IsNullOrEmpty(Style)) {
+ if (!string.IsNullOrEmpty(Style))
+ {
using (var reader = new StringReader(Style))
return StyleSheet.FromReader(reader);
}
throw new InvalidOperationException("TypeName isn't set.");
if (serviceProvider == null)
throw new ArgumentNullException(nameof(serviceProvider));
- var typeResolver = serviceProvider.GetService(typeof (IXamlTypeResolver)) as IXamlTypeResolver;
+ var typeResolver = serviceProvider.GetService(typeof(IXamlTypeResolver)) as IXamlTypeResolver;
if (typeResolver == null)
throw new ArgumentException("No IXamlTypeResolver in IServiceProvider");
namespace Tizen.NUI.Xaml
{
- [AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = true)]
- sealed class ProvideCompiledAttribute : Attribute
- {
- public string CompiledVersion { get; }
+ [AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = true)]
+ sealed class ProvideCompiledAttribute : Attribute
+ {
+ public string CompiledVersion { get; }
- public ProvideCompiledAttribute (string compiledVersion)
- {
- CompiledVersion = compiledVersion;
- }
- }
+ public ProvideCompiledAttribute(string compiledVersion)
+ {
+ CompiledVersion = compiledVersion;
+ }
+ }
}
\ No newline at end of file
{
if (serviceProvider == null)
throw new ArgumentNullException(nameof(serviceProvider));
- if (Key == null) {
+ if (Key == null)
+ {
var lineInfoProvider = serviceProvider.GetService(typeof(IXmlLineInfoProvider)) as IXmlLineInfoProvider;
var lineInfo = (lineInfoProvider != null) ? lineInfoProvider.XmlLineInfo : new XmlLineInfo();
throw new XamlParseException("you must specify a key in {StaticResource}", lineInfo);
var xmlLineInfo = xmlLineInfoProvider != null ? xmlLineInfoProvider.XmlLineInfo : null;
object resource = null;
- foreach (var p in valueProvider.ParentObjects) {
+ foreach (var p in valueProvider.ParentObjects)
+ {
var irp = p as IResourcesProvider;
var resDict = irp != null && irp.IsResourcesCreated ? irp.XamlResources : p as ResourceDictionary;
if (resDict == null)
var bp = valueProvider.TargetProperty as BindableProperty;
var pi = valueProvider.TargetProperty as PropertyInfo;
var propertyType = bp?.ReturnType ?? pi?.PropertyType;
- if (propertyType == null) {
- if (resource != null) {
- if (resource.GetType().GetTypeInfo().IsGenericType && (resource.GetType().GetGenericTypeDefinition() == typeof(OnPlatform<>) || resource.GetType().GetGenericTypeDefinition() == typeof(OnIdiom<>))) {
+ if (propertyType == null)
+ {
+ if (resource != null)
+ {
+ if (resource.GetType().GetTypeInfo().IsGenericType && (resource.GetType().GetGenericTypeDefinition() == typeof(OnPlatform<>) || resource.GetType().GetGenericTypeDefinition() == typeof(OnIdiom<>)))
+ {
// This is only there to support our backward compat story with pre 2.3.3 compiled Xaml project who was not providing TargetProperty
var method = resource.GetType().GetRuntimeMethod("op_Implicit", new[] { resource.GetType() });
- if (method != null) {
+ if (method != null)
+ {
resource = method.Invoke(null, new[] { resource });
}
}
}
if (propertyType.IsAssignableFrom(resource?.GetType()))
return resource;
- var implicit_op = resource?.GetType().GetImplicitConversionOperator(fromType: resource?.GetType(), toType: propertyType)
+ var implicit_op = resource?.GetType().GetImplicitConversionOperator(fromType: resource?.GetType(), toType: propertyType)
?? propertyType.GetImplicitConversionOperator(fromType: resource?.GetType(), toType: propertyType);
if (implicit_op != null)
- return implicit_op.Invoke(resource, new [] { resource });
+ return implicit_op.Invoke(resource, new[] { resource });
- if (resource != null) {
+ if (resource != null)
+ {
//Special case for https://bugzilla.xamarin.com/show_bug.cgi?id=59818
//On OnPlatform, check for an opImplicit from the targetType
- if ( Device.Flags != null
+ if (Device.Flags != null
&& Device.Flags.Contains("xamlDoubleImplicitOpHack")
&& resource.GetType().GetTypeInfo().IsGenericType
- && (resource.GetType().GetGenericTypeDefinition() == typeof(OnPlatform<>))) {
+ && (resource.GetType().GetGenericTypeDefinition() == typeof(OnPlatform<>)))
+ {
var tType = resource.GetType().GenericTypeArguments[0];
var opImplicit = tType.GetImplicitConversionOperator(fromType: tType, toType: propertyType)
?? propertyType.GetImplicitConversionOperator(fromType: tType, toType: propertyType);
- if (opImplicit != null) {
+ if (opImplicit != null)
+ {
//convert the OnPlatform<T> to T
var opPlatformImplicitConversionOperator = resource?.GetType().GetImplicitConversionOperator(fromType: resource?.GetType(), toType: tType);
resource = opPlatformImplicitConversionOperator?.Invoke(null, new[] { resource });
/// <returns>A TXaml with the properties that are defined in the application manifest for callingType.</returns>
/// 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 static TXaml LoadFromXaml<TXaml>(this TXaml view, Type callingType)
+ public static TXaml LoadFromXaml<TXaml>(this TXaml view, Type callingType)
{
XamlLoader.Load(view, callingType);
return view;
internal static string GetResourceIdForType(Type type)
{
var assembly = type.GetTypeInfo().Assembly;
- foreach (var xria in assembly.GetCustomAttributes<XamlResourceIdAttribute>()) {
+ foreach (var xria in assembly.GetCustomAttributes<XamlResourceIdAttribute>())
+ {
if (xria.Type == type)
return xria.ResourceId;
}
internal static string GetPathForType(Type type)
{
var assembly = type.GetTypeInfo().Assembly;
- foreach (var xria in assembly.GetCustomAttributes<XamlResourceIdAttribute>()) {
+ foreach (var xria in assembly.GetCustomAttributes<XamlResourceIdAttribute>())
+ {
if (xria.Type == type)
return xria.Path;
}
internal static string GetResourceIdForPath(Assembly assembly, string path)
{
- foreach (var xria in assembly.GetCustomAttributes<XamlResourceIdAttribute>()) {
+ foreach (var xria in assembly.GetCustomAttributes<XamlResourceIdAttribute>())
+ {
if (xria.Path == path)
return xria.ResourceId;
}
internal static Type GetTypeForResourceId(Assembly assembly, string resourceId)
{
- foreach (var xria in assembly.GetCustomAttributes<XamlResourceIdAttribute>()) {
+ foreach (var xria in assembly.GetCustomAttributes<XamlResourceIdAttribute>())
+ {
if (xria.ResourceId == resourceId)
return xria.Type;
}
internal static Type GetTypeForPath(Assembly assembly, string path)
{
- foreach (var xria in assembly.GetCustomAttributes<XamlResourceIdAttribute>()) {
+ foreach (var xria in assembly.GetCustomAttributes<XamlResourceIdAttribute>())
+ {
if (xria.Path == path)
return xria.Type;
}
internal IProvideValueTarget IProvideValueTarget
{
- get { return (IProvideValueTarget)GetService(typeof (IProvideValueTarget)); }
- set { services[typeof (IProvideValueTarget)] = value; }
+ get { return (IProvideValueTarget)GetService(typeof(IProvideValueTarget)); }
+ set { services[typeof(IProvideValueTarget)] = value; }
}
internal IXamlTypeResolver IXamlTypeResolver
{
- get { return (IXamlTypeResolver)GetService(typeof (IXamlTypeResolver)); }
- set { services[typeof (IXamlTypeResolver)] = value; }
+ get { return (IXamlTypeResolver)GetService(typeof(IXamlTypeResolver)); }
+ set { services[typeof(IXamlTypeResolver)] = value; }
}
internal IRootObjectProvider IRootObjectProvider
{
- get { return (IRootObjectProvider)GetService(typeof (IRootObjectProvider)); }
- set { services[typeof (IRootObjectProvider)] = value; }
+ get { return (IRootObjectProvider)GetService(typeof(IRootObjectProvider)); }
+ set { services[typeof(IRootObjectProvider)] = value; }
}
internal IXmlLineInfoProvider IXmlLineInfoProvider
{
- get { return (IXmlLineInfoProvider)GetService(typeof (IXmlLineInfoProvider)); }
- set { services[typeof (IXmlLineInfoProvider)] = value; }
+ get { return (IXmlLineInfoProvider)GetService(typeof(IXmlLineInfoProvider)); }
+ set { services[typeof(IXmlLineInfoProvider)] = value; }
}
internal INameScopeProvider INameScopeProvider
{
- get { return (INameScopeProvider)GetService(typeof (INameScopeProvider)); }
- set { services[typeof (INameScopeProvider)] = value; }
+ get { return (INameScopeProvider)GetService(typeof(INameScopeProvider)); }
+ set { services[typeof(INameScopeProvider)] = value; }
}
internal IValueConverterProvider IValueConverterProvider
{
- get { return (IValueConverterProvider)GetService(typeof (IValueConverterProvider)); }
- set { services[typeof (IValueConverterProvider)] = value; }
+ get { return (IValueConverterProvider)GetService(typeof(IValueConverterProvider)); }
+ set { services[typeof(IValueConverterProvider)] = value; }
}
/// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
/// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
[Obsolete("SimpleValueTargetProvider(object[] objectAndParents) is obsolete as of version 2.3.4. Please use SimpleValueTargetProvider(object[] objectAndParents, object targetProperty) instead.")]
- public SimpleValueTargetProvider(object[] objectAndParents) : this (objectAndParents, null)
+ public SimpleValueTargetProvider(object[] objectAndParents) : this(objectAndParents, null)
{
}
[EditorBrowsable(EditorBrowsableState.Never)]
public object FindByName(string name)
{
- for (var i = 0; i < objectAndParents.Length; i++) {
- var bo = objectAndParents[i] as BindableObject;
- if (bo == null) continue;
- var ns = NameScope.GetNameScope(bo) as INameScope;
- if (ns == null) continue;
- var value = ns.FindByName(name);
- if (value != null)
- return value;
+ for (var i = 0; i < objectAndParents.Length; i++)
+ {
+ var bo = objectAndParents[i] as BindableObject;
+ if (bo == null) continue;
+ var ns = NameScope.GetNameScope(bo) as INameScope;
+ if (ns == null) continue;
+ var value = ns.FindByName(name);
+ if (value != null)
+ return value;
}
return null;
}
IXmlLineInfo xmlLineInfo = null;
if (serviceProvider != null)
{
- var lineInfoProvider = serviceProvider.GetService(typeof (IXmlLineInfoProvider)) as IXmlLineInfoProvider;
+ var lineInfoProvider = serviceProvider.GetService(typeof(IXmlLineInfoProvider)) as IXmlLineInfoProvider;
if (lineInfoProvider != null)
xmlLineInfo = lineInfoProvider.XmlLineInfo;
}
{
var n = _node;
object value = null;
- while (n != null) {
+ while (n != null)
+ {
if ((value = (n as IElementNode)?.Namescope?.FindByName(name)) != null)
return value;
n = n.Parent;
if (propertyKey == null)
throw new ArgumentNullException(nameof(propertyKey));
- ClearValue(propertyKey.BindableProperty, fromStyle:false, checkAccess: false);
+ ClearValue(propertyKey.BindableProperty, fromStyle: false, checkAccess: false);
}
/// <summary>
bindable._inheritedContext = value;
}
- bindable.ApplyBindings(skipBindingContext:false, fromBindingContextChanged:true);
+ bindable.ApplyBindings(skipBindingContext: false, fromBindingContextChanged: true);
bindable.OnBindingContextChanged();
}
[EditorBrowsable(EditorBrowsableState.Never)]
protected void UnapplyBindings()
{
- for (int i = 0, _propertiesCount = _properties.Count; i < _propertiesCount; i++) {
- BindablePropertyContext context = _properties [i];
+ for (int i = 0, _propertiesCount = _properties.Count; i < _propertiesCount; i++)
+ {
+ BindablePropertyContext context = _properties[i];
if (context.Binding == null)
continue;
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 < _properties.Count; i++)
+ {
var context = _properties[i];
var index = properties.IndexOf(context.Property);
if (index < 0)
continue;
values[index] = context.Value;
}
- for (var i = 0; i < values.Length; i++) {
+ for (var i = 0; i < values.Length; i++)
+ {
if (!ReferenceEquals(values[i], null))
continue;
values[i] = properties[i].DefaultValueCreator == null ? properties[i].DefaultValue : CreateAndAddContext(properties[i]).Value;
value = property.CoerceValue(this, value);
BindablePropertyContext context = GetOrCreateContext(property);
- if (manuallySet) {
+ if (manuallySet)
+ {
context.Attributes |= BindableContextAttributes.IsManuallySet;
context.Attributes &= ~BindableContextAttributes.IsSetFromStyle;
- } else
+ }
+ else
context.Attributes &= ~BindableContextAttributes.IsManuallySet;
if (fromStyle)
internal void ApplyBindings(bool skipBindingContext, bool fromBindingContextChanged)
{
var prop = _properties.ToArray();
- for (int i = 0, propLength = prop.Length; i < propLength; i++) {
- BindablePropertyContext context = prop [i];
+ for (int i = 0, propLength = prop.Length; i < propLength; i++)
+ {
+ BindablePropertyContext context = prop[i];
BindingBase binding = context.Binding;
if (binding == null)
continue;
static void BindingContextPropertyChanged(BindableObject bindable, object oldvalue, object newvalue)
{
bindable._inheritedContext = null;
- bindable.ApplyBindings(skipBindingContext: true, fromBindingContextChanged:true);
+ bindable.ApplyBindings(skipBindingContext: true, fromBindingContextChanged: true);
bindable.OnBindingContextChanged();
}
{
context = CreateAndAddContext(property);
}
- else if (property.DefaultValueCreator != null )
+ else if (property.DefaultValueCreator != null)
{
context.Value = property.DefaultValueCreator(this); //Update Value from dali
}//added by xb.teng
/// <param name="value">The default value.</param>
/// <returns>System.Boolean</returns>
public delegate bool ValidateValueDelegate<in TPropertyType>(BindableObject bindable, TPropertyType value);
-
+
//To confirm the static dictionary will be created before the constructor is called.
static BindableProperty()
{
}
- static readonly Dictionary<Type, TypeConverter> WellKnownConvertTypes = new Dictionary<Type,TypeConverter>
+ static readonly Dictionary<Type, TypeConverter> WellKnownConvertTypes = new Dictionary<Type, TypeConverter>
{
{ typeof(Uri), new UriTypeConverter() },
{ typeof(Color), new ColorTypeConverter() },
type = (parent as TriggerBase).TargetType;
if (type == null)
- throw new XamlParseException($"Can't resolve {parts [0]}", lineinfo);
+ throw new XamlParseException($"Can't resolve {parts[0]}", lineinfo);
return ConvertFrom(type, parts[0], lineinfo);
}
// Skip 1; we would not be making this check if the immediate parent were not a VisualState
// VisualStates must be in a VisualStateGroup
- if(!(parents[2] is VisualStateGroup)) {
+ if (!(parents[2] is VisualStateGroup))
+ {
throw new XamlParseException($"Expected {nameof(VisualStateGroup)} but found {parents[2]}.", lineInfo);
}
/// 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 string UpdateSourceEventName {
+ public string UpdateSourceEventName
+ {
get { return _updateSourceEventName; }
- set {
+ set
+ {
ThrowIfApplied();
_updateSourceEventName = value;
}
if (propertyGetter == null)
throw new ArgumentNullException(nameof(propertyGetter));
- return new Binding(GetBindingPath(propertyGetter), mode, converter, converterParameter, stringFormat);
- }
+ return new Binding(GetBindingPath(propertyGetter), mode, converter, converterParameter, stringFormat);
+ }
internal override void Apply(bool fromTarget)
{
{
if (Source != null && fromBindingContextChanged && IsApplied)
return;
-
+
base.Unapply(fromBindingContextChanged: fromBindingContextChanged);
if (_expression != null)
get { return _mode; }
set
{
- if ( value != BindingMode.Default
+ if (value != BindingMode.Default
&& value != BindingMode.OneWay
&& value != BindingMode.OneWayToSource
&& value != BindingMode.TwoWay
/// 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 object TargetNullValue
- {
- get { return _targetNullValue; }
- set {
- ThrowIfApplied();
- _targetNullValue = value;
- }
- }
+ {
+ get { return _targetNullValue; }
+ set
+ {
+ ThrowIfApplied();
+ _targetNullValue = value;
+ }
+ }
/// 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 object FallbackValue {
- get => _fallbackValue;
- set {
- ThrowIfApplied();
- _fallbackValue = value;
- }
- }
-
- internal bool AllowChaining { get; set; }
+ public object FallbackValue
+ {
+ get => _fallbackValue;
+ set
+ {
+ ThrowIfApplied();
+ _fallbackValue = value;
+ }
+ }
+
+ internal bool AllowChaining { get; set; }
internal object Context { get; set; }
{
child.Parent = this;
- child.ApplyBindings(skipBindingContext: false, fromBindingContextChanged:true);
+ child.ApplyBindings(skipBindingContext: false, fromBindingContextChanged: true);
ChildAdded?.Invoke(this, new ElementEventArgs(child));
{
/// 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 DataTrigger([TypeConverter(typeof(TypeTypeConverter))] [Parameter("TargetType")] Type targetType) : base(new BindingCondition(), targetType)
+ public DataTrigger([TypeConverter(typeof(TypeTypeConverter))][Parameter("TargetType")] Type targetType) : base(new BindingCondition(), targetType)
{
}
{
/// 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 MultiTrigger([TypeConverter(typeof(TypeTypeConverter))] [Parameter("TargetType")] Type targetType) : base(new MultiCondition(), targetType)
+ public MultiTrigger([TypeConverter(typeof(TypeTypeConverter))][Parameter("TargetType")] Type targetType) : base(new MultiCondition(), targetType)
{
}
{
_triggerValue = value;
}
-
+
}
}
/// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- [Obsolete]void RegisterName(string name, object scopedElement, IXmlLineInfo xmlLineInfo);
+ [Obsolete] void RegisterName(string name, object scopedElement, IXmlLineInfo xmlLineInfo);
}
}
[EditorBrowsable(EditorBrowsableState.Never)]
[TypeConverter(typeof(TypeTypeConverter))]
[Obsolete("Use Source")]
- public Type MergedWith {
+ public Type MergedWith
+ {
get { return _mergedWith; }
- set {
+ set
+ {
if (_mergedWith == value)
return;
/// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
[TypeConverter(typeof(RDSourceTypeConverter))]
- public Uri Source {
+ public Uri Source
+ {
get { return _source; }
- set {
+ set
+ {
if (_source == value)
return;
throw new InvalidOperationException("Source can only be set from XAML."); //through the RDSourceTypeConverter
/// 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<ResourceDictionary> MergedDictionaries {
- get {
- if (_mergedDictionaries == null) {
+ public ICollection<ResourceDictionary> MergedDictionaries
+ {
+ get
+ {
+ if (_mergedDictionaries == null)
+ {
var col = new ObservableCollection<ResourceDictionary>();
col.CollectionChanged += MergedDictionaries_CollectionChanged;
_mergedDictionaries = col;
void StyleSheetsCollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
{
- switch (e.Action) {
- case NotifyCollectionChangedAction.Add:
+ switch (e.Action)
+ {
+ case NotifyCollectionChangedAction.Add:
ValuesChanged?.Invoke(this, ResourcesChangedEventArgs.StyleSheets);
- break;
+ break;
}
}
IList<ResourceDictionary> _collectionTrack;
_collectionTrack = _collectionTrack ?? new List<ResourceDictionary>();
// Collection has been cleared
- if (e.Action == NotifyCollectionChangedAction.Reset) {
+ if (e.Action == NotifyCollectionChangedAction.Reset)
+ {
foreach (var dictionary in _collectionTrack)
dictionary.ValuesChanged -= Item_ValuesChanged;
return _innerDictionary.GetEnumerator();
}
- internal IEnumerable<KeyValuePair<string, object>> MergedResources {
- get {
+ internal IEnumerable<KeyValuePair<string, object>> MergedResources
+ {
+ get
+ {
if (MergedDictionaries != null)
foreach (var r in MergedDictionaries.Reverse().SelectMany(x => x.MergedResources))
yield return r;
/// <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.
[EditorBrowsable(EditorBrowsableState.Never)]
- public Style([TypeConverter(typeof(TypeTypeConverter))] [Parameter("TargetType")] Type targetType)
+ public Style([TypeConverter(typeof(TypeTypeConverter))][Parameter("TargetType")] Type targetType)
{
if (targetType == null)
throw new ArgumentNullException(nameof(targetType));
/// <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.
[EditorBrowsable(EditorBrowsableState.Never)]
- public Trigger([TypeConverter(typeof(TypeTypeConverter))] [Parameter("TargetType")] Type targetType) : base(new XamlPropertyCondition(), targetType)
+ public Trigger([TypeConverter(typeof(TypeTypeConverter))][Parameter("TargetType")] Type targetType) : base(new XamlPropertyCondition(), targetType)
{
}
/// 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 {
+ public IValueConverter Converter
+ {
get { return _converter; }
- set {
+ set
+ {
ThrowIfApplied();
_converter = value;
}
/// 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 object ConverterParameter {
+ public object ConverterParameter
+ {
get { return _converterParameter; }
- set {
+ set
+ {
ThrowIfApplied();
_converterParameter = value;
}
/// 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 object Source {
+ public object Source
+ {
get { return _source; }
- set {
+ set
+ {
ThrowIfApplied();
_source = value;
}
}
- internal string UpdateSourceEventName {
+ internal string UpdateSourceEventName
+ {
get { return _updateSourceEventName; }
- set {
+ set
+ {
ThrowIfApplied();
_updateSourceEventName = value;
}
{
readonly Func<TSource, TProperty> _getter;
readonly Action<TSource, TProperty> _setter;
- readonly PropertyChangedProxy [] _handlers;
+ readonly PropertyChangedProxy[] _handlers;
- public TypedBinding(Func<TSource, TProperty> getter, Action<TSource, TProperty> setter, Tuple<Func<TSource, object>, string> [] handlers)
+ public TypedBinding(Func<TSource, TProperty> getter, Action<TSource, TProperty> setter, Tuple<Func<TSource, object>, string>[] handlers)
{
if (getter == null)
throw new ArgumentNullException(nameof(getter));
if (handlers == null)
return;
- _handlers = new PropertyChangedProxy [handlers.Length];
+ _handlers = new PropertyChangedProxy[handlers.Length];
for (var i = 0; i < handlers.Length; i++)
- _handlers [i] = new PropertyChangedProxy(handlers [i].Item1, handlers [i].Item2, this);
+ _handlers[i] = new PropertyChangedProxy(handlers[i].Item1, handlers[i].Item2, this);
}
readonly WeakReference<object> _weakSource = new WeakReference<object>(null);
return;
base.Apply(source, bindObj, targetProperty, fromBindingContextChanged);
-
+
#if (!DO_NOT_CHECK_FOR_BINDING_REUSE)
BindableObject prevTarget;
if (_weakTarget.TryGetTarget(out prevTarget) && !ReferenceEquals(prevTarget, bindObj))
internal override BindingBase Clone()
{
- Tuple<Func<TSource, object>, string> [] handlers = _handlers == null ? null : new Tuple<Func<TSource, object>, string> [_handlers.Length];
- if (handlers != null) {
+ Tuple<Func<TSource, object>, string>[] handlers = _handlers == null ? null : new Tuple<Func<TSource, object>, string>[_handlers.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);
+ handlers[i] = new Tuple<Func<TSource, object>, string>(_handlers[i].PartGetter, _handlers[i].PropertyName);
}
- return new TypedBinding<TSource, TProperty>(_getter, _setter, handlers) {
+ return new TypedBinding<TSource, TProperty>(_getter, _setter, handlers)
+ {
Mode = Mode,
Converter = Converter,
ConverterParameter = ConverterParameter,
#endif
if (_handlers != null)
Unsubscribe();
-
+
#if (!DO_NOT_CHECK_FOR_BINDING_REUSE)
_weakSource.SetTarget(null);
_weakTarget.SetTarget(null);
if (isTSource && (mode == BindingMode.OneWay || mode == BindingMode.TwoWay) && _handlers != null)
Subscribe((TSource)sourceObject);
- if (needsGetter) {
+ if (needsGetter)
+ {
var value = property.DefaultValue;
- if (isTSource) {
- try {
+ if (isTSource)
+ {
+ try
+ {
value = GetSourceValue(_getter((TSource)sourceObject), property.ReturnType);
- } catch (Exception ex) when (ex is NullReferenceException || ex is KeyNotFoundException) {
+ }
+ catch (Exception ex) when (ex is NullReferenceException || ex is KeyNotFoundException)
+ {
}
}
- if (!TryConvert(ref value, property, property.ReturnType, true)) {
+ if (!TryConvert(ref value, property, property.ReturnType, true))
+ {
// Log.Warning("Binding", "{0} can not be converted to type '{1}'", value, property.ReturnType);
return;
}
}
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)) {
+ if (!TryConvert(ref value, property, typeof(TProperty), false))
+ {
// Log.Warning("Binding", "{0} can not be converted to type '{1}'", value, typeof(TProperty));
return;
}
return true;
object original = value;
- try {
+ try
+ {
value = Convert.ChangeType(value, convertTo, CultureInfo.InvariantCulture);
return true;
- } catch (Exception ex ) when (ex is InvalidCastException || ex is FormatException||ex is OverflowException) {
+ }
+ catch (Exception ex) when (ex is InvalidCastException || ex is FormatException || ex is OverflowException)
+ {
value = original;
return false;
}
WeakReference<INotifyPropertyChanged> _weakPart = new WeakReference<INotifyPropertyChanged>(null);
readonly BindingBase _binding;
- public INotifyPropertyChanged Part {
- get {
+ public INotifyPropertyChanged Part
+ {
+ get
+ {
INotifyPropertyChanged target;
if (_weakPart.TryGetTarget(out target))
return target;
return null;
- }
- set {
+ }
+ set
+ {
_weakPart.SetTarget(value);
Listener.SubscribeTo(value, OnPropertyChanged);
}
void Subscribe(TSource sourceObject)
{
- for (var i = 0; i < _handlers.Length; i++) {
- var part = _handlers [i].PartGetter(sourceObject);
+ for (var i = 0; i < _handlers.Length; i++)
+ {
+ var part = _handlers[i].PartGetter(sourceObject);
if (part == null)
break;
var inpc = part as INotifyPropertyChanged;
if (inpc == null)
continue;
- _handlers [i].Part = (inpc);
+ _handlers[i].Part = (inpc);
}
}
void Unsubscribe()
{
for (var i = 0; i < _handlers.Length; i++)
- _handlers [i].Listener.Unsubscribe();
+ _handlers[i].Listener.Unsubscribe();
}
}
}
\ No newline at end of file