Ejemplo n.º 1
0
        // Push the ConstantViewController that list all the constants that has the selected class
        void OpenConstantViewController(LogEventConstantNameType type, int sectionIndex)
        {
            var constantViewController = new ConstantViewController(type, sectionIndex);

            constantViewController.ConstantSelected += ConstantViewController_ConstantSelected;
            NavigationController.PushViewController(constantViewController, true);
        }
Ejemplo n.º 2
0
        public ConstantViewController(LogEventConstantNameType type, int sectionIndex) : base(UITableViewStyle.Grouped, null, true)
        {
            this.type         = type;
            this.sectionIndex = sectionIndex;
            var title = type == LogEventConstantNameType.Event ? "Event Names Constants" : "Parameter Names Constants";
            var typeToApplyReflection = type == LogEventConstantNameType.Event ? typeof(EventNamesConstants) : typeof(ParameterNamesConstants);
            var constantSection       = new Section("Select a constant");

            var properties = typeToApplyReflection.GetProperties(BindingFlags.Public | BindingFlags.Static);

            foreach (var property in properties)
            {
                constantSection.Add(new StringElement(property.Name, () => {
                    ReturnValueOfSelectedConstant(property);
                    ClearEvent(ConstantSelected);
                    NavigationController.PopViewController(true);
                }));
            }

            Root = new RootElement(title)
            {
                constantSection
            };
        }