Example #1
0
        //------------------------------------------------------------------------------

        /// <summary>
        /// Clear all the watches
        /// </summary>
        public void ClearAll()
        {
            List <string> commandList = new List <string>();

            commandList.Insert(0, String.Format("{0,5}", TraceConst.CST_CLEAR_ALL));
            TTrace.SendToWinWatchClient(commandList, Id);
        }
Example #2
0
        //------------------------------------------------------------------------------

        /// <summary>
        /// Clear all the watches
        /// </summary>
        public void Close()
        {
            List <string> commandList = new List <string>();

            commandList.Insert(0, String.Format("{0,5}", TraceConst.CST_CLOSE_WIN));
            TTrace.SendToWinWatchClient(commandList, Id);
        }
Example #3
0
        //------------------------------------------------------------------------------

        /// <summary>
        /// Put the window in foreground
        /// </summary>
        public void DisplayWin()
        {
            List <string> commandList = new List <string>();

            commandList.Insert(0, String.Format("{0,5}", TraceConst.CST_DISPLAY_TREE));
            TTrace.SendToWinWatchClient(commandList, Id);
        }
Example #4
0
        //------------------------------------------------------------------------------

        /// <summary>
        /// Send a watch
        /// </summary>
        /// <param name="watchName">Watch name</param>
        /// <param name="watchValue">Watch value</param>
        public void Send(string watchName, object watchValue)
        {
            if (Enabled == false)
            {
                return;
            }

            List <string> commandList = new List <string>();

            commandList.Insert(0, String.Format("{0,5}{1}", TraceConst.CST_WATCH_NAME, watchName));

            // create a node with same properties as "self" with new ID
            TraceNodeEx node = new TraceNodeEx(null, false);                                           // no parent, don't generate node id

            node.AddValue(watchValue, TTrace.Options.SendPrivate, TTrace.Options.ObjectTreeDepth, ""); // sendPrivate true , max 3 levels, no title
            node.Members.AddToStringList(commandList);                                                 // convert all groups and nested items/group to strings

            TTrace.SendToWinWatchClient(commandList, Id);
        }
Example #5
0
        //------------------------------------------------------------------------------

        /// <summary>
        /// WinWatch constructor. The Window Watch is create on the viewer (if not already done)
        /// </summary>
        /// <param name="winWatchId">Required window trace Id. If empty, a guid will be generated</param>
        /// <param name="winWatchText">The Window Title on the viewer.If empty, a default name will be used</param>
        public WinWatch(string winWatchId, string winWatchText) : this()
        {
            if (string.IsNullOrEmpty(winWatchId))
            {
                winWatchId = Helper.NewGuid().ToString();
            }

            Id = winWatchId;

            if (string.IsNullOrEmpty(winWatchText))
            {
                winWatchText = "Watches " + Id;
            }

            // create the trace window
            var commandList = new List <string>();

            commandList.Insert(0, String.Format("{0,5}{1}", TraceConst.CST_WINWATCH_NAME, winWatchText));
            TTrace.SendToWinWatchClient(commandList, Id);
        }