• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# DebugDelegate类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中DebugDelegate的典型用法代码示例。如果您正苦于以下问题:C# DebugDelegate类的具体用法?C# DebugDelegate怎么用?C# DebugDelegate使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



DebugDelegate类属于命名空间,在下文中一共展示了DebugDelegate类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: Send

     public static void Send(string gmailuser, string password, string to, string subject, string message, TradeLink.API.DebugDelegate deb)
     {
         d = deb;
         try
         {
             MailMessage mail = new MailMessage();
             System.Net.NetworkCredential cred = new System.Net.NetworkCredential
 (gmailuser, password);
             mail.To.Add(to);
             mail.Subject = subject;
             mail.From = new MailAddress(gmailuser);
             mail.IsBodyHtml = true;
             mail.Body = message;
             SmtpClient smtp = new SmtpClient("smtp.gmail.com");
             smtp.UseDefaultCredentials = false;
             smtp.EnableSsl = true;
             smtp.Credentials = cred;
             smtp.Port = 587;
             smtp.SendCompleted += new SendCompletedEventHandler(s_SendCompleted);
             smtp.Send(mail);
         }
         catch (Exception ex)
         {
             debug("Error sending email from: " + gmailuser + " to: " + to + " subject: " + subject + " err: " + ex.Message + ex.StackTrace);
         }
     }
开发者ID:bluejack2000,项目名称:core,代码行数:26,代码来源:Email.cs


示例2: ServerSterling

 public ServerSterling(TLServer tls, int sleepOnNodata, int sleepAfterOrder, DebugDelegate deb)
 {
     SendDebug = deb;
     tl = tls;
     _SLEEP = 50;
     _ORDERSLEEP = sleepAfterOrder;
 }
开发者ID:antonywu,项目名称:tradelink,代码行数:7,代码来源:ServerSterling.cs


示例3: Qdl2GT

        /// <summary>
        /// takes all or part of quandl object and converts it into GT
        /// </summary>
        /// <param name="ro"></param>
        /// <param name="datecol"></param>
        /// <param name="valcol"></param>
        /// <param name="startrow"></param>
        /// <param name="endrow"></param>
        /// <returns></returns>
        public static GenericTracker<decimal> Qdl2GT(RootObject ro, string datecol, string valcol, int startrow, int endrow, DebugDelegate d)
        {
            // get columns
            var datecolidx = GetQdlColidx(ro,datecol);
            var valcolidx = GetQdlColidx(ro,valcol);
            // slice out the data
            var subset = GetAllRows(ro, startrow, endrow, d);
            // get date column
            var dates = QdlCol2Dates( GetColumn(subset, datecolidx));
            var vals =QdlCol2Vals( GetColumn(subset, valcolidx));
            // populate GT
            GenericTracker<decimal> gt = new GenericTracker<decimal>(dates.Count);
            for (int i = 0; i < dates.Count; i++)
            {
                var val = vals[i];
                var dt = dates[i];
                if (val == qh.ERROR_VALUE)
                    continue;
                if (dt == qh.ERROR_DATE)
                    continue;
                var tldate = Util.ToTLDate(dt);
                gt.addindex(tldate.ToString("F0"), val);
                

            }
            return gt;

            

            
        }
开发者ID:bluejack2000,项目名称:core,代码行数:40,代码来源:QuandlHelper.cs


示例4: RunHelper

 public RunHelper(VoidDelegate start, VoidDelegate end, DebugDelegate deb, string name)
 {
     OnStart = start;
     OnEnd = end;
     Name = name;
     OnDebug = deb;
     bw.DoWork += new System.ComponentModel.DoWorkEventHandler(bw_DoWork);
     bw.WorkerReportsProgress = false;
 }
开发者ID:bluejack2000,项目名称:core,代码行数:9,代码来源:RunHelper.cs


示例5: ConvertMap

 public ConvertMap(List<int> importmap, List<string> custval, ConvertMapType t, bool ignoreinvalid, DebugDelegate deb, DebugDelegate stat)
 {
     cust = custval;
     ignoreinvalidtick = ignoreinvalid;
     inp = importmap;
     type = t;
     SendDebugEvent = deb;
     SendStatusEvent = stat;
 }
开发者ID:antonywu,项目名称:tradelink,代码行数:9,代码来源:GenericCSVConvertMap.cs


示例6: hasMaxFails

        public static bool hasMaxFails(string task, int maxfail, DebugDelegate deb)
        {
            var t = GetTask(task);
            bool max = t.isValid && (t.Successes == 0) && (t.Failures > maxfail);
            if (max && (deb != null))
                deb(task + " hit maximum failures " + t.Failures + " with no success.");

            return max;
        }
开发者ID:bluejack2000,项目名称:core,代码行数:9,代码来源:TaskStatus.cs


示例7: SkinImpl

 public SkinImpl(object response, string responsename, string dll, DebugDelegate deb)
 {
     // save class name
     _class = responsename;
     // save dll
     if (havedll(dll))
         _dll = dll;
     // serialize props and save
     _props = serializeprops(GetType(_class, _dll), response,deb);
 }
开发者ID:bluejack2000,项目名称:core,代码行数:10,代码来源:SkinImpl.cs


示例8: ServerNxCore

        public ServerNxCore(TLServer tls, string filename, int SaveStateInterval, bool Verbose, DebugDelegate debugs)
        {
            _fn = filename;
            _islive = _fn == LIVEFEED;
            _nxsyms.NewTxt += new TextIdxDelegate(_syms_NewTxt);
            SendDebugEvent = debugs;
            SaveStateIntervalSec = SaveStateInterval;
            VerboseDebugging = Verbose;
            d = debugs;
            debug(Util.TLSIdentity());
            _proc = new System.Threading.Thread(proc);
            tl = tls;
            tl.newProviderName = Providers.Nanex;
            tl.newFeatureRequest += new MessageArrayDelegate(ServerNxCore_newFeatureRequest);
            tl.newRegisterSymbols += new SymbolRegisterDel(tl_newRegisterSymbols);
            savestateint = (uint)(SaveStateIntervalSec * 1000);
            debug((tl.VerboseDebugging ? "Verbose is on" : "Verbose is off"));
            if (isLive)
            {
                debug("Running in live mode.");
                DOLIVESKIPTEST = true;
                // if live and no previous state, remove old state files
                if (!hasstate)
                {
                    debug("No state file found for today, removing previous states...");
                    System.IO.DirectoryInfo di = new System.IO.DirectoryInfo(Util.ProgramData(PROGRAM));
                    System.IO.FileInfo[] fis = di.GetFiles("nxstate.*.tmp");
                    foreach (System.IO.FileInfo fi in fis)
                    {
                        try
                        {

                            System.IO.File.Delete(fi.FullName);
                            debug("removed: " + fi.FullName);
                        }
                        catch { }
                    }
                }
                else
                {
                    debug("Will use saved state to advance tape position at startup: " + statefilepath);
                    _fn = statefilepath;
                }
                DOSAVESTATE = SaveStateIntervalSec != 0;
                if (DOSAVESTATE)
                    debug("Will save tape position every: " + SaveStateIntervalSec + " seconds.");
                else
                    debug("State saving disabled because SaveStateInterval is 0");

            }

        }
开发者ID:antonywu,项目名称:tradelink,代码行数:52,代码来源:ServerNxCore.cs


示例9: ServerRithmic

 public ServerRithmic(TLServer tls, DebugDelegate dd)
 {
     debs = dd;
     tl = tls;
     
     // set defaults
     PRI_bLoggedIntoMd = false;
     PRI_bGotPriceIncrInfo = false;
     PRI_oAccount = null;
     PRI_bGotAccounts = false;
     PRI_bLoggedIntoTs = false;
     PRI_bOrderComplete = false;
 }
开发者ID:antonywu,项目名称:tradelink,代码行数:13,代码来源:ServerRithmic.cs


示例10: Prompt

 public static void Prompt(string program, string basepath, AuthInfo ai, bool pause, string promptmsg, DebugDelegate deb)
 {
     PROGRAM = program;
     BASEPATH = basepath+"\\";
     aip = new AuthInfoPrompt(ai);
     aip.status(promptmsg);
     aip.NewAuthInfo += new AuthInfoDelegate(aip_NewAuthInfo);
     d = deb;
     if (pause)
         aip.ShowDialog();
     else
         aip.Show();
 }
开发者ID:antonywu,项目名称:tradelink,代码行数:13,代码来源:AuthInfoPrompt.cs


示例11: UploadTodaysTicks

 /// <summary>
 /// upload todays tickdata to a portal
 /// </summary>
 /// <param name="space"></param>
 /// <param name="un"></param>
 /// <param name="pw"></param>
 /// <param name="ticket"></param>
 /// <param name="workpath"></param>
 /// <param name="debug"></param>
 /// <returns></returns>
 public static bool UploadTodaysTicks(string space, string un, string pw, int ticket, string workpath, DebugDelegate debug)
 {
     bool r = true;
     try
     {
         List<string> files = TikUtil.GetFilesFromDate();
         string fn = workpath + "\\TickData." + Util.ToTLDate() + ".zip";
         r &= ZipFile(fn, files, string.Empty, debug);
         if (TradeLink.AppKit.AssemblaDocument.Create(space, un, pw, fn, ticket, false))
         {
             if (debug != null)
             {
                 debug("tick data upload succeeded for: " + fn);
             }
         }
         else
         {
             if (debug != null)
             {
                 r &= false;
                 debug("tick data upload failed for: " + fn);
             }
         }
         if (System.IO.File.Exists(fn))
         {
             try
             {
                 System.IO.File.Delete(fn);
             }
             catch (Exception ex)
             {
                 r &= false;
                 if (debug != null)
                 {
                     debug("unable to delete local copy: " + fn);
                     debug(ex.Message + ex.StackTrace);
                 }
             }
         }
     }
     catch (Exception ex)
     {
         r &= false;
         if (debug != null)
         {
             debug("unknown error uploading ticks. ");
             debug(ex.Message + ex.StackTrace);
         }
     }
     return r;
 }
开发者ID:bluejack2000,项目名称:core,代码行数:61,代码来源:AssemblaUtil.cs


示例12: FromAssembly

 /// <summary>
 /// Create a single Response from an Assembly containing many Responses. 
 /// </summary>
 /// <param name="a"></param>
 /// <param name="fullname"></param>
 /// <param name="deb"></param>
 /// <returns></returns>
 public static Response FromAssembly(System.Reflection.Assembly a, string fullname, DebugDelegate deb)
 {
     try
     {
         return FromAssembly(a, fullname);
     }
     catch (Exception ex)
     {
         if (deb != null)
         {
             deb(ex.Message + ex.StackTrace);
         }
     }
     return null;
 }
开发者ID:antonywu,项目名称:tradelink,代码行数:22,代码来源:ResponseLoader.cs


示例13: FromDLL

        /// <summary>
        /// Create a single Response from a DLL containing many Responses.  
        /// </summary>
        /// <param name="fullname"></param>
        /// <param name="dllname"></param>
        /// <param name="deb"></param>
        /// <returns></returns>
        public static Response FromDLL(string fullname, string dllname, DebugDelegate deb)
        {
            try
            {
                return FromDLL(fullname, dllname);
            }
            catch (Exception ex)
            {
                if (deb != null)
                {
                    deb(ex.Message + ex.StackTrace);

                }
            }
            return null;
        }
开发者ID:antonywu,项目名称:tradelink,代码行数:23,代码来源:ResponseLoader.cs


示例14: TLServer_IP

 public TLServer_IP(string ipaddr, int port, int wait, int TickBufferSize, DebugDelegate deb)
 {
     SendDebugEvent = deb;
     if (TickBufferSize == 0)
         _queueb4send = false;
     else
         tickq = new RingBuffer<Tick>(TickBufferSize);
     MinorVer = Util.ProgramBuild(Util.PROGRAM,debug);
     _wait = wait;
     if (!IPUtil.isValidAddress(ipaddr))
         debug("Not valid ip address: " + ipaddr + ", using localhost.");
     _addr = IPUtil.isValidAddress(ipaddr) ? IPAddress.Parse(ipaddr) : IPAddress.Loopback;
     _port = port;
     v("tlserver_ip wait: " + _wait);
     Start();
 }
开发者ID:sopnic,项目名称:larytet-master,代码行数:16,代码来源:TLServer_IP.cs


示例15: run

        public static RunHelper run(VoidDelegate start, VoidDelegate complete, DebugDelegate deb, string name)
        {
            debs = deb;
            RunHelper rh = new RunHelper();
            if (rh.isBusy)
            {
                debug("must wait until previous job completed. " + name);
                return rh;
            }
            if (start == null)
                throw new Exception("cannot pass a null start delegate to run helper!");
            rh = new RunHelper(start, complete, deb, name);

            rh.bw.RunWorkerAsync(rh);


            return rh;
        }
开发者ID:wang-shun,项目名称:tradelink,代码行数:18,代码来源:RunHelper.cs


示例16: SetAuthInfo

 public static bool SetAuthInfo(string file, AuthInfo ai, DebugDelegate deb)
 {
     try
     {
         System.IO.StreamWriter sw = new System.IO.StreamWriter(file, false);
         sw.WriteLine(ai.Username);
         sw.WriteLine(ai.Password);
         sw.Close();
         return true;
     }
     catch (Exception ex)
     {
         if (deb != null)
         {
             deb("error saving file: " + file + " with: " + ex.Message + ex.StackTrace);
         }
     }
     return false;
 }
开发者ID:bluejack2000,项目名称:core,代码行数:19,代码来源:AuthInfo.cs


示例17: Serialize

 public static string Serialize(HistSimIndex hsi, DebugDelegate debug)
 {
     try
     {
         hsi.packTOC();
         XmlSerializer xs = new XmlSerializer(typeof(HistSimIndex));
         StringWriter fs = new StringWriter();
         xs.Serialize(fs, hsi);
         fs.Close();
         string msg = fs.GetStringBuilder().ToString();
         return GZip.Compress(msg);
     }
     catch (Exception ex)
     {
         if (debug != null)
             debug(ex.Message + ex.StackTrace);
     }
     return string.Empty;
 }
开发者ID:bluejack2000,项目名称:core,代码行数:19,代码来源:HistSimIndex.cs


示例18: GetUserResponseName

        public static string GetUserResponseName(string dll, DebugDelegate debs)
        {
            rname = string.Empty;

            // get all responses
            var all = TradeLink.Common.ResponseLoader.GetResponseList(dll,debs);

            // prompt user
            ResponseList rl = new ResponseList(all);
            rl.ResponseSelected += new DebugDelegate(rl_ResponseSelected);
            if (rl.ShowDialog() != DialogResult.OK)
            {
                rname = string.Empty;
                if (debs != null)
                    debs("User canceled response name selection.");
            }
            rl = null;

            // return result
            return rname;
        }
开发者ID:bluejack2000,项目名称:core,代码行数:21,代码来源:ResponseList.cs


示例19: GetAuthInfo

 public static AuthInfo GetAuthInfo(string filepath,DebugDelegate deb)
 {
     AuthInfo ai = new AuthInfo();
     try
     {
         System.IO.StreamReader sr = new System.IO.StreamReader(filepath);
         // skip user
         ai.Username = sr.ReadLine();
         // get password
         ai.Password = sr.ReadLine();
         sr.Close();
         return ai;
     }
     catch (Exception ex)
     {
         if (deb != null)
         {
             deb("exception opening: "+filepath+" "+ex.Message + ex.StackTrace);
         }
     }
     return ai;
 }
开发者ID:bluejack2000,项目名称:core,代码行数:22,代码来源:AuthInfo.cs


示例20: FromAssembly

        /// <summary>
        /// Create a single Response from an Assembly containing many Responses. 
        /// </summary>
        /// <param name="a">the assembly object</param>
        /// <param name="boxname">The fully-qualified Response Name (as in Response.FullName).</param>
        /// <returns></returns>
        public static Response FromAssembly(System.Reflection.Assembly a, string fullname, DebugDelegate deb)
        {
            Response b = null;
            try
            {

                Type type;
                object[] args;
                
                // get class from assembly
                type = a.GetType(fullname, true, true);
                args = new object[] { };
                // create an instance of type and cast to response
                b = (Response)Activator.CreateInstance(type, args);
                // if it doesn't have a name, add one
                if (b.Name == string.Empty)
                {
                    b.Name = type.Name;
                }
                if (b.FullName == string.Empty)
                {
                    b.FullName = type.FullName;
                }
                return b;
            }
            catch (Exception ex)
            {
                if (deb != null)
                {
                    deb(ex.Message + ex.StackTrace);
                }
                b = new InvalidResponse();
                b.Name = ex.Message + ex.StackTrace;
                return b;
            }
        }
开发者ID:bluejack2000,项目名称:core,代码行数:42,代码来源:ResponseLoader.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# DebugLevel类代码示例发布时间:2022-05-24
下一篇:
C# Dealer类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap