partial void PreviousCat (Foundation.NSObject sender) { // Display previous cat if (--PageNumber < 0) { PageNumber = 0; } ShowCat(); }
public override nint RowsInSection (UITableView tableview, nint section) { if (nearables == null) return 0; else return nearables.Length; }
/// <summary> /// called when a row is selected in the spinner /// </summary> public override void Selected (UIPickerView picker, nint row, nint component) { selectedIndex = (int)row; if (ValueChanged != null) { ValueChanged (this, new EventArgs ()); } }
public override string GetTitle(UIPickerView picker, nint row, nint component) { if (component == 0) return tk.pickerData[row]; else return row.ToString(); }
public static UIColor ColorFromHex(this UIColor color, nint hexValue) { return UIColor.FromRGB( (((float)((hexValue & 0xFF0000) >> 16))/255.0f), (((float)((hexValue & 0xFF00) >> 8))/255.0f), (((float)(hexValue & 0xFF))/255.0f) ); }
public override nint RowsInSection (UITableView tableview, nint section) { if (this._SourceData == null) return 0; return this._SourceData.Count; }
public override nint RowsInSection (UITableView tableview, nint section) { if (beacons == null) return 0; else return beacons.Length; }
public override SChartData GetDataPoint(ShinobiChart chart, nint dataIndex, nint dataSeriesIndex) { return new SChartDataPoint { XValue = new NSNumber (dataIndex), YValue = new NSNumber (data [dataIndex]), }; }
public override NSView GetViewForItem (NSTableView tableView, NSTableColumn tableColumn, nint row) { int r = (int)row; // This pattern allows you reuse existing views when they are no-longer in use. // If the returned view is null, you instance up a new view // If a non-null view is returned, you modify it enough to reflect the new data NSTextField view = (NSTextField)tableView.MakeView (CellIdentifier, this); if (view == null) { view = new NSTextField (); view.Identifier = CellIdentifier; view.BackgroundColor = NSColor.Clear; view.Bordered = false; view.Selectable = false; view.Editable = false; } // Setup view based on the column selected switch (tableColumn.Identifier) { case CellIdentifierFirst: view.StringValue = DataSource.Items[r]; break; } return view; }
public static void AddXtcIdsToUIBarButtonItems (this XElement root) { counter = 0; foreach (var barButtonItem in root.getBarButtonItems()) barButtonItem.ensureAccessibilityLabel(barButtonItem.createXtcIdentifierForBarButtonItem()); }
public override SChartData GetDataPoint(ShinobiChart chart, nint dataIndex, nint dataSeriesIndex) { return new SChartRadialDataPoint { Name = countrySizes[(int)dataIndex].Item1, Value = countrySizes[(int)dataIndex].Item2 }; }
public DataViewController GetViewController (nint index, UIStoryboard storyboard) { var dataViewController = (DataViewController)storyboard.InstantiateViewController ("DataViewController"); dataViewController.PageNumber = index + 1; dataViewController.Pdf = pdf; return dataViewController; }
public override string TitleForHeader (UITableView tableView, nint section) { if (section == (int) RecipeSection.Instructions) return "Instructions"; return null; }
public override string GetTitle(UIPickerView picker, nint row, nint component) { if (component == 0) return tk.chartTypes[row]; else return tk.chartAnimation[row]; }
public override nint RowsInSection(UITableView tableview, nint section) { if (todoService == null || todoService.Items == null) return 0; return todoService.Items.Count; }
public override nint RowsInSection(UITableView tableview, nint section) { // If the section is not colapsed return the rows in that section otherwise return 0 if (((IEnumerable<object>)ItemsSource?.ElementAt((int)section)).Any() == true && !_isCollapsed[(int)section]) return ((IEnumerable<object>)ItemsSource.ElementAt((int)section)).Count(); return 0; }
public override nint GetRowsInComponent(UIPickerView pickerView, nint component) { if (component == 0) return tk.chartTypes.Length; else return tk.chartAnimation.Length; }
async Task LoadToDoList() { syncTaskId = UIApplication.SharedApplication.BeginBackgroundTask( () => { /*code here will be exeuated when the remaining time is really low*/ UIApplication.SharedApplication.EndBackgroundTask(syncTaskId); syncTaskId = -1; }); //Expression<Func<TodoItem, bool>> predicate = (t => t.Text.ToLower().Contains("stuff")); Expression<Func<TodoItem, bool>> predicate = (t => ture); datasouce = await _dataService.QueryDataAsync(predicate,"getTodo",true); InvokeOnMainThread(()=>{ TableView.Source = new AMSDataTableSource(datasouce , this , dataCellId , _storyboard ); TableView.ReloadData(); }); UIApplication.SharedApplication.EndBackgroundTask(syncTaskId); }
public override NSView GetViewForItem(NSTableView tableView, NSTableColumn tableColumn, nint row) { int r = (int)row; if (tableColumn.Identifier == CellIdentifierEnabled) { NSButton v = null; if (v == null) { v = new NSButton(); v.Title = string.Empty; v.SetButtonType(NSButtonType.Switch); if (_dataSource.Items[r].Checked) { v.State = NSCellStateValue.On; } else { v.State = NSCellStateValue.Off; } v.Activated += (object sender, EventArgs e) => { var b = v.State == NSCellStateValue.On; _dataSource.Items[r].Checked = b; _controller.SaveRuleState(r, b); }; } return v; } // This pattern allows you reuse existing views when they are no-longer in use. // If the returned view is null, you instance up a new view // If a non-null view is returned, you modify it enough to reflect the new data NSTextField view = (NSTextField)tableView.MakeView(CellIdentifier, this); if (view == null) { view = new NSTextField(); view.Identifier = CellIdentifier; view.BackgroundColor = NSColor.Clear; view.Bordered = false; view.Selectable = false; view.Editable = false; } // Setup view based on the column selected switch (tableColumn.Identifier) { case CellIdentifierEnabled: view.StringValue = _dataSource.Items[r].Checked.ToString(); break; case CellIdentifierFixWhat: view.StringValue = _dataSource.Items[r].Name; break; case CellIdentifierExample: view.StringValue = _dataSource.Items[r].Example; break; } return view; }
public override void PointSelected (TKChart chart, TKChartData point, TKChartSeries series, nint index) { if (this.labelRender != null) { this.labelRender.SelectedSeries = (int)series.Index; this.labelRender.SelectedDataPoint = index; } }
public NSObject GetObjectValue(NSTableView tableView, NSTableColumn tableColumn, nint row) { if (IsViewReady) { Employee emp = DataStore.Employees[(int)row]; switch (tableColumn.Identifier) { case "FirstName": return new NSString(emp.FirstName); case "LastName": return new NSString(emp.LastName); case "DepartmentName": NSPopUpButtonCell button = tableColumn.DataCellForRow(row) as NSPopUpButtonCell; button.RemoveAllItems(); foreach(Department dep in DataStore.Departments) { button.Menu.AddItem(dep.Name, new ObjCRuntime.Selector("departmentSelected:"), ""); } return button; default: return new NSString(""); } } else return new NSString(""); }
public override string GetTitle(UIPickerView picker, nint row, nint component) { if (row < 0 && row >= _values.Count) { return "Not found"; } string title = String.Empty; switch (_pickerOption) { case PickerOptions.Courses: title = ((Course)_values[(int)row]).CourseTitle; break; //case PickerOptions.Banner: // title = ((Banner)_values[(int)row]).BannerName; // break; //case PickerOptions.Region: // title = ((Region)_values[(int)row]).RegionName; // break; //case PickerOptions.MonthOfYear: // title = ((MonthOfYear)_values[(int)row]).MonthOfYearName; // break; default: break; } return title; }
public override NSObject GetContextForSegue(string segueIdentifier, WKInterfaceTable table, nint rowIndex) { CrmTask task = _rows[(int)rowIndex]; List<NSObject> keys = new List<NSObject> { new NSString("command"), new NSString("taskid") }; List<NSObject> values = new List<NSObject> { new NSString("closetask"), new NSString(task.TaskId) }; var cmdDict = NSDictionary.FromObjectsAndKeys(values.ToArray(), keys.ToArray()); OpenParentApplication(cmdDict, (replyInfo, error) => { if (error != null) { //Console.WriteLine(error); //TODO: Handle error return; } _rows = new List<CrmTask>(); GetTasks(); }); return new NSString(task.Subject); }
public override string TitleForHeader (UITableView tableView, nint section) { if (section == 1) return "Recent"; else return "Older Ideas"; }
public static NSWindowDepth BestDepth(NSString colorspace, nint bitsPerSample, nint bitsPerPixel, bool planar, ref bool exactMatch) { if (colorspace == null) throw new ArgumentNullException ("colorspace"); return NSBestDepth (colorspace.Handle, bitsPerSample, bitsPerPixel, planar, ref exactMatch); }
public override SChartSeries GetSeries(ShinobiChart chart, nint dataSeriesIndex) { // In our example all series are line series SChartLineSeries lineSeries = new SChartLineSeries (); lineSeries.Style.LineWidth = 2; return lineSeries; }
public override nint RowsInSection(UITableView tableview, nint section) { if (_events != null) return _events.Count; return 0; }
public override IQLPreviewItem GetPreviewItem(QLPreviewController controller, nint index) { string documentsPath = Environment.GetFolderPath (Environment.SpecialFolder.InternetCache); NSUrl url = NSUrl.FromFilename (Path.Combine (documentsPath, fileName)); return new PDFViewItem (fileName, url); }
private void ConfigureTextField (NSTableCellView view, nint row) { // Add to view view.TextField.AutoresizingMask = NSViewResizingMask.WidthSizable; view.AddSubview (view.TextField); // Configure view.TextField.BackgroundColor = NSColor.Clear; view.TextField.Bordered = false; view.TextField.Selectable = false; view.TextField.Editable = true; // Wireup events view.TextField.EditingEnded += (sender, e) => { // Take action based on type switch (view.Identifier) { case "Product": DataSource.Products [(int)view.TextField.Tag].Title = view.TextField.StringValue; break; case "Details": DataSource.Products [(int)view.TextField.Tag].Description = view.TextField.StringValue; break; } }; // Tag view view.TextField.Tag = row; }
public override string TitleForHeader(UITableView tableView, nint section) { if (!this.checkPointData.DisabledCheckPoints.Any ()) return string.Empty; return SectionNames [section]; }
public override nint GetItemsCount(UICollectionView collectionView, nint section) => Faces?.Count ?? 0;
public override nint RowsInSection(UITableView tableview, nint section) => Items?.ElementAt((int)section).Count() ?? 0;
//Function to get the number of rows in a section public override nint RowsInSection(UITableView tableview, nint section) { return(tableItems.Count); }
public override nfloat GetHeightForHeader(UITableView tableView, nint section) { // ----------------------------------------------------------------------------- // This overrides SectionHeaderHeight (of UITableView), for indiv rows... return((nfloat)40.0); }
public override string TitleForHeader(UITableView tableView, nint section) { // ---------------------------------------------------------------------- // We use custom header class, so this is blank... return(""); }
public override nint RowsInSection(UITableView tableView, nint section) { return(this.firstTimeDict.Count); }
public override void Clicked(UIAlertView alertview, nint buttonIndex) { base.Clicked(alertview, buttonIndex); Console.WriteLine(buttonIndex.ToString() + " clicked"); }
// Return the number of rows in the specified section (group). public override nint RowsInSection(UITableView tableview, nint section) { return(_statisticsResults[_statisticsResults.Keys.ElementAt((int)section)].Count); }
// Return the number of rows for the table (count of the statistics definition list). public override nint RowsInSection(UITableView tableview, nint section) { return(_statisticDefinitions.Count); }
// Return the header text for the specified section (group). public override string TitleForHeader(UITableView tableView, nint section) { return(_statisticsResults.Keys.ElementAt((int)section)); }
// Return the desired width for each component in the picker. public override nfloat GetComponentWidth(UIPickerView pickerView, nint component) { // first component is the fields list, second is the statistic types. return(component == 0 ? 160f : 120f); }
// Return the number of rows to display. public override nint RowsInSection(UITableView tableview, nint section) { return(_potentialOrderByFields.Count); }
// Return the number of rows in each of the two sections. public override nint GetRowsInComponent(UIPickerView pickerView, nint component) { // first component is the fields list, second is the statistic types. return(component == 0 ? _fieldNames.Length : _statTypes.Length); }
// Return the desired height for rows in the picker. public override nfloat GetRowHeight(UIPickerView pickerView, nint component) { return(40f); }
public PostGameMenu(CGSize frameSize, IGameUIState gameStateDelegate) { GameStateDelegate = gameStateDelegate; nfloat menuHeight = frameSize.Height * 0.8f; var background = new SKSpriteNode(AppKit.NSColor.Black, new CGSize(frameSize.Width * 0.8f, menuHeight)); background.ZPosition = -1; background.Alpha = 0.5f; background.Position = new CGPoint(0, -0.2f * menuHeight); myLabel = InGameScene.LabelWithText("Final Score", 65); myLabel.Position = new CGPoint(Frame.GetMidX(), Frame.GetMidY()); Position = new CGPoint(frameSize.Width * 0.5f, frameSize.Height * 0.5f); UserInteractionEnabled = true; myLabel.UserInteractionEnabled = true; AddChild(myLabel); InGameScene.DropShadowOnLabel(myLabel); var bananaLocation = new CGPoint(frameSize.Width * -0.4f, Frame.GetMidY() * -0.4f); var coinLocation = new CGPoint(frameSize.Width * -0.4f, Frame.GetMidY() * -0.6f); var totalLocation = new CGPoint(frameSize.Width * -0.4f, Frame.GetMidY() * -0.8f); var bananaScoreLocation = new CGPoint(frameSize.Width * +0.4f, Frame.GetMidY() * -0.4f); var coinScoreLocation = new CGPoint(frameSize.Width * +0.4f, Frame.GetMidY() * -0.6f); var totalScoreLocation = new CGPoint(frameSize.Width * +0.4f, Frame.GetMidY() * -0.8f); bananaText = (SKLabelNode)myLabel.Copy(); bananaText.Text = "Bananas"; bananaText.FontSize = 0.1f * menuHeight; bananaText.Scale = 0.8f; bananaLocation.X += bananaText.CalculateAccumulatedFrame().Width * 0.5f + frameSize.Width * 0.1f; bananaText.Position = new CGPoint(bananaLocation.X, -2000); AddChild(bananaText); InGameScene.DropShadowOnLabel(bananaText); bananaScore = (SKLabelNode)bananaText.Copy(); bananaScore.Text = "000"; bananaScoreLocation.X -= bananaScore.CalculateAccumulatedFrame().Width * 0.5f + frameSize.Width * 0.1f; bananaScore.Position = new CGPoint(bananaScoreLocation.X, -2000); AddChild(bananaScore); coinText = (SKLabelNode)bananaText.Copy(); coinText.Text = "Large Bananas"; coinLocation.X += coinText.CalculateAccumulatedFrame().Width * 0.5f + frameSize.Width * 0.1f; coinText.Position = new CGPoint(coinLocation.X, -2000f); AddChild(coinText); InGameScene.DropShadowOnLabel(coinText); coinScore = (SKLabelNode)coinText.Copy(); coinScore.Text = "000"; coinScoreLocation.X -= coinScore.CalculateAccumulatedFrame().Width * 0.5f + frameSize.Width * 0.1f; coinScore.Position = new CGPoint(coinScoreLocation.X, -2000f); AddChild(coinScore); totalText = (SKLabelNode)bananaText.Copy(); totalText.Text = "Total"; totalLocation.X += totalText.CalculateAccumulatedFrame().Width * 0.5f + frameSize.Width * 0.1f; totalText.Position = new CGPoint(totalLocation.X, -2000f); AddChild(totalText); InGameScene.DropShadowOnLabel(totalText); totalScore = (SKLabelNode)totalText.Copy(); totalScore.Text = "000"; totalScoreLocation.X -= totalScore.CalculateAccumulatedFrame().Width * 0.5f + frameSize.Width * 0.1f; totalScore.Position = new CGPoint(totalScoreLocation.X, -2000f); AddChild(totalScore); SKAction flyup = SKAction.MoveTo(new CGPoint(frameSize.Width * 0.5f, frameSize.Height - 100), 0.25); flyup.TimingMode = SKActionTimingMode.EaseInEaseOut; SKAction flyupBananas = SKAction.MoveTo(bananaLocation, 0.25); flyupBananas.TimingMode = SKActionTimingMode.EaseInEaseOut; SKAction flyupBananasScore = SKAction.MoveTo(bananaScoreLocation, 0.25f); flyupBananasScore.TimingMode = SKActionTimingMode.EaseInEaseOut; SKAction flyupCoins = SKAction.MoveTo(coinLocation, 0.25); flyupCoins.TimingMode = SKActionTimingMode.EaseInEaseOut; SKAction flyupCoinsScore = SKAction.MoveTo(coinScoreLocation, 0.25); flyupCoinsScore.TimingMode = SKActionTimingMode.EaseInEaseOut; SKAction flyupTotal = SKAction.MoveTo(totalLocation, 0.25); flyupTotal.TimingMode = SKActionTimingMode.EaseInEaseOut; SKAction flyupTotalScore = SKAction.MoveTo(totalScoreLocation, 0.25); flyupTotalScore.TimingMode = SKActionTimingMode.EaseInEaseOut; int bananasCollected = gameStateDelegate.BananasCollected; int coinsCollected = gameStateDelegate.CoinsCollected; int totalCollected = bananasCollected + (coinsCollected * 100); SKAction countUpBananas = SKAction.CustomActionWithDuration(bananasCollected / 100f, ((node, elapsedTime) => { if (bananasCollected > 0) { SKLabelNode label = (SKLabelNode)node; nint total = (nint)(elapsedTime / (bananasCollected / 100.0f) * bananasCollected); label.Text = total.ToString(); if (total % 10 == 0) { GameSimulation.Sim.PlaySound("deposit.caf"); } } })); SKAction countUpCoins = SKAction.CustomActionWithDuration(coinsCollected / 100f, ((node, elapsedTime) => { if (coinsCollected > 0) { SKLabelNode label = (SKLabelNode)node; nint total = (nint)((elapsedTime / (coinsCollected / 100.0f)) * coinsCollected); label.Text = total.ToString(); if (total % 10 == 0) { GameSimulation.Sim.PlaySound("deposit.caf"); } } })); SKAction countUpTotal = SKAction.CustomActionWithDuration(totalCollected / 500.0f, ((node, elapsedTime) => { if (totalCollected > 0) { SKLabelNode label = (SKLabelNode)node; nint total = (nint)((elapsedTime / (totalCollected / 500.0f)) * totalCollected); label.Text = total.ToString(); if (total % 25 == 0) { GameSimulation.Sim.PlaySound("deposit.caf"); } } })); RunAction(flyup, () => { bananaText.RunAction(flyupBananas); bananaScore.RunAction(flyupBananasScore, () => { bananaScore.RunAction(countUpBananas, () => { bananaScore.Text = bananasCollected.ToString(); coinText.RunAction(flyupCoins); coinScore.RunAction(flyupCoinsScore, () => { coinScore.RunAction(countUpCoins, () => { coinScore.Text = coinsCollected.ToString(); totalText.RunAction(flyupTotal); totalScore.RunAction(flyupTotalScore, () => { totalScore.RunAction(countUpTotal, () => { totalScore.Text = totalCollected.ToString(); }); }); }); }); }); }); }); }
// Get the title to display in each picker component. public override string GetTitle(UIPickerView pickerView, nint row, nint component) { // first component is the fields list, second is the statistic types. return(component == 0 ? _fieldNames[row] : _statTypes.GetValue(row).ToString()); }
public override CGSize GetReferenceSizeForHeader(UICollectionView collectionView, UICollectionViewLayout layout, nint section) { var width = UIScreen.MainScreen.Bounds.Width; return(section == 0 ? ViewModel.TopBanners == null || BannersHeaderReuseID.IsNullOrEmpty() || ViewModel.TopBanners.Count() == 0 ? CGSize.Empty : new CGSize(width, width * 9 / 16) : new CGSize(width, 44)); }
public override nfloat GetHeightForFooter(UITableView tableView, nint section) { return(section == 3 && !IsEdit ? (nfloat)0.1 : base.GetHeightForFooter(tableView, section)); }
public override string GetTitle(UIPickerView pickerView, nint row, nint component) { return(this.values[(int)row].Title); }
public override nint GetItemsCount(UICollectionView collectionView, nint section) { return(section == 0 ? 0 : (ItemsSource?.Count() ?? 0)); }
public void Clear() { Control.String = string.Empty; changeCount = Control.ChangeCount; }
public override void Selected(UIPickerView pickerView, nint row, nint component) { this.PickerChanged?.Invoke(this, new DatePickerChangedEventArgs { SelectedValue = this.values[(int)row] }); }
public override nint RowsInSection(UITableView tableView, nint section) { return(serviceTable [sortedKeys [(int)section]].Count); }
public override nint GetRowsInComponent(UIPickerView pickerView, nint component) { return(this.values.Count); }
public override nint RowsInSection(UITableView tableView, nint section) { return(this.panel.Generator.Items.Count); }
public override void DidCropToImage(TOCropViewController cropViewController, UIImage image, CoreGraphics.CGRect cropRect, nint angle) { IsCropped = true; try { if (image != null) { _page.CroppedImage = image.AsJPEG().ToArray(); } } catch (Exception ex) { Debug.WriteLine(ex.Message); } finally { if (image != null) { image.Dispose(); image = null; } CloseView(); } }
public TagDeletedEventArgs(nint index) { Index = index; }
public override string TitleForHeader(UITableView tableView, nint section) { return(sortedKeys != null ? sortedKeys [(int)section] : null); }
public override nint RowsInSection(UITableView tableview, nint section) { return(_tableItemTexts?.Length ?? 0); }
public override nint RowsInSection(UITableView tableView, nint section) { return(state._FilteredFeats.Count); }