• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# ICharSequence类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中ICharSequence的典型用法代码示例。如果您正苦于以下问题:C# ICharSequence类的具体用法?C# ICharSequence怎么用?C# ICharSequence使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ICharSequence类属于命名空间,在下文中一共展示了ICharSequence类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: InnerToken

        /// <summary>
        /// A method for getting tokens containing mutible words
        /// </summary>
        private ICharSequence InnerToken(ICharSequence text)
        {
            int i = text.Length();

            // Find the first space in the Token, going backwards
            while (i > 0 && text.CharAt(i - 1) == ' ')
            {
                i--;
            }

            if (i > 0 && text.CharAt(i - 1) == ' ')
            {
                return text;
            }
            else
            {
                if (text.GetType().IsInstanceOfType(typeof(ISpanned)))
                {
                    SpannableString sp = new SpannableString(text + " ");
                    TextUtils.CopySpansFrom((ISpanned)text, 0, text.Length(), Java.Lang.Class.FromType(typeof(Java.Lang.Object)), sp, 0);
                    return sp;
                }
                else
                {
                    return new Java.Lang.String(text + " ");
                }
            }
        }
开发者ID:prozum,项目名称:solitude,代码行数:31,代码来源:SpaceTokenizer.cs


示例2: FuzzyQueryNode

 /// <summary>
 /// 
 /// </summary>
 /// <param name="field">Name of the field query will use.</param>
 /// <param name="term">Term token to use for building term for the query</param>
 /// <param name="minSimilarity">similarity value</param>
 /// <param name="begin">position in the query string</param>
 /// <param name="end">position in the query string</param>
 public FuzzyQueryNode(string field, ICharSequence term,
     float minSimilarity, int begin, int end)
     : base(field, term, begin, end)
 {
     this.similarity = minSimilarity;
     IsLeaf = true;
 }
开发者ID:apache,项目名称:lucenenet,代码行数:15,代码来源:FuzzyQueryNode.cs


示例3: BeforeTextChanged

 void ITextWatcher.BeforeTextChanged(ICharSequence s, int start, int count, int after)
 {
     if (BeforeTextChanged != null)
     {
         BeforeTextChanged(s, start, count, after);
     }
 }
开发者ID:jlarsson,项目名称:MonoDroid.Simplified,代码行数:7,代码来源:TextWatcher.cs


示例4: EscapeChar

        private static ICharSequence EscapeChar(ICharSequence str, CultureInfo locale)
        {
            if (str == null || str.Length == 0)
                return str;

            ICharSequence buffer = str;

            // regular escapable Char for terms
            for (int i = 0; i < escapableTermChars.Length; i++)
            {
                buffer = ReplaceIgnoreCase(buffer, escapableTermChars[i].ToLower(locale),
                    "\\", locale);
            }

            // First Character of a term as more escaping chars
            for (int i = 0; i < escapableTermExtraFirstChars.Length; i++)
            {
                if (buffer[0] == escapableTermExtraFirstChars[i][0])
                {
                    buffer = new StringCharSequenceWrapper("\\" + buffer[0]
                        + buffer.SubSequence(1, buffer.Length).ToString());
                    break;
                }
            }

            return buffer;
        }
开发者ID:apache,项目名称:lucenenet,代码行数:27,代码来源:EscapeQuerySyntaxImpl.cs


示例5: SimpleMenuItem

		public SimpleMenuItem (SimpleMenu menu, int id, int order, ICharSequence title)
		{
			mMenu = menu;
			mId = id;
			mOrder = order;
			mTitle = title;
		}
开发者ID:BratislavDimitrov,项目名称:monodroid-samples,代码行数:7,代码来源:SimpleMenuItem.cs


示例6: 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


示例7: NewInstance

 /**
  * Create a new instance of MyFragment that will be initialized
  * with the given arguments.
  */
 internal static MyFragment NewInstance(ICharSequence label) {
     MyFragment f = new MyFragment();
     Bundle b = new Bundle();
     b.PutCharSequence("label", label);
     f.SetArguments(b);
     return f;
 }
开发者ID:MahendrenGanesan,项目名称:samples,代码行数:11,代码来源:FragmentArgumentsSupport.cs


示例8: OnTextChanged

 void ITextWatcher.OnTextChanged(ICharSequence s, int start, int before, int count)
 {
     if (OnTextChanged != null)
     {
         OnTextChanged(new TextChangedEventArgs(s, start, before, count));
     }
 }
开发者ID:jlarsson,项目名称:MonoDroid.Simplified,代码行数:7,代码来源:TextWatcher.cs


示例9: 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


示例10: PerformFiltering

		protected override FilterResults PerformFiltering (ICharSequence constraint)
		{
			if (filterResults == null) {
				filterResults = new FilterResults ();
			}

			Task.Run (async () => await SearchWithStringAsync (constraint));

			return filterResults;
		}
开发者ID:colbylwilliams,项目名称:XWeather,代码行数:10,代码来源:LocationSearchFilter.cs


示例11: UnescapedCharSequence

 /// <summary>
 /// Create a non-escaped <see cref="ICharSequence"/>
 /// </summary>
 public UnescapedCharSequence(ICharSequence text)
 {
     this.chars = new char[text.Length];
     this.wasEscaped = new bool[text.Length];
     for (int i = 0; i < text.Length; i++)
     {
         this.chars[i] = text[i];
         this.wasEscaped[i] = false;
     }
 }
开发者ID:apache,项目名称:lucenenet,代码行数:13,代码来源:UnescapedCharSequence.cs


示例12: 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


示例13: FilterFormatted

            public ICharSequence FilterFormatted(ICharSequence source, int start, int end, ISpanned dest, int dstart, int dend)
            {
                for (int i = start; i < end; ++i)
                {
                    if (!Character.IsDigit(source.CharAt(i)) && !backgroundHintTextView.IsCharInFilter(source.CharAt(i)))
                    {
                        return new Java.Lang.String("");
                    }
                }

                return null;
            }
开发者ID:TheJaniceTong,项目名称:Judo-Xamarin,代码行数:12,代码来源:BackgroundHintTextView.cs


示例14: SearchWithStringAsync

		async Task SearchWithStringAsync (ICharSequence constraint)
		{
			var searchString = constraint?.ToString ();

			if (searchString == null) {
				LocationResults = new List<WuAcLocation> ();
				ResultStrings = new List<SpannableString> ();
				return;
			}

			bool canceled = false;

			try {

				ResultStrings = new List<SpannableString> ();

				if (!string.IsNullOrWhiteSpace (searchString)) {

					LocationResults = await WuAcClient.GetAsync (searchString);

					Java.Lang.Object [] matchObjects = new Java.Lang.Object [LocationResults.Count];

					for (int i = 0; i < LocationResults.Count; i++) {

						var name = LocationResults [i].name;

						ResultStrings.Add (name.GetSearchResultSpannableString (searchString));

						matchObjects [i] = new Java.Lang.String (name);
					}

					filterResults.Values = matchObjects;
					filterResults.Count = LocationResults.Count;

				} else {

					LocationResults = new List<WuAcLocation> ();
				}

			} catch (System.Exception ex) {

				System.Diagnostics.Debug.WriteLine (ex.Message);

				canceled = true;

			} finally {

				if (!canceled) {
					publish = true;
					Activity.RunOnUiThread (() => PublishResults (constraint, filterResults));
				}
			}
		}
开发者ID:colbylwilliams,项目名称:XWeather,代码行数:53,代码来源:LocationSearchFilter.cs


示例15: Draw

        public override void Draw(Canvas canvas, ICharSequence text, int start, int end, float x, int top, int y, int bottom, Paint paint)
        {
            PrepView();

            canvas.Save();

            //Centering the token looks like a better strategy that aligning the bottom
            int padding = (bottom - top - View.Bottom) / 2;
            canvas.Translate(x, bottom - View.Bottom - padding);
            View.Draw(canvas);
            canvas.Restore();
        }
开发者ID:mattwhetton,项目名称:TokenCompleteTextView,代码行数:12,代码来源:ViewSpan.cs


示例16: BeforeTextChanged

 public void BeforeTextChanged(ICharSequence s, int start, int count, int after)
 {
     if (s.Length() > 4)
     {
         mTextInputLayout.SetError("学号输入错误!");
         mTextInputLayout.SetErrorEnabled(true);
     }
     else
     {
         mTextInputLayout.SetErrorEnabled(false);
     }
 }
开发者ID:huguodong,项目名称:XamandroidSupportDesign22.2.0.0,代码行数:12,代码来源:AgendaFragment.cs


示例17: 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


示例18: GetSize

 public override int GetSize(Paint paint, ICharSequence text, int start, int end, Paint.FontMetricsInt fm)
 {
     LocalPaint.Set(paint);
     ApplyCustomTypeFace(LocalPaint, _typeface);
     LocalPaint.GetTextBounds(_icon, 0, 1, TextBounds);
     if (fm != null)
     {
         fm.Descent = (int) (TextBounds.Height()*BaselineRatio);
         fm.Ascent = -(TextBounds.Height() - fm.Descent);
         fm.Top = fm.Ascent;
         fm.Bottom = fm.Descent;
     }
     return TextBounds.Width();
 }
开发者ID:PragmaticIT,项目名称:xiconify,代码行数:14,代码来源:CustomTypefaceSpan.cs


示例19: EscapeQuoted

        private ICharSequence EscapeQuoted(ICharSequence str, CultureInfo locale)
        {
            if (str == null || str.Length == 0)
                return str;

            ICharSequence buffer = str;

            for (int i = 0; i < escapableQuotedChars.Length; i++)
            {
                buffer = ReplaceIgnoreCase(buffer, escapableTermChars[i].ToLower(locale),
                    "\\", locale);
            }
            return buffer;
        }
开发者ID:apache,项目名称:lucenenet,代码行数:14,代码来源:EscapeQuerySyntaxImpl.cs


示例20: GetSize

 public override int GetSize(Paint paint, ICharSequence text, int start, int end, Paint.FontMetricsInt fm)
 {
     LOCAL_PAINT.Set(paint);
     ApplyCustomTypeFace(LOCAL_PAINT, type);
     LOCAL_PAINT.GetTextBounds(icon, 0, 1, TEXT_BOUNDS);
     if (fm != null)
     {
         float baselineRatio = baselineAligned ? 0 : BASELINE_RATIO;
         fm.Descent = (int)(TEXT_BOUNDS.Height() * baselineRatio);
         fm.Ascent = -(TEXT_BOUNDS.Height() - fm.Descent);
         fm.Top = fm.Ascent;
         fm.Bottom = fm.Descent;
     }
     return TEXT_BOUNDS.Width();
 }
开发者ID:Mitch528,项目名称:IconifyXamarin,代码行数:15,代码来源:CustomTypefaceSpan.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# ICharStream类代码示例发布时间:2022-05-24
下一篇:
C# IChannelSender类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap