本文整理汇总了C#中System.PageData.Update方法的典型用法代码示例。如果您正苦于以下问题:C# PageData.Update方法的具体用法?C# PageData.Update怎么用?C# PageData.Update使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.PageData
的用法示例。
在下文中一共展示了PageData.Update方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnAddButtonTileClick
private async void OnAddButtonTileClick(object sender, EventArgs e)
{
try
{
BitmapFactory.Options options = new BitmapFactory.Options();
options.InScaled = false;
BandIcon tileIcon = BandIcon.ToBandIcon(BitmapFactory.DecodeResource(Resources, Resource.Raw.tile, options));
BandIcon badgeIcon = BandIcon.ToBandIcon(BitmapFactory.DecodeResource(Resources, Resource.Raw.badge, options));
FilledButton button = new FilledButton(0, 5, 210, 45);
button.BackgroundColor = Color.Red;
button.Margins = new Margins(0, 5, 0, 0);
button.ElementId = 12;
TextButton button2 = new TextButton(0, 0, 210, 45);
button2.PressedColor = Color.Blue;
button2.Margins = new Margins(0, 5, 0, 0);
button2.ElementId = 21;
FlowPanel flowPanel = new FlowPanel(15, 0, 260, 105, FlowPanelOrientation.Vertical);
flowPanel.AddElements(button);
flowPanel.AddElements(button2);
PageLayout pageLayout = new PageLayout(flowPanel);
BandTile.Builder builder = new BandTile.Builder(Java.Util.UUID.RandomUUID(), mEditTileName.Text, tileIcon);
if (mCheckboxBadging.Checked)
{
builder.SetTileSmallIcon(badgeIcon);
}
if (mCheckboxCustomTheme.Checked)
{
builder.SetTheme(mThemeView.Theme);
}
builder.SetPageLayouts(pageLayout);
BandTile tile = builder.Build();
try
{
var result = await Model.Instance.Client.TileManager.AddTileTaskAsync(Activity, tile);
if (result)
{
Toast.MakeText(Activity, "Tile added", ToastLength.Short).Show();
}
else
{
Toast.MakeText(Activity, "Unable to add tile", ToastLength.Short).Show();
}
}
catch (Exception ex)
{
Util.ShowExceptionAlert(Activity, "Add tile", ex);
}
PageData pageData = new PageData(Java.Util.UUID.RandomUUID(), 0);
pageData.Update(new FilledButtonData(12, Color.Yellow));
pageData.Update(new TextButtonData(21, "Text Button"));
await Model.Instance.Client.TileManager.SetPagesTaskAsync(tile.TileId, pageData);
Toast.MakeText(Activity, "Page updated", ToastLength.Short).Show();
// Refresh our tile list and count
await RefreshData();
RefreshControls();
}
catch (Exception ex)
{
Util.ShowExceptionAlert(Activity, "Add tile", ex);
}
}
示例2: OnAddBarcodeButtonClick
private async void OnAddBarcodeButtonClick(object sender, EventArgs e)
{
try
{
BitmapFactory.Options options = new BitmapFactory.Options();
options.InScaled = false;
BandIcon tileIcon = BandIcon.ToBandIcon(BitmapFactory.DecodeResource(Resources, Resource.Raw.tile, options));
BandIcon badgeIcon = BandIcon.ToBandIcon(BitmapFactory.DecodeResource(Resources, Resource.Raw.badge, options));
// create layout 1
Barcode barcode1 = new Barcode(new PageRect(0, 0, 221, 70), BarcodeType.Code39);
barcode1.Margins = new Margins(3, 0, 0, 0);
barcode1.ElementId = 11;
TextBlock textBlock1 = new TextBlock(new PageRect(0, 0, 230, 30), TextBlockFont.Small, 0);
textBlock1.Color = Color.Red;
textBlock1.ElementId = 21;
FlowPanel flowPanel1 = new FlowPanel(new PageRect(15, 0, 245, 105), FlowPanelOrientation.Vertical);
flowPanel1.AddElements(barcode1);
flowPanel1.AddElements(textBlock1);
PageLayout pageLayout1 = new PageLayout(flowPanel1);
// create layout 2
Barcode barcode2 = new Barcode(0, 0, 221, 70, BarcodeType.Pdf417);
barcode2.Margins = new Margins(3, 0, 0, 0);
barcode2.ElementId = 11;
TextBlock textBlock2 = new TextBlock(0, 0, 230, 30, TextBlockFont.Small, 0);
textBlock2.Color = Color.Red;
textBlock2.ElementId = 21;
FlowPanel flowPanel2 = new FlowPanel(15, 0, 245, 105, FlowPanelOrientation.Vertical);
flowPanel2.AddElements(barcode2);
flowPanel2.AddElements(textBlock2);
PageLayout pageLayout2 = new PageLayout(flowPanel2);
// create the tile
BandTile.Builder builder = new BandTile.Builder(Java.Util.UUID.RandomUUID(), mEditTileName.Text, tileIcon);
if (mCheckboxBadging.Checked)
{
builder.SetTileSmallIcon(badgeIcon);
}
if (mCheckboxCustomTheme.Checked)
{
builder.SetTheme(mThemeView.Theme);
}
builder.SetPageLayouts(pageLayout1, pageLayout2);
BandTile tile = builder.Build();
// add tile
try
{
var result = await Model.Instance.Client.TileManager.AddTileTaskAsync(Activity, tile);
if (result)
{
Toast.MakeText(Activity, "Tile added", ToastLength.Short).Show();
}
else
{
Toast.MakeText(Activity, "Unable to add tile", ToastLength.Short).Show();
}
}
catch (Exception ex)
{
Util.ShowExceptionAlert(Activity, "Add tile", ex);
}
PageData pageData1 = new PageData(Java.Util.UUID.RandomUUID(), 0);
pageData1.Update(new BarcodeData(11, "MK12345509", BarcodeType.Code39));
pageData1.Update(new TextButtonData(21, "MK12345509"));
PageData pageData2 = new PageData(Java.Util.UUID.RandomUUID(), 1);
pageData2.Update(new BarcodeData(11, "901234567890123456", BarcodeType.Pdf417));
pageData2.Update(new TextButtonData(21, "901234567890123456"));
await Model.Instance.Client.TileManager.SetPagesTaskAsync(tile.TileId, pageData1, pageData2);
Toast.MakeText(Activity, "Page updated", ToastLength.Short).Show();
// Refresh our tile list and count
await RefreshData();
RefreshControls();
}
catch (Exception ex)
{
Util.ShowExceptionAlert(Activity, "Add tile", ex);
}
}
示例3: OnCreateView
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
{
View rootView = inflater.Inflate(Resource.Layout.fragment_tiles, container, false);
mListTiles = rootView.FindViewById<ListView>(Resource.Id.listTiles);
RelativeLayout header = (RelativeLayout)inflater.Inflate(Resource.Layout.fragment_tiles_header, null);
mTextRemainingCapacity = header.FindViewById<TextView>(Resource.Id.textAvailableCapacity);
mButtonAddButtonTile = header.FindViewById<Button>(Resource.Id.buttonAddButtonTile);
mButtonAddButtonTile.Click += async delegate
{
try
{
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final android.graphics.BitmapFactory.Options options = new android.graphics.BitmapFactory.Options();
BitmapFactory.Options options = new BitmapFactory.Options();
options.InScaled = false;
BandIcon tileIcon = BandIcon.ToBandIcon(BitmapFactory.DecodeResource(Resources, Resource.Raw.tile, options));
BandIcon badgeIcon = BandIcon.ToBandIcon(BitmapFactory.DecodeResource(Resources, Resource.Raw.badge, options));
FilledButton button = new FilledButton(0, 5, 210, 45);
button.BackgroundColor = Color.Red;
button.Margins = new Margins(0, 5, 0 ,0);
button.ElementId = 12;
TextButton button2 = new TextButton(0, 0, 210, 45);
button2.PressedColor = Color.Blue;
button2.Margins = new Margins(0, 5, 0 ,0);
button2.ElementId = 21;
FlowPanel flowPanel = new FlowPanel(15, 0, 260, 105, FlowPanelOrientation.Vertical);
flowPanel.AddElements(button);
flowPanel.AddElements(button2);
PageLayout pageLayout = new PageLayout(flowPanel);
BandTile.Builder builder = new BandTile.Builder(Java.Util.UUID.RandomUUID(), mEditTileName.Text, tileIcon);
if (mCheckboxBadging.Checked)
{
builder.SetTileSmallIcon(badgeIcon);
}
if (mCheckboxCustomTheme.Checked)
{
builder.SetTheme(mThemeView.Theme);
}
builder.SetPageLayouts(pageLayout);
BandTile tile = builder.Build();
try
{
var result = await Model.Instance.Client.TileManager.AddTileTaskAsync(Activity, tile);
if (result)
{
Toast.MakeText(Activity, "Tile added", ToastLength.Short).Show();
}
else
{
Toast.MakeText(Activity, "Unable to add tile", ToastLength.Short).Show();
}
}
catch (Exception ex)
{
Util.ShowExceptionAlert(Activity, "Add tile", ex);
}
PageData pageData = new PageData(Java.Util.UUID.RandomUUID(), 0);
pageData.Update(new FilledButtonData(12, Color.Yellow));
pageData.Update(new TextButtonData(21, "Text Button"));
await Model.Instance.Client.TileManager.SetPagesTaskAsync(tile.TileId, pageData);
Toast.MakeText(Activity, "Page updated", ToastLength.Short).Show();
// Refresh our tile list and count
await RefreshData();
RefreshControls();
}
catch (Exception e)
{
Util.ShowExceptionAlert(Activity, "Add tile", e);
}
};
mButtonAddBarcodeTile = header.FindViewById<Button>(Resource.Id.buttonAddBarcodeTile);
mButtonAddBarcodeTile.Click += async delegate
{
try
{
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final android.graphics.BitmapFactory.Options options = new android.graphics.BitmapFactory.Options();
BitmapFactory.Options options = new BitmapFactory.Options();
options.InScaled = false;
BandIcon tileIcon = BandIcon.ToBandIcon(BitmapFactory.DecodeResource(Resources, Resource.Raw.tile, options));
BandIcon badgeIcon = BandIcon.ToBandIcon(BitmapFactory.DecodeResource(Resources, Resource.Raw.badge, options));
// create layout 1
Barcode barcode1 = new Barcode(new PageRect(0, 0, 221, 70), BarcodeType.Code39);
barcode1.Margins = new Margins(3, 0, 0, 0);
barcode1.ElementId = 11;
//.........这里部分代码省略.........