本文整理汇总了C#中Android.Content.Context类的典型用法代码示例。如果您正苦于以下问题:C# Context类的具体用法?C# Context怎么用?C# Context使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Context类属于Android.Content命名空间,在下文中一共展示了Context类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: OnReceive
public override void OnReceive(Context context, Intent intent)
{
Android.Util.Log.Info("MonoGame", intent.Action.ToString());
if(intent.Action == Intent.ActionScreenOff)
{
ScreenReceiver.ScreenLocked = true;
MediaPlayer.IsMuted = true;
}
else if(intent.Action == Intent.ActionScreenOn)
{
// If the user turns the screen on just after it has automatically turned off,
// the keyguard will not have had time to activate and the ActionUserPreset intent
// will not be broadcast. We need to check if the lock is currently active
// and if not re-enable the game related functions.
// http://stackoverflow.com/questions/4260794/how-to-tell-if-device-is-sleeping
KeyguardManager keyguard = (KeyguardManager)context.GetSystemService(Context.KeyguardService);
if (!keyguard.InKeyguardRestrictedInputMode())
{
ScreenReceiver.ScreenLocked = false;
MediaPlayer.IsMuted = false;
}
}
else if(intent.Action == Intent.ActionUserPresent)
{
// This intent is broadcast when the user unlocks the phone
ScreenReceiver.ScreenLocked = false;
MediaPlayer.IsMuted = false;
}
}
开发者ID:Boerlam001,项目名称:MonoGame,代码行数:29,代码来源:ScreenReciever.cs
示例17: ProgressButton
public ProgressButton(Context context, IAttributeSet attrs,
int defStyle)
: base(context, attrs, defStyle)
{
ResourceIdManager.UpdateIdValues();
Initialize(context, attrs, defStyle);
}
开发者ID:jamesmontemagno,项目名称:MonoDroidToolkit,代码行数:7,代码来源:ProgressButton.cs
示例18: SlidingTabStrip
public SlidingTabStrip(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 themeForegroundColor = outValue.Data;
_defaultBottomBorderColor = SetColorAlpha(themeForegroundColor,0x26);
_defaultTabColorizer = new SimpleTabColorizer();
_defaultTabColorizer.SetIndicatorColors(0xFF33B5);
_defaultTabColorizer.SetDividerColors(SetColorAlpha(themeForegroundColor,0x20));
_bottomBorderThickness = (int) (2 * density);
_bottomBorderPaint = new Paint();
_bottomBorderPaint.Color = Color.White;
_selectedIndicatorThickness = (int) (6 * density);
_selectedIndicatorPaint = new Paint();
_dividerHeight = 0.5f;
_dividerPaint = new Paint();
_dividerPaint.StrokeWidth=((int) (1 * density));
}
开发者ID:jeedey93,项目名称:xamarin-android-samples,代码行数:26,代码来源:SlidingTabStrip.cs
示例19: Apply
public void Apply(IMenu menu, Context context, object parent)
{
PlatformExtensions.ValidateTemplate(ItemsSource, Items);
var setter = new XmlPropertySetter<IMenu>(menu, context, new BindingSet());
menu.SetBindingMemberValue(AttachedMembers.Object.Parent, parent);
setter.SetBinding(nameof(DataContext), DataContext, false);
setter.SetBoolProperty(nameof(IsVisible), IsVisible);
setter.SetBoolProperty(nameof(IsEnabled), IsEnabled);
if (!string.IsNullOrEmpty(Bind))
setter.BindingSet.BindFromExpression(menu, Bind);
if (string.IsNullOrEmpty(ItemsSource))
{
if (Items != null)
{
for (int index = 0; index < Items.Count; index++)
Items[index].Apply(menu, context, index, index);
}
}
else
{
menu.SetBindingMemberValue(AttachedMembers.Menu.ItemsSourceGenerator, new MenuItemsSourceGenerator(menu, context, ItemTemplate));
setter.SetBinding(nameof(ItemsSource), ItemsSource, true);
}
setter.Apply();
}
开发者ID:dbeattie71,项目名称:MugenMvvmToolkit,代码行数:25,代码来源:MenuTemplate.cs
示例20: WrapedViewGroup
public WrapedViewGroup(Context context)
: base(context)
{
this.Clickable = true;
this.tapDetector = new TapDetector(this);
this.clickDetector = new ClickDetector(this);
}
开发者ID:evnik,项目名称:UIFramework,代码行数:7,代码来源:WrapedViewGroup.cs
注:本文中的Android.Content.Context类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论