当前位置: 首页>>代码示例>>C#>>正文


C# Log.GetType方法代码示例

本文整理汇总了C#中Log.GetType方法的典型用法代码示例。如果您正苦于以下问题:C# Log.GetType方法的具体用法?C# Log.GetType怎么用?C# Log.GetType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Log的用法示例。


在下文中一共展示了Log.GetType方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: LogListener

 /// <summary>
 /// Initialize a new LogListener instance registered to receive Log Events from a 
 /// specific log.  By default, all log events are received.
 /// </summary>
 /// <param name="log">Log instance to register this listener with</param>
 public LogListener(Log log)
 {
     if ((log != null) && (log.GetType() != typeof(NullLog)))
     {
         log.OnLogMessageReceived += new LogEventHandler(OnLogMessageReceived);
         subscribedLog = log;
     }
 }
开发者ID:jrhay,项目名称:PortableKnowledge.Logging,代码行数:13,代码来源:LogListener.cs

示例2: Serialize

        public static void Serialize(string file, Log logSimulacion)
        {
            System.Xml.Serialization.XmlSerializer xs
                = new System.Xml.Serialization.XmlSerializer(logSimulacion.GetType());

            StreamWriter writer = File.CreateText(file);
            xs.Serialize(writer, logSimulacion);
            writer.Flush();
            writer.Close();
        }
开发者ID:dprolongo,项目名称:PBioService,代码行数:10,代码来源:Log.cs

示例3: ClassToXML

        /// <summary>
        /// 构造日志xml项
        /// </summary>
        /// <param name="doc">XmlDocument</param>
        /// <param name="log">日志对象</param>
        /// <returns>xmlnode</returns>
        private XmlNode ClassToXML(XmlDocument doc, Log log)
        {
            XmlElement elementnode = doc.CreateElement("log");

            PropertyInfo[] pinfo = log.GetType().GetProperties();

            for (int i = 0; i < pinfo.Length; i++)
            {
                XmlNode ele = doc.CreateElement(pinfo[i].Name);

                ele.InnerText = pinfo[i].GetValue(log, null).ToString();

                elementnode.AppendChild(ele);
            }

            return elementnode;
        }
开发者ID:ZoeCheck,项目名称:128_5.6_2010,代码行数:23,代码来源:Log.cs

示例4: GetLog

 public string GetLog(DateTime firstdt, DateTime lastdt, Log log)
 {
     StringBuilder sb = new StringBuilder();
     sb.Append("select * from log where timeline between '");
     sb.Append(firstdt);
     sb.Append("' and '");
     sb.Append(lastdt);
     sb.Append("'");
     foreach (var prop in log.GetType().GetProperties())
     {
         //시간 프로퍼티 중복 회피 위해
         if (prop.Name == "timeline")
         {
             continue;
         }
         sb.Append(" and ");
         sb.Append(prop.Name);
         if (prop.PropertyType == typeof(string))
         {
             sb.Append(" like '%");
             sb.Append(GetEscapedString(log[prop.Name].ToString(),true));
             sb.Append("%'");
             sb.Append(" escape '#'");
         }
         else
         {
             sb.Append(" = ");
             sb.Append(log[prop.Name]);
         }
     }
     return sb.ToString();
 }
开发者ID:hesed7,项目名称:hitpan,代码行数:32,代码来源:SQLDataQueryRepository.cs


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