本文整理汇总了C#中IAttributeSet.GetAttributeValue方法的典型用法代码示例。如果您正苦于以下问题:C# IAttributeSet.GetAttributeValue方法的具体用法?C# IAttributeSet.GetAttributeValue怎么用?C# IAttributeSet.GetAttributeValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IAttributeSet
的用法示例。
在下文中一共展示了IAttributeSet.GetAttributeValue方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MapViewLayoutParams
public MapViewLayoutParams(Context context, IAttributeSet attrs)
: base(context, attrs)
{
this.X = attrs.GetAttributeIntValue("http://schemas.mapquest.com/apk/res/mapquest", "x", int.MaxValue);
this.Y = attrs.GetAttributeIntValue("http://schemas.mapquest.com/apk/res/mapquest", "x", int.MaxValue);
String geoPoint = attrs.GetAttributeValue("http://schemas.mapquest.com/apk/res/mapquest", "geoPoint");
if ((geoPoint.Length > 0))
{
String[] arr = geoPoint.Split(new[] { "," }, StringSplitOptions.None);
if (arr.Length > 1)
{
try
{
double latitude = Double.Parse(arr[0].Trim());
double longitude = Double.Parse(arr[1].Trim());
this.Point = new GeoPoint(latitude, longitude);
this.Mode = 0;
}
catch (NumberFormatException nfe)
{
Log.Error("mq.android.maps.mapview", "Invalid value for geoPoint attribute : " + geoPoint);
}
}
}
}
示例2: DirectionArrow
public DirectionArrow(Context context, IAttributeSet attrs)
: base(context, attrs)
{
var dirAttr = attrs.GetAttributeValue(null, "direction");
Enum.TryParse(dirAttr, out _dir);
Create();
}
示例3: PriceButton
public PriceButton(Context context, IAttributeSet attrs)
: base(context, attrs)
{
LayoutInflater.From(context).Inflate(Resource.Layout.PriceButton, this);
_bigFiguresTextView = FindViewById<TextView>(Resource.Id.PriceButtonBigFiguresTextView);
_pipsTextView = FindViewById<TextView>(Resource.Id.PriceButtonPipsTextView);
_tenthOfPipTextView = FindViewById<TextView>(Resource.Id.PriceButtonTenthOfPipTextView);
_progressView = FindViewById<ProgressBar>(Resource.Id.PriceButtonProgress);
_contentView = FindViewById<LinearLayout>(Resource.Id.PriceButtonContent);
var directionLabelTextView = FindViewById<TextView>(Resource.Id.PriceButtonDirectionTextView);
directionLabelTextView.Text = attrs.GetAttributeValue(null, "direction_label");
Click += PriceButton_Click;
}
示例4: OnCreateView
public global::Android.Views.View OnCreateView(string name, Context context, IAttributeSet attrs)
{
String viewFullName = string.Format("android.widget.{0}", name); // this is bad as it will only do the normal controls....
var id = attrs.GetAttributeValue(BindingConstants.BindingNamespace, BindingConstants.IdString);
var view = _layoutInflater.CreateView(viewFullName, null, attrs);
if (view == null || id == null)
{
return view;
}
var node = FindNodeWithId(_rootnode, id);
if (node != null)
{
BindingFactory bf = new BindingFactory();
foreach (var property in node.Value.Properties)
{
Add(view, property.Value, node.Value);
}
}
return view;
}
示例5: LoadValuesFromXml
private void LoadValuesFromXml(IAttributeSet attrs)
{
_title = attrs.GetAttributeValue(XmlNamespaceAndroid, "title");
_units = attrs.GetAttributeValue(XmlNamespaceSessions, "units");
}
示例6: ProcessAttributeSets
void ProcessAttributeSets(IAttributeSet attrs)
{
var resID = attrs.GetAttributeResourceValue (null, "description", -1);
var val = resID == -1 ?
attrs.GetAttributeValue (null, "description")
: Context.Resources.GetString (resID);
desc = (val ?? string.Empty).ToUpper ();
}
示例7: Initialize
void Initialize(IAttributeSet attrs = null)
{
maxValue = 127;
if (attrs != null) {
channel_name = attrs.GetAttributeValue ("http://schemas.android.com/apk/lib/QuMixDroid_Controls", "channel_name");
}
}
示例8: SetValuesFromXml
private void SetValuesFromXml(IAttributeSet attrs)
{
maxValue = attrs.GetAttributeIntValue (ANDROIDNS, "max", 100);
minValue = attrs.GetAttributeIntValue (APPLICATIONNS, "min", 0);
unitsLeft = GetAttributeStringValue (attrs, APPLICATIONNS, "unitsLeft", "");
var units = GetAttributeStringValue (attrs, APPLICATIONNS, "units", "");
unitsRight = GetAttributeStringValue (attrs, APPLICATIONNS, "unitsRight", units);
var newInterval = attrs.GetAttributeValue (APPLICATIONNS, "interval");
if (newInterval != null)
int.TryParse (newInterval, out interval);
}
示例9: GetAttributeStringValue
private string GetAttributeStringValue(IAttributeSet attrs, string nameSpace, string name, string defaultValue)
{
var value = attrs.GetAttributeValue (nameSpace, name);
if (value == null)
value = defaultValue;
return value;
}
示例10: IonTextView
public IonTextView(Context context, IAttributeSet attrs)
: base(context, attrs)
{
this.context = context;
for (int i = 0; i < attrs.AttributeCount; i++)
{
this.ttfName = attrs.GetAttributeValue("http://schemas.android.com/apk/res/com.gem.nwtbiblefree", "ttf");
init();
}
}
示例11: InsetTextView
public InsetTextView(Context context, IAttributeSet attrs, int defStyle)
: base(context, attrs, defStyle)
{
text = attrs.GetAttributeValue (null, "text");
Initialize ();
}