Exemplo n.º 1
0
        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());
        }
Exemplo n.º 2
0
 public static int Compare(Background backgroundA, Background backgroundB)
 {
     return string.Compare(backgroundA.Name, backgroundB.Name);
 }
Exemplo n.º 3
0
 public void SetBackground(Background background)
 {
     this.BackgroundName = background.Name;
 }
Exemplo n.º 4
0
        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);
            }
        }
Exemplo n.º 5
0
        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());
        }
Exemplo n.º 6
0
 public BackgroundDialog(Background currentBackground)
 {
     this.EdgesForExtendedLayout = UIRectEdge.None;
     this.SelectedBackground = currentBackground;
     this.Title = "Background Selection";
 }