Exemple #1
0
        //------------------------------------------------------------------------------

        /// <summary>
        ///   Return the last local log file. (when mode 4 or 5 is used). Note : Call TTrace.Flush() to ensure traces are saved
        /// </summary>

        public string GetLocalLogFile()
        {
            InternalWinTrace traceForm = TTrace.GetInternalTraceForm(Id, true);

            if (traceForm == null)
            {
                return("");
            }
            return(traceForm.LastLocalLogFileName);
        }
Exemple #2
0
        //------------------------------------------------------------------------------
        /// <summary>
        /// change the tree to display user defined multiple columns
        /// must be called before setting column titles. The first column is the main column
        /// </summary>

        public void SetMultiColumn()
        {
            InternalWinTrace traceForm = TTrace.GetInternalTraceForm(Id, true);

            traceForm.IsMultiColTree = true;

            StringList commandList = new StringList();

            commandList.Insert(0, String.Format("{0,5}{1,11}", TraceConst.CST_TREE_MULTI_COLUMN, 0));
            TTrace.SendToWinTraceClient(commandList, Id);
        }
Exemple #3
0
        //------------------------------------------------------------------------------

        /// <summary>
        /// set columns title
        /// </summary>
        /// <param name="titles">Tab separated columns titles
        /// Example : Title1 \t title2
        /// </param>
        public void SetColumnsTitle(string titles)
        {
            InternalWinTrace traceForm = TTrace.GetInternalTraceForm(Id, true);

            traceForm.IsMultiColTree = true;
            traceForm.TitleList      = titles;

            StringList commandList = new StringList();

            Helper.AddCommand(commandList, TraceConst.CST_TREE_COLUMNTITLE, titles);
            TTrace.SendToWinTraceClient(commandList, Id);
        }
Exemple #4
0
        //------------------------------------------------------------------------------

        /// <summary>
        /// change the tree to display user defined multiple columns
        /// must be called before setting column titles
        /// </summary>
        /// <param name="mainColIndex">The Main column index (default is 0)</param>

        public void SetMultiColumn(int mainColIndex)
        {
            InternalWinTrace traceForm = TTrace.GetInternalTraceForm(Id, true);

            traceForm.IsMultiColTree = true;
            traceForm.MainCol        = mainColIndex;

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

            commandList.Insert(0, String.Format("{0,5}{1,11}", TraceConst.CST_TREE_MULTI_COLUMN, mainColIndex));
            TTrace.SendToWinTraceClient(commandList, Id);
        }
Exemple #5
0
        //------------------------------------------------------------------------------

        /// <summary>
        ///   Set the log file.(Path is relative to the viewer). To enabled
        ///   log on local AND on the viewer call this function twice. To
        ///   don't use the viewer, set the TTrace.options.SendMode to
        ///   None.
        ///   <code>
        ///   The Mode can be one of the following :
        ///   0, Viewer Log is disabled.
        ///   1, Viewer log enabled. No size limit.
        ///   2, Viewer log enabled. A new file is create each day (CCYYMMDD is appended to the filename)
        ///   3, Local log is disabled
        ///   4, Local log enabled. No size limit. Ignored in silverlight 2
        ///   5, Local log enabled. A new file is create each day (CCYYMMDD is appended to the filename). Ignored in silverlight 2
        ///   </code>
        ///   </summary>
        ///   <param name="fileName">\File to open</param>
        ///   <param name="mode">Local and viewer site log mode. </param>
        ///   <param name="maxLines">Number of lines before starting a new
        ///                          \file (default \: \-1 = unlimited). </param>

        public void SetLogFile(string fileName, int mode, int maxLines)
        {
            // 3, Local log is disabled
            // 4, Local log enabled. No size limit.
            // 5, Local log enabled. A new file is create each day (CCYYMMDD is appended to the filename)
            if (mode >= 3)
            {
                InternalWinTrace traceForm = TTrace.GetInternalTraceForm(Id, true);
                if (traceForm == null)
                {
                    return;
                }
                traceForm.LogFileName = fileName;
                traceForm.LogFileType = mode;
                traceForm.MaxLines    = maxLines;
                // don't send anything to the viewer.
            }
            else
            {
                StringList commandList = new StringList();
                Helper.AddCommand(commandList, TraceConst.CST_LOGFILE, mode, maxLines, fileName);
                TTrace.SendToWinTraceClient(commandList, Id);
            }
        }