コード例 #1
0
            public override void RowSelected(UITableView tableView, NSIndexPath indexPath)
            {
                this.owner.owner.SelectedOption = indexPath.Row;
                OptionInfo info = null;

                if (this.owner.owner.Sections.Length > 0)
                {
                    OptionSection sectionInfo = this.owner.owner.Sections [indexPath.Section];
                    info = sectionInfo.Items [indexPath.Row];
                    sectionInfo.SelectedOption = indexPath.Row;
                }
                else
                {
                    info = this.owner.owner.Options [indexPath.Row];
                    this.owner.owner.SelectedOption = indexPath.Row;
                }

                if (info.Handler != null)
                {
                    info.Handler(info, EventArgs.Empty);
                }

                if (this.owner.owner.Popover != null && this.owner.owner.Popover.PopoverVisible)
                {
                    this.owner.owner.Popover.Dismiss(false);
                }
                else
                {
                    this.owner.NavigationController.PopViewController(true);
                }
            }
コード例 #2
0
            public override UITableViewCell GetCell(UITableView tableView, NSIndexPath indexPath)
            {
                UITableViewCell cell = tableView.DequeueReusableCell("cell");
                OptionInfo      info = null;

                if (this.owner.owner.Sections.Length > 0)
                {
                    OptionSection sectionInfo = this.owner.owner.Sections [indexPath.Section];
                    info = sectionInfo.Items [indexPath.Row];
                    if (indexPath.Row == sectionInfo.SelectedOption)
                    {
                        cell.Accessory = UITableViewCellAccessory.Checkmark;
                    }
                }
                else
                {
                    info = this.owner.owner.Options [indexPath.Row];
                    if (indexPath.Row == this.owner.owner.SelectedOption)
                    {
                        cell.Accessory = UITableViewCellAccessory.Checkmark;
                    }
                }

                cell.TextLabel.Text = info.OptionText;
                cell.SelectionStyle = UITableViewCellSelectionStyle.None;
                return(cell);
            }
コード例 #3
0
        void addIndicatorOption(string text, EventHandler handler)
        {
            OptionInfo option = new OptionInfo(text, handler);

            Indicators.Add(option);
            this.AddOption(option);
        }
コード例 #4
0
        void addTrendlineOption(string text, EventHandler handler)
        {
            OptionInfo option = new OptionInfo(text, handler);

            Trendlines.Add(option);
            this.AddOption(option);
        }
コード例 #5
0
        void AddOptionInSection(OptionInfo option, string sectionName)
        {
            foreach (OptionSection section in this.sections)
            {
                if (section.Title.Equals(sectionName))
                {
                    section.Items.Add(option);
                    return;
                }
            }

            OptionSection newSection = new OptionSection(sectionName);

            newSection.Items.Add(option);
            this.sections.Add(newSection);
        }
コード例 #6
0
        public virtual void optionTouched(object sender, EventArgs e)
        {
            UISegmentedControl segmented = sender as UISegmentedControl;

            if (segmented != null)
            {
                this.SelectedOption = segmented.SelectedSegment;
            }
            else
            {
                this.SelectedOption = 0;
            }
            OptionInfo info = options [(int)this.SelectedOption];

            if (info.Handler != null)
            {
                info.Handler(info, EventArgs.Empty);
            }
        }
コード例 #7
0
            public override UITableViewCell GetCell(UITableView tableView, NSIndexPath indexPath)
            {
                UITableViewCell cell = tableView.DequeueReusableCell("cell");

                cell.SelectionStyle = UITableViewCellSelectionStyle.None;
                if ((indexPath.Section == 0 && indexPath.Row == example.SelectedTrendLine) ||
                    (indexPath.Section == 1 && indexPath.Row == example.SelectedIndicator))
                {
                    cell.Accessory = UITableViewCellAccessory.Checkmark;
                }
                else
                {
                    cell.Accessory = UITableViewCellAccessory.None;
                }
                OptionInfo info = indexPath.Section == 0 ? example.Trendlines [indexPath.Row] : example.Indicators [indexPath.Row];

                cell.TextLabel.Text = info.OptionText;
                return(cell);
            }
コード例 #8
0
        void loadCharts()
        {
            overlayChart.RemoveAllData();
            indicatorsChart.RemoveAllData();

            TKChartNumericAxis yAxis = new TKChartNumericAxis();

            yAxis.Range = new TKRange(new NSNumber(250), new NSNumber(750));
            yAxis.Style.LabelStyle.TextAlignment           = TKChartAxisLabelAlignment.Right | TKChartAxisLabelAlignment.Bottom;
            yAxis.Style.LabelStyle.FirstLabelTextAlignment = TKChartAxisLabelAlignment.Right | TKChartAxisLabelAlignment.Top;
            yAxis.AllowZoom = true;
            yAxis.AllowPan  = true;
            series.YAxis    = yAxis;

            NSDateFormatter formatter = new NSDateFormatter();

            formatter.DateFormat = "MM/dd/yyyy";

            NSDate minDate            = formatter.Parse("01/01/2011");
            NSDate maxDate            = formatter.Parse("01/01/2013");
            TKChartDateTimeAxis xAxis = new TKChartDateTimeAxis();

            xAxis.Range = new TKRange(minDate, maxDate);
            xAxis.MinorTickIntervalUnit                    = TKChartDateTimeAxisIntervalUnit.Days;
            xAxis.MajorTickIntervalUnit                    = TKChartDateTimeAxisIntervalUnit.Years;
            xAxis.MajorTickInterval                        = 1;
            xAxis.Style.MajorTickStyle.TicksHidden         = false;
            xAxis.Style.MajorTickStyle.TicksOffset         = -3;
            xAxis.Style.MajorTickStyle.TicksWidth          = 1.5f;
            xAxis.Style.MajorTickStyle.MaxTickClippingMode = TKChartAxisClippingMode.Visible;
            xAxis.Style.MajorTickStyle.TicksFill           = new TKSolidFill(UIColor.FromRGB(203 / 255.0f, 203 / 255.0f, 203 / 255.0f));
            xAxis.AllowZoom = true;
            xAxis.AllowPan  = true;
            series.XAxis    = xAxis;

            OptionInfo info = Trendlines [SelectedTrendLine];

            info.Handler(info, EventArgs.Empty);

            info = Indicators [SelectedIndicator];
            info.Handler(info, EventArgs.Empty);
        }
コード例 #9
0
            public override void RowSelected(UITableView tableView, NSIndexPath indexPath)
            {
                OptionInfo info = null;

                if (indexPath.Section == 0)
                {
                    tableView.DeselectRow(NSIndexPath.FromRowSection(example.SelectedTrendLine, 0), false);
                    example.SelectedTrendLine = indexPath.Row;
                    info = example.Trendlines [indexPath.Row];
                }
                else
                {
                    tableView.DeselectRow(NSIndexPath.FromRowSection(example.SelectedIndicator, 1), false);
                    example.SelectedIndicator = indexPath.Row;
                    info = example.Indicators [indexPath.Row];
                }

                info.Handler(info, EventArgs.Empty);
                tableView.ReloadData();
            }
コード例 #10
0
 public virtual void AddOption(OptionInfo option)
 {
     options.Add(option);
 }
コード例 #11
0
 public virtual void AddOption(OptionInfo option)
 {
     options.Add (option);
 }
コード例 #12
0
        void AddOptionInSection(OptionInfo option, string sectionName)
        {
            foreach (OptionSection section in this.sections) {
                if (section.Title.Equals(sectionName)) {
                    section.Items.Add (option);
                    return;
                }
            }

            OptionSection newSection = new OptionSection(sectionName);
            newSection.Items.Add(option);
            this.sections.Add(newSection);
        }
コード例 #13
0
 void addTrendlineOption(string text, EventHandler handler)
 {
     OptionInfo option = new OptionInfo (text, handler);
     Trendlines.Add (option);
     this.AddOption (option);
 }
コード例 #14
0
 void addIndicatorOption(string text, EventHandler handler)
 {
     OptionInfo option = new OptionInfo (text, handler);
     Indicators.Add (option);
     this.AddOption (option);
 }