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
// ------------------------------------------------------------------------------
//  <autogenerated>
//      This code was generated by a tool.
//      Mono Runtime Version: 2.0.50727.1433
// 
//      Changes to this file may cause incorrect behavior and will be lost if 
//      the code is regenerated.
//  </autogenerated>
// ------------------------------------------------------------------------------

// 
// This source code was auto-generated by Web Services Description Language Utility
//Mono Framework v2.0.50727.1433
//


/// <remarks/>
[System.Web.Services.WebServiceBinding(Name="GlobalWeatherSoap", Namespace="http://www.webserviceX.NET")]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
public partial class GlobalWeather : System.Web.Services.Protocols.SoapHttpClientProtocol {
    
    private System.Threading.SendOrPostCallback GetWeatherOperationCompleted;
    
    private System.Threading.SendOrPostCallback GetCitiesByCountryOperationCompleted;
    
    public GlobalWeather() {
        this.Url = "http://www.webservicex.net/globalweather.asmx";
    }
    
    public event GetWeatherCompletedEventHandler GetWeatherCompleted;
    
    public event GetCitiesByCountryCompletedEventHandler GetCitiesByCountryCompleted;
    
    /// <remarks>
///Get weather report for all major cities around the world.
///</remarks>
    [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://www.webserviceX.NET/GetWeather", RequestNamespace="http://www.webserviceX.NET", ResponseNamespace="http://www.webserviceX.NET", ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped, Use=System.Web.Services.Description.SoapBindingUse.Literal)]
    public string GetWeather(string CityName, string CountryName) {
        object[] results = this.Invoke("GetWeather", new object[] {
                    CityName,
                    CountryName});
        return ((string)(results[0]));
    }
    
    public System.IAsyncResult BeginGetWeather(string CityName, string CountryName, System.AsyncCallback callback, object asyncState) {
        return this.BeginInvoke("GetWeather", new object[] {
                    CityName,
                    CountryName}, callback, asyncState);
    }
    
    public string EndGetWeather(System.IAsyncResult asyncResult) {
        object[] results = this.EndInvoke(asyncResult);
        return ((string)(results[0]));
    }
    
    public void GetWeatherAsync(string CityName, string CountryName) {
        this.GetWeatherAsync(CityName, CountryName, null);
    }
    
    public void GetWeatherAsync(string CityName, string CountryName, object userState) {
        if ((this.GetWeatherOperationCompleted == null)) {
            this.GetWeatherOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetWeatherCompleted);
        }
        this.InvokeAsync("GetWeather", new object[] {
                    CityName,
                    CountryName}, this.GetWeatherOperationCompleted, userState);
    }
    
    private void OnGetWeatherCompleted(object arg) {
        if ((this.GetWeatherCompleted != null)) {
            System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
            this.GetWeatherCompleted(this, new GetWeatherCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
        }
    }
    
    /// <remarks>
///Get all major cities by country name(full / part).
///</remarks>
    [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://www.webserviceX.NET/GetCitiesByCountry", RequestNamespace="http://www.webserviceX.NET", ResponseNamespace="http://www.webserviceX.NET", ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped, Use=System.Web.Services.Description.SoapBindingUse.Literal)]
    public string GetCitiesByCountry(string CountryName) {
        object[] results = this.Invoke("GetCitiesByCountry", new object[] {
                    CountryName});
        return ((string)(results[0]));
    }
    
    public System.IAsyncResult BeginGetCitiesByCountry(string CountryName, System.AsyncCallback callback, object asyncState) {
        return this.BeginInvoke("GetCitiesByCountry", new object[] {
                    CountryName}, callback, asyncState);
    }
    
    public string EndGetCitiesByCountry(System.IAsyncResult asyncResult) {
        object[] results = this.EndInvoke(asyncResult);
        return ((string)(results[0]));
    }
    
    public void GetCitiesByCountryAsync(string CountryName) {
        this.GetCitiesByCountryAsync(CountryName, null);
    }
    
    public void GetCitiesByCountryAsync(string CountryName, object userState) {
        if ((this.GetCitiesByCountryOperationCompleted == null)) {
            this.GetCitiesByCountryOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetCitiesByCountryCompleted);
        }
        this.InvokeAsync("GetCitiesByCountry", new object[] {
                    CountryName}, this.GetCitiesByCountryOperationCompleted, userState);
    }
    
    private void OnGetCitiesByCountryCompleted(object arg) {
        if ((this.GetCitiesByCountryCompleted != null)) {
            System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
            this.GetCitiesByCountryCompleted(this, new GetCitiesByCountryCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
        }
    }
}

public partial class GetWeatherCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
    
    private object[] results;
    
    internal GetWeatherCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : 
            base(exception, cancelled, userState) {
        this.results = results;
    }
    
    public string Result {
        get {
            this.RaiseExceptionIfNecessary();
            return ((string)(this.results[0]));
        }
    }
}

public delegate void GetWeatherCompletedEventHandler(object sender, GetWeatherCompletedEventArgs args);

public partial class GetCitiesByCountryCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
    
    private object[] results;
    
    internal GetCitiesByCountryCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : 
            base(exception, cancelled, userState) {
        this.results = results;
    }
    
    public string Result {
        get {
            this.RaiseExceptionIfNecessary();
            return ((string)(this.results[0]));
        }
    }
}

public delegate void GetCitiesByCountryCompletedEventHandler(object sender, GetCitiesByCountryCompletedEventArgs args);

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