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


C# ICharSequence类代码示例

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


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


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