public TextKeyTranslateView(TextKey sourcekey, TextKey translatekey) { this.SourceKey = sourcekey; this.TranslateKey = translatekey; ColumnDefinitions.Add(1, GridUnitType.Star); ColumnDefinitions.Add(1, GridUnitType.Star); _LblSource = new Label() { Column = 0, Text = SourceKey.Value }; _LblTranslate = new Label() { Column = 1, Text = TranslateKey.Value }; _TxtTranslate = new UI.PasteTextField() { Column = 1, Visibility = Skill.Framework.UI.Visibility.Hidden }; _TxtTranslate.TextField.Text = TranslateKey.Value; this.Controls.Add(_LblSource); this.Controls.Add(_LblTranslate); this.Controls.Add(_TxtTranslate); _TxtTranslate.TextField.TextChanged += _TxtTranslate_TextChanged; this.Margin = new Thickness(0, 0, 17, 0); }
public StringProperties(ExposeProperties owner, PropertyInfo info, ExposePropertyAttribute attribute) : base(owner, attribute.Order, info) { object[] attributes = info.GetCustomAttributes(true); PasteTextFieldAttribute pasteTextFieldAttribute = null; AreaFieldAttribute areaAtt = null; System.Type ptType = typeof(PasteTextFieldAttribute); System.Type aType = typeof(AreaFieldAttribute); foreach (object o in attributes) { if (o.GetType() == ptType) { pasteTextFieldAttribute = (PasteTextFieldAttribute)o; } if (o.GetType() == aType) { areaAtt = (AreaFieldAttribute)o; } } if (pasteTextFieldAttribute != null) { _PasteTextField = new PasteTextField(pasteTextFieldAttribute.Persian, areaAtt != null); _TextField = _PasteTextField.TextField; if (areaAtt != null) { _PasteTextField.Height = Mathf.Max(18, areaAtt.Height); } } else { _TextField = new Skill.Editor.UI.TextField(); if (areaAtt != null) { _TextField.Height = Mathf.Max(18, areaAtt.Height); } } _TextField.TextChanged += TextField_ValueChanged; _TextField.Label.text = attribute.Name; _TextField.Label.tooltip = attribute.Description; }