예제 #1
0
        public UserViewModel()
        {
            _UsersList = new List <User>
            {
                new User {
                    UserId = 1, FirstName = "Raj", LastName = "Beniwal", City = "Delhi", State = "DEL", Country = "INDIA"
                },
                new User {
                    UserId = 2, FirstName = "Mark", LastName = "henry", City = "New York", State = "NY", Country = "USA"
                },
                new User {
                    UserId = 3, FirstName = "Mahesh", LastName = "Chand", City = "Philadelphia", State = "PHL", Country = "USA"
                },
                new User {
                    UserId = 4, FirstName = "Vikash", LastName = "Nanda", City = "Noida", State = "UP", Country = "INDIA"
                },
                new User {
                    UserId = 5, FirstName = "Harsh", LastName = "Kumar", City = "Ghaziabad", State = "UP", Country = "INDIA"
                },
                new User {
                    UserId = 6, FirstName = "Reetesh", LastName = "Tomar", City = "Mumbai", State = "MP", Country = "INDIA"
                },
                new User {
                    UserId = 7, FirstName = "Deven", LastName = "Verma", City = "Palwal", State = "HP", Country = "INDIA"
                },
                new User {
                    UserId = 8, FirstName = "Ravi", LastName = "Taneja", City = "Delhi", State = "DEL", Country = "INDIA"
                }
            };

            _AllWebData = new GetWebData();
        }
예제 #2
0
 static void Main(string[] args)
 {
     #region 网页抓取
     GetWebData getWebData = getPageCon;
     getWebData.BeginInvoke(null, null); //异步执行网页读取
     LoadingAnimate();                   //loading 动画
     HanderData(pageData);
     #endregion
 }
예제 #3
0
        static void Main(string[] args)
        {
            #region List数组
            List <int> arr = new List <int>();
            for (var i = 0; i < 10; i++)
            {
                arr.Add(i);
                //Console.WriteLine();
            }
            #endregion
            #region 委托
            testWeiTuo wt = new testWeiTuo(intrr);
            wt += intss;
            wt("AA");
            openInt("Aa", intrr);
            #endregion
            #region Event CallBack
            AsyncFunction o = new AsyncFunction();
            //o.Fun();
            #endregion
            #region Timer
            Timer Timmer;
            //Timmer = new Timer();

            #endregion

            #region 网页抓取
            GetWebData getWebData = getPageCon;
            getWebData.BeginInvoke(null, null); //异步执行网页读取
            LoadingAnimate();
            if (pageData.Count > 0)
            {
                //Console.WriteLine(pageData[0]);
            }
            else
            {
                Console.WriteLine("没有读取到数据");
            }
            WebContent.Credentials = CredentialCache.DefaultCredentials;

            //Byte[] pageData = WebContent.DownloadData("https://movie.douban.com/top250"); //从指定网站下载数据
            //string pageHtml = Encoding.Default.GetString(pageData);  //如果获取网站页面采用的是GB2312,则使用这句
            //string pageHtml = Encoding.UTF8.GetString(pageData); //如果获取网站页面采用的是UTF-8,则使用这句
            //Console.WriteLine(pageHtml);//在控制台输入获取的内容
            //string[] getLink = GetLinks(pageHtml);//使用正则表达式获取页面链接

            //foreach (string Link in getLink)
            //{
            //    Console.WriteLine(Link);
            //}
            #endregion
            Console.ReadKey();
        }
예제 #4
0
        public DonateListViewModel()
        {
            PayListHistorys = new ObservableCollection <PayListHistory>();
            pWebData        = MainWindow.m_pAllWebData;

            getDonateListContent();
            getDonateHouseContent();
            ThreadPool.QueueUserWorkItem(new WaitCallback(RefreshList));
            string sDonateListDisplayMode = ConfigurationManager.AppSettings["DonateListDisplayMode"];

            if (sDonateListDisplayMode == @"1")
            {
                ThreadPool.QueueUserWorkItem(new WaitCallback(ReLoadData));
            }

            //ThreadPool.QueueUserWorkItem(new WaitCallback(RefreshHouseData));
        }
예제 #5
0
        public MainPage()
        {
            m_nRefreshTimeOutCount = 0;
            pWebData = MainWindow.m_pAllWebData;
            InitializeComponent();
            getPageRefreshTime();
            setDisplayByMode(strMode);
            string strDisplayInch = ConfigurationManager.AppSettings["DisplayInch"];

            if (strMode == "3")
            {
                try
                {
                    Media_play_Path = ConfigurationManager.AppSettings["Video_Path"];
                    string Media_play_Mode = ConfigurationManager.AppSettings["Video_Play_Mode"];
                    if (File.Exists(Media_play_Path))
                    {
                        MediaPlay.Source = new Uri(Media_play_Path);
                        if (Media_play_Mode == "None")
                        {
                            MediaPlay.Stretch = Stretch.Uniform;
                        }
                        else
                        {
                            MediaPlay.Stretch = Stretch.Fill;
                        }
                    }
                    else
                    {
                        this.MediaPlay.Close();
                        this.MediaPlay.Visibility = Visibility.Hidden;
                    }
                }
                catch (Exception ex)
                {
                }
            }
            else
            {
                if (pWebData != null)
                {
                    if (pWebData.m_pTempInfoData.success == true)
                    {
                        //显示寺庙介绍
                        setTempInfoData();
                        //设定寺院名字的图片
                        setTemplInfoNamePic();
                    }

                    if (pWebData.m_pMonkInfoData.success == true)
                    {
                        //显示法师ListView内容
                        displayMonkList();
                    }

                    if (pWebData.m_pActivityInfoData.success == true)
                    {
                        //获取寺庙活动的内容
                        getActiveInfoContent();
                        //显示寺庙活动在label上
                        if (strMode == "1")
                        {
                            DisplayActiveInfoContent();
                        }
                        //显示寺庙活动在listview中
                        DisplayActiveInfoContentInList();
                    }
                }
            }

            if (pWebData != null)
            {
                if (pWebData.m_pTempInfoData.success == true)
                {
                    //设定寺院名字的图片
                    setTemplInfoNamePic();
                }

                if (strDisplayInch != "19_4")
                {
                    if (pWebData.m_pqRCodeInfoData.success == true)
                    {
                        //设定在线功德二维码
                        setQRCodePic_Zxgdx();
                        //设定公众号二维码
                        setQRCodePic_Gzgzh();
                    }
                }

                if (pWebData.m_pHousePayHistoryData.success == true)
                {
                    //getDonateHouseContent();
                }
            }
            //显示捐赠listview内容
            displayDonateHouse();
            displayDonateList();
            if (strDisplayInch != "19_4")
            {
                Page_All_Refresh();
            }
        }
예제 #6
0
        //public MainPage(MainWindow parent)
        public MainPage()
        {
            pWebData = MainWindow.m_pAllWebData;
            InitializeComponent();
            //setWindowsShutDown();
//             WindowStartupLocation = WindowStartupLocation.Manual;
//             this.Left = 0;
//             this.Top = 0;
            //this.Topmost = true;
            /*ViewModel viewModel = new ViewModel();*/
            //this.DataContext = ParentWindow.AllWebData;
            //pWebData = ParentWindow.AllWebData;

            getPageRefreshTime();
            setDisplayByMode(strMode);

            if (strMode == "3")
            {
                Media_play_Path = ConfigurationManager.AppSettings["Video_Path"];
                string Media_play_Mode = ConfigurationManager.AppSettings["Video_Play_Mode"];
                MediaPlay.Source = new Uri(Media_play_Path);
                if (Media_play_Mode == "None")
                {
                    MediaPlay.Stretch = Stretch.Uniform;
                }
                else
                {
                    MediaPlay.Stretch = Stretch.Fill;
                }
            }
            else
            {
                if (pWebData != null)
                {
                    if (pWebData.m_pTempInfoData.success == true)
                    {
                        //显示寺庙介绍
                        setTempInfoData();
                        //设定寺院名字的图片
                        setTemplInfoNamePic();
                    }

                    if (pWebData.m_pMonkInfoData.success == true)
                    {
                        //显示法师ListView内容
                        displayMonkList();
                    }

                    if (pWebData.m_pActivityInfoData.success == true)
                    {
                        //获取寺庙活动的内容
                        getActiveInfoContent();
                        //显示寺庙活动在label上
                        if (strMode == "1")
                        {
                            DisplayActiveInfoContent();
                        }
                        //显示寺庙活动在listview中
                        DisplayActiveInfoContentInList();
                    }
                }
            }

            if (pWebData != null)
            {
                if (pWebData.m_pTempInfoData.success == true)
                {
                    //设定寺院名字的图片
                    setTemplInfoNamePic();
                }

                if (pWebData.m_pqRCodeInfoData.success == true)
                {
                    //设定二维码
                    setQRCodePic();
                }

                if (pWebData.m_pHousePayHistoryData.success == true)
                {
                    getDonateHouseContent();
                }
                if (pWebData.m_pTemplePayHistoryData.success == true)
                {
                    ////获取捐赠listview的内容
                    getDonateListContent();
                    //显示捐赠listview内容
                    displayDonateList();

                    //                     DisplayDonateListByTimer();
                }
            }
            Page_All_Refresh();
        }