本文整理汇总了C#中UIActionSheet类的典型用法代码示例。如果您正苦于以下问题:C# UIActionSheet类的具体用法?C# UIActionSheet怎么用?C# UIActionSheet使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
UIActionSheet类属于命名空间,在下文中一共展示了UIActionSheet类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: HandleBtnSimpleActionSheetTouchUpInside
protected void HandleBtnSimpleActionSheetTouchUpInside (object sender, EventArgs e)
{
// create an action sheet using the qualified constructor
actionSheet = new UIActionSheet ("simple action sheet", null, "cancel", "delete", null);
actionSheet.Clicked += delegate(object a, UIButtonEventArgs b) { Console.WriteLine ("Button " + b.ButtonIndex.ToString () + " clicked"); };
actionSheet.ShowInView (View);
}
示例2: HandleButtonTrashClicked
void HandleButtonTrashClicked (object sender, EventArgs e)
{
string filepath = Path.Combine(Environment.GetFolderPath (Environment.SpecialFolder.Personal), _filename);
if(File.Exists(filepath))
{
var actionSheet = new UIActionSheet("") {Utils.Translate("delete"), Utils.Translate("cancel")};
actionSheet.Title = Utils.Translate("confirmdeleteimage");
actionSheet.DestructiveButtonIndex = 0;
actionSheet.CancelButtonIndex = 1;
actionSheet.ShowFromTabBar(JaktLoggApp.instance.TabBarController.TabBar);
actionSheet.Clicked += delegate(object s, UIButtonEventArgs evt) {
switch (evt.ButtonIndex)
{
case 0:
//Slett
File.Delete(filepath);
_filename = string.Empty;
imageView.Image = null;
_callback(this);
NavigationController.PopViewControllerAnimated(true);
break;
case 1:
//Avbryt
break;
}
};
}
}
示例3: HandleBtnSimpleActionSheetTouchUpInside
void HandleBtnSimpleActionSheetTouchUpInside (object sender, EventArgs e)
{
// create an action sheet using the qualified constructor
actionSheet = new UIActionSheet ("simple action sheet", null, "cancel", "delete", null);
actionSheet.Clicked += OnClicked;
actionSheet.ShowInView (View);
}
示例4: Clicked
public override void Clicked(UIActionSheet actionview, int buttonIndex)
{
if (buttonIndex == 0)
{
Console.Write("Satya!!!!!!");
/*UIActivityIndicatorView spinner = new UIActivityIndicatorView(new RectangleF(0,0,200,300));
spinner.ActivityIndicatorViewStyle = UIActivityIndicatorViewStyle.WhiteLarge;
spinner.Center= new PointF(160, 140);
spinner.HidesWhenStopped = true;
actionview.AddSubview(spinner);
InvokeOnMainThread(delegate() {
spinner.StartAnimating();
});
*/
var documents = Environment.GetFolderPath (Environment.SpecialFolder.MyDocuments);
fileName = documents + "/" + fileName;
data = NSData.FromUrl(_nsurl);
File.WriteAllBytes(fileName,data.ToArray());
if (File.Exists(fileName))
{
UIAlertView alert = new UIAlertView();
alert.Title = "Download Complete";
alert.AddButton("Done");
alert.Show();
}
//spinner.StopAnimating();
}
}
示例5: HandleBtActionClicked
void HandleBtActionClicked (object sender, EventArgs e)
{
var actionSheet = new UIActionSheet("") {"Del på facebook", "Send link på e-post", Utils.Translate("cancel")};
actionSheet.Title = "Del denne siden";
//actionSheet.DestructiveButtonIndex = 0;
actionSheet.CancelButtonIndex = 2;
actionSheet.ShowInView(this.View);
actionSheet.Clicked += delegate(object s, UIButtonEventArgs evt)
{
switch (evt.ButtonIndex)
{
case 0:
//Del på facebook
break;
case 1:
//Send link på e-post
var url = webView.Request.MainDocumentURL;
var htmlstr ="<a href='"+url+"'>"+url+"</a>";
var reportScreen = new ReportJakt(htmlstr);
this.NavigationController.PushViewController(reportScreen, true);
break;
/*case 2:
//Del på face
MessageBox.Show("Ennå ikke implementert...", "");
break;
*/default:
//Avbryt
break;
}
};
}
示例6: ViewDidLoad
public override void ViewDidLoad ()
{
base.ViewDidLoad ();
_picker = new UIImagePickerController ();
_pickerDel = new PickerDelegate (this);
_picker.Delegate = _pickerDel;
_actionSheet = new UIActionSheet ();
_actionSheet.AddButton ("Library");
_actionSheet.AddButton ("Camera");
_actionSheet.AddButton ("Cancel");
_actionSheet.CancelButtonIndex = 2;
_actionSheet.Delegate = new ActionSheetDelegate (this);
showPicker.TouchUpInside += delegate { _actionSheet.ShowInView (this.View); };
playMovie.Hidden = true;
playMovie.TouchUpInside += delegate {
if (_mp != null) {
View.AddSubview (_mp.View);
_mp.SetFullscreen (true, true);
_mp.Play ();
}
};
}
示例7: PickRegisterOption
private void PickRegisterOption()
{
try {
UIActionSheet actionSheet;
actionSheet = new UIActionSheet();
actionSheet.AddButton("Phone");
actionSheet.AddButton("Email");
actionSheet.Clicked += delegate(object a, UIButtonEventArgs b) {
if (b.ButtonIndex == (0)) {
EmailRegisterView.Hidden = true;
PhoneRegisterView.Hidden = false;
SetEditing(false, true);
this.registerMode = this.appDelegate.MODE_REGISTER_PHONE;
} else {
EmailRegisterView.Hidden = false;
PhoneRegisterView.Hidden = true;
this.registerMode = this.appDelegate.MODE_REGISTER_EMAIL;
SetEditing(false, true);
}
};
actionSheet.ShowInView(View);
} catch (Exception ex) {
Console.Write(ex.Message);
}
}
示例8: LoadView
public override void LoadView ()
{
NavigationItem.RightBarButtonItem= new UIBarButtonItem(UIBarButtonSystemItem.Compose,
delegate {
var actionSheet = new UIActionSheet ("Email", null, "Cancel", "PNG", "PDF"){
Style = UIActionSheetStyle.Default
};
actionSheet.Clicked += delegate (object sender, UIButtonEventArgs args){
if(args.ButtonIndex > 1)
return;
Email(args.ButtonIndex == 0 ? "png" : "pdf");
};
actionSheet.ShowInView (View);
});
var scrollView = new GraphScrollView(exampleInfo,
new RectangleF(new PointF(0, 0),
new SizeF(UIScreen.MainScreen.ApplicationFrame.Size.Width,
UIScreen.MainScreen.ApplicationFrame.Height -
UIScreen.MainScreen.ApplicationFrame.Top - 10)));
View = scrollView;
}
示例9: RightBarButtonClicked
private void RightBarButtonClicked(object sender, EventArgs args)
{
var actionSheet = new UIActionSheet("") {Utils.Translate("email.sendbymail"), Utils.Translate("cancel")};
actionSheet.Title = Utils.Translate("actionsheet.reportheader");
//actionSheet.DestructiveButtonIndex = 0;
actionSheet.CancelButtonIndex = 2;
actionSheet.ShowFromTabBar(JaktLoggApp.instance.TabBarController.TabBar);
actionSheet.Clicked += delegate(object s, UIButtonEventArgs e)
{
switch (e.ButtonIndex)
{
case 0:
//Enkel rapport
var reportScreen = new ReportJakt(jakt);
this.NavigationController.PushViewController(reportScreen, true);
break;
/*case 1:
//Jaktbok
var uploadScreen = new UploadScreen(jakt);
this.NavigationController.PushViewController(uploadScreen, true);
break;
case 2:
//Del på face
MessageBox.Show("Ennå ikke implementert...", "");
break;
*/default:
//Avbryt
break;
}
};
}
示例10: Clicked
public override void Clicked(UIActionSheet actionSheet, int buttonIndex)
{
switch (buttonIndex)
{
case 0:
MoveVerseToCategory (Category.Sunday);
break;
case 1:
MoveVerseToCategory (Category.Monday);
break;
case 2:
MoveVerseToCategory (Category.Tuesday);
break;
case 3:
MoveVerseToCategory (Category.Wednesday);
break;
case 4:
MoveVerseToCategory (Category.Thursday);
break;
case 5:
MoveVerseToCategory (Category.Friday);
break;
case 6:
MoveVerseToCategory (Category.Saturday);
break;
case 7:
MoveVerseToCategory (Category.Queue);
break;
case 8:
MoveVerseToCategory (Category.Review);
break;
}
}
示例11: CreateTilesPopUp
public void CreateTilesPopUp()
{
UIActionSheet actionsheet = new UIActionSheet("Selecteer een categorie"){ "Map", "Road", "Shop", "Annuleer" };
actionsheet.Clicked += (sender, e) =>
{
switch (e.ButtonIndex)
{
case 0:
GlobalSupport.MessageIdentifier = 800;
NavigateToDetails();
break;
case 1:
GlobalSupport.MessageIdentifier = 801;
NavigateToDetails();
break;
case 2:
GlobalSupport.MessageIdentifier = 802;
NavigateToDetails();
break;
}
};
actionsheet.ShowInView(this.View);
}
示例12: ShowOptionsMenu
public static void ShowOptionsMenu(this UIViewController vc, IParentMenu parentMenu)
{
if (parentMenu == null)
{
return;
}
var actionSheet = new UIActionSheet();
#warning TODO - make this OO - let the _parentMenu render itself...
var actions = new List<ICommand>();
foreach (var child in parentMenu.Children)
{
var childCast = child as CaptionAndIconMenu;
#warning More to do here - e.g. check for null!
actionSheet.AddButton(childCast.Caption);
actions.Add(childCast.Command);
}
actionSheet.Clicked += (object sender, UIButtonEventArgs e) =>
{
if (e.ButtonIndex >= 0)
{
actions[e.ButtonIndex].Execute(null);
}
};
#warning More to do here - e.g. check for null!
//if (UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Phone)
// actionSheet.ShowFromToolbar(NavigationController.Toolbar);
//else
actionSheet.ShowFrom(vc.NavigationItem.RightBarButtonItem, true);
}
示例13: LoadView
public override void LoadView ()
{
NavigationItem.RightBarButtonItem= new UIBarButtonItem(UIBarButtonSystemItem.Compose,
delegate {
var actionSheet = new UIActionSheet ("Email", null, "Cancel", "PNG", "PDF"){
Style = UIActionSheetStyle.Default
};
actionSheet.Clicked += delegate (object sender, UIButtonEventArgs args){
if(args.ButtonIndex > 1)
return;
Email(args.ButtonIndex == 0 ? "png" : "pdf");
};
actionSheet.ShowInView (View);
});
View = new UIView(plotFrame);
image_plotted_by_OxyPlot = new GraphView(plotModel);
image_plotted_by_OxyPlot.Frame = plotFrame;
View.AddSubview(image_plotted_by_OxyPlot);
image_plotted_by_OxyPlot.SetAllowPinchScaling(true);
}
示例14: LoadView
public override void LoadView ()
{
NavigationItem.RightBarButtonItem= new UIBarButtonItem(UIBarButtonSystemItem.Compose,
delegate {
var actionSheet = new UIActionSheet ("Email", null, "Cancel", "PNG", "PDF"){
Style = UIActionSheetStyle.Default
};
actionSheet.Clicked += delegate (object sender, UIButtonEventArgs args){
if(args.ButtonIndex > 1)
return;
Email(args.ButtonIndex == 0 ? "png" : "pdf");
};
actionSheet.ShowInView (View);
});
// Only for iOS 7 and later?
this.EdgesForExtendedLayout = UIRectEdge.None;
this.View = this.plotView;
}
示例15: ActionSheetDatePicker
/// <summary>
///
/// </summary>
public ActionSheetDatePicker(UIView owner)
{
// save our uiview owner
this.owner = owner;
// configure the title label
titleLabel.BackgroundColor = UIColor.Clear;
titleLabel.TextColor = UIColor.LightTextColor;
titleLabel.Font = UIFont.BoldSystemFontOfSize (18);
// configure the done button
doneButton.SetTitle ("done", UIControlState.Normal);
doneButton.TouchUpInside += (s, e) => {
actionSheet.DismissWithClickedButtonIndex (0, true);
// Add DoneButtonClicked Event
//Console.WriteLine("Done clicked");
if (DoneButtonClicked != null)
{
DoneButtonClicked(s,e);
}
};
// expose done clicked event
// create + configure the action sheet
actionSheet = new UIActionSheet () { Style = UIActionSheetStyle.BlackTranslucent };
actionSheet.Clicked += (s, e) => { Console.WriteLine ("Clicked on item {0}", e.ButtonIndex); };
// add our controls to the action sheet
actionSheet.AddSubview (datePicker);
actionSheet.AddSubview (titleLabel);
actionSheet.AddSubview (doneButton);
}