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


C# Java类代码示例

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


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

示例1: DestroyItem

 public override void DestroyItem(ViewGroup container, int position, Java.Lang.Object objectValue) {
     //var vp = (ViewPager)container;
     //var chd = container.GetChildAt(position);
     //不能 Dispose, 如果释放了,会在 FinishUpdate 的时候, 报错
     //chd.Dispose();
     //container.RemoveView((View)chd);
 }
开发者ID:zhangcj,项目名称:Xamarin.Forms.Lagou,代码行数:7,代码来源:FlipViewAdapter.cs

示例2: Evaluate

        public Java.Lang.Object Evaluate(float t, Java.Lang.Object startValue, Java.Lang.Object endValue)
        {
            var start = (PathPoint)startValue;
            var end = (PathPoint)endValue;

            float x, y;
            if (end.Operation == PathPointOperation.Curve)
            {
                float oneMinusT = 1 - t;
                x = oneMinusT * oneMinusT * oneMinusT * start.X +
                    3 * oneMinusT * oneMinusT * t * end.Control0X +
                    3 * oneMinusT * t * t * end.Control1X +
                    t * t * t * end.X;
                y = oneMinusT * oneMinusT * oneMinusT * start.Y +
                    3 * oneMinusT * oneMinusT * t * end.Control0Y +
                    3 * oneMinusT * t * t * end.Control1Y +
                    t * t * t * end.Y;
            }
            else if (end.Operation == PathPointOperation.Line)
            {
                x = start.X + t * (end.X - start.X);
                y = start.Y + t * (end.Y - start.Y);
            }
            else
            {
                x = end.X;
                y = end.Y;
            }
            return PathPoint.MoveTo(x, y);
        }
开发者ID:cyecp,项目名称:XamarinComponents,代码行数:30,代码来源:PathEvaluator.cs

示例3: OnFailure

 public void OnFailure(Request request, Java.IO.IOException exception)
 {
     if (onFailure != null)
     {
         onFailure(request, exception);
     }
 }
开发者ID:monostefan,项目名称:square-bindings,代码行数:7,代码来源:Call.cs

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

示例5: OnFailure

 public void OnFailure(ICall call, Java.IO.IOException exception)
 {
     if (onFailure != null)
     {
         onFailure(call, exception);
     }
 }
开发者ID:Redth,项目名称:square-bindings,代码行数:7,代码来源:Call.cs

示例6: ArrayList

 /// <summary>
 /// Private ctor
 /// </summary>
 private ArrayList(Java.Util.IList<object> list, bool isFixedSize, bool isReadOnly, bool isSynchronized)
 {
     this.list = list;
     this.isFixedSize = isFixedSize;
     this.isReadOnly = isReadOnly;
     this.isSynchronized = isSynchronized;
 }
开发者ID:sebastianhaba,项目名称:api,代码行数:10,代码来源:ArrayList.cs

示例7: CreateFadeOutAnimation

        public static ObjectAnimator CreateFadeOutAnimation(Java.Lang.Object target, int duration, EventHandler endAnimationHandler)
        {
            ObjectAnimator oa = ObjectAnimator.OfFloat(target, ALPHA, INVISIBLE);
            oa.SetDuration(duration).AnimationEnd += endAnimationHandler;

            return oa;
        }
开发者ID:andyci,项目名称:ShowcaseView,代码行数:7,代码来源:AnimationUtils.cs

示例8: CreateSocket

        public override Java.Net.Socket CreateSocket(string host, int port, Java.Net.InetAddress localHost, int localPort)
        {
            SSLSocket socket = (SSLSocket)_factory.CreateSocket(host, port, localHost, localPort);
            socket.SetEnabledProtocols(socket.GetSupportedProtocols());

            return socket;
        }
开发者ID:jamespettigrew,项目名称:ModernHttpClient,代码行数:7,代码来源:ImprovedSSLSocketFactory.cs

示例9: OnTextChanged

		async protected override void OnTextChanged(Java.Lang.ICharSequence text, int start, int lengthBefore, int lengthAfter)
		{
			base.OnTextChanged(text, start, lengthBefore, lengthAfter);
			UpdateCharacterCount(StringUtils.TrimWhiteSpaceAndNewLine(Text));
			if (Validate != null)
			{
				Validate();
			}

			if (Text.Length <= 2 || !Text.Contains("@"))
			{
				if (SuggestionsView != null)
				{
					SuggestionsView.Visibility = ViewStates.Gone;
				}
				return;
			}


			if (Text.Substring(Text.Length - 1) == " " || Text.Substring(Text.Length - 1) == "@")
			{
				SuggestionsView.Visibility = ViewStates.Gone;
				return;
			}

			int startSelection = SelectionStart;

			string selectedWord = "";

			int length = 0;
			foreach (string currentWord in Text.Split(' '))
			{
				Console.WriteLine(currentWord);
				length = length + currentWord.Length + 1;
				if (length > startSelection)
				{
					selectedWord = currentWord;
					break;
				}
			}

			Console.WriteLine("Selected word is: " + selectedWord);

			if (!selectedWord.Contains("@") || selectedWord.IndexOf('@') != 0)
			{
				SuggestionsView.Visibility = ViewStates.Gone;
				return;
			}


			try
			{
				List<User> users = await TenServices.SearchFollowingUsers(selectedWord);
				SuggestionsView.BindDataToView(users);
			}
			catch (RESTError e)
			{
				Console.WriteLine(e.Message);
			}
		}
开发者ID:natevarghese,项目名称:XamarinTen,代码行数:60,代码来源:CharacterLimitedSuggestionEditText.cs

示例10: 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;
			}
开发者ID:ARMoir,项目名称:mobile-samples,代码行数:33,代码来源:AutoCompleteCustomAdapter.cs

示例11: 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;
        }
开发者ID:MuffPotter,项目名称:Xamarin.Plugins,代码行数:29,代码来源:ParsingUtil.cs

示例12: GetItemPosition

        /// <summary>
        /// Called when the host view is attempting to determine if an item's position has changed. We 
        /// </summary>
        /// <param name="objectValue"></param>
        /// <returns></returns>
        public override int GetItemPosition(Java.Lang.Object objectValue)
        {
            if (objectValue.Equals(Wizard.PreviousStep))
                return PositionUnchanged;

            return PositionNone; //Indicates that the item is no longer present in the adapter.. Forces a screen reload.. causing the updated context data to appear
        }
开发者ID:cryptocoinx,项目名称:WizarDroid.Net,代码行数:12,代码来源:WizardPagerAdapter.cs

示例13: OnPostExecute

		/// <summary>
		/// Called after the bitmap is loaded.
		/// </summary>
		/// <param name="result">Result of the DoInBackground function.</param>
		protected override void OnPostExecute(Java.Lang.Object result)
		{
			base.OnPostExecute(result);

			if (IsCancelled)
			{
				result = null;
				Log.Debug("TT", "OnPostExecute - Task Cancelled");
			}
			else
			{
				using (Bitmap bmpResult = result as Bitmap)
				{
					if (_imageViewReference != null && bmpResult != null)
					{
						ImageView imageView = (ImageView)_imageViewReference.Get();

						AsyncImageTask asyncImageTask = GetAsyncImageTask(imageView);

						if(this == asyncImageTask && imageView != null) {
							imageView.SetImageBitmap(bmpResult);
							//							if (!pLRUCache.ContainsKey(path))
							//								pLRUCache.Add(path, bmpResult);
						}
					}
				}
			}
		}
开发者ID:WFoundation,项目名称:WF.Player.Android,代码行数:32,代码来源:AsyncImageTask.cs

示例14: RemoveCallbacks

 public void RemoveCallbacks(Action action, Java.Lang.Object token)
 {
     var runnable = Java.Lang.Thread.RunnableImplementor.Remove (action);
     if (runnable == null)
         return;
     RemoveCallbacks (runnable, token);
     runnable.Dispose ();
 }
开发者ID:yudhitech,项目名称:xamarin-android,代码行数:8,代码来源:Handler.cs

示例15: handler

 void IWebSocketListener.OnFailure(Java.IO.IOException exception, Response response)
 {
     var handler = Failure;
     if (handler != null)
     {
         handler(sender, new FailureEventArgs(exception, response));
     }
 }
开发者ID:Redth,项目名称:square-bindings,代码行数:8,代码来源:Call.cs


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