当前位置: 首页>>代码示例>>C#>>正文


C# ICharSequence.ToString方法代码示例

本文整理汇总了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;
        }
开发者ID:PragmaticIT,项目名称:xiconify,代码行数:35,代码来源:ParsingUtil.cs

示例2: PerformFiltering

 protected override FilterResults PerformFiltering(ICharSequence constraint)
 {
     var results = performFilteringHandler(constraint.ToString());
     return new FilterResults
     {
         Count = results.Size(),
         Values = results
     };
 }
开发者ID:nepula-h-okuyama,项目名称:DroidKaigi2016Xamarin,代码行数:9,代码来源:DelegateFilter.cs

示例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
                    };
            }
开发者ID:darkice-matt-crombie,项目名称:MvxSpinnerTest,代码行数:11,代码来源:MvxFilteringAdapter.cs

示例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);
        }
开发者ID:smstuebe,项目名称:xamarin-fingerprint,代码行数:13,代码来源:FingerprintAuthenticationCallback.cs

示例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);
        }
开发者ID:vecode,项目名称:GW2Trader,代码行数:16,代码来源:RangeInputFilter.cs

示例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;
     }
 }
开发者ID:kobynet,项目名称:EllipsizingTextViewSharp,代码行数:9,代码来源:EllipsizingTextViewSharp.cs

示例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;
     }
 }
开发者ID:WindSpirit,项目名称:Alpha,代码行数:8,代码来源:EllipsizingTextView.cs

示例8: ToString

 public static String ToString(ICharSequence charSequence)
 {
     return charSequence.ToString();
 }
开发者ID:slown1,项目名称:Xamarin.Tsnackbar,代码行数:4,代码来源:CharsequenceHelper.cs

示例9: OnAuthenticationHelp

 public override void OnAuthenticationHelp(int helpMsgId, ICharSequence helpString)
 {
     Log.Debug(TAG, "OnAuthenticationHelp: {0}:`{1}`", helpString, helpMsgId);
     ReportScanFailure(helpMsgId, helpString.ToString());
 }
开发者ID:Appercode,项目名称:monodroid-samples,代码行数:5,代码来源:FingerprintManagerApiDialogFragment.cs

示例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);
            }
开发者ID:Appercode,项目名称:monodroid-samples,代码行数:26,代码来源:FingerprintManagerApiDialogFragment.cs

示例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;

            }
        }
开发者ID:RasaCosmin,项目名称:DropboxApp,代码行数:71,代码来源:AutoResizeTextView.cs

示例12: PublishResults

 protected override void PublishResults(ICharSequence constraint, FilterResults results)
 {
     publishResultsHandler(constraint.ToString(), results.Values as AbstractList);
 }
开发者ID:nepula-h-okuyama,项目名称:DroidKaigi2016Xamarin,代码行数:4,代码来源:DelegateFilter.cs

示例13: SetText

 public override void SetText(ICharSequence text, BufferType type)
 {
     base.SetText(Iconify.Compute(Context, text.ToString(), this), BufferType.Normal);
 }
开发者ID:Mitch528,项目名称:IconifyXamarin,代码行数:4,代码来源:IconToggleButton.cs

示例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;
            }
开发者ID:SansSkill,项目名称:Introproject,代码行数:25,代码来源:ListItemAdapter.cs

示例15: RunQuery

 public ICursor RunQuery(ICharSequence constraint)
 {
     Console.WriteLine(constraint);
     ICursor cursor = _db.FetchNote(constraint.ToString());
     return cursor;
 }
开发者ID:PablusVinii,项目名称:SuperNWTBible,代码行数:6,代码来源:NotesActivity.cs


注:本文中的ICharSequence.ToString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。