protected RootElement CreateSection(List<string> listOfSources) { var items = new Section (GetSectionTitle ()); if (!listOfSources.Any ()) { AddElementsInCaseOfEmptyList (items); return new RootElement ("") { items }; } var rGroup = new RadioGroup (-1); foreach (var item in listOfSources) { var radioButton = new RadioElement (item); radioButton.Tapped += () => Upload (listOfSources[rGroup.Selected]); items.Add (radioButton); } return new RootElement ("", rGroup) { items }; }
private void buildMediaCaptureSettingsElements() { audioCaptureEnabledElement = new BooleanElement("Record Audio", settings.AudioCaptureEnabled ); audioCaptureEnabledElement.ValueChanged += delegate { EnforceDependencies(); }; videoCaptureEnabledElement = new BooleanElement("Record Video", settings.VideoCaptureEnabled ); videoCaptureEnabledElement.ValueChanged += delegate { EnforceDependencies(); }; autoRecordNextMovieElement = new BooleanElement("Loop Recordings", settings.AutoRecordNextMovie ); // duration choices noLimitElement = new RadioElement("Unlimited"); oneMinuteLimitElement = new RadioElement("1 Minute"); fiveMinuteLimitElement = new RadioElement("5 Minutes"); tenMinuteLimitElement = new RadioElement("10 Minutes"); thirtyMinuteLimitElement = new RadioElement("30 Minutes"); int index = 0; int duration = settings.MaxMovieDurationInSeconds; if ( duration <= 0 ) { index = 0; } else if ( duration <= 60 ) { index = 1; } else if ( duration <= 300 ) { index = 2; } else if ( duration <= 600 ) { index = 3; } else if ( duration <= 1800 ) { index = 4; } durationLimitGroup = new RadioGroup("DurationGroup", index ); durationElement = new RootElement("Maximum Time", durationLimitGroup ) { new Section() { noLimitElement, oneMinuteLimitElement, fiveMinuteLimitElement, tenMinuteLimitElement, thirtyMinuteLimitElement } }; }
private void buildImageCaptureSettingsElements() { imageCaptureEnabledElement = new BooleanElement("Capture", settings.ImageCaptureEnabled ); imageCaptureEnabledElement.ValueChanged += delegate { EnforceDependencies(); }; dontSaveImagesElement = new RadioElement("Don't Save"); saveImagesToPhotoLibraryElement = new RadioElement("Photo Library"); saveImagesToMyDocumentsElement = new RadioElement("My Documents"); int index = 0; if ( settings.SaveCapturedImagesToPhotoLibrary ) { index = 1; } else if ( settings.SaveCapturedImagesToMyDocuments ) { index = 2; } saveImageGroup = new RadioGroup("SaveImagesGroup", index ); saveImageElement = new RootElement("Save To", saveImageGroup ) { new Section() { dontSaveImagesElement, saveImagesToPhotoLibraryElement, saveImagesToMyDocumentsElement } }; }
private void buildCameraSettingsElements() { // camera fronCameraElement = new RadioElement("Front"); backCameraElement = new RadioElement("Back"); int index = (int)settings.Camera; cameraGroup = new RadioGroup("CameraGroup", index ); cameraElement = new RootElement("Source Camera", cameraGroup) { new Section() { fronCameraElement, backCameraElement } }; // resolution choices lowResElement = new RadioElement("Low"); mediumResElement = new RadioElement("Medium"); highResElement = new RadioElement("High"); index = (int)settings.CaptureResolution; resolutionGroup = new RadioGroup("ResolutionGroup", index ); resolutionElement = new RootElement("Resolution", resolutionGroup) { new Section() { lowResElement, mediumResElement, highResElement } }; }
public override void ViewWillAppear(bool animated) { base.ViewWillAppear (animated); try { this.NavigationItem.SetLeftBarButtonItem(new UIBarButtonItem(UIImage.FromBundle("icons/399-list1"), UIBarButtonItemStyle.Plain, FlyoutNavigationHandler), true); folder = Environment.GetFolderPath (Environment.SpecialFolder.Personal); conn = new SQLiteAsyncConnection (System.IO.Path.Combine (folder, "CubScouts.db")); if (!myDB.TableExists("CubScout")) { conn.CreateTableAsync<CubScout>().ContinueWith (t => { Console.WriteLine ("Table created!"); }); } //Setup Map Types Radio Group RadioGroup myScoutTypes = new RadioGroup("scoutTypes",0); RadioElement rTiger = new RadioElement("Tiger","scoutTypes"); RadioElement rWolf = new RadioElement("Wolf","scoutTypes"); RadioElement rBear = new RadioElement("Bear","scoutTypes"); RadioElement rWeblo = new RadioElement("Weblo","scoutTypes"); Section myScoutTypesSection = new Section(); myScoutTypesSection.Add(rTiger); myScoutTypesSection.Add(rWolf); myScoutTypesSection.Add(rBear); myScoutTypesSection.Add(rWeblo); secCurrentScouts = new Section ("Pack 957 Tigers"); //MultilineElement scoutElement; //Call the reload method to re-populate the list. ReloadCubScouts(secCurrentScouts); EntryElement fn; EntryElement ln; EntryElement nn; RootElement st; Root = new RootElement ("Tigers") { new Section ("Add") { new RootElement ("Add Scout") { new Section ("Your info") { (fn = new EntryElement("First Name","First Name","")), (ln = new EntryElement("Last Name","Last Name","")), (nn = new EntryElement("Nickname","Nickname","")), (st = new RootElement("Scout Types", myScoutTypes) { myScoutTypesSection }), new StringElement("Save",delegate { CubScout newScout = new CubScout {FirstName = fn.Value.Trim(), LastName = ln.Value.Trim(), Nickname = nn.Value.Trim (), ScoutType = st.RadioSelected.ToString()}; conn.InsertAsync (newScout).ContinueWith (t => { Console.WriteLine ("New scout ID: {0}", newScout.Id); }); fn.Value = ""; ln.Value = ""; nn.Value = ""; st.RadioSelected = 0; this.NavigationController.PopViewControllerAnimated(true); }), }, } }, secCurrentScouts, }; } catch (Exception ex) { using (UIAlertView myAlert = new UIAlertView()) { myAlert.Message = ex.Message; myAlert.Title = "Error!"; myAlert.AddButton("OK"); myAlert.Show(); } } finally { } }
public override void ViewWillAppear(bool animated) { base.ViewWillAppear (animated); try { this.NavigationItem.SetLeftBarButtonItem(new UIBarButtonItem(UIImage.FromBundle("icons/399-list1"), UIBarButtonItemStyle.Plain, FlyoutNavigationHandler), true); folder = Environment.GetFolderPath (Environment.SpecialFolder.Personal); conn = new SQLiteAsyncConnection (System.IO.Path.Combine (folder, "CubScouts.db")); if (!myDB.TableExists("CubScout")) { conn.CreateTableAsync<CubScout>().ContinueWith (t => { Console.WriteLine ("Table created!"); }); } //Setup Map Types Radio Group RadioGroup myScoutTypes = new RadioGroup("scoutTypes",3); RadioElement rTiger = new RadioElement("Tiger","scoutTypes"); RadioElement rWolf = new RadioElement("Wolf","scoutTypes"); RadioElement rBear = new RadioElement("Bear","scoutTypes"); RadioElement rWeblo = new RadioElement("Weblo","scoutTypes"); Section myScoutTypesSection = new Section(); myScoutTypesSection.Add(rTiger); myScoutTypesSection.Add(rWolf); myScoutTypesSection.Add(rBear); myScoutTypesSection.Add(rWeblo); secCurrentScouts = new Section ("Pack 957 Weblos"); //MultilineElement scoutElement; //Call the reload method to re-populate the list. ReloadCubScouts(secCurrentScouts); //Setup text colors, etc. // var headerAdd = new UILabel(new RectangleF(0,0,this.View.Bounds.Width-25,48)){ // Font = UIFont.BoldSystemFontOfSize (22), // TextColor = UIColor.White, // BackgroundColor = UIColor.Clear, // Text = "Add" // }; EntryElement fn; EntryElement ln; EntryElement nn; RootElement st; EntryElement mn; EntryElement dn; EntryElement ea; EntryElement hp; EntryElement cp; Root = new RootElement ("Weblos") { new Section ("Add") { new RootElement ("Add Scout") { new Section ("Your info") { (fn = new EntryElement("First Name","First Name","")), (ln = new EntryElement("Last Name","Last Name","")), (nn = new EntryElement("Nickname","Nickname","")), (st = new RootElement("Den", myScoutTypes) { myScoutTypesSection }), (mn = new EntryElement("Mom's Name","Mom's Name", "")), (dn = new EntryElement("Dad's Name","Dad's Name", "")), (ea = new EntryElement("Email Address","Email Address", "")), (hp = new EntryElement("Home Phone", "(999) 999-9999", "")), (cp = new EntryElement("Mobile Phone", "(999) 999-9999", "")), new StringElement("Save",delegate { CubScout newScout = new CubScout {FirstName = fn.Value.Trim(), LastName = ln.Value.Trim(), Nickname = nn.Value.Trim (), ScoutType = st.RadioSelected.ToString(), MomsName = mn.Value.Trim(), DadsName = dn.Value.Trim(), EmailAddress = ea.Value.Trim(), HomePhone = hp.Value.Trim(), CellPhone = cp.Value.Trim()}; conn.InsertAsync (newScout).ContinueWith (t => { Console.WriteLine ("New scout ID: {0}", newScout.Id); }); fn.Value = ""; ln.Value = ""; nn.Value = ""; st.RadioSelected = 3; mn.Value = ""; dn.Value = ""; ea.Value = ""; hp.Value = ""; cp.Value = ""; this.NavigationController.PopViewControllerAnimated(true); }), }, } }, secCurrentScouts, }; } catch (Exception ex) { using (UIAlertView myAlert = new UIAlertView()) { myAlert.Message = ex.Message; myAlert.Title = "Error!"; myAlert.AddButton("OK"); myAlert.Show(); } } finally { } }
public CalloutViewCtrl () : base(null) { this.CentersCheck = new CheckboxElement[Centers.Length]; for (int i = 0; i < Centers.Length; i++) { var tmp = new CheckboxElement (Centers[i]); this.CentersCheck [i] = tmp; } this.FirstName = new EntryElement ("First Name", "Rocky", KeyStore.Get ("FirstName")) { TextAlignment = UITextAlignment.Right }; this.LastName = new EntryElement ("Last Name", "D. Bull", KeyStore.Get ("LastName")) { TextAlignment = UITextAlignment.Right }; this.Email = new EntryElement ("E-Mail", "*****@*****.**", KeyStore.Get ("Email")) { TextAlignment = UITextAlignment.Right, KeyboardType = UIKeyboardType.EmailAddress }; OptionGroup = new RadioGroup ("type", 0); Callout = new RadioElement ("Call-Out", "type"); Inlate = new RadioElement ("In Late", "type"); StartDate = new DateElement ("Out On", DateTime.Today) { Alignment = UITextAlignment.Right }; MultipleDays = new BooleanElement ("Out Multiple Days", false); EndDate = new DateElement ("Back On", DateTime.Today.AddDays (1)) { Alignment = UITextAlignment.Right }; WhenInDate = new DateTimeElement ("Will Be In", DateTime.Today.AddHours (12)) { Alignment = UITextAlignment.Right }; Explaination = new EntryElement ("Explaination", "reasons.", null) { TextAlignment = UITextAlignment.Right }; Section Name = new Section () { FirstName, LastName, Email }; Section Options = new Section () { Callout, Inlate }; Section CalloutDates = new Section () { StartDate, MultipleDays }; MultipleDays.ValueChanged += (sender, e) => { if (MultipleDays.Value) { CalloutDates.Add(EndDate); } else { CalloutDates.Remove(EndDate); } }; Section LateDay = new Section () { WhenInDate }; Callout.Tapped += delegate { this.Root.RemoveAt(2); this.Root.Insert(2, CalloutDates); }; Inlate.Tapped += delegate { this.Root.RemoveAt(2); this.Root.Insert(2, LateDay); }; this.Submit = new StringElement ("Submit") { Alignment = UITextAlignment.Center }; this.Root = new RootElement ("Call-Out", OptionGroup) { Name, Options, CalloutDates, new Section("Centers") { this.CentersCheck }, new Section() { Explaination }, new Section() { Submit } }; this.Submit.Tapped += Submit_Tapped; this.NavigationItem.LeftBarButtonItem = new UIBarButtonItem (UIBarButtonSystemItem.Cancel, delegate { this.NavigationController.PopViewController(true); }); }
public override void ViewWillAppear(bool animated) { base.ViewWillAppear (animated); folder = Environment.GetFolderPath (Environment.SpecialFolder.Personal); conn = new SQLiteAsyncConnection (System.IO.Path.Combine (folder, "CubScouts.db")); //Setup Map Types Radio Group RadioGroup myScoutTypes = new RadioGroup("scoutTypes",0); RadioElement rTiger = new RadioElement("Tiger","scoutTypes"); RadioElement rWolf = new RadioElement("Wolf","scoutTypes"); RadioElement rBear = new RadioElement("Bear","scoutTypes"); RadioElement rWeblo = new RadioElement("Weblo","scoutTypes"); Section myScoutTypesSection = new Section(); myScoutTypesSection.Add(rTiger); myScoutTypesSection.Add(rWolf); myScoutTypesSection.Add(rBear); myScoutTypesSection.Add(rWeblo); EntryElement fn; EntryElement ln; EntryElement nn; RootElement st; EntryElement mn; EntryElement dn; EntryElement ea; EntryElement hp; EntryElement cp; Root = new RootElement ("Add Scout") { new Section ("Scout Info") { (fn = new EntryElement("First Name","First Name","")), (ln = new EntryElement("Last Name","Last Name","")), (nn = new EntryElement("Nickname","Nickname","")), (st = new RootElement("Den", myScoutTypes) { myScoutTypesSection }), (mn = new EntryElement("Mom's Name","Mom's Name", "")), (dn = new EntryElement("Dad's Name","Dad's Name", "")), (ea = new EntryElement("Email Address","Email Address", "")), (hp = new EntryElement("Home Phone", "(999) 999-9999", "")), (cp = new EntryElement("Mobile Phone", "(999) 999-9999", "")), new StringElement("Save",delegate { CubScout newScout = new CubScout {FirstName = fn.Value.Trim(), LastName = ln.Value.Trim(), Nickname = nn.Value.Trim (), ScoutType = st.RadioSelected.ToString(), MomsName = mn.Value.Trim(), DadsName = dn.Value.Trim(), EmailAddress = ea.Value.Trim(), HomePhone = hp.Value.Trim(), CellPhone = cp.Value.Trim()}; conn.InsertAsync (newScout).ContinueWith (t => { Console.WriteLine ("New scout ID: {0}", newScout.Id); }); fn.Value = ""; ln.Value = ""; nn.Value = ""; st.RadioSelected = 0; mn.Value = ""; dn.Value = ""; ea.Value = ""; hp.Value = ""; cp.Value = ""; this.NavigationController.PopViewControllerAnimated(true); }), }, }; }
private void BuildViewController() { if (OfflineDataSection != null) OfflineDataSection.Clear(); Reachability.ReachabilityChanged += (object sender, EventArgs e) => { UpdateSettings (); }; onlineElement = new BooleanElement(LocalString.GetString("Online"), Application._user.NetworkStatus != DataAccessLayer.NetworkState.Disconnected); onlineElement.ValueChanged += onlineElement_ValueChanged; urlElement = new StringElement( "Server URL",DataAccessLayer.Utilities.ServerIP); // Upload Element offlineTasks = BusinessLayer.Task.HasNewOfflineTasks(); string UploadLabel = ""; if (offlineTasks != 0) UploadLabel = " (" + LocalString.GetString("UnsynchronizedData_") + " " + offlineTasks.ToString() + ")"; uploadDataElement = new ImageStringElement(LocalString.GetString("UploadData") + UploadLabel,UIImage.FromFile("Images/ic_action_upload.png")); uploadDataElement.Tapped += delegate() { UploadData(); }; clearofflineDataElement = new ImageStringElement(LocalString.GetString("ClearOfflineData"),UIImage.FromFile("Images/ic_action_ClearOfflineData.png")); clearofflineDataElement.Tapped += delegate { ClearSQLiteData(); }; changeOfflinePasswordElement = new ImageStringElement(LocalString.GetString("ChangeOfflinePassword"),UIImage.FromFile("Images/ic_action_OfflinePassword.png")); changeOfflinePasswordElement.Tapped += delegate { // Create a VCSelectAnsprechpartnern dialog vcChangeOfflinePassword = Storyboard.InstantiateViewController<VCChangeOfflinePasswordAlt>(); vcChangeOfflinePassword.VCSettings = this; vcChangeOfflinePassword.ModalPresentationStyle = UIModalPresentationStyle.FormSheet; PresentViewController(vcChangeOfflinePassword, true, null); }; gunThemeElement = new BooleanElement("Plus Theme",Application.GunTheme); gunThemeElement.ValueChanged += (object sender, EventArgs e) => { if (gunThemeElement.Value == true) BusinessLayer.User.SetGunTheme(1); else BusinessLayer.User.SetGunTheme(0); }; SaveNothingElement = new RadioElement (LocalString.GetString("SaveNothing"), "LoginDateiSpeichern"); SaveNothingElement.Tapped += delegate { BusinessLayer.User.SetLoginSaveOption("0"); Application._user.SaveOnlineUserData(); }; SaveMandantElement = new RadioElement (LocalString.GetString("SaveNameMandant"), "LoginDateiSpeichern"); SaveMandantElement.Tapped += delegate { BusinessLayer.User.SetLoginSaveOption("1"); Application._user.SaveOnlineUserData(); }; SaveAllElement = new RadioElement (LocalString.GetString("SaveAll"), "LoginDateiSpeichern"); SaveAllElement.Tapped += delegate { BusinessLayer.User.SetLoginSaveOption("2"); Application._user.SaveOnlineUserData(); }; logElement = new ImageStringElement("Logs",UIImage.FromFile("Images/ic_action_Log.png")); logElement.Tapped += delegate { // Create a VCSelectAnsprechpartnern dialog vcLog = Storyboard.InstantiateViewController<VCLogs>(); List<BusinessLayer.Log> logs = BusinessLayer.Log.GetLogs(); vcLog._logs = logs; PresentViewController(vcLog, true, null); }; LicenseElement = new StringElement(Application.licenseKey.rec.ValueData.ToString().Split(new String[]{"-<>-"},StringSplitOptions.RemoveEmptyEntries)[0]); NetworkSection = new Section(LocalString.GetString("NetworkConnectivity")) { urlElement,onlineElement }; OfflineDataSection = new Section(LocalString.GetString("OfflineData")) { changeOfflinePasswordElement ,uploadDataElement,clearofflineDataElement }; AppearenceSection = new Section(LocalString.GetString("Appearence")) { gunThemeElement }; LogSection = new Section("Logs") { logElement }; SecuritySection = new Section(LocalString.GetString("Security")) { new RootElement(LocalString.GetString("LoginDateiSpeichern"), new RadioGroup("LoginDateiSpeichern", Convert.ToInt32(BusinessLayer.User.GetLoginSaveOption()))) { new Section() { SaveNothingElement, SaveMandantElement, SaveAllElement } } }; LicenseSection = new Section("Device ID") { LicenseElement }; taskElement = new RootElement ("TestRootElement"){NetworkSection,OfflineDataSection , AppearenceSection, SecuritySection, LogSection ,LicenseSection }; this.Root.Add(taskElement); // onlineElement.GetActiveCell().SelectionStyle = UITableViewCellSelectionStyle.None; Console.WriteLine("First Constr"); }
public Menu() : base() { this.Pushing = true; this.Root = new RootElement("Options"); this.Root.UnevenRows = true; var notifications = new NotificationReviewDialog(); var nav = new Section("Navigation"); nav.Add(new StringElement(EmojiSharp.Emoji.CALENDAR.Unified+ " View History", () =>ShowDialog(new MonthView()))); nav.Add(new StringElement("Add New Goal", () => buildAndShowAddDialog())); this.inactiveSwitch = new BooleanElement("Show Inactive Goals", ClockKingOptions.ShowInactiveGoals); this.GroupingOptions.Selected = (int)ClockKingOptions.GroupingChoice; var groupingRoot = new RootElement("Goals grouped by:", GroupingOptions); var groupingSection = new Section("Grouping Options"); groupingRoot.Add(groupingSection); foreach (var s in new[] { "Status", "Time of Day", "Category" }) { var groupOption = new RadioElement(s); groupOption.Tapped += () => OnGroupingChoiceChanged(); groupingSection.Add(groupOption); } var switches = new Section("Goal listing"){ inactiveSwitch,groupingRoot }; this.debugSection = new Section("debugging"); this.tracingEnabled = new BooleanElement("Enabled Trace banners", ClockKingOptions.TracingEnabled); debugSection.Add(tracingEnabled); debugSection.Add(new StringElement("Reload Data", () => { Close(); this.Controller.ConditionallyRefreshData(true); })); debugSection.Add(new StringElement("Show Pending Notifications", () => ShowDialog(notifications))); debugSection.Add(new StringElement("Reset Notifications", () => this.Controller.ResetNotifications())); debugSection.Add(new StringElement("Trim Occurrences", () => this.Controller.CheckPoints.RewriteOccurrences())); var support = new Section("Support"); support.Add(new StringElement("About Routinely", () => NavigateToUrl(aboutUrl))); support.Add(new StringElement("Feedback", () => NavigateToUrl(feedbackUrl))); var filePath = NSBundle.MainBundle.PathForResource("Info", "plist"); var dict = NSDictionary.FromFile(filePath); var BuildVer = dict["CFBundleVersion"].ToString(); var appVer = dict["CFBundleShortVersionString"].ToString(); support.Add(new StringElement("Version", string.Format("{0} ({1})",appVer,BuildVer))); support.Add(new StringElement("Rate Routinely!", () => RatingsManager.Prompt())); this.Root.Add(nav); this.Root.Add(switches); this.Root.Add(support); if(ClockKingOptions.EnableDebugOptions) this.Root.Add(debugSection); inactiveSwitch.ValueChanged += (s, e) => { if (ClockKingOptions.ShowInactiveGoals != inactiveSwitch.Value) { Close(); inactiveSwitch.Value = ClockKingOptions.ShowInactiveGoals = !ClockKingOptions.ShowInactiveGoals; Controller.RespondToModelChanges(); } }; tracingEnabled.ValueChanged += (s, e) => { if (ClockKingOptions.TracingEnabled != tracingEnabled.Value) { if (ClockKingOptions.TracingEnabled) Controller.notify("Disabling banners", "re-enable using the toggle", iiToastNotification.Unified.ToastNotificationType.Error); ClockKingOptions.TracingEnabled = !ClockKingOptions.TracingEnabled; if (ClockKingOptions.TracingEnabled) Controller.notify("Enabling banners", "disable using the toggle", iiToastNotification.Unified.ToastNotificationType.Error); } }; }