Click here to Skip to main content
15,886,736 members
Articles / Mobile Apps / Android

Android - Stock Market Watch (COINS) in C# using Visual Studio 2010

Rate me:
Please Sign up or sign in to vote.
4.90/5 (102 votes)
24 Mar 2013CPOL23 min read 270.1K   10.1K   289  
Describes the power of C# in building professional application - Stock Market Watch with Charts on Android platform using Mono C#.
//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//     Runtime Version:4.0.30319.225
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

// 
// This source code was auto-generated by Microsoft.VSDesigner, Version 4.0.30319.225.
// 
#pragma warning disable 1591

namespace COINSMobile.stockwebservice {
    using System;
    using System.Web.Services;
    using System.Diagnostics;
    using System.Web.Services.Protocols;
    using System.ComponentModel;
    using System.Xml.Serialization;
    
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.0.30319.1")]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    [System.Web.Services.WebServiceBindingAttribute(Name="Stock WebserviceSoap", Namespace="http://stock.webservice.net.in")]
    public partial class StockWebservice : System.Web.Services.Protocols.SoapHttpClientProtocol {
        
        private System.Threading.SendOrPostCallback StockExistsOperationCompleted;
        
        private System.Threading.SendOrPostCallback GetStockQuoteOperationCompleted;
        
        private bool useDefaultCredentialsSetExplicitly;
        
        /// <remarks/>
        public StockWebservice() {
            this.Url = "http://stock.webservice.net.in/stockquoteservice.asmx";
            if ((this.IsLocalFileSystemWebService(this.Url) == true)) {
                this.UseDefaultCredentials = true;
                this.useDefaultCredentialsSetExplicitly = false;
            }
            else {
                this.useDefaultCredentialsSetExplicitly = true;
            }
        }
        
        public new string Url {
            get {
                return base.Url;
            }
            set {
                if ((((this.IsLocalFileSystemWebService(base.Url) == true) 
                            && (this.useDefaultCredentialsSetExplicitly == false)) 
                            && (this.IsLocalFileSystemWebService(value) == false))) {
                    base.UseDefaultCredentials = false;
                }
                base.Url = value;
            }
        }
        
        public new bool UseDefaultCredentials {
            get {
                return base.UseDefaultCredentials;
            }
            set {
                base.UseDefaultCredentials = value;
                this.useDefaultCredentialsSetExplicitly = true;
            }
        }
        
        /// <remarks/>
        public event StockExistsCompletedEventHandler StockExistsCompleted;
        
        /// <remarks/>
        public event GetStockQuoteCompletedEventHandler GetStockQuoteCompleted;
        
        /// <remarks/>
        [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://stock.webservice.net.in/StockExists", RequestNamespace="http://stock.webservice.net.in", ResponseNamespace="http://stock.webservice.net.in", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
        public string StockExists(string symbol) {
            object[] results = this.Invoke("StockExists", new object[] {
                        symbol});
            return ((string)(results[0]));
        }
        
        /// <remarks/>
        public void StockExistsAsync(string symbol) {
            this.StockExistsAsync(symbol, null);
        }
        
        /// <remarks/>
        public void StockExistsAsync(string symbol, object userState) {
            if ((this.StockExistsOperationCompleted == null)) {
                this.StockExistsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnStockExistsOperationCompleted);
            }
            this.InvokeAsync("StockExists", new object[] {
                        symbol}, this.StockExistsOperationCompleted, userState);
        }
        
        private void OnStockExistsOperationCompleted(object arg) {
            if ((this.StockExistsCompleted != null)) {
                System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
                this.StockExistsCompleted(this, new StockExistsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
            }
        }
        
        /// <remarks/>
        [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://stock.webservice.net.in/GetStockQuote", RequestNamespace="http://stock.webservice.net.in", ResponseNamespace="http://stock.webservice.net.in", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
        public string GetStockQuote(string symbol) {
            object[] results = this.Invoke("GetStockQuote", new object[] {
                        symbol});
            return ((string)(results[0]));
        }
        
        /// <remarks/>
        public void GetStockQuoteAsync(string symbol) {
            this.GetStockQuoteAsync(symbol, null);
        }
        
        /// <remarks/>
        public void GetStockQuoteAsync(string symbol, object userState) {
            if ((this.GetStockQuoteOperationCompleted == null)) {
                this.GetStockQuoteOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetStockQuoteOperationCompleted);
            }
            this.InvokeAsync("GetStockQuote", new object[] {
                        symbol}, this.GetStockQuoteOperationCompleted, userState);
        }
        
        private void OnGetStockQuoteOperationCompleted(object arg) {
            if ((this.GetStockQuoteCompleted != null)) {
                System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
                this.GetStockQuoteCompleted(this, new GetStockQuoteCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
            }
        }
        
        /// <remarks/>
        public new void CancelAsync(object userState) {
            base.CancelAsync(userState);
        }
        
        private bool IsLocalFileSystemWebService(string url) {
            if (((url == null) 
                        || (url == string.Empty))) {
                return false;
            }
            System.Uri wsUri = new System.Uri(url);
            if (((wsUri.Port >= 1024) 
                        && (string.Compare(wsUri.Host, "localHost", System.StringComparison.OrdinalIgnoreCase) == 0))) {
                return true;
            }
            return false;
        }
    }
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.0.30319.1")]
    public delegate void StockExistsCompletedEventHandler(object sender, StockExistsCompletedEventArgs e);
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.0.30319.1")]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    public partial class StockExistsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
        
        private object[] results;
        
        internal StockExistsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : 
                base(exception, cancelled, userState) {
            this.results = results;
        }
        
        /// <remarks/>
        public string Result {
            get {
                this.RaiseExceptionIfNecessary();
                return ((string)(this.results[0]));
            }
        }
    }
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.0.30319.1")]
    public delegate void GetStockQuoteCompletedEventHandler(object sender, GetStockQuoteCompletedEventArgs e);
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.0.30319.1")]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    public partial class GetStockQuoteCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
        
        private object[] results;
        
        internal GetStockQuoteCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : 
                base(exception, cancelled, userState) {
            this.results = results;
        }
        
        /// <remarks/>
        public string Result {
            get {
                this.RaiseExceptionIfNecessary();
                return ((string)(this.results[0]));
            }
        }
    }
}

#pragma warning restore 1591

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)


Written By
Architect ClarityCX Solutions & Services Pvt. Ltd.
India India
Sandip is a "Software Architect, CEO, Founder at ClarityCX Solutions & Services Private Limited"

He has 24 years of rich experience working in software development in the areas of market research, web, mobile and e-commerce.

Sandip has wide ranging experience in C#, VB.NET, ASP.Net, JQuery, JSON, LINQ, WCF, WPF, NodeJs, MongoDB, AngularJS, Express, Silverlight, SOA, Android, IPhone, IPad and Windows Mobile applications.

Specialized in Hybrid and Native Apps in iOS, Android, Windows Phone, Blackberry, Symbian, Tizen, WebOS.

Sandip can be reached at sandip.net@gmail.com
Tweet: @sandipnascar
FB: https:sandipnascar
View My Page

Comments and Discussions