コード例 #1
0
        private void WebClientDownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e)
        {
            try
            {
                if (e.Error == null)
                {
                    string s = e.Result.ToString().Replace(Environment.NewLine,string.Empty);
                    List<Symbol> symbolList = new List<Symbol>();

                    Regex re = null;
                    if (ReportDate >= DateTime.Today)
                    {
                        re = new Regex(Pattern1, RegexOptions.Multiline);
                    }
                    else
                    {
                        re = new Regex(Pattern2, RegexOptions.Multiline);
                    }
                    
                    MatchCollection mc = re.Matches(s);
                    {
                        foreach (Match m in mc)
                        {
                            Symbol symbol = new Symbol();
                            symbol.CompanyName = m.Groups["Company"].Value.ToString();
                            symbol.SymbolName = m.Groups["Ticker2"].Value.ToString();
                            if (m.Groups["Time"].Value.ToString().Equals("After Market Close"))
                            {
                                symbol.ReportDate = ReportDate.AddDays(1);
                            }
                            else
                            {
                                symbol.ReportDate = ReportDate;
                            }
                            symbolList.Add(symbol);
                        }
                    }

                    if (OnLoadDataComplete != null)
                    {
                        OnLoadDataComplete(this, symbolList);
                    }
                }
                else
                {
                    if (OnError != null) { OnError(this, e.Error); }
                }
            }
            catch (Exception ex)
            {
                if (OnError != null) { OnError(this, ex); }
            }
        }
コード例 #2
0
 /// <summary>
 /// Deprecated Method for adding a new object to the SymbolSet EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToSymbolSet(Symbol symbol)
 {
     base.AddObject("SymbolSet", symbol);
 }
コード例 #3
0
 private bool FilterSymbolSet(Symbol entity)
 {
     return (entity.SymbolName == this.SymbolName);
 }
コード例 #4
0
 /// <summary>
 /// Create a new Symbol object.
 /// </summary>
 /// <param name="symbolName">Initial value of the SymbolName property.</param>
 /// <param name="indexSymbolName">Initial value of the IndexSymbolName property.</param>
 /// <param name="companyName">Initial value of the CompanyName property.</param>
 public static Symbol CreateSymbol(global::System.String symbolName, global::System.String indexSymbolName, global::System.String companyName)
 {
     Symbol symbol = new Symbol();
     symbol.SymbolName = symbolName;
     symbol.IndexSymbolName = indexSymbolName;
     symbol.CompanyName = companyName;
     return symbol;
 }