public override void RowSelected(UITableView tableView, NSIndexPath indexPath) { UITableViewCell cell = tableView.CellAt(indexPath); if (__lastSelectedCell != null) __lastSelectedCell.Accessory = UITableViewCellAccessory.None; cell.Accessory = UITableViewCellAccessory.Checkmark; __lastSelectedCell = cell; List<Background> sectionBackgrounds = __backgroundsByType[__sections[indexPath.Section]]; this.CurrentSelectedBackground = sectionBackgrounds[indexPath.Row]; var handler = this.RowHasBeenSelected; if (handler != null) handler(this, new EventArgs()); }
public static int Compare(Background backgroundA, Background backgroundB) { return string.Compare(backgroundA.Name, backgroundB.Name); }
public void SetBackground(Background background) { this.BackgroundName = background.Name; }
public static void LoadBackgrounds() { DirectoryInfo defaultBackgrounds = new DirectoryInfo(ApplicationEnviroment.DEFAULT_BACKGROUNDS_DIRECTORY); foreach (FileInfo singleBackground in defaultBackgrounds.GetFiles("*.png")) { Background newDefaultBackground = new Background(); newDefaultBackground.Name = singleBackground.Name.Substring(0, singleBackground.Name.Length - singleBackground.Extension.Length); newDefaultBackground.IsDefault = true; newDefaultBackground.Location = singleBackground.FullName; if (string.Equals(singleBackground.Name, DEFAULT_BACKGROUND_NAME)) DefaultBackground = newDefaultBackground; __backgrounds.Add(newDefaultBackground); } DirectoryInfo customBackgrounds = new DirectoryInfo(ApplicationEnviroment.CUSTOM_BACKGROUNDS_DIRECTORY); foreach (FileInfo singleBackground in customBackgrounds.GetFiles("*.png")) { Background newCustomBackground = new Background(); newCustomBackground.Name = singleBackground.Name.Substring(0, singleBackground.Name.Length - singleBackground.Extension.Length); newCustomBackground.IsDefault = false; newCustomBackground.Location = singleBackground.FullName; __backgrounds.Add(newCustomBackground); } }
private void TableSource_RowHasBeenSelected(object sender, EventArgs e) { if (string.Equals(this.SelectedBackground.Name, __tableSource.CurrentSelectedBackground)) return; this.SelectedBackground = __tableSource.CurrentSelectedBackground; var handler = this.SelectionChanged; if (handler != null) handler(this, new EventArgs()); }
public BackgroundDialog(Background currentBackground) { this.EdgesForExtendedLayout = UIRectEdge.None; this.SelectedBackground = currentBackground; this.Title = "Background Selection"; }