当前位置: 首页>>代码示例>>C#>>正文


C# Get.AnalyseXMLResults方法代码示例

本文整理汇总了C#中Get.AnalyseXMLResults方法的典型用法代码示例。如果您正苦于以下问题:C# Get.AnalyseXMLResults方法的具体用法?C# Get.AnalyseXMLResults怎么用?C# Get.AnalyseXMLResults使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Get的用法示例。


在下文中一共展示了Get.AnalyseXMLResults方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: MainMenu

        public MainMenu(Window mw, Data h)
        {
            spWindow = new Window();
            spWindow.Height = SystemMetrics.ScreenHeight;
            spWindow.Width = SystemMetrics.ScreenWidth;

            HwDevices = h;

            Get xml = new Get("http://weather.yahooapis.com/forecastrss?w=" + HwDevices.WOEID + "&u=c.xml");
            HwDevices = xml.AnalyseXMLResults(HwDevices);

            Bitmap aux = Resources.GetBitmap(Resources.BitmapResources.Title);
            Image logo = new Image(aux);
            logo.Width = 250;
            logo.Height = 75;

            TemperatureData = new Text();
            HumidityData = new Text();

            TemperatureData.Font = Resources.GetFont(Resources.FontResources.NinaB);
            TemperatureData.ForeColor = Colors.DarkGray;
            TemperatureData.TextContent = "Temperature: " + HwDevices.ReadValue();
            if (HwDevices.fahrenheit)
                TemperatureData.TextContent += "F";
            else
                TemperatureData.TextContent += "C";

            HumidityData.Font = Resources.GetFont(Resources.FontResources.NinaB);
            HumidityData.ForeColor = Colors.DarkGray;
            HumidityData.TextContent = "Humidity: " + HwDevices.humidity+"%";
            aux = null;

            switch (HwDevices.getWeatherType())
            {
                case 0:
                    aux = Resources.GetBitmap(Resources.BitmapResources.warning);
                    break;
                case 1:
                    aux = Resources.GetBitmap(Resources.BitmapResources.sun);
                    break;
                case 2:
                    aux = Resources.GetBitmap(Resources.BitmapResources.cloudy);
                    break;
                case 3:
                    aux = Resources.GetBitmap(Resources.BitmapResources.moon);
                    break;
                case 4:
                    aux = Resources.GetBitmap(Resources.BitmapResources.cloud);
                    break;
                case 5:
                    aux = Resources.GetBitmap(Resources.BitmapResources.lightning__1_);
                    break;
                case 6:
                    aux = Resources.GetBitmap(Resources.BitmapResources.rainy);
                    break;
                case 7:
                    aux = Resources.GetBitmap(Resources.BitmapResources.rainy__1_);
                    break;
                case 8:
                    aux = Resources.GetBitmap(Resources.BitmapResources.snowy);
                    break;
                case 9:
                    aux = Resources.GetBitmap(Resources.BitmapResources.cloud__1_);
                    break;
                case 10:
                    aux = Resources.GetBitmap(Resources.BitmapResources.snowy__1_);
                    break;
            }
            Image weather = new Image(aux);
            weather.Width = weather.Height = 50;

            Text LocationText = new Text("Location: "+HwDevices.location);
            LocationText.Font = Resources.GetFont(Resources.FontResources.NinaB);
            LocationText.ForeColor = Colors.DarkGray;

            Text text2 = new Text();
            text2.Font = Resources.GetFont(Resources.FontResources.NinaB);
            text2.ForeColor = Colors.DarkGray;
            text2.TextContent = "Stats";
            text2.SetMargin(5);
            SimpleButton sb2 = new SimpleButton(text2, 130, 30);
            sb2.Click += new EventHandler(sb2_Click);

            Text text3 = new Text();
            text3.Font = Resources.GetFont(Resources.FontResources.NinaB);
            text3.ForeColor = Colors.DarkGray;
            text3.TextContent = "Settings";
            text3.SetMargin(5);
            SimpleButton sb3 = new SimpleButton(text3, 130, 30);
            sb3.Click += new EventHandler(sb3_Click);

            ImageButton refresh = new ImageButton(new ImageBrush(Resources.GetBitmap(Resources.BitmapResources.refresh)),30,30);
            refresh.Click += new EventHandler(refresh_Click);

            Canvas canvas = new Canvas();

            Canvas.SetTop(LocationText, 70);
            canvas.Children.Add(LocationText);

            Canvas.SetTop(TemperatureData, 100);
//.........这里部分代码省略.........
开发者ID:apalayret,项目名称:IHA_Project_North_Pole,代码行数:101,代码来源:MainMenu.cs


注:本文中的Get.AnalyseXMLResults方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。