本文整理汇总了C#中ICharSequence.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# ICharSequence.ToString方法的具体用法?C# ICharSequence.ToString怎么用?C# ICharSequence.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ICharSequence
的用法示例。
在下文中一共展示了ICharSequence.ToString方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Parse
public static ICharSequence Parse(Context context, IList<IconFontDescriptorWrapper> iconFontDescriptors,
ICharSequence text, TextView target)
{
context = context.ApplicationContext;
// Analyse the text and replace {} blocks With the appropriate character
// Retain all transformations in the accumulator
var spannableBuilder = new SpannableStringBuilder(text);
RecursivePrepareSpannableIndexes(context, text.ToString(), spannableBuilder, iconFontDescriptors, 0);
var isAnimated = HasAnimatedSpans(spannableBuilder);
// 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 TextView.");
}
if (!(target is IHasOnViewAttachListener))
{
throw new ArgumentException(target.GetType().Name + " does not implement " +
"HasOnViewAttachListener. Please use IconTextView, IconButton or IconToggleButton.");
}
((IHasOnViewAttachListener) target).OnViewAttachListener =
new OnViewAttachListenerOnViewAttachListenerAnonymousInnerClassHelper(target);
}
else if (target is IHasOnViewAttachListener)
{
((IHasOnViewAttachListener) target).OnViewAttachListener = null;
}
return spannableBuilder;
}
示例2: PerformFiltering
protected override FilterResults PerformFiltering(ICharSequence constraint)
{
var results = performFilteringHandler(constraint.ToString());
return new FilterResults
{
Count = results.Size(),
Values = results
};
}
示例3: PerformFiltering
protected override FilterResults PerformFiltering(ICharSequence constraint)
{
var stringConstraint = constraint == null ? string.Empty : constraint.ToString();
var count = _owner.SetConstraintAndWaitForDataChange(stringConstraint);
return new FilterResults
{
Count = count
};
}
示例4: OnAuthenticationError
public override void OnAuthenticationError(FingerprintState errorCode, ICharSequence errString)
{
base.OnAuthenticationError(errorCode, errString);
var message = errString != null ? errString.ToString() : string.Empty;
var result = new FingerprintAuthenticationResult { Status = FingerprintAuthenticationResultStatus.Failed, ErrorMessage = message };
if (errorCode == FingerprintState.ErrorLockout)
{
result.Status = FingerprintAuthenticationResultStatus.TooManyAttempts;
}
SetResultSafe(result);
}
示例5: FilterFormatted
public ICharSequence FilterFormatted(ICharSequence source, int start, int end, ISpanned dest, int dstart,
int dend)
{
try
{
var val = dest.ToString().Insert(dstart, source.ToString());
var input = int.Parse(val);
if (IsInRange(_min, _max, input))
return null;
}
catch (Exception ex)
{
}
return new String(string.Empty);
}
示例6: OnTextChanged
protected override void OnTextChanged(ICharSequence text, int start, int before, int after)
{
base.OnTextChanged(text, start, before, after);
if (_programmaticChange == false)
{
_fullText = text.ToString();
_isStale = true;
}
}
示例7: OnTextChanged
protected override void OnTextChanged( ICharSequence text, int start, int lengthBefore, int lengthAfter )
{
base.OnTextChanged ( text, start, lengthBefore, lengthAfter );
if ( !programmaticChange ) {
fullText = text.ToString ( );
isStale = true;
}
}
示例8: ToString
public static String ToString(ICharSequence charSequence)
{
return charSequence.ToString();
}
示例9: OnAuthenticationHelp
public override void OnAuthenticationHelp(int helpMsgId, ICharSequence helpString)
{
Log.Debug(TAG, "OnAuthenticationHelp: {0}:`{1}`", helpString, helpMsgId);
ReportScanFailure(helpMsgId, helpString.ToString());
}
示例10: OnAuthenticationError
public override void OnAuthenticationError(int errMsgId, ICharSequence errString)
{
// There are some situations where we don't care about the error. For example,
// if the user cancelled the scan, this will raise errorID #5. We don't want to
// report that, we'll just ignore it as that event is a part of the workflow.
bool reportError = (errMsgId == (int) FingerprintState.ErrorCanceled) &&
!_fragment.ScanForFingerprintsInOnResume;
string debugMsg = string.Format("OnAuthenticationError: {0}:`{1}`.", errMsgId, errString);
if (_fragment.UserCancelledScan)
{
string msg = _fragment.Resources.GetString(Resource.String.scan_cancelled_by_user);
ReportScanFailure(-1, msg);
}
else if (reportError)
{
ReportScanFailure(errMsgId, errString.ToString());
debugMsg += " Reporting the error.";
}
else
{
debugMsg += " Ignoring the error.";
}
Log.Debug(TAG, debugMsg);
}
示例11: OnMeasure
protected override void OnMeasure(int widthMeasureSpec, int heightMeasureSpec)
{
base.OnMeasure (widthMeasureSpec, heightMeasureSpec);
return;
_inMeasure = true;
//base.OnMeasure (widthMeasureSpec, heightMeasureSpec);
try {
var availableWidth = MeasureSpec.GetSize (widthMeasureSpec) - CompoundPaddingLeft - CompoundPaddingRight;
var availableHeight = MeasureSpec.GetSize (heightMeasureSpec) - CompoundPaddingTop - CompoundPaddingBottom;
_originalText = GetOriginalText ();
if (_originalText == null || _originalText.Length () == 0 || availableWidth <= 0) {
SetMeasuredDimension (widthMeasureSpec, heightMeasureSpec);
return;
}
var textPaint = Paint;
var targetTextSize = _maxTextSize;
var originalText = new Java.Lang.String (_originalText.ToString ());
var finalText = originalText;
var textSize = GetTextSize (originalText, textPaint, targetTextSize);
var textExcedsBounds = textSize.Height () > availableHeight || textSize.Width () > availableWidth;
if (_shrinkTextSize && textExcedsBounds) {
var heightMultiplier = availableHeight / (float)textSize.Height ();
var widthMultiplier = availableWidth / (float)textSize.Width ();
var multiplier = System.Math.Min (heightMultiplier, widthMultiplier);
targetTextSize = System.Math.Max (targetTextSize * multiplier, _minTextSize);
textSize = GetTextSize (finalText, textPaint, targetTextSize);
}
if (textSize.Width () > availableWidth) {
var modifiedText = new StringBuilder ();
var lines = originalText.Split (Java.Lang.JavaSystem.GetProperty ("line.separator"));
for (var i = 0; i < lines.Length; i++) {
modifiedText.Append (ResizeLine (textPaint, lines [i], availableWidth));
if (i != lines.Length - 1)
modifiedText.Append (Java.Lang.JavaSystem.GetProperty ("line.separator"));
}
finalText = new Java.Lang.String (modifiedText);
textSize = GetTextSize (finalText, textPaint, targetTextSize);
}
textPaint.TextSize = targetTextSize;
var isMultiline = finalText.IndexOf ('\n') > -1;
if (isMultiline) {
SetLineSpacing (LineSpacingExtra, LineSpacingMultiplierMultiline);
SetIncludeFontPadding (false);
} else {
SetLineSpacing (LineSpacingExtra, LineSpacingMultiplierSingleline);
SetIncludeFontPadding (true);
}
Text = finalText + "\u200B";
var measuredWidth = textSize.Width () + CompoundPaddingLeft + CompoundPaddingRight;
var measureHeight = textSize.Height () + CompoundPaddingTop + CompoundPaddingBottom;
measureHeight = System.Math.Max (measureHeight, MeasureSpec.GetSize (heightMeasureSpec));
SetMeasuredDimension (measuredWidth, measureHeight);
} finally {
_inMeasure = false;
}
}
示例12: PublishResults
protected override void PublishResults(ICharSequence constraint, FilterResults results)
{
publishResultsHandler(constraint.ToString(), results.Values as AbstractList);
}
示例13: SetText
public override void SetText(ICharSequence text, BufferType type)
{
base.SetText(Iconify.Compute(Context, text.ToString(), this), BufferType.Normal);
}
示例14: PerformFiltering
protected override FilterResults PerformFiltering(ICharSequence constraint)
{
returnObj = new FilterResults();
_results = new List<ListItem>();
if (_adapter._originalData == null)
_adapter._originalData = _adapter.Items;
if (constraint == null)
return returnObj;
if (_adapter._originalData != null && _adapter._originalData.Any())
{
var searchQuery = constraint.ToString ();
_results.AddRange(_adapter._originalData.Where(item => item.Name.ToLower().Contains(searchQuery.ToLower())));
}
// Nasty piece of .NET to Java wrapping, be careful with this!
returnObj.Values = FromArray(_results.Select(item => item.ToJavaObject()).ToArray());
returnObj.Count = _results.Count;
constraint.Dispose();
return returnObj;
}
示例15: RunQuery
public ICursor RunQuery(ICharSequence constraint)
{
Console.WriteLine(constraint);
ICursor cursor = _db.FetchNote(constraint.ToString());
return cursor;
}