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


C# Content.Context类代码示例

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


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

示例1: TeamFindMemberAdapter

 public TeamFindMemberAdapter(Context context,global::Android.Support.V4.App.Fragment fragment,List<Tap5050PotentialTeamMemberInfo> list,EventCard card)
 {
     nn_fragment = fragment;
     nn_context = context;
     nn_list = list;
     nn_card = card;
 }
开发者ID:MADMUC,项目名称:TAP5050,代码行数:7,代码来源:TeamFindMemberAdapter.cs

示例2: CustomInfoWindow

		public CustomInfoWindow (Context context, ViewGroup viewGroup, List<CustomPin> pins)
		{
			_context = context;
			_viewGroup = viewGroup;
			_pins = pins;

		}
开发者ID:biyyalakamal,项目名称:customer-success-samples,代码行数:7,代码来源:CustomInfoWindow.cs

示例3: ProgressDialogHelper

		public ProgressDialogHelper(Context context) {
			this.progress = new ProgressDialog(context);
			progress.SetProgressStyle(ProgressDialogStyle.Spinner);
			progress.Indeterminate = false;
			progress.Progress = 99;
			progress.SetCanceledOnTouchOutside(false);
		}
开发者ID:MarcinSzyszka,项目名称:MobileSecondHand,代码行数:7,代码来源:ProgressDialogHelper.cs

示例4: SmoothStreamingRendererBuilder

 public SmoothStreamingRendererBuilder(Context context, string userAgent, string url, IMediaDrmCallback drmCallback)
 {
     _context = context;
     _userAgent = userAgent;
     _url = ExoPlayerUtil.ToLowerInvariant(url).EndsWith("/manifest") ? url : url + "/Manifest";
     _drmCallback = drmCallback;
 }
开发者ID:mayuki,项目名称:AgqrPlayer4Tv,代码行数:7,代码来源:SmoothStreamingRendererBuilder.cs

示例5: MonoGameAndroidGameView

        public MonoGameAndroidGameView(Context context, AndroidGameWindow androidGameWindow, Game game)
            : base(context)
        {
            _gameWindow = androidGameWindow;
			_game = game;
            _touchManager = new AndroidTouchEventManager(androidGameWindow);
        }
开发者ID:procfxgen,项目名称:MGShaderEditor,代码行数:7,代码来源:MonoGameAndroidGameView.cs

示例6: Initialize

        private void Initialize (Context ctx)
        {
            var dm = ctx.Resources.DisplayMetrics;
            var inflater = LayoutInflater.FromContext (ctx);

            overlayInset = (int)TypedValue.ApplyDimension (ComplexUnitType.Dip, 45, dm);

            backgroundView = new SliceView (ctx) {
                StartAngle = 0,
                EndAngle = 360,
                Color = emptyPieColor,
            };
            AddView (backgroundView);

            loadingOverlayView = inflater.Inflate (Resource.Layout.PieChartLoading, this, false);
            AddView (loadingOverlayView);

            emptyOverlayView = inflater.Inflate (Resource.Layout.PieChartEmpty, this, false);
            emptyOverlayView.Visibility = ViewStates.Gone;
            AddView (emptyOverlayView);

            statsOverlayView = inflater.Inflate (Resource.Layout.PieChartStats, this, false);
            statsOverlayView.Visibility = ViewStates.Gone;
            AddView (statsOverlayView);

            statsTimeTextView = statsOverlayView.FindViewById<TextView> (Resource.Id.TimeTextView);
            statsMoneyTextView = statsOverlayView.FindViewById<TextView> (Resource.Id.MoneyTextView);

            Click += delegate {
                // Deselect slices on click. The Clickable property is set to true only when a slice is selected.
                ActiveSlice = -1;
            };
            Clickable = false;
        }
开发者ID:eatskolnikov,项目名称:mobile,代码行数:34,代码来源:PieChart.cs

示例7: displayTracks

        public void displayTracks(string track, Context c, Action<string> callback)
        {
            if (checkForNetwork() != true)
            {
                callback(NETFAULT);
            }
            else
            {
                POHWS.webservice.Service1 Service3 = new POHWS.webservice.Service1();
                string retStr = "";
                Service3.BeginGetTrack(track, delegate(IAsyncResult iar)
                    {
                        POHWS.webservice.Track tableData = Service3.EndGetTrack(iar);
            #if DEBUG
                        Console.WriteLine("in displayTracks : track = {0}, tableData.Content = {1}.", track, tableData.Content);
            #endif
                        Android.App.Application.SynchronizationContext.Post(delegate
                            {
                                string uri = "StyleSheet.css";
                                string settings = string.Empty;

                                var input = c.Assets.Open(uri);
                                using (StreamReader sr = new System.IO.StreamReader(input))
                                {
                                    settings = sr.ReadToEnd();
                                }

                                string CSS = "<html><head><style>" + settings + "</style></head><body style='height:600px;background: url(file:///android_asset/Back_AQHA.png)' >";
                                retStr = CSS + tableData.Content + "</body></html>";
                                callback(retStr);
                            }, null);
                    }, null);
            }
        }
开发者ID:nodoid,项目名称:Webview,代码行数:34,代码来源:webservice-user.cs

示例8: CreateIntent

 public static Intent CreateIntent(Context context, String action, int albumID, int episodeID)
 {
     var intent = CreateIntent(context, action);
     ExtraUtils.PutAlbum (intent, albumID);
     ExtraUtils.PutEpisode(intent, episodeID);
     return intent;
 }
开发者ID:puncsky,项目名称:DrunkAudible,代码行数:7,代码来源:PlayerService.cs

示例9: GetCellCore

		protected override AView GetCellCore(Cell item, AView convertView, ViewGroup parent, Context context)
		{
			Performance.Start();
			var cell = (ViewCell)item;

			var container = convertView as ViewCellContainer;
			if (container != null)
			{
				container.Update(cell);
				Performance.Stop();
				return container;
			}

			BindableProperty unevenRows = null, rowHeight = null;
			if (ParentView is TableView)
			{
				unevenRows = TableView.HasUnevenRowsProperty;
				rowHeight = TableView.RowHeightProperty;
			}
			else if (ParentView is ListView)
			{
				unevenRows = ListView.HasUnevenRowsProperty;
				rowHeight = ListView.RowHeightProperty;
			}

			IVisualElementRenderer view = Platform.CreateRenderer(cell.View);
			Platform.SetRenderer(cell.View, view);
			cell.View.IsPlatformEnabled = true;
			var c = new ViewCellContainer(context, view, cell, ParentView, unevenRows, rowHeight);

			Performance.Stop();

			return c;
		}
开发者ID:cosullivan,项目名称:Xamarin.Forms,代码行数:34,代码来源:ViewCellRenderer.cs

示例10: CircleImageView

		public CircleImageView(Context context, IAttributeSet attrs, int defStyle)
			: base(context, attrs, defStyle)
		{

			// init paint
			paint = new Paint();
			paint.AntiAlias = true;

			paintBorder = new Paint();
			paintBorder.AntiAlias = true;

			// load the styled attributes and set their properties
			TypedArray attributes = context.ObtainStyledAttributes(attrs, Resource.Styleable.CircularImageView, defStyle, 0);

			if (attributes.GetBoolean(Resource.Styleable.CircularImageView_border, true))
			{
				int defaultBorderSize = (int)(4 * context.Resources.DisplayMetrics.Density+ 0.5f);
				BorderWidth = attributes.GetDimensionPixelOffset(Resource.Styleable.CircularImageView_border_width, defaultBorderSize);
				BorderColor = attributes.GetColor(Resource.Styleable.CircularImageView_border_color, Color.White);
			}

			if (attributes.GetBoolean(Resource.Styleable.CircularImageView_shadow, false))
			{
				addShadow();
			}
		}
开发者ID:scrafty614,项目名称:XamarinStudio_Example,代码行数:26,代码来源:CircleImageView.cs

示例11: Show

		public void Show (Context context, string status = null, int progress = -1, MaskType maskType = MaskType.Black, TimeSpan? timeout = null, Action clickCallback = null, bool centered = true, Action cancelCallback = null)
		{
			if (progress >= 0)
				showProgress (context, progress, status, maskType, timeout, clickCallback, cancelCallback);
			else
				showStatus (context, true, status, maskType, timeout, clickCallback, centered, cancelCallback);
		}
开发者ID:skela,项目名称:AndHUD,代码行数:7,代码来源:AndHUD.cs

示例12: GetView

		public override View GetView(Context context, View convertView, ViewGroup parent)
        {
			var view = convertView as RelativeLayout;
			
			if (view == null)
				view = new RelativeLayout(context);
						
            var parms = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.WrapContent,
                                                        ViewGroup.LayoutParams.WrapContent);
            parms.SetMargins(5, 3, 5, 0);
            parms.AddRule((int) LayoutRules.AlignParentLeft);

            _caption = new TextView(context) {Text = Caption, TextSize = 16f};
            view.AddView(_caption, parms);

            if (!string.IsNullOrEmpty(Value))
            {
                var tparms = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.WrapContent,
                                                             ViewGroup.LayoutParams.WrapContent);
                tparms.SetMargins(5, 3, 5, 0);
                tparms.AddRule((int) LayoutRules.AlignParentRight);

                _text = new TextView(context) {Text = Value, TextSize = 16f};
                view.AddView(_text, tparms);
            }

            return view;
        }
开发者ID:xlvisuals,项目名称:MonoDroid.Dialog,代码行数:28,代码来源:StringElement.cs

示例13: GetApkExpansionFiles

        /// <summary>
        /// The get apk expansion files.
        /// </summary>
        /// <param name="ctx">
        /// The ctx.
        /// </param>
        /// <param name="mainVersion">
        /// The main version.
        /// </param>
        /// <param name="patchVersion">
        /// The patch version.
        /// </param>
        /// <returns>
        /// A list of obb files for this app.
        /// </returns>
        public static IEnumerable<string> GetApkExpansionFiles(Context ctx, int mainVersion, int patchVersion)
        {
            var ret = new List<string>();

            if (Environment.ExternalStorageState.Equals(Environment.MediaMounted))
            {
                string packageName = ctx.PackageName;

                // Build the full path to the app's expansion files
                string expPath = Environment.ExternalStorageDirectory + ExpansionFilesPath + packageName;

                // Check that expansion file path exists
                if (Directory.Exists(expPath))
                {
                    string main = Path.Combine(expPath, string.Format("main.{0}.{1}.obb", mainVersion, packageName));
                    string patch = Path.Combine(expPath, string.Format("patch.{0}.{1}.obb", mainVersion, packageName));

                    if (mainVersion > 0 && File.Exists(main))
                    {
                        ret.Add(main);
                    }

                    if (patchVersion > 0 && File.Exists(patch))
                    {
                        ret.Add(patch);
                    }
                }
            }

            return ret.ToArray();
        }
开发者ID:jele69,项目名称:Android.Play.ExpansionLibrary,代码行数:46,代码来源:ApkExpansionSupport.cs

示例14: SlidingTabStrip1

        public SlidingTabStrip1(Context context, IAttributeSet attrs)
            : base(context, attrs)
        {
            SetWillNotDraw(false);

            float density = Resources.DisplayMetrics.Density;

            TypedValue outValue = new TypedValue();
            context.Theme.ResolveAttribute(Android.Resource.Attribute.ColorForeground, outValue, true);
            int themeForeGround = outValue.Data;
            mDefaultBottomBorderColor = SetColorAlpha(themeForeGround, DEFAULT_BOTTOM_BORDER_COLOR_ALPHA);

            mDefaultTabColorizer = new SimpleTabColorizer1();
            mDefaultTabColorizer.IndicatorColors = INDICATOR_COLORS;
            mDefaultTabColorizer.DividerColors = DIVIDER_COLORS;

            mBottomBorderThickness = (int)(DEFAULT_BOTTOM_BORDER_THICKNESS_DIPS * density);
            mBottomBorderPaint = new Paint();
            mBottomBorderPaint.Color = GetColorFromInteger(0xC5C5C5); //Gray

            mSelectedIndicatorThickness = (int)(SELECTED_INDICATOR_THICKNESS_DIPS * density);
            mSelectedIndicatorPaint = new Paint();

            mDividerHeight = DEFAULT_DIVIDER_HEIGHT;
            mDividerPaint = new Paint();
            mDividerPaint.StrokeWidth = (int)(DEFAULT_DIVIDER_THICKNESS_DIPS * density);
        }
开发者ID:ThanhBui92,项目名称:OrigamiApp,代码行数:27,代码来源:SlidingTabStrip1.cs

示例15: SampleBrowser

		public SampleBrowser(Context context, IGraphicsContext graphicsContext, IWindowInfo windowInfo)
		{
			// TODO: Complete member initialization
			this.androidContext = context;
			this.GLGraphicsContext = graphicsContext;
			this.GlWindowInfo = windowInfo;
		}
开发者ID:ryan-bunker,项目名称:axiom3d,代码行数:7,代码来源:SampleBrowser.Droid.cs


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