Paradox Game Engine  v1.0.0 beta06
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros Pages
MultilineElement.cs
Go to the documentation of this file.
1 // Copyright (c) 2014 Silicon Studio Corp. (http://siliconstudio.co.jp)
2 // This file is distributed under GPL v3. See LICENSE.md for details.
3 using Android.Content;
4 using Android.Views;
5 
6 namespace MonoDroid.Dialog
7 {
9  {
10  public int Lines { get; set; }
11  public int MaxLength {get;set;}
12 
13  public MultilineElement(string caption, string value)
14  : base(caption, value, (int)DroidResources.ElementLayout.dialog_textarea)
15  {
16  Lines = 3;
17  }
18 
19  public override View GetView(Context context, View convertView, ViewGroup parent)
20  {
21  View view = DroidResources.LoadMultilineElementLayout(context, convertView, parent, LayoutId, out _entry);
22  if (_entry != null)
23  {
24  _entry.SetLines(Lines);
25  _entry.Text = Value;
26  _entry.Hint = Caption;
27  _entry.TextChanged += delegate(object sender, Android.Text.TextChangedEventArgs e) {
28  if(MaxLength > 0 && _entry.Text.Length > MaxLength)
29  _entry.Text = _entry.Text.Substring(0,MaxLength);
30  };
31  }
32  return view;
33  }
34 
35  }
36 }
MultilineElement(string caption, string value)
Definition: EntryElement.cs:13
override View GetView(Context context, View convertView, ViewGroup parent)
Overriden my most derived classes, creates a view that creates a View with the contents for display ...