本文整理汇总了C#中Java.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# Java.ToString方法的具体用法?C# Java.ToString怎么用?C# Java.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Java
的用法示例。
在下文中一共展示了Java.ToString方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PerformFiltering
protected override Filter.FilterResults PerformFiltering (Java.Lang.ICharSequence constraint)
{
FilterResults results = new FilterResults();
if (constraint != null) {
var searchFor = constraint.ToString ();
Console.WriteLine ("searchFor:" + searchFor);
var matchList = new List<string>();
// find matches, IndexOf means look for the input anywhere in the items
// but it isn't case-sensitive by default!
var matches = from i in customAdapter.AllItems
where i.IndexOf(searchFor) >= 0
select i;
foreach (var match in matches) {
matchList.Add (match);
}
customAdapter.MatchItems = matchList.ToArray ();
Console.WriteLine ("resultCount:" + matchList.Count);
// not sure if the Java array/FilterResults are used
Java.Lang.Object[] matchObjects;
matchObjects = new Java.Lang.Object[matchList.Count];
for (int i = 0; i < matchList.Count; i++) {
matchObjects[i] = new Java.Lang.String(matchList[i]);
}
results.Values = matchObjects;
results.Count = matchList.Count;
}
return results;
}
示例2: FilterFormatted
public Java.Lang.ICharSequence FilterFormatted(Java.Lang.ICharSequence source, int start, int end, global::Android.Text.ISpanned dest, int dstart, int dend)
{
var s = source.ToString();
var d = dest.ToString();
var proposal = d.Remove(dstart, dend - dstart).Insert(dstart, s.Substring(start, end - start));
if (_onChangeDelegate(proposal))
return null;
else
{
var r = new Java.Lang.String(d.Substring(dstart, dend - dstart));
if (source is ISpanned)
{
// This spannable thing here, is needed to copy information about which part of
// the string is being under composition by the keyboard (or other spans). A
// spannable string has support for extra information to the string, besides
// its characters and that information must not be lost!
var ssb = new SpannableString(r);
var spannableEnd = (end <= ssb.Length()) ? end : ssb.Length();
global::Android.Text.TextUtils.CopySpansFrom((ISpanned)source, start, spannableEnd, null, ssb, 0);
return ssb;
}
else
return r;
}
}
示例3: Parse
public static Java.Lang.ICharSequence Parse(Context context, IList<IIconModule> modules, Java.Lang.ICharSequence text, View target = null)
{
context = context.ApplicationContext;
// Analyse the text and replace {} blocks with the appropriate character
// Retain all transformations in the accumulator
var builder = new SpannableStringBuilder(text);
RecursivePrepareSpannableIndexes(context, text.ToString(), builder, modules, 0);
var isAnimated = HasAnimatedSpans(builder);
// If animated, periodically invalidate the TextView so that the
// CustomTypefaceSpan can redraw itself
if (isAnimated)
{
if (target == null)
throw new ArgumentException("You can't use \"spin\" without providing the target View.");
if (!(target is IHasOnViewAttachListener))
throw new ArgumentException(target.Class.SimpleName + " does not implement " +
"HasOnViewAttachListener. Please use IconTextView, IconButton or IconToggleButton.");
((IHasOnViewAttachListener)target).SetOnViewAttachListener(new MyListener(target));
}
else if (target is IHasOnViewAttachListener)
{
((IHasOnViewAttachListener)target).SetOnViewAttachListener(null);
}
return builder;
}
示例4: ApplyEntityValueToEditor
protected override void ApplyEntityValueToEditor(Java.Lang.Object o) {
if(o == null) {
this.editorButton.Text = "Tap to select.";
return;
}
this.editorButton.Text = o.ToString();
//type = (EmployeeType)Enum.Parse(typeof(EmployeeType), o.ToString());
type = (EmployeeType)Enum.Parse(type.GetType(), o.ToString());
}
示例5: ApplyEntityValueToEditor
protected override void ApplyEntityValueToEditor(Java.Lang.Object o)
{
if(o == null) {
this.editorButton.Text = "Tap to select.";
return;
}
this.editorButton.Text = o.ToString();
type = (EmployeeType)o;
}
示例6: Apply
public Java.Lang.Object Apply(Java.Lang.Object context, Java.Lang.Object groupName) {
// Developers can create a special group layout for any given group name.
if(groupName.Equals("Group 2")) {
EditorGroup group = new EditorGroup((Context)context, groupName.ToString(), Resource.Layout.dataform_custom_group);
// Each group can have a specific layout manager, be it a table layout, a linear layout, a placeholder layout or even something completely custom.
group.LayoutManager = new DataFormPlaceholderLayoutManager((Context)context, Resource.Layout.dataform_group_placeholder_layout);
return group;
}
return null;
}
示例7: Validate
public void Validate(Java.Lang.Object o, IValidationCompletedCallback validationCompletedCallback) {
ValidationInfo info;
if(o == null || o.ToString().Equals("")) {
info = new ValidationInfo(false, "This field can not be empty.", o);
} else {
info = new ValidationInfo(true, "The entered value is valid.", o);
}
validationCompletedCallback.ValidationCompleted(info);
}
示例8: PerformFiltering
protected override FilterResults PerformFiltering (Java.Lang.ICharSequence constraint)
{
if (constraint == null)
return new FilterResults () { Count = 0, Values = null };
var search = constraint.ToString ();
var addresses = geocoder.GetFromLocationName (search, 7,
LowerLeftLat,
LowerLeftLon,
UpperRightLat,
UpperRightLon);
return new FilterResults () {
Count = addresses.Count,
Values = (Java.Lang.Object)addresses
};
}
示例9: PerformFiltering
protected override void PerformFiltering(Java.Lang.ICharSequence text, int keyCode)
{
string textToFilter = text.ToString();
if (!string.IsNullOrEmpty(textToFilter) && textToFilter.StartsWith(_lastCompletionPrefix))
{
textToFilter = textToFilter.Substring(_lastCompletionPrefix.Length);
base.PerformFiltering(new Java.Lang.String(textToFilter), keyCode);
}
else
{
DismissDropDown();
}
}
示例10: PerformFiltering
//this method is called async (not from UI thread!) so making network request is possible here
protected override FilterResults PerformFiltering(Java.Lang.ICharSequence constraint)
{
FilterResults filterResults = new FilterResults();
if (constraint != null) {
nn_adapter.resultlist=AutoFillManager.RetrieveInfo (constraint.ToString ());
var tempcountry=(nn_adapter.nn_context!=null)? nn_adapter.nn_context.listcountry: nn_adapter.nn_context1.listcountry;
var tempprovince=(nn_adapter.nn_context!=null)? nn_adapter.nn_context.liststateandprovince: nn_adapter.nn_context1.liststateandprovince;
RetrievedInfo[] flag = new RetrievedInfo[nn_adapter.resultlist.Count];
for(int i=0;i<nn_adapter.resultlist.Count;i++){
var tempobj = nn_adapter.resultlist [i];
bool countryflag=false;
bool provinceflag=false;
foreach(var country in tempcountry){
if(country.country_name.Equals(tempobj.country)){
countryflag = true;
}
}
foreach(var province in tempprovince){
if(province.state_province_name.Equals(tempobj.state)){
provinceflag = true;
}
}
if(!(countryflag&&provinceflag)){
flag [i] = tempobj;
}
}
for (int i = 0; i < flag.Length; i++) {
if (flag [i]!=null) {
nn_adapter.resultlist.Remove(flag[i]);
}
}
nn_adapter.resultarraylist=new ArrayList(nn_adapter.resultlist);
filterResults.Values = nn_adapter.resultarraylist;
filterResults.Count = nn_adapter.resultarraylist.Size();
}
return filterResults;
}
示例11: Call
public void Call (Java.Lang.Object content)
{
Console.WriteLine (content.ToString());
}
示例12: OnPropertyChanged
public void OnPropertyChanged(String s, Java.Lang.Object o) {
if(o.ToString() == type.ToString()) {
return;
}
ApplyEntityValueToEditor(o);
// Remember to call value changed, otherwise the object being edited will not be updated.
OnEditorValueChanged(o);
}
示例13: UncaughtException
public void UncaughtException(Java.Lang.Thread thread, Java.Lang.Throwable ex)
{
WriteException(ex != null ? ex.ToString() : "Java uncaught exception is null");
}
示例14: OnBindGroupViewHolder
public override void OnBindGroupViewHolder(ListViewHolder holder, Java.Lang.Object groupKey)
{
GroupItemViewHolder vh = (GroupItemViewHolder) holder;
vh.txtGroupHeader.Text = groupKey.ToString().ToUpper();
}
示例15: FilterFormatted
public Java.Lang.ICharSequence FilterFormatted(Java.Lang.ICharSequence source, int start, int end, ISpanned dest, int dstart, int dend)
{
var replacement = source.ToString();
var ok = this.MayInsertTextAt(this.currencyEdit.Text, replacement, dstart, this.currencyEdit.DecimalPlaces);
if (ok)
{
return source;
}
else
{
return new Java.Lang.String(string.Empty);
}
}