コード例 #1
0
        //
        // GET: /Home/

        public ActionResult Index(string search)
        {
            if (search == null)
            {
                return(View());
            }

            List <string> html = new List <string>();

            ClientController my_client = new ClientController();
            UrlController    my_urls   = new UrlController(search);
            string           url_str   = my_urls.ResultURL;

            ParserController Htmlparser = new ParserController(my_client.sendRequest(url_str));


            Models.MainPageModel ParserModel = new Models.MainPageModel();

            ParserModel.setRequestResults(Htmlparser.workParser());

            List <string> htmlClean = new List <string>();
            string        res       = "";

            html = ParserModel.getRequestResults();
            foreach (string value in html)
            {
                res += value;
            }
            //должен браться из модели
            ViewBag.Result = res;

            return(View());
        }
コード例 #2
0
        public MainPageViewModel()
        {
            mainPageModel = new Models.MainPageModel();

            var mapper = Mappers.Xy <SampleChart>()
                         .X(model => model.DateTime.Ticks)
                         .Y(model => model.Value);

            Charting.For <SampleChart>(mapper);

            CurrentChartValues = new ChartValues <SampleChart>();
            PowerChartValues   = new ChartValues <SampleChart>();
            DateTimeFormatter  = value => new DateTime((long)value).ToString("HH:mm");

            AxisStep = TimeSpan.FromMinutes(15).Ticks;
            AxisUnit = TimeSpan.TicksPerMinute;


            SetAxisLimits(DateTime.Now);
            IsReading = true;


            if (IsReading)
            {
                Task.Factory.StartNew(RenderCurrentChart);
            }

            if (IsReading)
            {
                Task.Factory.StartNew(RenderPowerChart);
            }
        }