protected override bool Init(object controller, object binding, DefinitionFile definition) { if (!base.Init(controller, binding, definition)) { return(false); } DefinitionFileWithStyle file = new DefinitionFileWithStyle(definition, typeof(UiText)); FontName = file["Font"] as string; FontSize = DefinitionResolver.Get <int>(Controller, Binding, file["FontSize"], 0); FontSpacing = DefinitionResolver.Get <int>(Controller, Binding, file["FontSpacing"], 0); LineHeight = DefinitionResolver.Get <int>(Controller, Binding, file["LineHeight"], 100); Justify = DefinitionResolver.Get <bool>(Controller, Binding, file["Justify"], false); _indent = DefinitionResolver.Get <Length>(Controller, Binding, file["Indent"], Length.Zero); _lineWidth = DefinitionResolver.Get <Length>(Controller, Binding, file["LineWidth"], Length.Stretch); Text = DefinitionResolver.GetString(Controller, Binding, file["Text"]) ?? string.Empty; TextColor = DefinitionResolver.GetColorWrapper(Controller, Binding, file["TextColor"]) ?? UiLabel.DefaultTextColor; HorizontalContentAlignment horzAlign = DefinitionResolver.Get <HorizontalContentAlignment>(Controller, Binding, file["HorizontalContentAlignment"], HorizontalContentAlignment.Left); VerticalContentAlignment vertAlign = DefinitionResolver.Get <VerticalContentAlignment>(Controller, Binding, file["VerticalContentAlignment"], VerticalContentAlignment.Top); TextAlign = UiHelper.TextAlignFromContentAlignment(horzAlign, vertAlign); return(true); }
protected override void Init(Controllers.UiController controller, object binding, DefinitionFile definition) { base.Init(controller, binding, definition); DefinitionFileWithStyle file = new DefinitionFileWithStyle(definition, typeof(TransformGroup)); _reverse = DefinitionResolver.Get <bool>(controller, binding, file["Reverse"], false); List <DefinitionFile> drawableFiles = file["Drawables"] as List <DefinitionFile>; if (drawableFiles != null) { foreach (var def in drawableFiles) { ButtonDrawable drawable = def.CreateInstance(controller, binding) as ButtonDrawable; if (drawable != null) { _drawables.Add(drawable); } } } _transitionPushed = (file["TransitionEffect"] as DefinitionFile).CreateInstance(controller, binding) as TransitionEffect; }
protected override bool Init(object controller, object binding, DefinitionFile definition) { if (!base.Init(controller, binding, definition)) { return(false); } DefinitionFileWithStyle file = new DefinitionFileWithStyle(definition, typeof(UiListBox)); _vertical = DefinitionResolver.Get <Mode>(Controller, Binding, file["Mode"], Mode.Vertical) == Mode.Vertical; _template = (DefinitionFile)file["Template"]; _items = (IItemsProvider)DefinitionResolver.GetValueFromMethodOrField(Controller, Binding, file["Items"]); _items.Subscribe(this); _rule = DefinitionResolver.Get <ScrollingService.ExceedRule>(Controller, Binding, file["ExceedRule"], ScrollingService.ExceedRule.Allow); _maxScrollExceed = DefinitionResolver.Get <Length>(Controller, Binding, file["MaxScrollExceed"], ScrollingService.MaxScrollExceed); _reverse = DefinitionResolver.Get <bool>(Controller, Binding, file["Reverse"], false); _wheelSpeed = (float)DefinitionResolver.Get <double>(Controller, Binding, file["WheelScrollSpeed"], 0); _additionalTemplates = file["AdditionalTemplates"] as Dictionary <Type, DefinitionFile>; _maxAddOneTime = DefinitionResolver.Get <int>(Controller, Binding, file["MaxAddOneTime"], 32); _maxAddFirstTime = DefinitionResolver.Get <int>(Controller, Binding, file["MaxAddFirstTime"], _maxAddOneTime); return(true); }
protected override bool Init(object controller, object binding, DefinitionFile definition) { if (!base.Init(controller, binding, definition)) { return(false); } DefinitionFileWithStyle file = new DefinitionFileWithStyle(definition, typeof(UiImage)); _image = DefinitionResolver.GetShared <Texture2D>(Controller, Binding, file["Image"], null); _stretch = DefinitionResolver.Get <Stretch>(Controller, Binding, file["Stretch"], Stretch.Uniform); _color = DefinitionResolver.GetColorWrapper(Controller, Binding, file["Color"]) ?? new ColorWrapper(); _rotationSpeed = (float)DefinitionResolver.Get <double>(Controller, Binding, file["RotationSpeed"], 0); _scaleByUnit = DefinitionResolver.Get <bool>(Controller, Binding, file["ScaleByUnit"], true); _scale = DefinitionResolver.Get(Controller, Binding, file["Scale"], Scale.One); _image.ValueChanged += _image_ValueChanged; switch (DefinitionResolver.Get <ResampleFilter>(Controller, Binding, file["ResampleFilter"], ResampleFilter.Default)) { case ResampleFilter.Point: _samplerState = SamplerState.PointClamp; break; case ResampleFilter.Linear: _samplerState = SamplerState.LinearClamp; break; case ResampleFilter.Anisotropic: _samplerState = SamplerState.AnisotropicClamp; break; } return(true); }
protected virtual void Init(UiController controller, object binding, DefinitionFile definition) { DefinitionFileWithStyle file = new DefinitionFileWithStyle(definition, typeof(ButtonDrawable)); float changeTime = (float)DefinitionResolver.Get <double>(controller, binding, file["ChangeTime"], 0) / 1000.0f; _changeSpeed = changeTime > 0 ? 1 / changeTime : 10000; _colorDisabled = DefinitionResolver.GetColorWrapper(controller, binding, file["ColorDisabled"]); _colorReleased = DefinitionResolver.GetColorWrapper(controller, binding, file["ColorReleased"]); _colorPushed = DefinitionResolver.GetColorWrapper(controller, binding, file["ColorPushed"]); _margin = DefinitionResolver.Get <Margin>(controller, binding, file["Margin"], Margin.None); _opacity = (float)DefinitionResolver.Get <double>(controller, binding, file["Opacity"], 1); if (file["Special"] != null) { _specialState = DefinitionResolver.Get <bool>(controller, binding, file["Special"], false); } else { _specialState = null; } if (file["Checked"] != null) { _checkedState = DefinitionResolver.Get <bool>(controller, binding, file["Checked"], false); } else { _checkedState = null; } }
protected override bool Init(object controller, object binding, DefinitionFile definition) { if (!base.Init(controller, binding, definition)) { return(false); } DefinitionFileWithStyle file = new DefinitionFileWithStyle(definition, typeof(UiExpandingBorder)); _expanded = DefinitionResolver.GetShared <bool>(Controller, Binding, file["Expanded"], true); _expandWidth = DefinitionResolver.Get <Length>(Controller, Binding, file["ExpandedWidth"], PositionParameters.Width); _expandHeight = DefinitionResolver.Get <Length>(Controller, Binding, file["ExpandedHeight"], PositionParameters.Height); _expandSpeed = DefinitionResolver.Get <int>(Controller, Binding, file["ExpandTime"], 0); _expandedValue = _expanded.Value ? 1 : 0; RegisterDelegate("CollapseFinished", file["CollapseFinished"]); RegisterDelegate("ExpandFinished", file["ExpandFinished"]); RegisterDelegate("ExpandStarted", file["ExpandStarted"]); if (_expandSpeed > 0) { _expandSpeed = 1000 / _expandSpeed; } else { _expandSpeed = 10000; } _expanded.ValueChanged += _expanded_ValueChanged; return(true); }
protected override void Init(UiController controller, object binding, DefinitionFile definition) { base.Init(controller, binding, definition); DefinitionFileWithStyle file = new DefinitionFileWithStyle(definition, typeof(Text)); string font = DefinitionResolver.GetString(controller, binding, file["Font"]); int fontSize = DefinitionResolver.Get <int>(controller, binding, file["FontSize"], 0); int fontSpacing = DefinitionResolver.Get <int>(controller, binding, file["FontSpacing"], 0); _lineHeight = DefinitionResolver.Get <int>(controller, binding, file["LineHeight"], 100); _font = new UiFont(font, fontSize, fontSpacing); _textRotation = DefinitionResolver.Get <TextRotation>(controller, binding, file["TextRotation"], TextRotation.None); HorizontalContentAlignment horzAlign = DefinitionResolver.Get <HorizontalContentAlignment>(controller, binding, file["HorizontalContentAlignment"], HorizontalContentAlignment.Center); VerticalContentAlignment vertAlign = DefinitionResolver.Get <VerticalContentAlignment>(controller, binding, file["VerticalContentAlignment"], VerticalContentAlignment.Center); _pathEllipsis = DefinitionResolver.Get <bool>(controller, binding, file["PathEllipsis"], false); _line = DefinitionResolver.Get <int>(controller, binding, file["Line"], -1); if (_pathEllipsis || _line >= 0) { _stringBuilder = new StringBuilder(); } _textAlign = UiHelper.TextAlignFromContentAlignment(horzAlign, vertAlign); _text = DefinitionResolver.GetSharedString(controller, binding, file["Text"]); }
protected override void Init(UiController controller, object binding, DefinitionFile definition) { base.Init(controller, binding, definition); _power = DefinitionResolver.Get <double>(controller, binding, definition["Power"], 1); _origin = DefinitionResolver.Get <Origin>(controller, binding, definition["Origin"], Origin.Container); _angle = DefinitionResolver.Get <double>(controller, binding, definition["Angle"], 0) * Math.PI / 180.0; }
public MarketSimulationManager(IConnectionFactory connectionFactory, MarketSimulationProvider simulationProvider, DefinitionResolver definitionResolver) : base(connectionFactory) { _simulationProvider = simulationProvider; _definitionResolver = definitionResolver; }
private void UpdateOrderPrice(BuyOrderType orderType, string marketNameOrId, string itemName, decimal newPrice) { var character = Context.Player.Character; if (character == null) { Context.Respond("You cannot do this while dead."); return; } if (!DefinitionResolver.TryGetDefinitionByName(itemName, out var itemDefinition)) { Context.Respond($"Unable to find an item by the name of {itemName}"); return; } if (newPrice < new decimal(0.01)) { Context.Respond($"{newPrice} is too small. Please use a higher value."); return; } var manager = EconomyPlugin.GetManager <MarketManager>(); var orderManager = EconomyPlugin.GetManager <MarketOrderManager>(); manager.GetMarkets() .Then(markets => { MarketDataObject market = null; if (long.TryParse(marketNameOrId, out var marketId)) { market = markets.FirstOrDefault(m => m.Id == marketId); } else { market = markets.FirstOrDefault(m => m.Name.Equals(marketNameOrId, StringComparison.InvariantCultureIgnoreCase)); } if (market == null) { Context.Respond($"Unable to find market by name or id of '{marketNameOrId}'."); return; } orderManager.GetMarketOrder(orderType, market.Id, itemDefinition.Id) .Then(order => { orderManager.UpdateOrderPrice(order.Id, newPrice) .Then(() => Context.Respond( $"Successfully updated Order#{order.Id}'s price to {Utilities.FriendlyFormatCurrency(newPrice)}.")) .Catch(HandleError); }) .Catch(HandleError); }) .Catch(HandleError); }
protected override void Init(UiController controller, object binding, DefinitionFile definition) { base.Init(controller, binding, definition); _power = DefinitionResolver.Get <double>(controller, binding, definition["Power"], 1); _horizontal = DefinitionResolver.Get <Length>(controller, binding, definition["Horizontal"], Length.Zero); _vertical = DefinitionResolver.Get <Length>(controller, binding, definition["Vertical"], Length.Zero); }
protected override bool Init(object controller, object binding, DefinitionFile definition) { if (!base.Init(controller, binding, definition)) { return(false); } DefinitionFileWithStyle file = new DefinitionFileWithStyle(definition, typeof(UiStackPanel)); StackMode = DefinitionResolver.Get(Controller, Binding, file["Mode"], Mode.Vertical); _spacing = DefinitionResolver.Get(Controller, Binding, file["Spacing"], Length.Zero); _padding = DefinitionResolver.Get(Controller, Binding, file["Padding"], Length.Zero); _notifyParentOnResize = DefinitionResolver.Get(Controller, Binding, file["NotifyParentOnResize"], true); _wrap = DefinitionResolver.Get(Controller, Binding, file["Wrap"], false); _horizontalContentAlignment = DefinitionResolver.Get(Controller, Binding, file["HorizontalContentAlignment"], HorizontalContentAlignment.Left); _verticalContentAlignment = DefinitionResolver.Get(Controller, Binding, file["VerticalContentAlignment"], VerticalContentAlignment.Top); _expanded = DefinitionResolver.GetShared(Controller, Binding, file["Expanded"], true); _expandSpeed = DefinitionResolver.Get(Controller, Binding, file["ExpandTime"], 0); _collapseSpeed = DefinitionResolver.Get(Controller, Binding, file["CollapseTime"], (int)_expandSpeed); _expandedValue = _expanded.Value ? 1 : 0; if (_expandSpeed > 0) { _expandSpeed = 1000 / _expandSpeed; } else { _expandSpeed = 10000; } if (_collapseSpeed > 0) { _collapseSpeed = 1000 / _collapseSpeed; } else { _collapseSpeed = 10000; } RegisterDelegate("CollapseFinished", file["CollapseFinished"]); RegisterDelegate("ExpandFinished", file["ExpandFinished"]); RegisterDelegate("ExpandStarted", file["ExpandStarted"]); TryInitChildren(definition); _expanded.ValueChanged += _expanded_ValueChanged; return(true); }
bool IDefinitionClass.Init(UiController controller, object binding, DefinitionFile definition) { DefinitionFileWithStyle file = new DefinitionFileWithStyle(definition, typeof(QuickSeparatorLine)); _color = DefinitionResolver.GetColorWrapper(controller, binding, file["Color"]); _left = DefinitionResolver.Get <Length>(controller, binding, file["Left"], Length.Zero); _right = DefinitionResolver.Get <Length>(controller, binding, file["Right"], Length.Zero); return(true); }
protected override void Init(UiController controller, object binding, DefinitionFile definition) { base.Init(controller, binding, definition); DefinitionFileWithStyle file = new DefinitionFileWithStyle(definition, typeof(Image)); _image = DefinitionResolver.Get <Texture2D>(controller, binding, file["Image"], null); _scale = DefinitionResolver.Get(controller, binding, file["Scale"], Scale.One); _horizontalAlignment = DefinitionResolver.Get <HorizontalContentAlignment>(controller, binding, file["HorizontalContentAlignment"], HorizontalContentAlignment.Center); _verticalAlignment = DefinitionResolver.Get <VerticalContentAlignment>(controller, binding, file["VerticalContentAlignment"], VerticalContentAlignment.Center); }
protected override bool Init(object controller, object binding, DefinitionFile definition) { if (!base.Init(controller, binding, definition)) { return(false); } DefinitionFileWithStyle file = new DefinitionFileWithStyle(definition, typeof(UiLabel)); string fontName = file["Font"] as string; int fontSize = DefinitionResolver.Get <int>(Controller, Binding, file["FontSize"], 0); int fontSpacing = DefinitionResolver.Get <int>(Controller, Binding, file["FontSpacing"], 0); _font = new UiFont(fontName, fontSize, fontSpacing); _lineHeight = DefinitionResolver.Get <int>(Controller, Binding, file["LineHeight"], 100); _textMargin = DefinitionResolver.Get <Margin>(Controller, Binding, file["TextMargin"], Margin.None); _rotation = DefinitionResolver.Get <TextRotation>(Controller, Binding, file["TextRotation"], TextRotation.None); _maxWidth = DefinitionResolver.Get <Length>(Controller, Binding, file["MaxWidth"], new Length(pixels: int.MaxValue)); Text = DefinitionResolver.GetSharedString(Controller, Binding, file["Text"]); if (Text == null) { return(false); } TextColor = DefinitionResolver.GetColorWrapper(Controller, Binding, file["TextColor"]) ?? DefaultTextColor; HorizontalContentAlignment horzAlign = DefinitionResolver.Get <HorizontalContentAlignment>(Controller, Binding, file["HorizontalContentAlignment"], HorizontalContentAlignment.Auto); VerticalContentAlignment vertAlign = DefinitionResolver.Get <VerticalContentAlignment>(Controller, Binding, file["VerticalContentAlignment"], VerticalContentAlignment.Auto); if (horzAlign == HorizontalContentAlignment.Auto) { horzAlign = UiHelper.ContentAlignFromAlignment(PositionParameters.HorizontalAlignment); } if (vertAlign == VerticalContentAlignment.Auto) { vertAlign = UiHelper.ContentAlignFromAlignment(PositionParameters.VerticalAlignment); } TextAlign = UiHelper.TextAlignFromContentAlignment(horzAlign, vertAlign); if (DefinitionResolver.Get <bool>(Controller, Binding, file["AutoSizeUpdate"], false)) { Text.ValueChanged += Text_ValueChanged; } return(true); }
protected override void Init(UiController controller, object binding, DefinitionFile definition) { base.Init(controller, binding, definition); _power = DefinitionResolver.Get <double>(controller, binding, definition["Power"], 1); _horizontal = DefinitionResolver.Get <double>(controller, binding, definition["Horizontal"], 1); _vertical = DefinitionResolver.Get <double>(controller, binding, definition["Vertical"], 1); _origin = DefinitionResolver.Get <Origin>(controller, binding, definition["Origin"], Origin.Container); }
protected override void Init(UiController controller, object binding, DefinitionFile definition) { base.Init(controller, binding, definition); DefinitionFileWithStyle file = new DefinitionFileWithStyle(definition, typeof(Icon)); _horzAlign = DefinitionResolver.Get <HorizontalContentAlignment>(controller, binding, file["HorizontalContentAlignment"], HorizontalContentAlignment.Center); _vertAlign = DefinitionResolver.Get <VerticalContentAlignment>(controller, binding, file["VerticalContentAlignment"], VerticalContentAlignment.Center); _stretch = DefinitionResolver.Get <Stretch>(controller, binding, file["Stretch"], Stretch.None); _scale = (float)DefinitionResolver.Get <double>(controller, binding, file["Scale"], 1); }
protected override void Init(UiController controller, object binding, DefinitionFile definition) { base.Init(controller, binding, definition); DefinitionFileWithStyle file = new DefinitionFileWithStyle(definition, typeof(NinePatchBackground)); _imageDisabled = DefinitionResolver.Get <NinePatchImage>(controller, binding, file["ImageDisabled"], null); _imageReleased = DefinitionResolver.Get <NinePatchImage>(controller, binding, file["ImageReleased"], null); _imagePushed = DefinitionResolver.Get <NinePatchImage>(controller, binding, file["ImagePushed"], null); _scaleByUnit = DefinitionResolver.Get <bool>(controller, binding, file["ScaleByUnit"], false); _scale = (float)DefinitionResolver.Get <double>(controller, binding, file["Scale"], 1); }
protected override bool Init(object controller, object binding, DefinitionFile definition) { if (!base.Init(controller, binding, definition)) { return(false); } var file = new DefinitionFileWithStyle(definition, typeof(UiContainer)); _clipChildren = DefinitionResolver.Get <bool>(Controller, Binding, file["ClipChildren"], false); return(true); }
private void CreateOrder(BuyOrderType orderType, string marketNameOrId, string itemName, decimal pricePerOne, decimal quantity) { var character = Context.Player.Character; if (character == null) { Context.Respond("You cannot do this while dead."); return; } if (quantity < new decimal(0.01)) { Context.Respond($"{quantity} is too low. Please use a higher value."); return; } if (pricePerOne < new decimal(0.01)) { Context.Respond($"{pricePerOne} is too low. Please use a higher value."); return; } if (!DefinitionResolver.TryGetDefinitionByName(itemName, out var itemDefinition)) { Context.Respond($"Unable to find an item by the name of {itemName}"); return; } var manager = EconomyPlugin.GetManager <MarketManager>(); var orderManager = EconomyPlugin.GetManager <MarketOrderManager>(); manager.GetMarketByNameOrId(marketNameOrId, Context.Player.SteamUserId) .Then(market => { if (market == null) { Context.Respond($"Unable to find a market by the name or id of {marketNameOrId}."); return; } orderManager.UpdateOrAddMarketOrder(orderType, market.Id, itemDefinition.Id, pricePerOne, quantity) .Then(order => { Context.Respond( $"Successfully created Order#{order.Id} for {quantity}x {itemDefinition.DisplayNameText} @ {Utilities.FriendlyFormatCurrency(pricePerOne)} per 1."); }) .Catch(HandleError); }) .Catch(HandleError); }
protected override bool Init(object controller, object binding, DefinitionFile definition) { if (!base.Init(controller, binding, definition)) { return(false); } DefinitionFileWithStyle file = new DefinitionFileWithStyle(definition, typeof(UiView)); _zoom = DefinitionResolver.GetShared <int>(Controller, Binding, file["Zoom"], 1); return(true); }
bool IDefinitionClass.Init(UiController controller, object binding, DefinitionFile definition) { DefinitionFileWithStyle file = new DefinitionFileWithStyle(definition, typeof(NinePatchBackground)); _image = DefinitionResolver.Get <NinePatchImage>(controller, binding, file["Image"], null); _scaleByUnit = DefinitionResolver.Get <bool>(controller, binding, file["ScaleByUnit"], false); _scale = (float)DefinitionResolver.Get <double>(controller, binding, file["Scale"], 1); _color = DefinitionResolver.GetColorWrapper(controller, binding, file["Color"]) ?? new ColorWrapper(); _margin = DefinitionResolver.Get <Margin>(controller, binding, file["Margin"], Margin.None); return(true); }
protected override bool Init(object controller, object binding, DefinitionFile definition) { if (!base.Init(controller, binding, definition)) { return(false); } DefinitionFileWithStyle file = new DefinitionFileWithStyle(definition, typeof(UiListBox)); _selectionColor = DefinitionResolver.GetColorWrapper(Controller, Binding, file["SelectionColor"]); return(true); }
protected override bool Init(object controller, object binding, DefinitionFile definition) { if (!base.Init(controller, binding, definition)) { return(false); } DefinitionFileWithStyle file = new DefinitionFileWithStyle(definition, typeof(UiCheckBox)); Checked = DefinitionResolver.GetShared <bool>(Controller, Binding, file["Checked"], false); return(true); }
protected override bool Init(object controller, object binding, DefinitionFile definition) { if (!base.Init(controller, binding, definition)) { return(false); } DefinitionFileWithStyle file = new DefinitionFileWithStyle(definition, typeof(UiColoredLabel)); Colors = DefinitionResolver.Get <Color[]>(Controller, Binding, file["Colors"], null); return(true); }
protected override bool Init(object controller, object binding, DefinitionFile definition) { if (!base.Init(controller, binding, definition)) { return(false); } DefinitionFileWithStyle file = new DefinitionFileWithStyle(definition, typeof(UiQuickList)); _items = DefinitionResolver.GetValueFromMethodOrField(Controller, Binding, file["Items"]) as IItemsProvider; if (_items == null) { return(false); } _items.Subscribe(this); _rowHeight = DefinitionResolver.Get <Length>(Controller, Binding, file["RowHeight"], Length.Default); _separatorHeight = DefinitionResolver.Get <Length>(Controller, Binding, file["SeparatorHeight"], Length.Zero); _maxScrollExceed = DefinitionResolver.Get <Length>(Controller, Binding, file["MaxScrollExceed"], ScrollingService.MaxScrollExceed); _reversed = DefinitionResolver.Get <bool>(Controller, Binding, file["Reversed"], false); _wheelSpeed = (float)DefinitionResolver.Get <double>(Controller, Binding, file["WheelScrollSpeed"], 0); _rule = DefinitionResolver.Get <ScrollingService.ExceedRule>(Controller, Binding, file["ExceedRule"], ScrollingService.ExceedRule.Allow); _columns = new List <QuickColumnDefinition>(); List <DefinitionFile> columnsDef = file["Columns"] as List <DefinitionFile>; if (columnsDef == null) { throw new Exception("Columns not defined!"); } foreach (var cd in columnsDef) { QuickColumnDefinition columnDefinitionObj = cd.CreateInstance(Controller, Binding) as QuickColumnDefinition; _columns.Add(columnDefinitionObj); } DefinitionFile separatorDef = file["Separator"] as DefinitionFile; if (separatorDef != null) { _separator = separatorDef.CreateInstance(Controller, Binding) as QuickSeparator; } return(true); }
protected override bool Init(object controller, object binding, Sitana.Framework.Ui.DefinitionFiles.DefinitionFile definition) { if (!base.Init(controller, binding, definition)) { return(false); } DefinitionFileWithStyle file = new DefinitionFileWithStyle(definition, typeof(UiEditBox)); _fontSize = DefinitionResolver.Get <int>(Controller, Binding, file["NativeInputFontSize"], 20); _nativeInputMargin = DefinitionResolver.Get <Margin>(Controller, Binding, file["NativeInputMargin"], Margin.None); _nativeInputAlign = DefinitionResolver.Get <Align>(Controller, Binding, file["NativeInputAlign"], Align.Left); return(true); }
protected override bool Init(object controller, object binding, DefinitionFile definition) { if (!base.Init(controller, binding, definition)) { return(false); } DefinitionFileWithStyle file = new DefinitionFileWithStyle(definition, typeof(UiRadioButton)); SelectedValue = DefinitionResolver.GetShared <int>(Controller, Binding, file["SelectedValue"], -1); Value = DefinitionResolver.Get <int>(Controller, Binding, file["Value"], 0); return(true); }
protected override bool Init(object controller, object binding, DefinitionFile definition) { if (!base.Init(controller, binding, definition)) { return(false); } DefinitionFileWithStyle file = new DefinitionFileWithStyle(definition, typeof(UiVerticalGradient)); _topColor = DefinitionResolver.GetColorWrapper(Controller, Binding, file["TopColor"]); _bottomColor = DefinitionResolver.GetColorWrapper(Controller, Binding, file["BottomColor"]); return(true); }
protected override bool Init(object controller, object binding, DefinitionFile definition) { if (!base.Init(controller, binding, definition)) { return(false); } DefinitionFileWithStyle file = new DefinitionFileWithStyle(definition, typeof(UiSpritePresenter)); _spriteInstance = DefinitionResolver.Get <Sprite>(Controller, Binding, file["Sprite"], null).CreateInstance(); _spriteInstance.Sequence = DefinitionResolver.GetString(Controller, Binding, file["Sequence"]); return(true); }