本文整理汇总了C#中MonoTouch.Dialog.EntryElement类的典型用法代码示例。如果您正苦于以下问题:C# EntryElement类的具体用法?C# EntryElement怎么用?C# EntryElement使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
EntryElement类属于MonoTouch.Dialog命名空间,在下文中一共展示了EntryElement类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: FinishedLaunching
public override bool FinishedLaunching (UIApplication app, NSDictionary options)
{
window = new UIWindow (UIScreen.MainScreen.Bounds);
var what = new EntryElement ("What ?", "e.g. pizza", String.Empty);
var where = new EntryElement ("Where ?", "here", String.Empty);
var section = new Section ();
if (CLLocationManager.LocationServicesEnabled) {
lm = new CLLocationManager ();
lm.LocationsUpdated += delegate (object sender, CLLocationsUpdatedEventArgs e) {
lm.StopUpdatingLocation ();
here = e.Locations [e.Locations.Length - 1];
var coord = here.Coordinate;
where.Value = String.Format ("{0:F4}, {1:F4}", coord.Longitude, coord.Latitude);
};
section.Add (new StringElement ("Get Current Location", delegate {
lm.StartUpdatingLocation ();
}));
}
section.Add (new StringElement ("Search...", async delegate {
await SearchAsync (what.Value, where.Value);
}));
var root = new RootElement ("MapKit Search Sample") {
new Section ("MapKit Search Sample") { what, where },
section
};
window.RootViewController = new UINavigationController (new DialogViewController (root, true));
window.MakeKeyAndVisible ();
return true;
}
示例2: ProvisioningDialog
public ProvisioningDialog()
: base(UITableViewStyle.Grouped, null)
{
Root = new RootElement ("GhostPractice Mobile");
var topSec = new Section ("Welcome");
topSec.Add (new StringElement ("Please enter activation code"));
activation = new EntryElement ("Code", "Activation Code", "999998-zcrdbrkqwogh");
topSec.Add (activation);
var submit = new StringElement ("Send Code");
submit.Alignment = UITextAlignment.Center;
submit.Tapped += delegate {
if (activation.Value == null || activation.Value == string.Empty) {
new UIAlertView ("Device Activation", "Please enter activation code", null, "OK", null).Show ();
return;
}
if (!isBusy) {
getAsyncAppAndPlatform ();
} else {
Wait ();
}
};
topSec.Add (submit);
Root.Add (topSec);
UIImage img = UIImage.FromFile ("Images/launch_small.png");
UIImageView v = new UIImageView (new RectangleF (0, 0, 480, 600));
v.Image = img;
Root.Add (new Section (v));
}
示例3: LoginViewController
public LoginViewController () : base (UITableViewStyle.Grouped, null)
{
hostEntry = new EntryElement ("Host", "imap.gmail.com", "imap.gmail.com");
portEntry = new EntryElement ("Port", "993", "993") {
KeyboardType = UIKeyboardType.NumberPad
};
sslCheckbox = new CheckboxElement ("Use SSL", true);
userEntry = new EntryElement ("Username", "Email / Username", "");
passwordEntry = new EntryElement ("Password", "password", "", true);
Root = new RootElement ("IMAP Login") {
new Section ("Server") {
hostEntry,
portEntry,
sslCheckbox
},
new Section ("Account") {
userEntry,
passwordEntry
},
new Section {
new StyledStringElement ("Login", Login)
}
};
foldersViewController = new FoldersViewController ();
}
示例4: ViewWillAppear
public override void ViewWillAppear (bool animated)
{
base.ViewWillAppear(animated);
var items = new List<object>();
for(int i = 0;i <= 10;i++)
{
items.Add (i);
}
chickenName = new EntryElement("Name Of", null, "");
chickenName.Value = "Big Bird";
rating = new PickerElement("Rating", items.ToArray(), null, this) {
Width = 40f,
ValueWidth = 202f, // use this to align picker value with other elements, for the life of me I can't find a calculation that automatically does it.
Alignment = UITextAlignment.Left
};
// set initial rating.
rating.Value = "5";
rating.SetSelectedValue(rating.Value);
date = new DateTimeElement2("Date", DateTime.Now, this) {
Alignment = UITextAlignment.Left,
Mode = UIDatePickerMode.Date
};
Root = new RootElement("Rate Chicken") {
new Section() {
chickenName,
rating,
date
}
};
}
示例5: SettingsViewController
public SettingsViewController()
: base(new RootElement("Einstellungen"))
{
var root = new RootElement("Einstellungen");
var userEntry = new EntryElement("Benutzername", "benutzername", ApplicationSettings.Instance.UserCredentials.Name);
var passwordEntry = new EntryElement("Passwort", "passwort", ApplicationSettings.Instance.UserCredentials.Password, true);
userEntry.AutocorrectionType = MonoTouch.UIKit.UITextAutocorrectionType.No;
userEntry.AutocapitalizationType = MonoTouch.UIKit.UITextAutocapitalizationType.None;
userEntry.Changed += UsernameChanged;
passwordEntry.Changed += PasswordChanged;
root.Add(new Section("Benutzerinformationen"){
userEntry,
passwordEntry
});
root.Add(new Section("Stundenplaneinstellungen"){
new StyledStringElement("Andere Stundenpläne", () => {NavigationController.PushViewController(new SettingsTimetablesDetailViewController(), true);}){
Accessory = UITableViewCellAccessory.DisclosureIndicator
}
});
Root = root;
Title = "Einstellungen";
NavigationItem.Title = "Einstellungen";
TabBarItem.Image = UIImage.FromBundle("Settings-icon");
}
示例6: EchoDicomServer
public void EchoDicomServer()
{
RootElement root = null;
Section resultSection = null;
var hostEntry = new EntryElement("Host", "Host name of the DICOM server", "server");
var portEntry = new EntryElement("Port", "Port number", "104");
var calledAetEntry = new EntryElement("Called AET", "Called application AET", "ANYSCP");
var callingAetEntry = new EntryElement("Calling AET", "Calling application AET", "ECHOSCU");
var echoButton = new StyledStringElement("Click to test",
delegate {
if (resultSection != null) root.Remove(resultSection);
string message;
var echoFlag = DoEcho(hostEntry.Value, Int32.Parse(portEntry.Value), calledAetEntry.Value, callingAetEntry.Value, out message);
var echoImage = new ImageStringElement(String.Empty, echoFlag ? new UIImage("yes-icon.png") : new UIImage("no-icon.png"));
var echoMessage = new StringElement(message);
resultSection = new Section(String.Empty, "C-ECHO result") { echoImage, echoMessage };
root.Add(resultSection);
})
{ Alignment = UITextAlignment.Center, BackgroundColor = UIColor.Blue, TextColor = UIColor.White };
root = new RootElement("Echo DICOM server") {
new Section { hostEntry, portEntry, calledAetEntry, callingAetEntry},
new Section { echoButton },
};
var dvc = new DialogViewController (root, true) { Autorotate = true };
navigation.PushViewController (dvc, true);
}
示例7: CreateRoot
RootElement CreateRoot()
{
nameElement = new EntryElement ("Name", "", "");
scoreElement = new EntryElement ("Score", "", "");
difficultyGroup = new RadioGroup (0);
return new RootElement ("Parse"){
new Section("Add a score!"){
nameElement,
scoreElement,
new RootElement ("Difficulty",difficultyGroup){
new Section ("Difficulty"){
new RadioElement ("Easy"),
new RadioElement ("Medium"),
new RadioElement ("Hard"),
},
},
},
new Section()
{
new StringElement("Submit Score",submitScore),
},
new Section()
{
new StringElement("View High Scores", viewHighScores),
}
};
}
示例8: GetViewController
public UIViewController GetViewController ()
{
var network = new BooleanElement ("Remote Server", EnableNetwork);
var host = new EntryElement ("Host Name", "name", HostName);
host.KeyboardType = UIKeyboardType.ASCIICapable;
var port = new EntryElement ("Port", "name", HostPort.ToString ());
port.KeyboardType = UIKeyboardType.NumberPad;
var root = new RootElement ("Options") {
new Section () { network, host, port }
};
var dv = new DialogViewController (root, true) { Autorotate = true };
dv.ViewDissapearing += delegate {
EnableNetwork = network.Value;
HostName = host.Value;
ushort p;
if (UInt16.TryParse (port.Value, out p))
HostPort = p;
else
HostPort = -1;
var defaults = NSUserDefaults.StandardUserDefaults;
defaults.SetBool (EnableNetwork, "network.enabled");
defaults.SetString (HostName ?? String.Empty, "network.host.name");
defaults.SetInt (HostPort, "network.host.port");
};
return dv;
}
示例9: DatePickerDemoViewController
public DatePickerDemoViewController()
: base(UITableViewStyle.Grouped, new RootElement ("Demo"), true)
{
//NOTE: ENSURE THAT ROOT.UNEVENROWS IS SET TO TRUE
// OTHERWISE THE DatePickerElement.Height function is not called
Root.UnevenRows = true;
// Create section to hold date picker
Section section = new Section ("Date Picker Test");
// Create elements
StringElement descriptionElement = new StringElement ("This demo shows how the date picker works within a section");
DatePickerElement datePickerElement = new DatePickerElement ("Select date", section, DateTime.Now, UIDatePickerMode.DateAndTime);
EntryElement entryElement = new EntryElement ("Example entry box", "test", "test");
StringElement buttonElement = new StringElement ("Reset Date Picker", () => {
// This is how you can set the date picker after it has been created
datePickerElement.SelectedDate = DateTime.Now;
});
StringElement buttonFinalElement = new StringElement ("Show Selected Date", () => {
// This is how you can access the selected date from the date picker
entryElement.Value = datePickerElement.SelectedDate.ToString();
});
// Add to section
section.AddAll (new Element[] { descriptionElement, datePickerElement, entryElement, buttonElement, buttonFinalElement });
// Add section to root
Root.Add (section);
}
示例10: ViewDidLoad
public override void ViewDidLoad()
{
base.ViewDidLoad();
Root = new RootElement(""){
new Section(){
(item = new EntryElement("Item","Enter Item name",presenter.Item)),
(quantity = new StepperElement("Quantity", presenter.Quantity, new StepperView())),
(location = new EntryElement("Location","Enter Location", presenter.Location)),
new StyledStringElement("Take Picture", delegate {
TakePicture();
}){Accessory = UITableViewCellAccessory.DisclosureIndicator},
new StringElement("View Picture",delegate {
ShowPicture();
}),
}};
this.NavigationItem.RightBarButtonItem = new UIBarButtonItem(UIBarButtonSystemItem.Save, async delegate
{
try
{
presenter.Item = item.Value;
presenter.Quantity = (int)quantity.Value;
presenter.Location = location.Value;
await presenter.SaveItem();
NavigationController.PopToRootViewController(true);
}
catch (Exception e)
{
new UIAlertView("Error Saving",e.Message,null,"OK",null).Show();
}
});
}
示例11: Pubnub_MessagingMain
public Pubnub_MessagingMain () : base (UITableViewStyle.Grouped, null)
{
EntryElement entryChannelName = new EntryElement("Channel Name", "Enter Channel Name", "");
EntryElement entryCipher = new EntryElement("Cipher", "Enter Cipher", "");
BooleanElement bSsl = new BooleanElement ("Enable SSL", false);
Root = new RootElement ("Pubnub Messaging") {
new Section ("Basic Settings")
{
entryChannelName,
bSsl
},
new Section ("Enter cipher key for encryption. Leave blank for unencrypted transfer.")
{
entryCipher
},
new Section()
{
new StyledStringElement ("Launch", () => {
if(String.IsNullOrWhiteSpace (entryChannelName.Value.Trim()))
{
new UIAlertView ("Error!", "Please enter a channel name", null, "OK").Show ();
}
else
{
new Pubnub_MessagingSub(entryChannelName.Value, entryCipher.Value, bSsl.Value);
}
})
{
BackgroundColor = UIColor.Blue,
TextColor = UIColor.White,
Alignment = UITextAlignment.Center
},
}
};
}
示例12: Initialize
private void Initialize()
{
var loginWithWidgetBtn = new StyledStringElement ("Login with Widget", this.LoginWithWidgetButtonClick) {
Alignment = UITextAlignment.Center
};
var loginWithConnectionBtn = new StyledStringElement ("Login with Google", this.LoginWithConnectionButtonClick) {
Alignment = UITextAlignment.Center
};
var loginBtn = new StyledStringElement ("Login", this.LoginWithUsernamePassword) {
Alignment = UITextAlignment.Center
};
this.resultElement = new StyledMultilineElement (string.Empty, string.Empty, UITableViewCellStyle.Subtitle);
var login1 = new Section ("Login");
login1.Add (loginWithWidgetBtn);
login1.Add (loginWithConnectionBtn);
var login2 = new Section ("Login with user/password");
login2.Add (this.userNameElement = new EntryElement ("User", string.Empty, string.Empty));
login2.Add (this.passwordElement = new EntryElement ("Password", string.Empty, string.Empty, true));
login2.Add (loginBtn);
var result = new Section ("Result");
result.Add(this.resultElement);
this.Root.Add (new Section[] { login1, login2, result });
}
开发者ID:ducaciprian,项目名称:Xamarin.Auth0Client,代码行数:30,代码来源:Auth0Client_iOS_SampleViewController.designer.cs
示例13: ViewDidLoad
public override void ViewDidLoad()
{
base.ViewDidLoad();
// Perform any additional setup after loading the view
var info = new RootElement("Info") {
new Section() {
{ eventname = new EntryElement("Event Name", "Enter the Name", null) },
{ recipients = new EntryElement("Recipients' Names", "Enter the Recipients", null) },
{ location = new EntryElement("Enter Location", "Enter the Location", null) }
},
new Section()
{
{ date = new DateElement("Pick the Date", DateTime.Now) },
{ timeelement = new TimeElement("Pick the Time", DateTime.Now) },
{ description = new EntryElement("Description", "Enter a Description", null) }
},
new Section()
{
new RootElement("Type", category = new RadioGroup("Type of Event", 0)) {
new Section() {
new RadioElement ("Meeting", "Type of Event"),
new RadioElement ("Company Event", "Type of Event"),
new RadioElement ("Machine Maintenance", "Type of Event"),
new RadioElement ("Emergency", "Type of Event")
}
},
new RootElement("Priority", priority = new RadioGroup ("priority", 0))
{
new Section()
{
new RadioElement("Low", "priority"),
new RadioElement("Medium", "priority"),
new RadioElement("High", "priority")
}
}
},
};
Root.Add(info);
UIButton createEventBtn = UIButton.FromType(UIButtonType.RoundedRect);
createEventBtn.SetTitle("Add Event", UIControlState.Normal);
createEventBtn.Frame = new Rectangle(0, 0, 320, 44);
int y = (int)((View.Frame.Size.Height - createEventBtn.Frame.Size.Height)/1.15);
int x = ((int)(View.Frame.Size.Width - createEventBtn.Frame.Size.Width)) / 2;
createEventBtn.Frame = new Rectangle(x, y, (int)createEventBtn.Frame.Width, (int)createEventBtn.Frame.Height);
View.AddSubview(createEventBtn);
createEventBtn.TouchUpInside += async (object sender, EventArgs e) =>
{
await createEvent(info);
};
}
示例14: PhotoViewController
public PhotoViewController()
: base(UITableViewStyle.Grouped, null, true)
{
// Add the image that will be publish
var imageView = new UIImageView (new CGRect (0, 0, View.Frame.Width, 220)) {
Image = UIImage.FromFile ("wolf.jpg")
};
// Add a textbox that where you will be able to add a comment to the photo
txtMessage = new EntryElement ("", "Say something nice!", "");
Root = new RootElement ("Post photo!") {
new Section () {
new UIViewElement ("", imageView, true) {
Flags = UIViewElement.CellFlags.DisableSelection | UIViewElement.CellFlags.Transparent,
},
txtMessage
}
};
// Create the request to post a photo into your wall
NavigationItem.RightBarButtonItem = new UIBarButtonItem ("Post", UIBarButtonItemStyle.Plain, ((sender, e) => {
// Disable the post button for prevent another untill the actual one finishes
(sender as UIBarButtonItem).Enabled = false;
// Add the photo and text that will be publish
var parameters = new NSDictionary ("picture", UIImage.FromFile ("wolf.jpg").AsPNG (), "caption", txtMessage.Value);
// Create the request
var request = new GraphRequest ("/" + Profile.CurrentProfile.UserID + "/photos", parameters, AccessToken.CurrentAccessToken.TokenString, null, "POST");
var requestConnection = new GraphRequestConnection ();
requestConnection.AddRequest (request, (connection, result, error) => {
// Enable the post button
(sender as UIBarButtonItem).Enabled = true;
// Handle if something went wrong
if (error != null) {
new UIAlertView ("Error...", error.Description, null, "Ok", null).Show ();
return;
}
// Do your magic if the request was successful
new UIAlertView ("Yay!!", "Your photo was published!", null, "Ok", null).Show ();
photoId = (result as NSDictionary) ["post_id"].ToString ();
// Add a button to allow to delete the photo posted
Root.Add (new Section () {
new StyledStringElement ("Delete Post", DeletePost) {
Alignment = UITextAlignment.Center,
TextColor = UIColor.Red
}
});
});
requestConnection.Start ();
}));
}
示例15: FieldImage
public FieldImage(string farmName,int farmID,FlyoutNavigationController fnc,SelectField sf)
: base(UITableViewStyle.Grouped, null)
{
Root = new RootElement (null) {};
this.Pushing = true;
var section = new Section () {};
var totalRainGuage = new StringElement ("Total Raid Guage(mm): " + DBConnection.getRain (farmID),()=>{});
var rainGuage=new EntryElement ("New Rain Guage(mm): ",null," ");
rainGuage.KeyboardType = UIKeyboardType.NumbersAndPunctuation;
var update=new StringElement("Add",()=>{
try{
DBConnection.updateRain(farmID,Int32.Parse(rainGuage.Value));
}
catch(Exception e){
new UIAlertView ("Error", "Wrong input format!", null, "Continue").Show ();
return;
}
UIAlertView alert = new UIAlertView ();
alert.Title = "Success";
alert.Message = "Your Data Has Been Saved";
alert.AddButton("OK");
alert.Show();
});
var showDetail=new StringElement("Show Rain Guage Detail",()=>{
RainDetail rd=new RainDetail(farmID,farmName);
sf.NavigationController.PushViewController(rd,true);
});
section.Add (totalRainGuage);
section.Add (rainGuage);
section.Add (update);
section.Add (showDetail);
Root.Add (section);
var section2 = new Section () { };
var farmImg=UIImage.FromFile ("img/"+farmName+".jpg");
if(farmImg==null)
farmImg=UIImage.FromFile ("Icon.png");
var imageView = new UIImageView (farmImg);
if(farmImg==null)
farmImg=UIImage.FromFile ("Icon.png");
var scrollView=new UIScrollView (
new RectangleF(0,0,fnc.View.Frame.Width-20,250)
);
scrollView.ContentSize = imageView.Image.Size;
scrollView.AddSubview (imageView);
scrollView.MaximumZoomScale = 3f;
scrollView.MinimumZoomScale = .1f;
scrollView.ViewForZoomingInScrollView += (UIScrollView sv) => { return imageView; };
var imageElement=new UIViewElement(null,scrollView,false);
section2.Add(imageElement);
Root.Add (section2);
}