Beispiel #1
0
 /// <summary>
 /// Returns a hash code for this instance.
 /// </summary>
 /// <returns>A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.</returns>
 public override int GetHashCode()
 {
     return
         (ErrorCount.GetHashCode()
          ^ WarningCount.GetHashCode()
          ^ InfoCount.GetHashCode()
         );
 }
Beispiel #2
0
        /// <summary>
        /// 删除信息统计数据
        /// </summary>
        /// <returns></returns>
        public static int DeleteInfoCount(InfoCount obj)
        {
            int n = DBHelper.ExecuteNonQuery("Delete_InfoCount", CommandType.StoredProcedure,
                                             new SqlParameter[] {
                new SqlParameter("@A_No", obj.A_No)
            });

            return(n);
        }
Beispiel #3
0
        /// <summary>
        /// 获取全部信息统计信息
        /// </summary>
        /// <returns></returns>
        public static List <InfoCount> GetAllInfoCount()
        {
            List <InfoCount> list = new List <InfoCount>();
            SqlDataReader    dr   = DBHelper.ExecuteReader("Select_InfoCount", CommandType.StoredProcedure);

            while (dr.Read())
            {
                InfoCount infoCount = new InfoCount()
                {
                    A_No     = Convert.ToInt32(dr["A_No"]),
                    IC_Count = Convert.ToInt32(dr["IC_Count"])
                };
                list.Add(infoCount);
            }
            dr.Close();
            DBHelper.CloseCon();
            return(list);
        }
Beispiel #4
0
        /// <summary>
        /// 根据条件查询信息统计信息
        /// </summary>
        /// <returns></returns>
        public static InfoCount GetInfoCountByConn(string demandType, string demandContent)
        {
            string        sql       = "Select * from InfoCount where " + demandType + " = @" + demandType;
            InfoCount     infoCount = new InfoCount();
            SqlDataReader dr        = DBHelper.ExecuteReader(sql, CommandType.Text, new SqlParameter[] {
                new SqlParameter("@" + demandType, demandContent)
            });

            if (dr.Read())
            {
                infoCount = new InfoCount()
                {
                    A_No     = Convert.ToInt32(dr["A_No"]),
                    IC_Count = Convert.ToInt32(dr["IC_Count"])
                };
            }
            dr.Close();
            DBHelper.CloseCon();
            return(infoCount);
        }
Beispiel #5
0
 /// <summary>
 /// 删除信息统计数据
 /// </summary>
 /// <returns></returns>
 public static int DeleteInfoCount(InfoCount obj)
 {
     return(InfoCount_Service.DeleteInfoCount(obj));
 }
Beispiel #6
0
 /// <summary>
 /// 修改信息统计数据
 /// </summary>
 /// <returns></returns>
 public static int UpdateInfoCount(InfoCount obj)
 {
     return(InfoCount_Service.UpdateInfoCount(obj));
 }
Beispiel #7
0
 /// <summary>
 /// 添加信息统计数据
 /// </summary>
 /// <returns></returns>
 public static int InsertInfoCount(InfoCount obj)
 {
     return(InfoCount_Service.InsertInfoCount(obj));
 }
            public void OnWindowDraw()
            {
                // update the count of different types of logs
                RefreshCount();

                // update collapse logs count
                RefreshCollapseCount();

                // draw the clear button and show the toggles of lock scroll and three types of log filters
                GUILayout.BeginHorizontal();
                {
                    GUILayout.FlexibleSpace();
                    if (GUILayout.Button("Clear", GUILayout.Width(100f)))
                    {
                        m_logs.Clear();
                    }
                    m_collapse      = GUILayout.Toggle(m_collapse, "Collapse", GUILayout.Width(120f));
                    m_infoFilter    = GUILayout.Toggle(m_infoFilter, string.Format("Info ({0}) \t", InfoCount.ToString()), GUILayout.Width(80f));
                    m_warningFilter = GUILayout.Toggle(m_warningFilter, string.Format("Warning ({0}) \t", WarningCount.ToString()), GUILayout.Width(100f));
                    m_errorFilter   = GUILayout.Toggle(m_errorFilter, string.Format("Error ({0}) \t", ErrorCount.ToString()), GUILayout.Width(100f));
                    GUILayout.FlexibleSpace();
                    m_lockScroll = GUILayout.Toggle(m_lockScroll, "Lock Scroll", GUILayout.Width(100f));
                }
                GUILayout.EndHorizontal();

                // draw the log message console panel
                GUILayout.BeginVertical("box");
                {
                    if (m_lockScroll)
                    {
                        m_logScrollPosition.y = float.MaxValue;
                    }

                    m_logScrollPosition = GUILayout.BeginScrollView(m_logScrollPosition, GUILayout.Height(200f));
                    {
                        bool selected = false;
                        for (LinkedListNode <LogMsg> i = m_logs.First; i != null; i = i.Next)
                        {
                            switch (i.Value.LogType)
                            {
                            case LogType.Log:
                                if (!m_infoFilter)
                                {
                                    continue;
                                }
                                break;

                            case LogType.Warning:
                                if (!m_warningFilter)
                                {
                                    continue;
                                }
                                break;

                            case LogType.Error:
                                if (!m_errorFilter)
                                {
                                    continue;
                                }
                                break;
                            }

                            if (m_collapse)
                            {
                                LogType type     = i.Value.LogType;
                                string  msg      = i.Value.LogMessage;
                                string  stack    = i.Value.StackTrack;
                                string  keyCheck = type.ToString() + msg + stack;
                                if (m_collapseLogs[keyCheck] == i.Value)
                                {
                                    string s = string.Format("[{0}] {1} ", m_collapseCheckLogs[keyCheck], GetLogMsgString(i.Value));
                                    if (GUILayout.Toggle(m_selectedLog == i, s))
                                    {
                                        selected = true;
                                        if (m_selectedLog != i)
                                        {
                                            m_selectedLog         = i;
                                            m_stackScrollPosition = Vector2.zero;
                                        }
                                    }
                                }
                            }
                            else
                            {
                                // not collapse
                                if (GUILayout.Toggle(m_selectedLog == i, GetLogMsgString(i.Value)))
                                {
                                    selected = true;
                                    if (m_selectedLog != i)
                                    {
                                        m_selectedLog         = i;
                                        m_stackScrollPosition = Vector2.zero;
                                    }
                                }
                            }
                        }
                        if (!selected)
                        {
                            m_selectedLog = null;
                        }
                    }
                    GUILayout.EndScrollView();
                }
                GUILayout.EndVertical();

                // draw the log stack console panel
                GUILayout.BeginVertical("box");
                {
                    m_stackScrollPosition = GUILayout.BeginScrollView(m_stackScrollPosition, GUILayout.Height(100f));
                    {
                        if (m_selectedLog != null)
                        {
                            GUILayout.BeginHorizontal();
                            Color32 color = GetLogMsgColor(m_selectedLog.Value.LogType);
                            GUILayout.Label(string.Format("<color=#{0}{1}{2}{3}><b>{4}</b></color>", color.r.ToString("x2"), color.g.ToString("x2"), color.b.ToString("x2"), color.a.ToString("x2"), m_selectedLog.Value.LogMessage));
                            if (GUILayout.Button("COPY", GUILayout.Width(60f), GUILayout.Height(30f)))
                            {
                                TextEditor textEditor = new TextEditor();
                                textEditor.text = string.Format("{0}\n\n{1}", m_selectedLog.Value.LogMessage, m_selectedLog.Value.StackTrack);
                                textEditor.OnFocus();
                                textEditor.Copy();
                            }
                            GUILayout.EndHorizontal();
                            GUILayout.Label(m_selectedLog.Value.StackTrack);
                        }
                        GUILayout.EndScrollView();
                    }
                }
                GUILayout.EndVertical();
            }