Click here to Skip to main content
Click here to Skip to main content
Add your own
alternative version

Tagged as

How we can write on C# in Linux: Implementing PanelApplet to Gnome Desktop

, 8 Mar 2010
This article describes how we can use our programming skills on the .NET framework to implement platform-independent code
appletSource1.zip
appletSource1
appletSource1.pidb
appletSource1.userprefs
appletSource1_Factory.server
bin
Debug
appletSource1.exe
appletSource1.exe.mdb
Data
weather.wsdl
Model
View
using System;
using System.IO;
using System.Text;
using System.Xml;
using System.Xml.Serialization;

namespace WeatherApplet.Data
{
	public class CurrentWeather
	{
		public string Location {get;set;}
		public string Time {get;set;}
		public string Wind {get;set;}
		public string Visibility {get;set;}
		public string SkyConditions {get;set;}
		public string Temperature {get;set;}
		public string DewPoint {get;set;}
		public string RelativeHumidity {get;set;}
		public string Pressure {get;set;}
		

		public CurrentWeather ()
		{
		}
		
		public static CurrentWeather Create(string xml)
		{
			 if (String.IsNullOrEmpty(xml))
                return new CurrentWeather();
                        
            try
            {
                XmlSerializer sr = new XmlSerializer(typeof(CurrentWeather));
                MemoryStream memoryStream = new MemoryStream(Encoding.UTF8.GetBytes(xml));
                               
                return (CurrentWeather)sr.Deserialize(memoryStream);
            }
            catch
            {
                return new CurrentWeather();
            }
		}
		
		
	}
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Ilya Builuk
Software Developer (Senior) Nokia
Germany Germany
Interested in design/development of framework functionality using the best patterns and practices.

| Advertise | Privacy | Mobile
Web01 | 2.8.140827.1 | Last Updated 9 Mar 2010
Article Copyright 2010 by Ilya Builuk
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid