using System;
using System.Collections.Generic;
+using Oobe.Common.Utils;
using Tizen.NUI;
-using Tizen.NUI.Binding;
using Tizen.NUI.BaseComponents;
+using Tizen.NUI.Binding;
using Tizen.NUI.Components;
-using Oobe.Common.Utils;
namespace Oobe.Common.Controls
{
public class CarouselPicker : Control
{
- public event EventHandler SelectedItemChanged;
-
private Oobe.Common.Controls.ScrollableBase scrollableBase;
private View itemsListView;
- private View upperLine, lowerLine;
+ private View upperLine;
+ private View lowerLine;
private Vector3 textCenterColorHSV = new Vector3();
private Vector3 textOuterColorHSV = new Vector3();
private float textCenterOpacity;
private float textOuterOpacity;
+ private int selectedItemIndex = 0;
private List<CarouselPickerItemData> items = new List<CarouselPickerItemData>();
- public CarouselPicker() : base()
+ public CarouselPicker()
+ : base()
{
}
- public CarouselPicker(CarouselPickerStyle style) : base(style)
+ public CarouselPicker(CarouselPickerStyle style)
+ : base(style)
{
- //TODO fix a bug with style not properly applied by base class
+ // TODO fix a bug with style not properly applied by base class
ApplyStyle(style);
}
- public void AddItem(CarouselPickerItemData item)
- {
- var view = CreateItemView(item);
- itemsListView.Add(view);
- items.Add(item);
- }
+ public event EventHandler SelectedItemChanged;
- public void RemoveItem(CarouselPickerItemData item)
- {
- var index = items.IndexOf(item);
- items.Remove(item);
- itemsListView.Children.RemoveAt(index);
- }
+ public new CarouselPickerStyle Style => ViewStyle as CarouselPickerStyle;
- private int selectedItemIndex = 0;
public int SelectedItemIndex
{
get
{
return selectedItemIndex;
}
+
set
{
- //always scroll
+ // always scroll
scrollableBase.ScrollToIndex(value);
if (selectedItemIndex != value)
{
}
}
+ public void AddItem(CarouselPickerItemData item)
+ {
+ var view = CreateItemView(item);
+ itemsListView.Add(view);
+ items.Add(item);
+ }
+
+ public void RemoveItem(CarouselPickerItemData item)
+ {
+ var index = items.IndexOf(item);
+ items.Remove(item);
+ itemsListView.Children.RemoveAt(index);
+ }
+
public override void ApplyStyle(ViewStyle viewStyle)
{
base.ApplyStyle(viewStyle);
textOuterColorHSV = Style.OuterText?.TextColor?.All?.ToHSV() ?? new Vector3();
textOuterOpacity = Style.OuterText?.Opacity?.All ?? 1.0f;
-
if (itemsListView != null)
{
scrollableBase?.Remove(itemsListView);
}
}
- private float CalculateScrollerSize()
- {
- float size = 0.0f;
-
- size += Style.CenterText?.Size2D?.Height ?? 0.0f;
- size += (float)Style.CenterText?.Margin?.Top;
- size += (float)Style.CenterText?.Margin?.Bottom;
-
- return size;
- }
-
- private View CreateItemView(CarouselPickerItemData item)
- {
- var view = new TextLabel();
- // TODO for some reason TextLabel(Style.CenterText)
- // or view.ApplyStyle(Style.CenterText) do not work here so set
- // everything manually
- // var view = new TextLabel(Style.CenterText);
- // view.ApplyStyle(Style.CenterText);
- view.Text = item.Text;
- view.TranslatableText = item.TranslatableText;
- view.Size2D = Style.CenterText?.Size2D ?? new Size2D();
- view.PixelSize = Style.CenterText?.PixelSize ?? 10.0f;
- view.Margin = Style.CenterText?.Margin ?? new Extents();
- view.HorizontalAlignment = Style.CenterText?.HorizontalAlignment ?? HorizontalAlignment.Center;
- view.VerticalAlignment = Style.CenterText?.VerticalAlignment ?? VerticalAlignment.Center;
- view.Opacity = Style.CenterText?.Opacity?.All ?? 1.0f;
- //TODO other properties?
- return view;
- }
-
protected override void OnUpdate()
{
base.OnUpdate();
base.Dispose(type);
}
- public new CarouselPickerStyle Style => ViewStyle as CarouselPickerStyle;
-
protected override ViewStyle GetViewStyle()
{
var ret = new CarouselPickerStyle();
return ret;
}
+ private float CalculateScrollerSize()
+ {
+ float size = 0.0f;
+
+ size += Style.CenterText?.Size2D?.Height ?? 0.0f;
+ size += (float)Style.CenterText?.Margin?.Top;
+ size += (float)Style.CenterText?.Margin?.Bottom;
+
+ return size;
+ }
+
+ private View CreateItemView(CarouselPickerItemData item)
+ {
+ var view = new TextLabel();
+
+ // TODO for some reason TextLabel(Style.CenterText)
+ // or view.ApplyStyle(Style.CenterText) do not work here so set
+ // everything manually
+ // var view = new TextLabel(Style.CenterText);
+ // view.ApplyStyle(Style.CenterText);
+ view.Text = item.Text;
+ view.TranslatableText = item.TranslatableText;
+ view.Size2D = Style.CenterText?.Size2D ?? new Size2D();
+ view.PixelSize = Style.CenterText?.PixelSize ?? 10.0f;
+ view.Margin = Style.CenterText?.Margin ?? new Extents();
+ view.HorizontalAlignment = Style.CenterText?.HorizontalAlignment ?? HorizontalAlignment.Center;
+ view.VerticalAlignment = Style.CenterText?.VerticalAlignment ?? VerticalAlignment.Center;
+ view.Opacity = Style.CenterText?.Opacity?.All ?? 1.0f;
+
+ // TODO other properties?
+ return view;
+ }
+
private void CreateMainList()
{
}
{
percent = Math.Clamp(percent, 0.0f, 1.0f);
- float a = from[0] + (to[0] - from[0]) * percent;
- float b = from[1] + (to[1] - from[1]) * percent;
- float c = from[2] + (to[2] - from[2]) * percent;
+ float a = from[0] + ((to[0] - from[0]) * percent);
+ float b = from[1] + ((to[1] - from[1]) * percent);
+ float c = from[2] + ((to[2] - from[2]) * percent);
return new Vector3(a, b, c);
}
private float ScaleScalar(float from, float to, float percent)
{
percent = Math.Clamp(percent, 0.0f, 1.0f);
- return from + (to - from) * percent;
+ return from + ((to - from) * percent);
}
private void UpdateItems()
foreach (View view in itemsListView.Children)
{
TextLabel itemView = view as TextLabel;
- if (itemView == null) continue;
+ if (itemView == null)
+ {
+ continue;
+ }
- float viewMid = view.PositionY + view.Size2D.Height / 2.0f;
+ float viewMid = view.PositionY + (view.Size2D.Height / 2.0f);
float percent = Math.Abs(viewMid + mid) / threshold;
itemView.Opacity = ScaleScalar(textCenterOpacity, textOuterOpacity, percent);
using System;
using Tizen.NUI;
-using Tizen.NUI.Components;
using Tizen.NUI.BaseComponents;
using Tizen.NUI.Binding;
+using Tizen.NUI.Components;
namespace Oobe.Common.Controls
{
public class CarouselPickerStyle : ControlStyle
{
- public CarouselPickerStyle() : base()
+ public CarouselPickerStyle()
+ : base()
{
InitSubStyle();
}
public Color LinesColor { get; set; }
+ public override void CopyFrom(BindableObject bindableObject)
+ {
+ base.CopyFrom(bindableObject);
+
+ CarouselPickerStyle carouselSelectorStyle = bindableObject as CarouselPickerStyle;
+
+ if (carouselSelectorStyle != null)
+ {
+ CenterText?.CopyFrom(carouselSelectorStyle.CenterText);
+ OuterText?.CopyFrom(carouselSelectorStyle.OuterText);
+ LinesColor = carouselSelectorStyle.LinesColor;
+ }
+ }
+
private void InitSubStyle()
{
CenterText = new TextLabelStyle
WidthResizePolicy = ResizePolicyType.FillToParent,
HeightResizePolicy = ResizePolicyType.FillToParent,
HorizontalAlignment = HorizontalAlignment.Center,
- VerticalAlignment = VerticalAlignment.Center
+ VerticalAlignment = VerticalAlignment.Center,
};
OuterText = new TextLabelStyle
{
WidthResizePolicy = ResizePolicyType.FillToParent,
HeightResizePolicy = ResizePolicyType.FillToParent,
HorizontalAlignment = HorizontalAlignment.Center,
- VerticalAlignment = VerticalAlignment.Center
+ VerticalAlignment = VerticalAlignment.Center,
};
LinesColor = Tizen.NUI.Color.Black;
}
-
- public override void CopyFrom(BindableObject bindableObject)
- {
- base.CopyFrom(bindableObject);
-
- CarouselPickerStyle carouselSelectorStyle = bindableObject as CarouselPickerStyle;
-
- if (carouselSelectorStyle != null)
- {
- CenterText?.CopyFrom(carouselSelectorStyle.CenterText);
- OuterText?.CopyFrom(carouselSelectorStyle.OuterText);
- LinesColor = carouselSelectorStyle.LinesColor;
- }
- }
}
}
+// <auto-generated/>
/*
* Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
*/
using System;
-using Tizen.NUI.BaseComponents;
using Oobe.Common.Interfaces;
+using Tizen.NUI.BaseComponents;
namespace Oobe.Common.Interfaces
{
- public abstract class ProcessStep
- {
- protected IProcessNavigation Navigation { get; private set; }
+ public abstract class ProcessStep
+ {
private bool initialized;
+ protected IProcessNavigation Navigation { get; private set; }
+
public void Initialize()
{
if (initialized)
+ {
return;
+ }
this.OnInitialized();
initialized = true;
public virtual void Shutdown()
{
if (!initialized)
+ {
return;
+ }
this.OnShutdown();
initialized = false;
{
return null;
}
- }
- }
+ }
+}
* limitations under the License.
*/
+using Oobe.Common.Styles;
using Tizen.NUI;
-using Tizen.NUI.Components;
using Tizen.NUI.BaseComponents;
-using Oobe.Common.Styles;
+using Tizen.NUI.Components;
namespace Oobe.Common.Layouts
{
/// <summary>
/// Constructs new BasePageLayout object
/// </summary>
- public BasePageLayout() : base()
+ public BasePageLayout()
+ : base()
{
Layout = new AbsoluteLayout();
Title = new TextLabel
if (value != content)
{
if (content != null)
+ {
Remove(content);
- // dispose?
+ }
+
content?.Dispose();
content = value;
if (content == null)
+ {
return;
+ }
+
content.PositionUsesPivotPoint = true;
content.PivotPoint = new Position(0.5f, 0.5f);
content.ParentOrigin = new Position(0.5f, 0.5f);
* limitations under the License.
*/
+using Oobe.Common.Styles;
using Tizen.NUI;
using Tizen.NUI.BaseComponents;
using Tizen.NUI.Components;
-using Oobe.Common.Styles;
namespace Oobe.Common.Layouts
{
/// <summary>
/// Constructs new OneButtonLayout object
/// </summary>
- public OneButtonLayout() : base()
+ public OneButtonLayout()
+ : base()
{
NextButton = new Button(ButtonStyles.Next);
NextButton.PositionUsesPivotPoint = true;
* limitations under the License.
*/
+using Oobe.Common.Styles;
using Tizen.NUI;
using Tizen.NUI.BaseComponents;
using Tizen.NUI.Components;
-using Oobe.Common.Styles;
namespace Oobe.Common.Layouts
{
/// <summary>
/// OOBE Layout with two Buttons, positioned at left and right bottom.
/// </summary>
- public class TwoButtonLayout : BasePageLayout
+ public class TwoButtonLayout
+ : BasePageLayout
{
/// <summary>
/// Constructs new TwoButtonLayout object
/// </summary>
- public TwoButtonLayout() : base()
+ public TwoButtonLayout()
+ : base()
{
NextButton = new Button(ButtonStyles.Next);
NextButton.PositionUsesPivotPoint = true;
public Button PreviousButton { get; private set; }
}
}
-
<OutputType>Library</OutputType>
<TargetFramework>tizen80</TargetFramework>
<TargetFrameworkIdentifier>Tizen</TargetFrameworkIdentifier>
+ <CodeAnalysisRuleSet>../Settings.StyleCop</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<ExcludeAssets>Runtime</ExcludeAssets>
</PackageReference>
<PackageReference Include="Tizen.NET.Sdk" Version="1.1.2" />
+ <PackageReference Include="StyleCop.Analyzers" Version="1.1.118">
+ <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
+ <PrivateAssets>all</PrivateAssets>
+ </PackageReference>
</ItemGroup>
<ItemGroup>
<LastGenOutput>Translations.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>
+ <ItemGroup>
+ <AdditionalFiles Include="../stylecop.json" />
+ <AdditionalFiles Include="../Settings.StyleCop" />
+ </ItemGroup>
</Project>
* limitations under the License.
*/
-using System;
+using System;
using System.Runtime.InteropServices;
using static Oobe.Common.Services.Vconf;
{
internal static partial class Vconf
{
- private const string LIBRARY_VCONF = "libvconf.so.0";
+ private const string LibraryVconf = "libvconf.so.0";
- [DllImport(LIBRARY_VCONF, EntryPoint = "vconf_get_bool")]
+ [DllImport(LibraryVconf, EntryPoint = "vconf_get_bool")]
internal static extern int VconfGetBool(string key, out bool val);
- [DllImport(LIBRARY_VCONF, EntryPoint = "vconf_set_bool")]
+ [DllImport(LibraryVconf, EntryPoint = "vconf_set_bool")]
internal static extern int VconfSetBool(string key, bool intval);
- [DllImport(LIBRARY_VCONF, EntryPoint = "vconf_get_int")]
+ [DllImport(LibraryVconf, EntryPoint = "vconf_get_int")]
internal static extern int VconfGetInt(string key, out int val);
- [DllImport(LIBRARY_VCONF, EntryPoint = "vconf_set_int")]
+ [DllImport(LibraryVconf, EntryPoint = "vconf_set_int")]
internal static extern int VconfSetInt(string key, int intval);
- [DllImport(LIBRARY_VCONF, EntryPoint = "vconf_get_str")]
+ [DllImport(LibraryVconf, EntryPoint = "vconf_get_str")]
internal static extern string VconfGetStr(string key);
- [DllImport(LIBRARY_VCONF, EntryPoint = "vconf_set_str")]
+ [DllImport(LibraryVconf, EntryPoint = "vconf_set_str")]
internal static extern int VconfSetStr(string key, string value);
- [DllImport(LIBRARY_VCONF, EntryPoint = "vconf_notify_key_changed")]
+ [DllImport(LibraryVconf, EntryPoint = "vconf_notify_key_changed")]
internal static extern void VconfNotifyKeyChanged(string key, NotificationCallback callback, IntPtr userData);
- [DllImport(LIBRARY_VCONF, EntryPoint = "vconf_ignore_key_changed")]
+ [DllImport(LibraryVconf, EntryPoint = "vconf_ignore_key_changed")]
internal static extern void VconfIgnoreKeyChanged(string key, NotificationCallback callback);
}
}
*/
using System;
-using Tizen.System;
using Tizen.Applications;
+using Tizen.System;
namespace Oobe.Common.Services
{
{
return Preference.Get<string>(CountryCodeKey);
}
- return String.Empty;
+
+ return string.Empty;
}
set
* limitations under the License.
*/
-using System;
+using System;
using System.Runtime.InteropServices;
using Oobe.Common.Utils;
using static Oobe.Common.Services.Interoperability.Interop.Vconf;
* limitations under the License.
*/
-using Tizen.NUI.Components;
-using Tizen.NUI.BaseComponents;
using Tizen.NUI;
+using Tizen.NUI.BaseComponents;
+using Tizen.NUI.Components;
namespace Oobe.Common.Styles
{
public class ButtonStyles
{
- public static ButtonStyle Next = GetNextButtonStyle();
- public static ButtonStyle Previous = GetPreviousButtonStyle();
- public static ButtonStyle Skip = GetSkipButtonStyle();
+ private static ButtonStyle next = GetNextButtonStyle();
+
+ private static ButtonStyle previous = GetPreviousButtonStyle();
+
+ private static ButtonStyle skip = GetSkipButtonStyle();
+
+ public static ButtonStyle Next { get => next; }
+
+ public static ButtonStyle Previous { get => previous; }
+
+ public static ButtonStyle Skip { get => skip; }
private static ButtonStyle GetPreviousButtonStyle() => new ButtonStyle
{
PointSize = new Selector<float?>
{
Normal = 22.0f,
- Pressed = 24.0f
+ Pressed = 24.0f,
},
EnableMarkup = true,
TranslatableText = "PREVIOUS",
PointSize = new Selector<float?>
{
Normal = 22.0f,
- Pressed = 24.0f
+ Pressed = 24.0f,
},
TextColor = Color.White,
TranslatableText = "CONTINUE",
*/
using System;
-using Tizen.NUI.Components;
using Tizen.NUI;
using Tizen.NUI.BaseComponents;
+using Tizen.NUI.Components;
namespace Oobe.Common.Styles
{
return label.FontStyle;
}
}
+
return null;
}
* limitations under the License.
*/
-using Tizen.NUI.Components;
-using Tizen.NUI.BaseComponents;
-using Tizen.NUI;
using Oobe.Common.Controls;
+using Tizen.NUI;
+using Tizen.NUI.BaseComponents;
+using Tizen.NUI.Components;
namespace Oobe.Common.Styles
{
public class CarouselPickerStyles
{
- public static CarouselPickerStyle Default = new CarouselPickerStyle{
- CenterText = new TextLabelStyle{
+ private static CarouselPickerStyle defaultStyle = new CarouselPickerStyle
+ {
+ CenterText = new TextLabelStyle
+ {
Size2D = new Size2D(312, 26),
PixelSize = 20.0f,
Margin = new Extents(24, 24, 16, 16),
TextColor = new Color(0, 20.0f / 255.0f, 71.0f / 255.0f, 1.0f),
Opacity = 1.0f,
},
- OuterText = new TextLabelStyle{
+ OuterText = new TextLabelStyle
+ {
Size2D = new Size2D(312, 26),
PixelSize = 20.0f,
Margin = new Extents(24, 24, 16, 16),
},
LinesColor = new Color(0, 20.0f / 255.0f, 71.0f / 255.0f, 1.0f),
};
+
+ public static CarouselPickerStyle Default { get => defaultStyle; }
}
}
{
public static class ScrollbarStyles
{
- public static ScrollbarStyle Default = new ScrollbarStyle{
- ThumbColor = new Color(10.0f/255.0f, 13.0f/255.0f, 73.0f/255.0f, 0.5f),
+ private static ScrollbarStyle defaultStyle = new ScrollbarStyle
+ {
+ ThumbColor = new Color(10.0f / 255.0f, 13.0f / 255.0f, 73.0f / 255.0f, 0.5f),
TrackColor = new Color(0.0f, 0.0f, 0.0f, 0.0f),
};
+
+ public static ScrollbarStyle Default { get => defaultStyle; }
}
}
* limitations under the License.
*/
-using Tizen.NUI;
using System;
+using Tizen.NUI;
namespace Oobe.Common.Utils
{
}
delta = max - min;
- s = delta / max; // s
+ s = delta / max; // s
- if( color.R == max )
- h = ( color.G - color.B ) / delta; // between yellow & magenta
- else if( color.G == max )
- h = 2 + ( color.B - color.R ) / delta; // between cyan & yellow
+ if (color.R == max)
+ {
+ h = (color.G - color.B) / delta; // between yellow & magenta
+ }
+ else if (color.G == max)
+ {
+ h = ((color.B - color.R) / delta) + 2; // between cyan & yellow
+ }
else
- h = 4 + ( color.R - color.G ) / delta; // between magenta & cyan
+ {
+ h = ((color.R - color.G) / delta) + 4; // between magenta & cyan
+ }
- h *= 60; // degrees
- if( h < 0 )
+ h *= 60; // degrees
+ if (h < 0)
+ {
h += 360;
+ }
return new Vector3(h, s, v);
}
float s = hsv[1];
float v = hsv[2];
- if (s == 0) {
+ if (s == 0)
+ {
// achromatic (grey)
r = g = b = v;
return new Color(r, g, b, 1.0f);
}
- h /= 60; // sector 0 to 5
- i = (int)Math.Floor( h );
- f = h - i; // factorial part of h
- p = v * ( 1 - s );
- q = v * ( 1 - s * f );
- t = v * ( 1 - s * ( 1 - f ) );
+ h /= 60; // sector 0 to 5
+ i = (int)Math.Floor(h);
+ f = h - i; // factorial part of h
+ p = v * (1 - s);
+ q = v * (1 - (s * f));
+ t = v * (1 - (s * (1 - f)));
- switch( i ) {
+ switch (i)
+ {
case 0:
r = v;
g = t;
g = p;
b = v;
break;
- default: // case 5:
+ default: // case 5:
r = v;
g = p;
b = q;
break;
}
+
return new Color(r, g, b, 1.0f);
}
}
* limitations under the License.
*/
-using Tizen.NUI.BaseComponents;
using Tizen.NUI;
+using Tizen.NUI.BaseComponents;
namespace Oobe.Common.Utils
{
/// <summary>
/// Horizontal scaling factor
/// </summary>
- private static readonly float WIDTH_SCALE_FACTOR = Tizen.NUI.Window.Instance.WindowSize.Width / 1280.0f;
+ private static readonly float WidthScaleFactor = Tizen.NUI.Window.Instance.WindowSize.Width / 1280.0f;
/// <summary>
/// Vertical scaling factor
/// </summary>
- private static readonly float HEIGHT_SCALE_FACTOR = Tizen.NUI.Window.Instance.WindowSize.Height / 720.0f;
+ private static readonly float HeightScaleFactor = Tizen.NUI.Window.Instance.WindowSize.Height / 720.0f;
/// <summary>
/// Scale Size2D accoring to device screen size.
/// </summary>
public static Size2D ScaledSize(Size2D size)
{
- return new Size2D((int)(size.Width * WIDTH_SCALE_FACTOR), (int)(size.Height * HEIGHT_SCALE_FACTOR));
+ return new Size2D((int)(size.Width * WidthScaleFactor), (int)(size.Height * HeightScaleFactor));
}
}
}
* limitations under the License.
*/
-using System;
+using System;
using Tizen.Internals.Errors;
namespace Oobe.Common.Utils
* limitations under the License.
*/
-using Tizen.NUI;
+using Tizen.NUI;
using Tizen.NUI.BaseComponents;
-using Tizen.NUI.Components;\r
-\r
+using Tizen.NUI.Components;
+
namespace Oobe.Common.Utils
{
public class Popup
{
private View view;
private Layer layer = null;
- private bool dismissible; //can be dissmissed when clicked outside
- private float backgroundOpacity;\r
+ private bool dismissible; // can be dissmissed when clicked outside
+ private float backgroundOpacity;
public Popup(View view, float backgroundOpacity = 0.1f, bool dismissible = false, bool centered = false)
{
- this.dismissible = dismissible;\r
- this.backgroundOpacity = backgroundOpacity;\r
+ this.dismissible = dismissible;
+ this.backgroundOpacity = backgroundOpacity;
this.view = view;
if (centered)
{
layer = new Layer();
layer.Add(CreateGray());
layer.Add(view);
- view.TouchEvent += (s, e) => false; //prevent gray view reacting\r
+ view.TouchEvent += (s, e) => false; // prevent gray view reacting
Window.Instance.AddLayer(layer);
- }\r
-\r
- private Control CreateGray()\r
- {\r
+ }
+
+ private Control CreateGray()
+ {
var gray = new Tizen.NUI.Components.Control()
{
WidthResizePolicy = ResizePolicyType.FillToParent,
HeightResizePolicy = ResizePolicyType.FillToParent,
BackgroundColor = new Color(0f, 0f, 0f, backgroundOpacity),
};
- if (dismissible)\r
- {\r
- gray.TouchEvent += (s, e) =>\r
- {\r
- if (e.Touch.GetState(0) == PointStateType.Up)\r
- {\r
- Dismiss();\r
- }\r
- return true;\r
- };\r
- }\r
- return gray;\r
- }\r
+ if (dismissible)
+ {
+ gray.TouchEvent += (s, e) =>
+ {
+ if (e.Touch.GetState(0) == PointStateType.Up)
+ {
+ Dismiss();
+ }
+
+ return true;
+ };
+ }
+
+ return gray;
+ }
}
}
* limitations under the License.
*/
-using Oobe.Common.Interfaces;
+using System;
+using System.Globalization;
+using System.Linq;
+using Oobe.Common.Controls;
+using Oobe.Common.Interfaces;
+using Oobe.Common.Layouts;
+using Oobe.Common.Resources;
using Oobe.Common.Styles;
+using Oobe.Common.Utils;
+using Oobe.Language.Model;
using Tizen.NUI;
-using Tizen.NUI.Components;
using Tizen.NUI.BaseComponents;
-using Oobe.Language.Model;
-using Oobe.Common.Controls;
-using Oobe.Common.Utils;
-using Oobe.Common.Resources;
-using System.Linq;
-using System.Globalization;
-using System;
-using Oobe.Common.Layouts;
+using Tizen.NUI.Components;
namespace Oobe.Language
{
{
private LanguageManger manager;
- public LanguageStep() : base()
+ public LanguageStep()
+ : base()
{
}
var lang = manager.Languages[carousel.SelectedItemIndex];
manager.CurrentLanguage = lang;
}
+
nav.Next();
};
{
[XmlAttribute("code")]
public string Code { get; set; }
+
[XmlAttribute("name_local")]
public string LocalName { get; set; }
}
[XmlElement("language")]
public List<LanguageInfo> Languages { get; set; }
}
-}
\ No newline at end of file
+}
*/
using System.Collections.Generic;
-using System.Linq;
using System.IO;
+using System.Linq;
using System.Xml.Serialization;
using Oobe.Common.Services;
{
return Languages.FirstOrDefault(s => s.Code == Settings.Language) ?? Languages.FirstOrDefault();
}
+
set
{
if (value != null)
<OutputType>Library</OutputType>
<TargetFramework>tizen80</TargetFramework>
<TargetFrameworkIdentifier>Tizen</TargetFrameworkIdentifier>
+ <CodeAnalysisRuleSet>../Settings.StyleCop</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<ExcludeAssets>Runtime</ExcludeAssets>
</PackageReference>
<PackageReference Include="Tizen.NET.Sdk" Version="1.1.2" />
+ <PackageReference Include="StyleCop.Analyzers" Version="1.1.118">
+ <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
+ <PrivateAssets>all</PrivateAssets>
+ </PackageReference>
</ItemGroup>
<ItemGroup>
<ItemGroup>
<Folder Include="res\" />
</ItemGroup>
+ <ItemGroup>
+ <AdditionalFiles Include="../stylecop.json" />
+ <AdditionalFiles Include="../Settings.StyleCop" />
+ </ItemGroup>
</Project>
{
[XmlAttribute("code")]
public string CountryCode { get; set; }
+
[XmlAttribute("name_en")]
public string Name { get; set; }
}
[XmlElement("region")]
public List<RegionInfo> Regions { get; set; }
}
-}
\ No newline at end of file
+}
* limitations under the License.
*/
+using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Xml.Serialization;
using Oobe.Common.Services;
-using System;
namespace Oobe.Region.Model
{
{
return Regions.FirstOrDefault(s => s.CountryCode == Settings.Country) ?? Regions.FirstOrDefault();
}
+
set
{
if (value != null)
<OutputType>Library</OutputType>
<TargetFramework>tizen80</TargetFramework>
<TargetFrameworkIdentifier>Tizen</TargetFrameworkIdentifier>
+ <CodeAnalysisRuleSet>../Settings.StyleCop</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<ExcludeAssets>Runtime</ExcludeAssets>
</PackageReference>
<PackageReference Include="Tizen.NET.Sdk" Version="1.1.2" />
+ <PackageReference Include="StyleCop.Analyzers" Version="1.1.118">
+ <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
+ <PrivateAssets>all</PrivateAssets>
+ </PackageReference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Oobe.Common\Oobe.Common.csproj" />
<ItemGroup>
<Folder Include="res\" />
</ItemGroup>
+ <ItemGroup>
+ <AdditionalFiles Include="../stylecop.json" />
+ <AdditionalFiles Include="../Settings.StyleCop" />
+ </ItemGroup>
</Project>
* limitations under the License.
*/
-using Oobe.Common.Styles;
+using Oobe.Common.Controls;
+using Oobe.Common.Interfaces;
+using Oobe.Common.Layouts;
+using Oobe.Common.Styles;
+using Oobe.Region.Model;
using Tizen.NUI;
using Tizen.NUI.BaseComponents;
-using Oobe.Common.Interfaces;
using Tizen.NUI.Components;
-using Oobe.Region.Model;
-using Oobe.Common.Controls;
-using Oobe.Common.Layouts;
namespace Oobe.Region
{
- public class RegionStep : ProcessStep
- {
- private RegionManager manager;
+ public class RegionStep : ProcessStep
+ {
+ private RegionManager manager;
- public RegionStep() : base()
+ public RegionStep()
+ : base()
{
}
carousel.AddItem(item);
}
- container.NextButton.Clicked += (obj, args) => {
+ container.NextButton.Clicked += (obj, args) =>
+ {
if (carousel.SelectedItemIndex >= 0 && carousel.SelectedItemIndex < manager.Regions.Count)
{
var region = manager.Regions[carousel.SelectedItemIndex];
manager.CurrentRegion = region;
}
+
nav.Next();
};
- container.PreviousButton.Clicked += (obj, args) => {
+ container.PreviousButton.Clicked += (obj, args) =>
+ {
nav.Previous();
};
container.Content = carousel;
return container;
- }
- }
+ }
+ }
}
TermsAccepted = false;
}
+ public bool TermsAccepted { get; private set; }
+
public string LoadTerms()
{
string terms = null;
var locale = Settings.Country;
- var filename = Path.Combine(Tizen.Applications.CoreApplication.Current.DirectoryInfo.Resource , "terms" , locale + ".txt");
+ var filename = Path.Combine(Tizen.Applications.CoreApplication.Current.DirectoryInfo.Resource, "terms", locale + ".txt");
- try {
+ try
+ {
terms = File.ReadAllText(filename);
- } catch (Exception e) {
+ }
+ catch (Exception e)
+ {
Tizen.Log.Debug("oobe", $"Unable to load terms: {e.Message}");
return null;
}
+
return terms;
}
- public bool TermsAccepted { get; private set; }
-
public void AcceptTerms()
{
TermsAccepted = true;
<OutputType>Library</OutputType>
<TargetFramework>tizen80</TargetFramework>
<TargetFrameworkIdentifier>Tizen</TargetFrameworkIdentifier>
+ <CodeAnalysisRuleSet>../Settings.StyleCop</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<ExcludeAssets>Runtime</ExcludeAssets>
</PackageReference>
<PackageReference Include="Tizen.NET.Sdk" Version="1.1.2" />
+ <PackageReference Include="StyleCop.Analyzers" Version="1.1.118">
+ <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
+ <PrivateAssets>all</PrivateAssets>
+ </PackageReference>
</ItemGroup>
<ItemGroup>
<ItemGroup>
<Folder Include="res\" />
+ <AdditionalFiles Include="../stylecop.json" />
+ <AdditionalFiles Include="../Settings.StyleCop" />
</ItemGroup>
</Project>
{
public class SwitchStyles
{
- public static SwitchStyle IHaveReadAndAgreeSwitchStyle = new SwitchStyle
+ private static SwitchStyle iHaveReadAndAgreeSwitchStyle = new SwitchStyle
{
Thumb = new ImageViewStyle
{
},
},
};
+
+ public static SwitchStyle IHaveReadAndAgreeSwitchStyle { get => iHaveReadAndAgreeSwitchStyle; }
}
}
{
public class TextLabelStyles
{
- public static TextLabelStyle IHaveReadAndAgreeTextStyle = new TextLabelStyle{
-
- TextColor = new Selector<Color>{
- Normal = new Color(0, 20.0f/255.0f, 71.0f/255.0f, 1.0f),
- Disabled = new Color(112.0f/255.0f, 112.0f/255.0f, 112.0f/255.0f, 1.0f),
+ private static TextLabelStyle iHaveReadAndAgreeTextStyle = new TextLabelStyle
+ {
+ TextColor = new Selector<Color>
+ {
+ Normal = new Color(0, 20.0f / 255.0f, 71.0f / 255.0f, 1.0f),
+ Disabled = new Color(112.0f / 255.0f, 112.0f / 255.0f, 112.0f / 255.0f, 1.0f),
},
Size2D = new Size2D(639, 26),
PixelSize = 22.0f,
FontFamily = "BreezeSans",
Ellipsis = false,
};
- // workaround for issue with TextLabelStyle State not being applied
- public static TextLabelStyle IHaveReadAndAgreeTextStyleDisabled = new TextLabelStyle{
- TextColor = new Selector<Color>{
- Normal = new Color(112.0f/255.0f, 112.0f/255.0f, 112.0f/255.0f, 1.0f),
+ // workaround for issue with TextLabelStyle State not being applied
+ private static TextLabelStyle iHaveReadAndAgreeTextStyleDisabled = new TextLabelStyle
+ {
+ TextColor = new Selector<Color>
+ {
+ Normal = new Color(112.0f / 255.0f, 112.0f / 255.0f, 112.0f / 255.0f, 1.0f),
},
Size2D = new Size2D(839, 26),
PixelSize = 22.0f,
FontFamily = "BreezeSans",
Ellipsis = false,
};
- public static TextLabelStyle GuideTextLabelStyle = new TextLabelStyle{
+
+ private static TextLabelStyle guideTextLabelStyle = new TextLabelStyle
+ {
PixelSize = 18,
Ellipsis = false,
Size2D = new Size2D(639, 22),
- TextColor = new Selector<Color>{
- Normal = new Color(112.0f / 255.0f, 112.0f / 255.0f, 112.0f / 255.0f, 1.0f)
+ TextColor = new Selector<Color>
+ {
+ Normal = new Color(112.0f / 255.0f, 112.0f / 255.0f, 112.0f / 255.0f, 1.0f),
},
};
- public static TextLabelStyle ContentTextLabelStyle = new TextLabelStyle{
- TextColor = new Selector<Color>{
+
+ private static TextLabelStyle contentTextLabelStyle = new TextLabelStyle
+ {
+ TextColor = new Selector<Color>
+ {
Normal = new Color(0, 12.0f / 255.0f, 43.0f / 255.0f, 1.0f),
},
PointSize = 16.0f,
Focusable = false,
MultiLine = true,
};
+
+ public static TextLabelStyle IHaveReadAndAgreeTextStyle { get => iHaveReadAndAgreeTextStyle; }
+
+ public static TextLabelStyle IHaveReadAndAgreeTextStyleDisabled { get => iHaveReadAndAgreeTextStyleDisabled; }
+
+ public static TextLabelStyle GuideTextLabelStyle { get => guideTextLabelStyle; }
+
+ public static TextLabelStyle ContentTextLabelStyle { get => contentTextLabelStyle; }
}
}
* limitations under the License.
*/
-using Oobe.Common.Interfaces;\r
-using Tizen.NUI.BaseComponents;\r
+using Oobe.Common.Interfaces;\r
using Oobe.Terms.Model;\r
using Oobe.Terms.Views;\r
+using Tizen.NUI.BaseComponents;\r
\r
namespace Oobe.Terms\r
{\r
\r
public override View CreateView(IProcessNavigation nav)\r
{\r
- return new TermsView(nav, provider);\r
- }\r
+ return new TermsView(nav, provider);
+ }\r
}\r
}\r
* limitations under the License.
*/
-using Oobe.Common.Styles;
using Oobe.Common.Interfaces;
+using Oobe.Common.Layouts;
+using Oobe.Common.Styles;
+using Oobe.Common.Utils;
+using Oobe.Terms.Model;
+using Oobe.Terms.Styles;
using Tizen.NUI;
using Tizen.NUI.BaseComponents;
using Tizen.NUI.Components;
-using Oobe.Terms.Model;
-using Oobe.Terms.Styles;
-using Oobe.Common.Layouts;
-using Oobe.Common.Utils;
namespace Oobe.Terms.Views
{
{
AgreementCheckable = true;
}
+
return false;
};
timer.Start();
-
}
private bool NextEnabled
{
return nextEnabled;
}
+
set
{
- if (nextEnabled == value) return;
+ if (nextEnabled == value)
+ {
+ return;
+ }
+
if (value)
{
NextButton.State = States.Normal;
NextButton.IsEnabled = false;
agreeSwitch.IsSelected = false;
}
+
nextEnabled = value;
}
}
{
return agreementCheckable;
}
+
set
{
- if (value == agreementCheckable) return;
+ if (value == agreementCheckable)
+ {
+ return;
+ }
+
if (value)
{
agreeLabel.State = States.Normal;
- //TODO workaround issue with TextLabel when Disabled style is not applied
- //when changing control state. Fix it by reapplying special style
- //remove below line when issue get fixed
+
+ // TODO workaround issue with TextLabel when Disabled style is not applied
+ // when changing control state. Fix it by reapplying special style
+ // remove below line when issue get fixed
agreeLabel.ApplyStyle(TextLabelStyles.IHaveReadAndAgreeTextStyle);
agreeSwitch.IsEnabled = true;
agreeSwitch.State = States.Normal;
else
{
agreeLabel.State = States.Disabled;
- //TODO workaround issue with TextLabel when Disabled style is not applied
- //when changing control state. Fix it by reapplying special style
- //remove below line when issue get fixed
+
+ // TODO workaround issue with TextLabel when Disabled style is not applied
+ // when changing control state. Fix it by reapplying special style
+ // remove below line when issue get fixed
agreeLabel.ApplyStyle(TextLabelStyles.IHaveReadAndAgreeTextStyleDisabled);
agreeSwitch.IsEnabled = false;
agreeSwitch.State = States.Disabled;
tapGestureDetector.Detected -= OnTapGestureDetected;
tapGestureDetector.Detach(agreeLabel);
}
+
agreementCheckable = value;
}
}
return true;
}
}
+
return false;
}
return Config.ScaledSize(referenceTermsSize);
}
}
-
}
<OutputType>Library</OutputType>
<TargetFramework>tizen80</TargetFramework>
<TargetFrameworkIdentifier>Tizen</TargetFrameworkIdentifier>
+ <CodeAnalysisRuleSet>../Settings.StyleCop</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<ExcludeAssets>Runtime</ExcludeAssets>
</PackageReference>
<PackageReference Include="Tizen.NET.Sdk" Version="1.1.2" />
+ <PackageReference Include="StyleCop.Analyzers" Version="1.1.118">
+ <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
+ <PrivateAssets>all</PrivateAssets>
+ </PackageReference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Oobe.Common\Oobe.Common.csproj" />
+ <AdditionalFiles Include="../stylecop.json" />
+ <AdditionalFiles Include="../Settings.StyleCop" />
</ItemGroup>
</Project>
* limitations under the License.
*/
-using Oobe.Common.Interfaces;\r
+using Oobe.Common.Interfaces;\r
+using Oobe.Common.Layouts;
using Oobe.Common.Styles;\r
using Tizen.NUI;\r
using Tizen.NUI.BaseComponents;\r
using Tizen.NUI.Components;\r
-using Oobe.Common.Layouts;
\r
namespace Oobe.Welcome\r
{\r
\r
TextLabel content = new TextLabel();\r
content.Size2D = new Size2D(1026, 166);\r
- content.TextColor = new Color(0, 12.0f/255.0f, 43.0f/255.0f, 1.0f);\r
+ content.TextColor = new Color(0, 12.0f / 255.0f, 43.0f / 255.0f, 1.0f);\r
content.PixelSize = 22.0f;\r
content.HorizontalAlignment = HorizontalAlignment.Center;\r
content.FontFamily = "BreezeSansLight";\r
content.Text = "There should be some description or information about Tizen IoT. There should be some description or information about Tizen IoT. There should be some description or information about Tizen IoT. There should be some description or information about Tizen IoT. There should be some description or information about Tizen IoT. There should be some description or information about Tizen IoT. There should be some description or information about Tizen IoT. There should be some description or information about Tizen IoT.";\r
\r
container.NextButton.TranslatableText = "GET_STARTED";\r
- container.NextButton.Clicked += (obj, args) => {\r
+ container.NextButton.Clicked += (obj, args) =>
+ {\r
nav.Finish();\r
};\r
\r
using System.Collections.ObjectModel;
using System.Linq;
using System.Threading.Tasks;
+using Oobe.Common.Styles;
using Tizen.NUI;
using Tizen.NUI.BaseComponents;
using Tizen.NUI.Components;
-using Oobe.Common.Styles;
namespace Oobe.Wifi.Controls
{
this.height = height;
}
- //code does not handle the case with separators but without footer
+ // code does not handle the case with separators but without footer
public Func<View> SeparatorFactory { get; set; } = null;
public View Footer
{
LayoutView.Remove(footer);
}
+
footer = value;
if (footer != null)
{
HideScrollbar = false,
};
}
+
return scrollableBase;
}
}
+ public ObservableCollection<View> Items
+ {
+ get
+ {
+ return items;
+ }
+
+ set
+ {
+ if (value != items)
+ {
+ DetachItems();
+ items = value;
+ AttachItems();
+ }
+ }
+ }
+
private View LayoutView
{
get
HeightResizePolicy = ResizePolicyType.FitToChildren,
});
}
- return View.Children.First();
- }
- }
- public ObservableCollection<View> Items
- {
- get
- {
- return items;
- }
- set
- {
- if (value != items)
- {
- DetachItems();
- items = value;
- AttachItems();
- }
+ return View.Children.First();
}
}
}
}
- //not thread safe
+ // not thread safe
private void AttachItems()
{
if (items != null)
{
AddRegularItem(item);
}
+
items.CollectionChanged += OnCollectionChanged;
}
}
if (item != null)
{
RemoveRegularItem(item);
- //if scroll was at the end, make sure it is still properly aligned to the end
- //Tizen.Log.Debug("demo", $"{View.CurrentPage}");
+
+ // if scroll was at the end, make sure it is still properly aligned to the end
+ // Tizen.Log.Debug("demo", $"{View.CurrentPage}");
}
}
else if (e.Action == System.Collections.Specialized.NotifyCollectionChangedAction.Reset)
{
RemoveItems();
}
+
LayoutView.HeightResizePolicy = ResizePolicyType.FitToChildren;
}
LayoutView.Add(item);
if (SeparatorFactory != null)
{
- if (itemToSeparator.ContainsKey(item)==false)
+ if (itemToSeparator.ContainsKey(item) == false)
{
var separator = SeparatorFactory();
itemToSeparator.Add(item, separator);
private void RemoveRegularItem(View item)
{
LayoutView.Remove(item);
- if(itemToSeparator.ContainsKey(item))
+ if (itemToSeparator.ContainsKey(item))
{
LayoutView.Remove(itemToSeparator[item]);
itemToSeparator.Remove(item);
{
LayoutView.Remove(child);
}
+
itemToSeparator.Clear();
}
}
* limitations under the License.
*/
-using System.Linq;
+using System.Linq;
using Tizen.NUI;
namespace Oobe.Wifi.Controls
base.OnChildAdd(child);
if (lastItem != null)
{
- if (LayoutChildren.Remove(lastItem))//remove by position, or find from the end
+ // remove by position, or find from the end
+ if (LayoutChildren.Remove(lastItem))
{
LayoutChildren.Add(lastItem);
}
* limitations under the License.
*/
-using System;
+using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
+using Oobe.Common.Styles;
+using Oobe.Common.Utils;
+using Tizen.Network.WiFi;
using Tizen.NUI;
using Tizen.NUI.BaseComponents;
using Tizen.NUI.Components;
-using Oobe.Common.Styles;
-using Tizen.Network.WiFi;
-using Oobe.Common.Utils;
namespace Oobe.Wifi.Controls.Wifi
{
- class AddNewNetworkPupup : View
+ public class AddNewNetworkPupup : View
{
- public event Action OnDismiss;
- enum NewNetworkViewMode
- {
- NoPassword,
- PasswordOnly,
- UserPassword
- };
- NewNetworkViewMode currentViewMode;
- TextLabel titleLabel;
- TextField ssidTextField;
- View ssidUnderline;
- TextLabel selectedSecurityTypeLabel;
- TapGestureDetector securityTypeDetector;
- TextLabel usernameLabel;
- TextField usernameTextField;
- View usernameUnderline;
- PasswordEntry passwordEntry;
- View passwordUnderline;
- Button revealButton;
- Button cancelButton;
- Button addButton;
- TextLabel failureLabel;
- WifiUISecurityType currentSecurityType;
+ private NewNetworkViewMode currentViewMode;
+ private TextLabel titleLabel;
+ private TextField ssidTextField;
+ private View ssidUnderline;
+ private TextLabel selectedSecurityTypeLabel;
+ private TapGestureDetector securityTypeDetector;
+ private TextLabel usernameLabel;
+ private TextField usernameTextField;
+ private View usernameUnderline;
+ private PasswordEntry passwordEntry;
+ private View passwordUnderline;
+ private Button revealButton;
+ private Button cancelButton;
+ private Button addButton;
+ private TextLabel failureLabel;
+ private WifiUISecurityType currentSecurityType;
private string backgroundImagePath = System.IO.Path.Combine(NUIApplication.Current.DirectoryInfo.Resource, "08_popup_body.png");
private string arrowImagePath = System.IO.Path.Combine(NUIApplication.Current.DirectoryInfo.Resource, "12_back_active.png");
- static Color largeTextColor => new Color(0.0f, 0x14 / 255.0f, 0x47 / 255.0f, 1.0f);
- static Color smallTextColor => new Color(0.0f, 0xC / 255.0f, 0x2B / 255.0f, 1.0f);
- static Size labelSize => new Size(600, 19);
- static Size textControlSize => new Size(680, 27);
- static Size passwordControlSize => new Size(583, 27);
- int labelFontSize = 14;
- int textFontSize = 22;
- int passwordFontSize = 22;
+ private int labelFontSize = 14;
+ private int textFontSize = 22;
+ private int passwordFontSize = 22;
public AddNewNetworkPupup()
{
Tizen.Log.Debug("oobe", "Finished creating Add New Network Popup");
}
- TextLabel CreateTextLabel(string translatableText, Position2D position = null)
+ public event Action OnDismiss;
+
+ public enum NewNetworkViewMode
+ {
+ NoPassword,
+ PasswordOnly,
+ UserPassword,
+ }
+
+ private static Color LargeTextColor => new Color(0.0f, 0x14 / 255.0f, 0x47 / 255.0f, 1.0f);
+
+ private static Color SmallTextColor => new Color(0.0f, 0xC / 255.0f, 0x2B / 255.0f, 1.0f);
+
+ private static Size LabelSize => new Size(600, 19);
+
+ private static Size TextControlSize => new Size(680, 27);
+
+ private static Size PasswordControlSize => new Size(583, 27);
+
+ private TextLabel CreateTextLabel(string translatableText, Position2D position = null)
{
position ??= new Position2D();
return new TextLabel
{
Position = position,
- Size = labelSize,
+ Size = LabelSize,
PixelSize = labelFontSize,
TranslatableText = translatableText,
FontFamily = "BreezeSans",
FontStyle = new PropertyMap().AddRegularFontStyle(),
- TextColor = smallTextColor,
+ TextColor = SmallTextColor,
HorizontalAlignment = HorizontalAlignment.Begin,
- VerticalAlignment = VerticalAlignment.Center
+ VerticalAlignment = VerticalAlignment.Center,
};
}
- TextField CreateTextField(string placeholderTranslatableText, Position2D position = null)
+ private TextField CreateTextField(string placeholderTranslatableText, Position2D position = null)
{
position ??= new Position2D();
var textField = new TextField
{
Position = position,
- Size = textControlSize,
+ Size = TextControlSize,
PixelSize = textFontSize,
FontFamily = "BreezeSans",
FontStyle = new PropertyMap().AddRegularFontStyle(),
- TextColor = largeTextColor,
+ TextColor = LargeTextColor,
TranslatablePlaceholderText = placeholderTranslatableText,
HorizontalAlignment = HorizontalAlignment.Begin,
- VerticalAlignment = VerticalAlignment.Center
+ VerticalAlignment = VerticalAlignment.Center,
};
return textField;
}
- View CreateUnderline(Position2D position = null, Size2D size = null)
+ private View CreateUnderline(Position2D position = null, Size2D size = null)
{
position ??= new Position2D();
size ??= new Size2D(728, 1);
{
Position = position,
Size = size,
- BackgroundColor = new Color(0xC3 / 255.0f, 0xCA / 255.0f, 0xD2 / 255.0f, 1.0f)
+ BackgroundColor = new Color(0xC3 / 255.0f, 0xCA / 255.0f, 0xD2 / 255.0f, 1.0f),
};
}
- PasswordEntry CreatePasswordEntry(Position2D position = null)
+ private PasswordEntry CreatePasswordEntry(Position2D position = null)
{
position ??= new Position2D();
var passwordEntry = new PasswordEntry
{
Position = position,
- Size = passwordControlSize,
+ Size = PasswordControlSize,
PixelSize = passwordFontSize,
FontFamily = "BreezeSans",
FontStyle = new PropertyMap().AddRegularFontStyle(),
- TextColor = largeTextColor,
+ TextColor = LargeTextColor,
TranslatablePlaceholderText = "WIFI_PASSWORD",
HorizontalAlignment = HorizontalAlignment.Begin,
VerticalAlignment = VerticalAlignment.Center,
- Revealed = false
+ Revealed = false,
};
return passwordEntry;
}
- Button CreateRevealButton(Position2D position = null)
+ private Button CreateRevealButton(Position2D position = null)
{
position ??= new Position2D();
var button = new Button(ButtonStyles.Reveal)
return button;
}
- void InitializeStaticElements()
+ private void InitializeStaticElements()
{
this.BackgroundImage = backgroundImagePath;
titleLabel = new TextLabel
TranslatableText = "WIFI_ADD_NETWORK",
FontFamily = "BreezeSans",
FontStyle = new PropertyMap().AddLightFontStyle(),
- TextColor = largeTextColor,
+ TextColor = LargeTextColor,
HorizontalAlignment = HorizontalAlignment.Center,
- VerticalAlignment = VerticalAlignment.Center
+ VerticalAlignment = VerticalAlignment.Center,
};
this.Add(titleLabel);
cancelButton = new Button(ButtonStyles.Cancel)
{
- Size = new Size(240, 72)
+ Size = new Size(240, 72),
};
cancelButton.Clicked += (s, e) => OnDismiss?.Invoke();
this.Add(cancelButton);
addButton = new Button(ButtonStyles.OK)
{
Size = new Size(240, 72),
- TranslatableText = "WIFI_ADD"
+ TranslatableText = "WIFI_ADD",
};
addButton.Clicked += async (s, e) =>
{
ShowFailureSsidLabel();
return;
}
+
bool success = false;
if (aps is null || aps.Count() == 0)
{
ShowFailureSsidLabel();
return;
}
+
foreach (var wifiAp in aps)
{
- Tizen.Log.Debug("oobe", $"Trying to add new network: SSID: {wifiAp.NetworkInformation.Bssid} ({wifiAp.NetworkInformation.Essid}), " +
+ string message = $"Trying to add new network: SSID: " +
+ $"{wifiAp.NetworkInformation.Bssid} ({wifiAp.NetworkInformation.Essid}), " +
$"Password: {(passwordEntry is null ? "not set" : "XXXXXXXX")}, " +
- $"Security type: {currentSecurityType.GetUIName()}");
+ $"Security type: {currentSecurityType.GetUIName()}";
+ Tizen.Log.Debug("oobe", message);
wifiAp.SecurityInformation.SecurityType = currentSecurityType.GetApSecurityType();
if (!(passwordEntry is null))
{
wifiAp.SecurityInformation.SetPassphrase(passwordEntry.Password);
}
+
Task<bool> task = null;
try
{
}
catch (Exception connectionException)
{
- Tizen.Log.Error("oobe", $"Failed to connect to WiFI {wifiAp.NetworkInformation.Bssid} ({wifiAp.NetworkInformation.Essid})" +
+ string errorMessage = $"Failed to connect to WiFI {wifiAp.NetworkInformation.Bssid} ({wifiAp.NetworkInformation.Essid})" +
$"Password: {(passwordEntry is null ? "not set" : "XXXXXXXX")}, " +
$"Security type: {currentSecurityType.GetUIName()} " +
- connectionException.Message);
+ connectionException.Message;
+ Tizen.Log.Error("oobe", errorMessage);
continue;
}
+
if (task is null)
{
Tizen.Log.Error("oobe", "Failed to cast connection task");
OnDismiss?.Invoke();
continue;
}
+
try
{
if (await task)
}
catch (Exception connectionException)
{
- Tizen.Log.Error("oobe", $"Failed to connect to WiFI {wifiAp.NetworkInformation.Bssid} ({wifiAp.NetworkInformation.Essid})" +
+ string errorMessage = $"Failed to connect to WiFI {wifiAp.NetworkInformation.Bssid} ({wifiAp.NetworkInformation.Essid})" +
$"Password: {(passwordEntry is null ? "not set" : "XXXXXXXX")}, " +
$"Security type: {currentSecurityType.GetUIName()} " +
- connectionException.Message);
+ connectionException.Message;
+ Tizen.Log.Error("oobe", errorMessage);
continue;
}
-
}
+
if (success)
{
OnDismiss?.Invoke();
FontStyle = new PropertyMap().AddRegularFontStyle(),
TextColor = new Color(0xAA / 255.0f, 0x18 / 255.0f, 0x18 / 255.0f, 1.0f),
HorizontalAlignment = HorizontalAlignment.Begin,
- VerticalAlignment = VerticalAlignment.Center
+ VerticalAlignment = VerticalAlignment.Center,
};
failureLabel.Hide();
this.Add(failureLabel);
TranslatableText = currentSecurityType.GetUIName(),\r
FontStyle = new PropertyMap().AddRegularFontStyle(),\r
FontFamily = "BreezeSans",\r
- TextColor = largeTextColor,\r
+ TextColor = LargeTextColor,\r
HorizontalAlignment = HorizontalAlignment.Begin,
VerticalAlignment = VerticalAlignment.Center,\r
};\r
return view;\r
}\r
\r
- void OpenSecurityTypePopup()
+ private void OpenSecurityTypePopup()
{
var view = new ChangeSecurityTypePopup(currentSecurityType);
var popup = new Oobe.Common.Utils.Popup(view, backgroundOpacity: 0f);
popup.Show();
}
- void ResetViewToNoPassword()
+ private void ResetViewToNoPassword()
{
Size = new Size(808, 343);
Position = new Position2D(236, 118);
currentViewMode = NewNetworkViewMode.NoPassword;
}
- void ResetViewToPasswordOnly()
+ private void ResetViewToPasswordOnly()
{
Size = new Size2D(808, 412);
Position = new Position2D(236, 59);
currentViewMode = NewNetworkViewMode.PasswordOnly;
}
- void ResetViewToUserPassword()
+ private void ResetViewToUserPassword()
{
Size = new Size2D(808, 440);
Position = new Position2D(236, 0);
currentViewMode = NewNetworkViewMode.UserPassword;
}
- void ResetViewTo(WifiUISecurityType securityType)
+ private void ResetViewTo(WifiUISecurityType securityType)
{
Tizen.Log.Debug("oobe", $"Reseting view to {securityType.GetUIName()}");
failureLabel.Hide();
}
}
- void ShowFailureSsidLabel()
+ private void ShowFailureSsidLabel()
{
failureLabel.Show();
failureLabel.TranslatableText = "WIFI_SSID_FAILURE";
failureLabel.Position2D = ssidTextField.Position2D + new Position2D(0, (int)ssidTextField.Size.Height);
}
- void ShowFailurePasswordLabel()
+ private void ShowFailurePasswordLabel()
{
failureLabel.Show();
if (currentViewMode == NewNetworkViewMode.NoPassword)
* limitations under the License.
*/
-using System;
+using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
private Dictionary<WiFiAP, ApView> apToViewMap = new Dictionary<WiFiAP, ApView>();
private CancellationTokenSource updatingCancellation = new CancellationTokenSource();
- public ObservableCollection<View> Views { get; private set; } = new ObservableCollection<View>();
-
public ApManager(Action<WiFiAP> onTapped)
{
this.onTapped = onTapped;
_ = RunUpdatingAps();
}
- private void OnConnectionStateChanged(object sender, ConnectionStateChangedEventArgs e)
- {
- if (apToViewMap.TryGetValue(e.AP, out ApView view))
- {
- view.Update(e.AP);
- }
- }
+ public ObservableCollection<View> Views { get; private set; } = new ObservableCollection<View>();
public void UpdateTo(IEnumerable<WiFiAP> aps)
{
{
ap.Dispose();
}
+
apToViewMap.Clear();
Views.Clear();
}
}
+ private void OnConnectionStateChanged(object sender, ConnectionStateChangedEventArgs e)
+ {
+ if (apToViewMap.TryGetValue(e.AP, out ApView view))
+ {
+ view.Update(e.AP);
+ }
+ }
+
private async Task RunUpdatingAps()
{
while (await Delay())
catch (Exception)
{
}
+
return updatingCancellation.IsCancellationRequested == false;
}
}
* limitations under the License.
*/
-using System;
+using System;
+using Oobe.Common.Styles;
using Tizen.Network.WiFi;
using Tizen.NUI;
using Tizen.NUI.BaseComponents;
-using Oobe.Common.Styles;
namespace Oobe.Wifi.Controls.Wifi
{
public class ApView : View
{
- public event Action Tapped;
private TextLabel detail = null;
private View range = null;
- //detectors have to be kept separately because of GC, there is no link by ref between View and Detector
+
+ // detectors have to be kept separately because of GC, there is no link by ref between View and Detector
private TapGestureDetector detector;
public ApView()
Layout = new AbsoluteLayout();
}
+ public event Action Tapped;
+
public void Update(WiFiAP wifiAp)
{
if (range == null)
private static string GetDetailInfo(WiFiAP wifiAp)
{
- //state
+ // state
if (wifiAp.NetworkInformation.ConnectionState == WiFiConnectionState.Connected)
{
return "Connected";
}
+
if (wifiAp.NetworkInformation.ConnectionState == WiFiConnectionState.Association)
{
return "Connecting...";
- }
- //security
+ } // security
else if (wifiAp.SecurityInformation.SecurityType == Tizen.Network.Connection.WiFiSecurityType.None)
{
return "Open";
private static string GetRangeImage(WiFiAP wifiAp)
{
- return System.IO.Path.Combine(NUIApplication.Current.DirectoryInfo.Resource
- , $"12_icon_wifi{(int)wifiAp.NetworkInformation.RssiLevel}.png");
+ return System.IO.Path.Combine(
+ NUIApplication.Current.DirectoryInfo.Resource,
+ $"12_icon_wifi{(int)wifiAp.NetworkInformation.RssiLevel}.png");
}
}
}
* limitations under the License.
*/
-using System;
+using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
{
public class ButtonStyles
{
- public static ButtonStyle Cancel = GetCancelButtonStyle();
- public static ButtonStyle OK = GetOKButtonStyle();
- public static ButtonStyle Scan = GetScanButtonStyle();
- public static ButtonStyle TurnOnOff = GetTurnOnOffButtonStyle();
- public static ButtonStyle Reveal = GetRevealButtonStyle();
- public static ButtonStyle AddNetwork = GetAddNetworkButtonStyle();
+ public static ButtonStyle Cancel { get => GetCancelButtonStyle(); }
+
+ public static ButtonStyle OK { get => GetOKButtonStyle(); }
+
+ public static ButtonStyle Scan { get => GetScanButtonStyle(); }
+
+ public static ButtonStyle TurnOnOff { get => GetTurnOnOffButtonStyle(); }
+
+ public static ButtonStyle Reveal { get => GetRevealButtonStyle(); }
+
+ public static ButtonStyle AddNetwork { get => GetAddNetworkButtonStyle(); }
private static ButtonStyle GetCancelButtonStyle() => new ButtonStyle
{
PointSize = new Selector<float?>
{
Normal = 22.0f,
- Pressed = 24.0f
+ Pressed = 24.0f,
},
EnableMarkup = true,
TranslatableText = "WIFI_CANCEL",
PointSize = new Selector<float?>
{
Normal = 22.0f,
- Pressed = 24.0f
+ Pressed = 24.0f,
},
TextColor = Color.White,
TranslatableText = "WIFI_OK",
* limitations under the License.
*/
-using System;
+using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
+using Oobe.Common.Styles;
+using Tizen.Network.WiFi;
using Tizen.NUI;
using Tizen.NUI.BaseComponents;
using Tizen.NUI.Components;
-using Oobe.Common.Styles;
-using Tizen.Network.WiFi;
namespace Oobe.Wifi.Controls.Wifi
{
- class ChangeSecurityTypePopup : View
+ public class ChangeSecurityTypePopup : View
{
- public event Action OnDismiss;
-
- public WifiUISecurityType WifiUISecurityType { get; private set; }
private WifiUISecurityType originalWifUISecurityType;
private ListView listView;
private ObservableCollection<View> choiceViews = new ObservableCollection<View>();
InitializeRadioButtons();
}
+ public event Action OnDismiss;
+
+ public WifiUISecurityType WifiUISecurityType { get; private set; }
+
public void InitializeStaticElements()
{
var titleLabel = new TextLabel()
FontStyle = new PropertyMap().AddLightFontStyle(),
TextColor = new Color(0.0f, 0x14 / 255.0f, 0x47 / 255.0f, 1.0f),
HorizontalAlignment = HorizontalAlignment.Center,
- VerticalAlignment = VerticalAlignment.Center
+ VerticalAlignment = VerticalAlignment.Center,
};
this.Add(titleLabel);
{
Position = new Position(488, 344),
Size = new Size(240, 72),
- TranslatableText = "WIFI_OK"
+ TranslatableText = "WIFI_OK",
};
addButton.Clicked += (s, e) =>
var view = CreateOption(type);
choiceViews.Add(view);
}
+
listView = new ListView(768, 238)
{
- Items = choiceViews
+ Items = choiceViews,
};
listView.View.Position = new Position(0, 82);
this.Add(listView.View);
{
view.Button.IsSelected = true;
}
+
radioButtonGroup.Add(view.Button);
view.Button.Clicked += (s, e) => this.WifiUISecurityType = view.WifiUISecurityType;
return view;
* limitations under the License.
*/
-using Tizen.NUI;
+using Tizen.NUI;
namespace Oobe.Wifi.Controls.Wifi
{
public class PasswordEntry : Tizen.NUI.BaseComponents.TextField
{
private bool revealed = false;
+
public string Password => Text;
public bool Revealed
{
revealed = value;
if (revealed)
- revealPassword();
+ {
+ RevealPassword();
+ }
else
- hidePassword();
+ {
+ HidePassword();
+ }
+
#pragma warning disable S1656
- Text = Text; //for refreshing - causes resetting cursor
+ Text = Text; // for refreshing - causes resetting cursor
#pragma warning restore S1656
}
}
- private void revealPassword()
+ private void RevealPassword()
{
var map = new PropertyMap();
map.Add("mode", new PropertyValue(0));
HiddenInputSettings = map;
}
- private void hidePassword()
+
+ private void HidePassword()
{
var map = new PropertyMap();
map.Add("mode", new PropertyValue(4));
* limitations under the License.
*/
-using System;
+using System;
+using Oobe.Common.Styles;
using Tizen.Network.WiFi;
using Tizen.NUI;
using Tizen.NUI.BaseComponents;
using Tizen.NUI.Components;
-using Oobe.Common.Styles;
namespace Oobe.Wifi.Controls.Wifi
{
- class SecurityTypeView : View
+ public class SecurityTypeView : View
{
- public RadioButton Button;
- public readonly WifiUISecurityType WifiUISecurityType;
-
private TextLabel descriptionTextLabel = null;
- /*//detectors have to be kept separately because of GC, there is no link by ref between View and Detector
- private TapGestureDetector detector;*/
public SecurityTypeView(WifiUISecurityType wifiUISecurityType)
{
InitializeSubelements();
}
- void InitializeSubelements()
+ public WifiUISecurityType WifiUISecurityType { get; set; }
+
+ public RadioButton Button { get; set; }
+
+ private void InitializeSubelements()
{
Button = new RadioButton
{
Position = new Position(40, 20),
Size = new Size(24, 24),
CellHorizontalAlignment = HorizontalAlignmentType.Center,
- CellVerticalAlignment = VerticalAlignmentType.Center
+ CellVerticalAlignment = VerticalAlignmentType.Center,
};
this.Add(Button);
FontStyle = new PropertyMap().AddLightFontStyle(),
TextColor = new Color(0.0f, 0x14 / 255.0f, 0x47 / 255.0f, 1.0f),
HorizontalAlignment = HorizontalAlignment.Begin,
- VerticalAlignment = VerticalAlignment.Center
+ VerticalAlignment = VerticalAlignment.Center,
};
this.Add(descriptionTextLabel);
}
* limitations under the License.
*/
-using System;
+using System;
using System.Threading.Tasks;
+using Oobe.Common.Styles;
+using Oobe.Wifi.Controls.Wifi;
+using Tizen.Network.WiFi;
using Tizen.NUI;
using Tizen.NUI.BaseComponents;
using Tizen.NUI.Components;
-using Tizen.Network.WiFi;
-using Oobe.Common.Styles;
-using Oobe.Wifi.Controls.Wifi;
namespace Oobe.Wifi.Controls.Wifi
{
- class WifiPasswordPopup : View
+ public class WifiPasswordPopup : View
{
- public event Action OnDismiss;
+ private const int MinPasswordLength = 8;
+ private const int MaxPasswordLength = 63;
private PasswordEntry passwordEntry = null;
private Button okButton;
private Button cancelButton;
private Button revealButton;
private TextLabel connectionFailure;
- private const int minPasswordLength = 8;
- private const int maxPasswordLength = 63;
private string backgroundImagePath = System.IO.Path.Combine(NUIApplication.Current.DirectoryInfo.Resource, "08_popup_body.png");
private WiFiAP wifiAp;
private bool isConnecting = false;
- public string Password => passwordEntry.Password;
-
public WifiPasswordPopup(Tizen.Network.WiFi.WiFiAP wifiAp)
{
BackgroundImage = backgroundImagePath;
Position = new Position(new Position2D(236, 116));
this.wifiAp = wifiAp;
- this.Add(new View() //underline
+ this.Add(new View() // underline
{
Size = new Size(672, 1),
Position = new Position(40, 117),
{
Size = new Size(728, 33),
Position = new Position(40, 24),
- //no translatableText because of dynamic content
+
+ // no translatableText because of dynamic content
Text = string.Format(Translations.WIFI_ENTER_PASSWORD_TO_JOIN, wifiAp.NetworkInformation.Essid),
PixelSize = 26,
TextColor = new Color(0, 0x14 / 255.0f, 0x47 / 255.0f, 1.0f),
{
Size = new Size(624, 27),
Position = new Position(40, 91),
- MaxLength = maxPasswordLength,
+ MaxLength = MaxPasswordLength,
PixelSize = 22,
TextColor = new Color(0, 0x0C / 255.0f, 0x2B / 255.0f, 1.0f),
FontFamily = "BreezeSans",
cancelButton = new Button(ButtonStyles.Cancel)
{
Size = new Size(240, 72),
- Position = new Position(80, 175)
+ Position = new Position(80, 175),
};
cancelButton.Clicked += (s, e) =>
{
{
Size = new Size(240, 72),
Position = new Position(488, 175),
- IsEnabled = false
+ IsEnabled = false,
};
okButton.Clicked += async (s, e) =>
{
this.Add(okButton);
}
+ public event Action OnDismiss;
+
+ public string Password => passwordEntry.Password;
+
private void TogglePasswordVisibility()
{
passwordEntry.Revealed = !passwordEntry.Revealed;
private void UpdateOKButton()
{
- okButton.IsEnabled = (Password.Length >= minPasswordLength) && (isConnecting == false);
+ okButton.IsEnabled = (Password.Length >= MinPasswordLength) && (isConnecting == false);
}
}
}
* limitations under the License.
*/
-using System;
+using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Tizen.Network.WiFi;
{
internal class WifiState : IDisposable
{
+ public WifiState()
+ {
+ WiFiManager.DeviceStateChanged += WiFiManager_DeviceStateChanged;
+ }
+
public event Action OnTurningOnFailed;
+
public event Action OnTurnedOn;
+
public event Action OnTurnedOff;
+
public event Action OnScanStarted;
+
public event Action OnScanFinished;
public bool IsTurnedOn => WiFiManager.IsActive;
- public WifiState()
- {
- WiFiManager.DeviceStateChanged += WiFiManager_DeviceStateChanged;
- }
-
public async Task TurnWifi()
{
try
{
OnScanFinished?.Invoke();
}
+
return new List<WiFiAP>();
}
* limitations under the License.
*/
-using System;
+using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Oobe.Wifi.Controls.Wifi
{
- enum WifiUISecurityType
+ public enum WifiUISecurityType
{
None,
EAP,
WEP,
WPAPSK,
- WPA2PSK
+ WPA2PSK,
}
- static class WifiUISecurityTypeExtensions
+ public static class WifiUISecurityTypeExtensions
{
public static string GetUIName(this WifiUISecurityType type)
{
*/
using System;
+using Oobe.Common.Styles;
using Tizen.NUI;
using Tizen.NUI.BaseComponents;
using Tizen.NUI.Components;
-using Oobe.Common.Styles;
namespace Oobe.Wifi.Controls.Wifi
{
public class WifiView : IDisposable
{
- private View view = null;
public const int ListItemWidth = 460;
- public const int ListItemHeight = 79;//89;
+ public const int ListItemHeight = 79;
- private WifiState State { get; set; } = new WifiState();
- private ApManager ApManager { get; set; } = new ApManager(OnApTapped);
+ private View view = null;
public View View
{
LinearOrientation = LinearLayout.Orientation.Vertical,
},
BackgroundImage = System.IO.Path.Combine(NUIApplication.Current.DirectoryInfo.Resource, "Rectangle_918.png"),
- //BackgroundColor = Color.Red,
- //Size = new Size(480, 401),
Size = new Size(480, 416),
};
view.Add(CreateHeader(480, 91));
view.Add(CreateListViewPlaceHolder());
}
+
return view;
}
}
+ private WifiState State { get; set; } = new WifiState();
+
+ private ApManager ApManager { get; set; } = new ApManager(OnApTapped);
+
+ public void Dispose()
+ {
+ view = null;
+ ApManager.Dispose();
+ State.Dispose();
+ }
+
+ private static View CreateScanningView()
+ {
+ var view = new View()
+ {
+ Layout = new LinearLayout()
+ {
+ LinearOrientation = LinearLayout.Orientation.Horizontal,
+ },
+ };
+
+ var progress = new View()
+ {
+ Size = new Size(22, 23),
+ Margin = new Extents(0, 0, 1, 0),
+ BackgroundImage = System.IO.Path.Combine(NUIApplication.Current.DirectoryInfo.Resource, "12_icon_scanning.png"),
+ };
+ view.Add(progress);
+
+ Animation animation = null;
+ progress.VisibilityChanged += (s, e) =>
+ {
+ if (e.Visibility == false)
+ {
+ animation?.Stop();
+ animation?.Clear();
+ animation?.Dispose();
+ animation = null;
+ progress.Orientation = new Rotation(new Radian(new Degree(0)), new Vector3(0, 0, -1));
+ }
+ else if (animation == null)
+ {
+ animation = new Animation(1_000);
+ animation.Looping = true;
+ animation.AnimateTo(progress, "Orientation", new Rotation(new Radian(new Degree(180)), new Vector3(0, 0, -1)), new AlphaFunction(AlphaFunction.BuiltinFunctions.Linear));
+ animation.Play();
+ }
+ };
+
+ view.Add(new TextLabel()
+ {
+ Size = new Size(190, 25),
+ TranslatableText = "WIFI_SCANNING",
+ Margin = new Extents(17, 0, 0, 0),
+ VerticalAlignment = VerticalAlignment.Center,
+ HorizontalAlignment = HorizontalAlignment.Begin,
+ PixelSize = 20f,
+ TextColor = new Color(0, 0x0C / 255f, 0x2B / 255f, 1.0f),
+ FontFamily = "BreezeSans",
+ FontStyle = new PropertyMap().AddRegularFontStyle(),
+ });
+ return view;
+ }
+
private static View CreateSeparator()
{
return new View()
Size = new Size(42, 42),
};
- addNewButton.Clicked += (s, e) => ShowAddNetworkPopup();
+ addNewButton.Clicked += (s, e) => ShowAddNetworkPopup();
manualWifi.Add(addNewButton);
manualWifi.Add(new TextLabel()
});
return manualWifi;
}
-
+
private static void ShowAddNetworkPopup()
{
var view = new AddNewNetworkPupup();
Tizen.Log.Debug("oobe", $"Already connected to {wifiAp.NetworkInformation.Essid}");
return;
}
+
ShowPasswordPopup(wifiAp);
}
private View CreateListViewPlaceHolder()
{
var view = new View();
- //var listView = new ListView(480, 324)//314)//480, 335
var listView = new ListView(480, 319)
{
Footer = CreateManualWifiView(),
};
view.Add(prompt);
- void turnOn()
+ void TurnOn()
{
prompt.Hide();
listView.Show();
}
- void turnOff(string message)
+
+ void TurnOff(string message)
{
listView.Hide();
prompt.TranslatableText = message;
prompt.Show();
}
- if (State.IsTurnedOn)
- turnOn();
- else
- turnOff("WIFI_TURN_ON_WIFI");
- State.OnTurnedOff += () => turnOff("WIFI_TURN_ON_WIFI");
- State.OnTurnedOn += () => turnOn();
- State.OnTurningOnFailed += () => turnOff("WIFI_CONNECTION_FAILED");
- return view;
- }
-
- private static View CreateScanningView()
- {
- var view = new View()
- {
- Layout = new LinearLayout()
- {
- LinearOrientation = LinearLayout.Orientation.Horizontal,
- }
- };
- var progress = new View()
+ if (State.IsTurnedOn)
{
- Size = new Size(22, 23),
- Margin = new Extents(0, 0, 1, 0),
- BackgroundImage = System.IO.Path.Combine(NUIApplication.Current.DirectoryInfo.Resource, "12_icon_scanning.png"),
- };
- view.Add(progress);
-
- Animation animation = null;
- progress.VisibilityChanged += (s, e) =>
+ TurnOn();
+ }
+ else
{
- if (e.Visibility == false)
- {
- animation?.Stop();
- animation?.Clear();
- animation?.Dispose();
- animation = null;
- progress.Orientation = new Rotation(new Radian(new Degree(0)), new Vector3(0, 0, -1));
- }
- else if (animation == null)
- {
- animation = new Animation(1_000);
- animation.Looping = true;
- animation.AnimateTo(progress, "Orientation", new Rotation(new Radian(new Degree(180)), new Vector3(0, 0, -1)), new AlphaFunction(AlphaFunction.BuiltinFunctions.Linear));
- animation.Play();
- }
- };
+ TurnOff("WIFI_TURN_ON_WIFI");
+ }
- view.Add(new TextLabel()
- {
- Size = new Size(190, 25),
- TranslatableText = "WIFI_SCANNING",
- Margin = new Extents(17, 0, 0, 0),
- VerticalAlignment = VerticalAlignment.Center,
- HorizontalAlignment = HorizontalAlignment.Begin,
- PixelSize = 20f,
- TextColor = new Color(0, 0x0C / 255f, 0x2B / 255f, 1.0f),
- FontFamily = "BreezeSans",
- FontStyle = new PropertyMap().AddRegularFontStyle(),
- });
+ State.OnTurnedOff += () => TurnOff("WIFI_TURN_ON_WIFI");
+ State.OnTurnedOn += () => TurnOn();
+ State.OnTurningOnFailed += () => TurnOff("WIFI_CONNECTION_FAILED");
return view;
}
var wifi = new TextLabel("Wi-Fi")
{
- //Size = new Size(49, 24),
PixelSize = 20f,
TextColor = new Color(0, 0x0C / 255f, 0x2B / 255f, 1.0f),
FontFamily = "BreezeSans",
var scanning = CreateScanningView();
view.Add(scanning);
- void startScan()
+ void StartScan()
{
wifi.Hide();
scanning.Show();
}
- void finishScan()
+
+ void FinishScan()
{
scanning.Hide();
wifi.Show();
}
- finishScan();
- State.OnScanStarted += startScan;
- State.OnScanFinished += finishScan;
- return view;
- }
- public void Dispose()
- {
- view = null;
- ApManager.Dispose();
- State.Dispose();
+ FinishScan();
+ State.OnScanStarted += StartScan;
+ State.OnScanFinished += FinishScan;
+ return view;
}
}
}
<TargetFramework>tizen80</TargetFramework>
<LangVersion>8.0</LangVersion>
<TargetFrameworkIdentifier>Tizen</TargetFrameworkIdentifier>
+ <CodeAnalysisRuleSet>../Settings.StyleCop</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Tizen.NET" Version="8.0.0.15430" />
<PackageReference Include="Tizen.NET.Sdk" Version="1.1.2" />
+ <PackageReference Include="StyleCop.Analyzers" Version="1.1.118">
+ <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
+ <PrivateAssets>all</PrivateAssets>
+ </PackageReference>
</ItemGroup>
<ItemGroup>
<Generator>PublicResXFileCodeGenerator</Generator>
<LastGenOutput>Translations.Designer.cs</LastGenOutput>
</EmbeddedResource>
+ <AdditionalFiles Include="../stylecop.json" />
+ <AdditionalFiles Include="../Settings.StyleCop" />
</ItemGroup>
</Project>
* limitations under the License.
*/
-using Oobe.Common.Interfaces;
-using Tizen.NUI.Components;
-using Tizen.NUI;
-using Tizen.NUI.BaseComponents;
-using Oobe.Wifi.Controls.Wifi;
-using Tizen.Network.WiFi;
using System;
using System.Collections.Generic;
-using Oobe.Common.Styles;
+using Oobe.Common.Interfaces;
using Oobe.Common.Layouts;
+using Oobe.Common.Styles;
+using Oobe.Wifi.Controls.Wifi;
+using Tizen.Network.WiFi;
+using Tizen.NUI;
+using Tizen.NUI.BaseComponents;
+using Tizen.NUI.Components;
namespace Oobe.Wifi
{
view.PreviousButton.Clicked += (s, e) => nav.Previous();
view.NextButton.Clicked += (s, e) => nav.Next();
- void applyStyle(bool isConnected) => view.NextButton.ApplyStyle(isConnected
+ void ApplyStyle(bool isConnected) => view.NextButton.ApplyStyle(isConnected
? Common.Styles.ButtonStyles.Next
: Common.Styles.ButtonStyles.Skip);
- applyStyle(WiFiManager.ConnectionState == WiFiConnectionState.Connected);
+ ApplyStyle(WiFiManager.ConnectionState == WiFiConnectionState.Connected);
- connectionChanged = (s, e) => applyStyle(e.State == WiFiConnectionState.Connected);
+ connectionChanged = (s, e) => ApplyStyle(e.State == WiFiConnectionState.Connected);
WiFiManager.ConnectionStateChanged += connectionChanged;
return view;
}
*/
using System;
-using Tizen.NUI.Components;
-using Tizen.NUI.BaseComponents;
using System.Collections.Generic;
using Tizen.NUI;
+using Tizen.NUI.BaseComponents;
+using Tizen.NUI.Components;
namespace Oobe.Controls
{
/// </summary>
public class ViewStack : View
{
- private class ViewStackBaseCustomLayout : LayoutGroup
- {
- protected override void OnMeasure(MeasureSpecification widthMeasureSpec, MeasureSpecification heightMeasureSpec)
- {
- ViewStack stack = this.Owner as ViewStack;
-
- if (!stack) return;
-
- int totalWidth = stack.Size2D.Width;
- int totalHeight = stack.Size2D.Height;
-
- SetMeasuredDimensions(ResolveSizeAndState(new LayoutLength(totalWidth), widthMeasureSpec, MeasuredSize.StateType.MeasuredSizeOK),
- ResolveSizeAndState(new LayoutLength(totalHeight), heightMeasureSpec, MeasuredSize.StateType.MeasuredSizeOK));
- }
-
- protected override void OnLayout(bool changed, LayoutLength left, LayoutLength top, LayoutLength right, LayoutLength bottom)
- {
- ViewStack stack = this.Owner as ViewStack;
-
- if (!changed || !stack) return;
-
- int totalWidth = stack.Size2D.Width;
- int totalHeight = stack.Size2D.Height;
-
- foreach (LayoutItem childLayout in LayoutChildren)
- {
- if (childLayout.Owner == stack.Current)
- {
- childLayout.Layout(
- new LayoutLength(0),
- new LayoutLength(0),
- new LayoutLength(totalWidth),
- new LayoutLength(totalHeight));
- }
- else
- {
- childLayout.Layout(
- new LayoutLength(-stack.PagesLeftPadding),
- new LayoutLength(0),
- new LayoutLength(totalWidth - stack.PagesLeftPadding),
- new LayoutLength(totalHeight));
- }
- }
- }
- }
-
private List<View> views = new List<View>();
private List<View> viewsToRemove = new List<View>();
private Animation pageEnterAnimation;
private Animation pageLeaveAnimation;
+ public ViewStack()
+ : base()
+ {
+ ClippingMode = ClippingModeType.ClipToBoundingBox;
+ pageEnterAnimation = new Animation();
+ pageLeaveAnimation = new Animation();
+ pageEnterAnimation.Finished += OnPageEntered;
+ pageLeaveAnimation.Finished += OnPageLeave;
+ }
+
/// <summary>
/// Informs about transition animation end
/// </summary>
/// <summary>
/// Get view currently stacked on Top of ViewStack
/// </summary>
- public View Current { get { return views.Count > 0 ? views[views.Count-1] : null; } }
+ public View Current
+ {
+ get
+ {
+ return views.Count > 0 ? views[views.Count - 1] : null;
+ }
+ }
/// <summary>
/// Get view currently stacked under Current
/// </summary>
- public View Previous { get { return views.Count > 1 ? views[views.Count - 2] : null; } }
-
- public ViewStack() : base()
+ public View Previous
{
- ClippingMode = ClippingModeType.ClipToBoundingBox;
- //Layout = new ViewStackBaseCustomLayout();
- pageEnterAnimation = new Animation();
- pageLeaveAnimation = new Animation();
- pageEnterAnimation.Finished += OnPageEntered;
- pageLeaveAnimation.Finished += OnPageLeave;
+ get
+ {
+ return views.Count > 1 ? views[views.Count - 2] : null;
+ }
}
/// <summary>
StartPageEnterAnimation(Previous, Current);
}
+ protected override void Dispose(Tizen.NUI.DisposeTypes type)
+ {
+ if (disposed)
+ {
+ return;
+ }
+
+ if (type == DisposeTypes.Explicit)
+ {
+ pageEnterAnimation.Dispose();
+ pageLeaveAnimation.Dispose();
+ }
+
+ base.Dispose(type);
+ }
+
+ private static void FinishAnimation(Animation anim)
+ {
+ if (anim != null)
+ {
+ if (anim.State == Animation.States.Playing)
+ {
+ anim.Stop(Animation.EndActions.StopFinal);
+ }
+
+ anim.Clear();
+ }
+ }
+
private void AddViewToDelayRemove(View view)
{
if (view)
Remove(view);
view.Dispose();
}
+
viewsToRemove.Clear();
}
FinishAnimation(pageEnterAnimation);
}
- static private void FinishAnimation(Animation anim)
- {
- if (anim != null)
- {
- if (anim.State == Animation.States.Playing)
- {
- anim.Stop(Animation.EndActions.StopFinal);
- }
- anim.Clear();
- }
- }
-
private void StartPageLeaveAnimation(View back, View front)
{
pageLeaveAnimation.Duration = ScrollDuration;
// run animation to place 'back' in viewport
pageLeaveAnimation.AnimateTo(back, "PositionX", 0, null);
}
+
if (front != null)
{
// place 'front' in viewport (should be already there)
// run animation to place 'front' out of viewport
pageLeaveAnimation.AnimateTo(front, "PositionX", Size2D.Width + PagesRightPadding);
}
+
pageLeaveAnimation.Play();
}
+
private void StartPageEnterAnimation(View back, View front)
{
pageEnterAnimation.Duration = ScrollDuration;
int diff = Position2D.X - PagesLeftPadding;
pageEnterAnimation.AnimateTo(back, "PositionX", diff);
}
+
if (front != null)
{
// place 'front' out of viewport
// run anim to place 'front' on viewport
pageEnterAnimation.AnimateTo(front, "PositionX", 0, null);
}
+
pageEnterAnimation.Play();
}
TransitionFinished?.Invoke(this, new EventArgs());
}
- protected override void Dispose(Tizen.NUI.DisposeTypes type)
+ private class ViewStackBaseCustomLayout : LayoutGroup
{
- if (disposed)
- return;
- if(type == DisposeTypes.Explicit)
+ protected override void OnMeasure(MeasureSpecification widthMeasureSpec, MeasureSpecification heightMeasureSpec)
{
- pageEnterAnimation.Dispose();
- pageLeaveAnimation.Dispose();
+ ViewStack stack = this.Owner as ViewStack;
+
+ if (!stack)
+ {
+ return;
+ }
+
+ int totalWidth = stack.Size2D.Width;
+ int totalHeight = stack.Size2D.Height;
+
+ SetMeasuredDimensions(
+ ResolveSizeAndState(new LayoutLength(totalWidth), widthMeasureSpec, MeasuredSize.StateType.MeasuredSizeOK),
+ ResolveSizeAndState(new LayoutLength(totalHeight), heightMeasureSpec, MeasuredSize.StateType.MeasuredSizeOK));
+ }
+
+ protected override void OnLayout(bool changed, LayoutLength left, LayoutLength top, LayoutLength right, LayoutLength bottom)
+ {
+ ViewStack stack = this.Owner as ViewStack;
+
+ if (!changed || !stack)
+ {
+ return;
+ }
+
+ int totalWidth = stack.Size2D.Width;
+ int totalHeight = stack.Size2D.Height;
+
+ foreach (LayoutItem childLayout in LayoutChildren)
+ {
+ if (childLayout.Owner == stack.Current)
+ {
+ childLayout.Layout(
+ new LayoutLength(0),
+ new LayoutLength(0),
+ new LayoutLength(totalWidth),
+ new LayoutLength(totalHeight));
+ }
+ else
+ {
+ childLayout.Layout(
+ new LayoutLength(-stack.PagesLeftPadding),
+ new LayoutLength(0),
+ new LayoutLength(totalWidth - stack.PagesLeftPadding),
+ new LayoutLength(totalHeight));
+ }
+ }
}
- base.Dispose(type);
}
}
}
* limitations under the License.
*/
-using System;
+using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
{
}
- public override string? GetString(string name)
+ public override string GetString(string name)
{
return base.GetString(name)
?? Oobe.Wifi.Controls.Wifi.Translations.ResourceManager.GetString(name);
}
- public override string? GetString(string name, CultureInfo culture)
+ public override string GetString(string name, CultureInfo culture)
{
return base.GetString(name, culture)
?? Oobe.Wifi.Controls.Wifi.Translations.ResourceManager.GetString(name, culture);
* limitations under the License.
*/
+using System;
using System.Collections.Generic;
+using System.IO;
using Oobe.Common.Interfaces;
using Oobe.Language;
+using Oobe.Region;
+using Oobe.Terms;
using Oobe.Views;
using Oobe.Welcome;
-using Tizen.NUI;
-using Oobe.Region;
-using System;
using Oobe.Wifi;
-using System.IO;
-using Oobe.Terms;
+using Tizen.NUI;
namespace Oobe
{
public sealed class ProcessManager : IProcessNavigation
{
+ private static ProcessManager instance;
+ private static string doneFile = Tizen.Applications.CoreUIApplication.Current.DirectoryInfo.Data + "oobe_done";
private MainView ui;
private LinkedList<Lazy<ProcessStep>> steps;
private LinkedListNode<Lazy<ProcessStep>> current;
private bool started;
- static private ProcessManager instance;
-
- static private string doneFile = Tizen.Applications.CoreUIApplication.Current.DirectoryInfo.Data + "oobe_done";
- internal class NavigationController : IProcessNavigation
+ private ProcessManager()
{
- private ProcessStep step;
- private ProcessManager manager;
-
- public NavigationController(ProcessManager manager, ProcessStep step)
- {
- this.step = step;
- this.manager = manager;
- }
-
- public void Next()
- {
- if (manager.CurrentStep == step)
- {
- manager.Next();
- }
- }
-
- public void Previous()
- {
- if (manager.CurrentStep == step)
- {
- manager.Previous();
- }
- }
-
- public void Finish()
- {
- if (manager.CurrentStep == step)
- {
- manager.Finish();
- }
- }
+ // TODO consider loading this from xaml or xml
+ steps = new LinkedList<Lazy<ProcessStep>>(new[]
+ {
+ new Lazy<ProcessStep>(() => new LanguageStep()),
+ new Lazy<ProcessStep>(() => new RegionStep()),
+ new Lazy<ProcessStep>(() => new TermsStep()),
+ new Lazy<ProcessStep>(() => new WifiStep()),
+ new Lazy<ProcessStep>(() => new WelcomeStep()),
+ });
}
- static public ProcessManager Instance
+ public static ProcessManager Instance
{
get
{
}
}
- private ProcessManager()
- {
- //TODO consider loading this from xaml, xml or something...
- steps = new LinkedList<Lazy<ProcessStep>>(new[]{
- new Lazy<ProcessStep>(() => new LanguageStep()),
- new Lazy<ProcessStep>(() => new RegionStep()),
- new Lazy<ProcessStep>(() => new TermsStep()),
- new Lazy<ProcessStep>(() => new WifiStep()),
- new Lazy<ProcessStep>(() => new WelcomeStep()),
- }
- );
- }
-
public ProcessStep CurrentStep { get => current.Value.Value; }
public void Start()
current = current.Next;
ui.Push(current.Value.Value.CreateView(new NavigationController(this, current.Value.Value)));
current.Next?.Value.Value.Initialize();
+
// do not show pagination on last page
if (current.Next == null)
+ {
ui.PaginationVisible = false;
+ }
}
}
{
step.Value.Shutdown();
}
+
SetDone();
NUIApplication.Current.Exit();
}
}
}
- private void SetDone()
- {
- if (!File.Exists(doneFile))
- {
- File.Create(doneFile).Dispose();
- }
- }
-
/// <summary>
/// Indicates if oobe process has been previously finished
/// </summary>
{
step.Value.Reset();
}
+
File.Delete(doneFile);
current = steps.First;
}
+
+ private void SetDone()
+ {
+ if (!File.Exists(doneFile))
+ {
+ File.Create(doneFile).Dispose();
+ }
+ }
+
+ internal class NavigationController : IProcessNavigation
+ {
+ private ProcessStep step;
+ private ProcessManager manager;
+
+ public NavigationController(ProcessManager manager, ProcessStep step)
+ {
+ this.step = step;
+ this.manager = manager;
+ }
+
+ public void Next()
+ {
+ if (manager.CurrentStep == step)
+ {
+ manager.Next();
+ }
+ }
+
+ public void Previous()
+ {
+ if (manager.CurrentStep == step)
+ {
+ manager.Previous();
+ }
+ }
+
+ public void Finish()
+ {
+ if (manager.CurrentStep == step)
+ {
+ manager.Finish();
+ }
+ }
+ }
}
}
<TargetFramework>tizen80</TargetFramework>
<LangVersion>8.0</LangVersion>
<TargetFrameworkIdentifier>Tizen</TargetFrameworkIdentifier>
+ <CodeAnalysisRuleSet>../Settings.StyleCop</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<ItemGroup>
<Folder Include="lib\" />
<Folder Include="res\" />
+ <AdditionalFiles Include="../stylecop.json" />
+ <AdditionalFiles Include="../Settings.StyleCop" />
</ItemGroup>
<ItemGroup>
<ExcludeAssets>Runtime</ExcludeAssets>
</PackageReference>
<PackageReference Include="Tizen.NET.Sdk" Version="1.1.2" />
+ <PackageReference Include="StyleCop.Analyzers" Version="1.1.118">
+ <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
+ <PrivateAssets>all</PrivateAssets>
+ </PackageReference>
</ItemGroup>
<ItemGroup>
* limitations under the License.
*/
-using Tizen.NUI;
-using Tizen.NUI.Components;
using System;
using System.Globalization;
using Oobe.Common.Resources;
using Oobe.Managers;
+using Tizen.NUI;
+using Tizen.NUI.Components;
namespace Oobe
{
- class Program : NUIApplication
+ public class OobeApp : NUIApplication
{
private const string ResetOperation = "http://tizen.org/appcontrol/operation/reset";
+ public static void Main(string[] args)
+ {
+ var app = new OobeApp();
+ app.Run(args);
+ }
+
protected override void OnCreate()
{
Tizen.Log.Debug("oobe", "OnCreate");
}
}
- void Initialize()
+ private void Initialize()
{
SetupLanguage();
ProcessManager.Instance.Start();
}
- void Start()
+ private void Start()
{
if (ProcessManager.Instance.IsDone())
{
Initialize();
}
- void Reset()
+ private void Reset()
{
ProcessManager.Instance.Reset();
}
- void SetupLanguage()
+ private void SetupLanguage()
{
void SetLanguage()
{
Tizen.Log.Debug("oobe", "Setting Language failed:" + e.Message);
}
}
+
NUIApplication.MultilingualResourceManager = new MultiResourceManager("Oobe.Common.Resources.Translations", typeof(Translations).Assembly);
Tizen.System.SystemSettings.LocaleLanguageChanged += (s, e) => SetLanguage();
SetLanguage();
}
-
- static void Main(string[] args)
- {
- var app = new Program();
- app.Run(args);
- }
}
}
* limitations under the License.
*/
-using Tizen.NUI.BaseComponents;
-using Tizen.NUI;
+using System;
using Oobe.Controls;
+using Tizen.NUI;
+using Tizen.NUI.BaseComponents;
using Tizen.NUI.Components;
-using System;
namespace Oobe.Views
{
/// </summary>
public class MainView : IDisposable
{
+ private const int TransitionTime = 750;
+ private readonly Extents stackMargin = new Extents(48, 48, 48, 48);
private ViewStack stack;
private Animation dimEffectAnimation;
private Pagination pagination;
- private const int TransitionTime = 750;
- private readonly Extents stackMargin = new Extents(48, 48, 48, 48);
public MainView(Window win)
{
Size2D stackSize = new Size2D(
win.WindowSize.Width - stackMargin.Start - stackMargin.End,
- win.WindowSize.Height - stackMargin.Top - stackMargin.Bottom
- );
+ win.WindowSize.Height - stackMargin.Top - stackMargin.Bottom);
- // For testing other resolutions
- // stackSize.Width = 1280 - stackMargin.Start - stackMargin.End;
- // stackSize.Height = 720 - stackMargin.Top - stackMargin.Bottom;
+ /* For testing other resolutions
+ stackSize.Width = 1280 - stackMargin.Start - stackMargin.End;
+ stackSize.Height = 720 - stackMargin.Top - stackMargin.Bottom;
+ */
- stack = new ViewStack(){
+ stack = new ViewStack()
+ {
ScrollDuration = TransitionTime,
Position2D = new Position2D(stackMargin.Start, stackMargin.Top),
Size2D = stackSize,
get => pagination.Visibility;
set
{
- if (value) pagination.Show();
- else pagination.Hide();
+ if (value)
+ {
+ pagination.Show();
+ }
+ else
+ {
+ pagination.Hide();
+ }
}
}
{
StartUndimAnimation(previous);
}
+
pagination.SelectedIndex = pagination.SelectedIndex - 1;
stack.Pop();
}
+ public void Dispose()
+ {
+ dimEffectAnimation.Dispose();
+ stack.Dispose();
+ pagination.Dispose();
+ }
+
private void StartDimAnimation(Views.Page view)
{
view.Opacity = 1.0f;
{
dimEffectAnimation.Stop(Animation.EndActions.StopFinal);
}
- dimEffectAnimation.Clear();
- }
- public void Dispose()
- {
- dimEffectAnimation.Dispose();
- stack.Dispose();
- pagination.Dispose();
+ dimEffectAnimation.Clear();
}
}
}
* limitations under the License.
*/
-using Tizen.NUI.BaseComponents;
using Tizen.NUI;
+using Tizen.NUI.BaseComponents;
using Tizen.NUI.Components;
namespace Oobe.Views
{
private View content;
+ public Page()
+ {
+ BackgroundImage = NUIApplication.Current.DirectoryInfo.Resource + "0_BG_WHITEsmall.png";
+ }
+
public View Content
- {
+ {
+ get
+ {
+ return content;
+ }
+
set
{
if (value == content)
+ {
return;
+ }
+
if (value)
{
Remove(content);
content = value;
}
}
- get {
- return content;
- }
}
-
- public Page()
- {
- BackgroundImage = NUIApplication.Current.DirectoryInfo.Resource + "0_BG_WHITEsmall.png";
- }
-
}
}
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<RuleSet Name="Rules for ConsoleApp" Description="Code analysis rules" ToolsVersion="16.0">
+ <IncludeAll Action="Warning" />
+ <Rules AnalyzerId="StyleCop.CSharp" RuleNamespace="StyleCop.CSharp">
+ <!-- SA1101PrefixLocalCallsWithThis -->
+ <!-- https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1101.md -->
+ <Rule Id="SA1101" Action="None" />
+ <!-- UsingDirectivesMustBePlacedCorrectly -->
+ <!-- https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1200.md -->
+ <Rule Id="SA1200" Action="None" />
+ <!-- Check XML style -->
+ <Rule Id="SA0001" Action="None" />
+ </Rules>
+</RuleSet>
--- /dev/null
+{
+ "settings": {
+ "indentation": {
+ "indentationSize": 4,
+ "useTabs": false
+ },
+ "layoutRules": {
+ "newlineAtEndOfFile": "require"
+ },
+ "documentationRules": {
+ "copyrightText": "Copyright (c) 2020 Samsung Electronics Co., Ltd.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\nhttp://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.",
+ "xmlHeader": false
+ }
+ }
+}