コード例 #1
0
        private List<TableItemGroup> GetTableSetup()
        {
            List<TableItemGroup> tableItems = new List<TableItemGroup>();

            TableItemGroup searchterms = new TableItemGroup { Name = "Search Terms" };
            TableItemGroup options = new TableItemGroup { Name = "Options" };

            searchterms.Items.Add(new TableItem
            {
                Heading = "Search Terms",
                CellType = "SearchTermsCell",
            });
            if (Categories.Autos.Contains(Category.Key))
            {
                searchterms.Items.Add(new TableItem
                {
                    Heading = "Make/Model",
                    SubHeading = "make / model",
                    CellType = "MakeModelCell"
                });
                searchterms.Items.Add(new TableItem
                {
                    Heading = "Year",
                    CellType = "MinMaxCell"
                });
                searchterms.Items.Add(new TableItem
                {
                    Heading = "Odometer",
                    CellType = "MinMaxCell"
                });
            }

            if (Categories.Groups.Find(x => x.Name == "Housing").Items.Contains(Category) || Categories.Groups.Find(x => x.Name == "For Sale").Items.Contains(Category))
            {
                searchterms.Items.Add(new TableItem
                {
                    Heading = "Price",
                    CellType = "PriceInputCell",
                });
            }

            if (Categories.Groups.Find(x => x.Name == "Housing").Items.Contains(Category))
            {
                searchterms.Items.Add(new TableItem
                {
                    Heading = "Sq Feet",
                    CellType = "MinMaxCell"
                });
            }

            if (Categories.SubCategories.ContainsKey(Category.Key))
            {
                options.Items.Add(new TableItem
                {
                    Heading = "Sub Category",
                    CellType = "PickerSelectorCell",
                    PickerOptions = new List<PickerOptions>
                            {
                                new PickerOptions {PickerWheelOptions = Categories.SubCategories[Category.Key]}
                            },
                });
            }

            if (Categories.Groups.Find(x => x.Name == "For Sale").Items.Contains(Category) || Categories.Autos.Contains(Category.Key))
            {
                options.Items.Add(new TableItem
                {
                    Heading = "Condition",
                    CellType = "ComboTableCell",
                    SubHeading = "condition",
                    PickerOptions = new List<PickerOptions> { new PickerOptions { PickerWheelOptions = Categories.ComboOptions["condition"] } },
                });
            }

            if (Categories.Groups.Find(x => x.Name == "Jobs").Items.Contains(Category))
            {
                options.Items.Add(new TableItem
                {
                    Heading = "Job Type",
                    CellType = "ComboTableCell",
                    SubHeading = "employment_type",
                    PickerOptions = new List<PickerOptions> { new PickerOptions { PickerWheelOptions = Categories.ComboOptions["employment_type"] } },
                });
            }

            if (Categories.Groups.Find(x => x.Name == "Gigs").Items.Contains(Category))
            {
                options.Items.Add(new TableItem
                {
                    Heading = "Paid",
                    CellType = "ComboTableCell",
                    SubHeading = "is_paid",
                    PickerOptions = new List<PickerOptions> { new PickerOptions { PickerWheelOptions = Categories.ComboOptions["is_paid"] } },
                });
            }

            if (Categories.Autos.Contains(Category.Key))
            {
                options.Items.Add(new TableItem
                {
                    Heading = "Cylinders",
                    CellType = "ComboTableCell",
                    SubHeading = "auto_cylinders",
                    PickerOptions = new List<PickerOptions> { new PickerOptions { PickerWheelOptions = Categories.ComboOptions["auto_cylinders"] } },
                });
                options.Items.Add(new TableItem
                {
                    Heading = "Drive",
                    CellType = "ComboTableCell",
                    SubHeading = "auto_drivetrain",
                    PickerOptions = new List<PickerOptions> { new PickerOptions { PickerWheelOptions = Categories.ComboOptions["auto_drivetrain"] } },
                });
                options.Items.Add(new TableItem
                {
                    Heading = "Fuel",
                    CellType = "ComboTableCell",
                    SubHeading = "auto_fuel_type",
                    PickerOptions = new List<PickerOptions> { new PickerOptions { PickerWheelOptions = Categories.ComboOptions["auto_fuel_type"] } },
                });
                options.Items.Add(new TableItem
                {
                    Heading = "Paint Color",
                    CellType = "ComboTableCell",
                    SubHeading = "auto_paint",
                    PickerOptions = new List<PickerOptions> { new PickerOptions { PickerWheelOptions = Categories.ComboOptions["auto_paint"] } },
                });
                options.Items.Add(new TableItem
                {
                    Heading = "Title Status",
                    CellType = "ComboTableCell",
                    SubHeading = "auto_title_status",
                    PickerOptions = new List<PickerOptions> { new PickerOptions { PickerWheelOptions = Categories.ComboOptions["auto_title_status"] } },
                });
                options.Items.Add(new TableItem
                {
                    Heading = "Transmission",
                    CellType = "ComboTableCell",
                    SubHeading = "auto_transmission",
                    PickerOptions = new List<PickerOptions> { new PickerOptions { PickerWheelOptions = Categories.ComboOptions["auto_transmission"] } },
                });
            }

            if (Categories.Housing.Contains(Category.Key))
            {
                options.Items.Add(new TableItem
                {
                    Heading = "Min Bedrooms",
                    CellType = "PickerSelectorCell",
                    PickerOptions = new List<PickerOptions>
                            {
                                new PickerOptions
                                {PickerWheelOptions = new List<KeyValuePair<object, object>>
                                    {
                                        new KeyValuePair<object, object>("Any", null),
                                        new KeyValuePair<object, object>("1+", "1"),
                                        new KeyValuePair<object, object>("2+", "2"),
                                        new KeyValuePair<object, object>("3+", "3"),
                                        new KeyValuePair<object, object>("4+", "4"),
                                    }
                                }
                            },
                });
                options.Items.Add(new TableItem
                {
                    Heading = "Min Bathrooms",
                    CellType = "PickerSelectorCell",
                    PickerOptions = new List<PickerOptions>
                            {
                                new PickerOptions
                                {PickerWheelOptions = new List<KeyValuePair<object, object>>
                                    {
                                        new KeyValuePair<object, object>("Any", null),
                                        new KeyValuePair<object, object>("1+", "1"),
                                        new KeyValuePair<object, object>("2+", "2"),
                                        new KeyValuePair<object, object>("3+", "3"),
                                        new KeyValuePair<object, object>("4+", "4"),
                                    }
                                }
                            },
                });
            }
            options.Items.Add(new TableItem
            {
                Heading = "Posted Date",
                CellType = "PickerSelectorCell",
                PickerOptions = new List<PickerOptions>
                        {
                            new PickerOptions
                            {PickerWheelOptions = new List<KeyValuePair<object, object>>
                                {
                                    new KeyValuePair<object, object>("Any", null),
                                    new KeyValuePair<object, object>("Today", "-1"),
                                    new KeyValuePair<object, object>("1 Week Old", "1"),
                                    new KeyValuePair<object, object>("2 Weeks Old", "2"),
                                    new KeyValuePair<object, object>("3 Weeks Old", "3"),
                                    new KeyValuePair<object, object>("4 Weeks Old", "4"),
                                }
                            }
                        },
            });
            options.Items.Add(new TableItem
            {
                Heading = "Max Listings",
                CellType = "PickerSelectorCell",
                PickerOptions = new List<PickerOptions>
                    {
                        new PickerOptions{PickerWheelOptions = new List<KeyValuePair<object, object>>
                            {
                                new KeyValuePair<object, object>(25, 25),
                                new KeyValuePair<object, object>(50, 50),
                                new KeyValuePair<object, object>(75, 75),
                                new KeyValuePair<object, object>(100, 100),
                            }}
                    },
            });

            tableItems.Add(searchterms);
            tableItems.Add(options);

            return tableItems;
        }
コード例 #2
0
        private List <TableItemGroup> GetTableSetup()
        {
            List <TableItemGroup> tableItems = new List <TableItemGroup>();

            TableItemGroup searchterms = new TableItemGroup {
                Name = "Search Terms"
            };
            TableItemGroup options = new TableItemGroup {
                Name = "Options"
            };

            searchterms.Items.Add(new TableItem
            {
                Heading  = "Search Terms",
                CellType = "SearchTermsCell",
            });
            if (Categories.Autos.Contains(Category.Key))
            {
                searchterms.Items.Add(new TableItem
                {
                    Heading    = "Make/Model",
                    SubHeading = "make / model",
                    CellType   = "MakeModelCell"
                });
                searchterms.Items.Add(new TableItem
                {
                    Heading  = "Year",
                    CellType = "MinMaxCell"
                });
                searchterms.Items.Add(new TableItem
                {
                    Heading  = "Odometer",
                    CellType = "MinMaxCell"
                });
            }

            if (Categories.Groups.Find(x => x.Name == "Housing").Items.Contains(Category) || Categories.Groups.Find(x => x.Name == "For Sale").Items.Contains(Category))
            {
                searchterms.Items.Add(new TableItem
                {
                    Heading  = "Price",
                    CellType = "PriceInputCell",
                });
            }

            if (Categories.Groups.Find(x => x.Name == "Housing").Items.Contains(Category))
            {
                searchterms.Items.Add(new TableItem
                {
                    Heading  = "Sq Feet",
                    CellType = "MinMaxCell"
                });
            }

            if (Categories.SubCategories.ContainsKey(Category.Key))
            {
                options.Items.Add(new TableItem
                {
                    Heading       = "Sub Category",
                    CellType      = "PickerSelectorCell",
                    PickerOptions = new List <PickerOptions>
                    {
                        new PickerOptions {
                            PickerWheelOptions = Categories.SubCategories[Category.Key]
                        }
                    },
                });
            }

            if (Categories.Groups.Find(x => x.Name == "For Sale").Items.Contains(Category) || Categories.Autos.Contains(Category.Key))
            {
                options.Items.Add(new TableItem
                {
                    Heading       = "Condition",
                    CellType      = "ComboTableCell",
                    SubHeading    = "condition",
                    PickerOptions = new List <PickerOptions> {
                        new PickerOptions {
                            PickerWheelOptions = Categories.ComboOptions["condition"]
                        }
                    },
                });
            }

            if (Categories.Groups.Find(x => x.Name == "Jobs").Items.Contains(Category))
            {
                options.Items.Add(new TableItem
                {
                    Heading       = "Job Type",
                    CellType      = "ComboTableCell",
                    SubHeading    = "employment_type",
                    PickerOptions = new List <PickerOptions> {
                        new PickerOptions {
                            PickerWheelOptions = Categories.ComboOptions["employment_type"]
                        }
                    },
                });
            }

            if (Categories.Groups.Find(x => x.Name == "Gigs").Items.Contains(Category))
            {
                options.Items.Add(new TableItem
                {
                    Heading       = "Paid",
                    CellType      = "ComboTableCell",
                    SubHeading    = "is_paid",
                    PickerOptions = new List <PickerOptions> {
                        new PickerOptions {
                            PickerWheelOptions = Categories.ComboOptions["is_paid"]
                        }
                    },
                });
            }

            if (Categories.Autos.Contains(Category.Key))
            {
                options.Items.Add(new TableItem
                {
                    Heading       = "Cylinders",
                    CellType      = "ComboTableCell",
                    SubHeading    = "auto_cylinders",
                    PickerOptions = new List <PickerOptions> {
                        new PickerOptions {
                            PickerWheelOptions = Categories.ComboOptions["auto_cylinders"]
                        }
                    },
                });
                options.Items.Add(new TableItem
                {
                    Heading       = "Drive",
                    CellType      = "ComboTableCell",
                    SubHeading    = "auto_drivetrain",
                    PickerOptions = new List <PickerOptions> {
                        new PickerOptions {
                            PickerWheelOptions = Categories.ComboOptions["auto_drivetrain"]
                        }
                    },
                });
                options.Items.Add(new TableItem
                {
                    Heading       = "Fuel",
                    CellType      = "ComboTableCell",
                    SubHeading    = "auto_fuel_type",
                    PickerOptions = new List <PickerOptions> {
                        new PickerOptions {
                            PickerWheelOptions = Categories.ComboOptions["auto_fuel_type"]
                        }
                    },
                });
                options.Items.Add(new TableItem
                {
                    Heading       = "Paint Color",
                    CellType      = "ComboTableCell",
                    SubHeading    = "auto_paint",
                    PickerOptions = new List <PickerOptions> {
                        new PickerOptions {
                            PickerWheelOptions = Categories.ComboOptions["auto_paint"]
                        }
                    },
                });
                options.Items.Add(new TableItem
                {
                    Heading       = "Title Status",
                    CellType      = "ComboTableCell",
                    SubHeading    = "auto_title_status",
                    PickerOptions = new List <PickerOptions> {
                        new PickerOptions {
                            PickerWheelOptions = Categories.ComboOptions["auto_title_status"]
                        }
                    },
                });
                options.Items.Add(new TableItem
                {
                    Heading       = "Transmission",
                    CellType      = "ComboTableCell",
                    SubHeading    = "auto_transmission",
                    PickerOptions = new List <PickerOptions> {
                        new PickerOptions {
                            PickerWheelOptions = Categories.ComboOptions["auto_transmission"]
                        }
                    },
                });
            }

            if (Categories.Housing.Contains(Category.Key))
            {
                options.Items.Add(new TableItem
                {
                    Heading       = "Min Bedrooms",
                    CellType      = "PickerSelectorCell",
                    PickerOptions = new List <PickerOptions>
                    {
                        new PickerOptions
                        {
                            PickerWheelOptions = new List <KeyValuePair <object, object> >
                            {
                                new KeyValuePair <object, object>("Any", null),
                                new KeyValuePair <object, object>("1+", "1"),
                                new KeyValuePair <object, object>("2+", "2"),
                                new KeyValuePair <object, object>("3+", "3"),
                                new KeyValuePair <object, object>("4+", "4"),
                            }
                        }
                    },
                });
                options.Items.Add(new TableItem
                {
                    Heading       = "Min Bathrooms",
                    CellType      = "PickerSelectorCell",
                    PickerOptions = new List <PickerOptions>
                    {
                        new PickerOptions
                        {
                            PickerWheelOptions = new List <KeyValuePair <object, object> >
                            {
                                new KeyValuePair <object, object>("Any", null),
                                new KeyValuePair <object, object>("1+", "1"),
                                new KeyValuePair <object, object>("2+", "2"),
                                new KeyValuePair <object, object>("3+", "3"),
                                new KeyValuePair <object, object>("4+", "4"),
                            }
                        }
                    },
                });
            }
            options.Items.Add(new TableItem
            {
                Heading       = "Posted Date",
                CellType      = "PickerSelectorCell",
                PickerOptions = new List <PickerOptions>
                {
                    new PickerOptions
                    {
                        PickerWheelOptions = new List <KeyValuePair <object, object> >
                        {
                            new KeyValuePair <object, object>("Any", null),
                            new KeyValuePair <object, object>("Today", "-1"),
                            new KeyValuePair <object, object>("1 Week Old", "1"),
                            new KeyValuePair <object, object>("2 Weeks Old", "2"),
                            new KeyValuePair <object, object>("3 Weeks Old", "3"),
                            new KeyValuePair <object, object>("4 Weeks Old", "4"),
                        }
                    }
                },
            });
            options.Items.Add(new TableItem
            {
                Heading       = "Max Listings",
                CellType      = "PickerSelectorCell",
                PickerOptions = new List <PickerOptions>
                {
                    new PickerOptions {
                        PickerWheelOptions = new List <KeyValuePair <object, object> >
                        {
                            new KeyValuePair <object, object>(25, 25),
                            new KeyValuePair <object, object>(50, 50),
                            new KeyValuePair <object, object>(75, 75),
                            new KeyValuePair <object, object>(100, 100),
                        }
                    }
                },
            });

            tableItems.Add(searchterms);
            tableItems.Add(options);

            return(tableItems);
        }