Пример #1
0
        public ShowTable(Vendjuuren.Domotica.Library.Table table)
            : this()
        {
            switch (table)
              {
            case Vendjuuren.Domotica.Library.Table.Logs:
              LogCollection logCollection = new LogCollection();
              logCollection.GetAll();
              List<Log> logs = new List<Log>();

              foreach (Log log in logCollection)
              {
            logs.Add(log);
              }
              dataGridView.DataSource = logs;
              break;
            case Vendjuuren.Domotica.Library.Table.Programs:
              ProgramCollection programCollection = new ProgramCollection();
              programCollection.GetAll();
              List<Vendjuuren.Domotica.Library.Program> programs = new List<Vendjuuren.Domotica.Library.Program>();

              foreach (Vendjuuren.Domotica.Library.Program program in programCollection)
              {
            programs.Add(program);
              }
              dataGridView.DataSource = programs;
              break;
              }
              dataGridView.Update();
        }
Пример #2
0
 public LogCollection FetchAll()
 {
     LogCollection coll = new LogCollection();
     Query qry = new Query(Log.Schema);
     coll.LoadAndCloseReader(qry.ExecuteReader());
     return coll;
 }
        /// <summary>
        /// Reads all log messages from the supplied file.
        /// </summary>
        public static void Compact(ICollection<string> inputFileNames, string outputFileName)
        {
            LogCollection logs = new LogCollection();

            foreach (var file in inputFileNames)
            {
                using (var stream = new FileStream(file, FileMode.Open, FileAccess.Read, FileShare.Read))
                {
                    if (stream.ReadBoolean())
                    {
                        //Wrong File Version
                        break;
                    }
                    if (stream.ReadNextByte() != 1)
                    {
                        //Wrong File Version
                        break;
                    }
                    using (var zipStream = new DeflateStream(stream, CompressionMode.Decompress, true))
                    using (var bs = new BufferedStream(zipStream, 8192))
                    {
                        while (bs.ReadBoolean())
                        {
                            var message = new LogMessage(bs);
                            logs.Pass1(message);
                        }
                    }
                }
            }

            logs.Compact();
            foreach (var file in inputFileNames)
            {
                using (var stream = new FileStream(file, FileMode.Open, FileAccess.Read, FileShare.Read))
                {
                    if (stream.ReadBoolean())
                    {
                        //Wrong File Version
                        break;
                    }
                    if (stream.ReadNextByte() != 1)
                    {
                        //Wrong File Version
                        break;
                    }
                    using (var zipStream = new DeflateStream(stream, CompressionMode.Decompress, true))
                    using (var bs = new BufferedStream(zipStream, 8192))
                    {
                        while (bs.ReadBoolean())
                        {
                            var message = new LogMessage(bs);
                            logs.Pass2(message);
                        }
                    }
                }
            }
            logs.Save(outputFileName);
        }
Пример #4
0
 public Span(string operationName, DateTimeOffset startTimestamp, ISpanContext spanContext, ISpanRecorder spanRecorder)
 {
     _state         = 0;
     _spanRecorder  = spanRecorder ?? throw new ArgumentNullException(nameof(spanRecorder));
     SpanContext    = spanContext ?? throw new ArgumentNullException(nameof(spanContext));
     Tags           = new TagCollection();
     Logs           = new LogCollection();
     OperationName  = operationName;
     StartTimestamp = startTimestamp;
 }
Пример #5
0
        private void EngineOnLog(object sender, LogEventArgs e)
        {
            LastSiusMessage = e.Message;
            LogCollection.Add(e.Message);

            while (LogCollection.Count > 20)
            {
                LogCollection.RemoveAt(0);
            }
        }
Пример #6
0
 public void Insert(LoggingEvent loggingEvent)
 {
     if (LogCollection != null)
     {
         BsonDocument doc = LoggingEventToBSON(loggingEvent);
         if (doc != null)
         {
             LogCollection.InsertOne(doc);
         }
     }
 }
 internal ServerState(
     Guid id,
     long term,
     Guid? votedFor,
     LogCollection logs)
 {
     _id = id;
     _term = term;
     _votedFor = votedFor;
     _logs = logs;
 }
Пример #8
0
        public void ParsingFromLogFile()
        {
            using (Stream fileStream = File.OpenRead(@"..\..\..\Data\Samples\TestLogParser.log"))
            {
                LogCollection lineParse = new LogCollection('|', "Time|ThreadId|Level|Ndc");

                lineParse.ParseLogFile(fileStream);

                Assert.AreEqual(15, lineParse.ElementsLog.Count);
            }
        }
Пример #9
0
        public void DoubleLineParsing()
        {
            LogCollection lineParse = new LogCollection('|', "Time|ThreadId|Level|Ndc");

            lineParse.ParseLogLine(@"2008-12-22 09:16:02,734|[4904]|INFO|Hsl.UniversalHost.|Core.Component|Manager [ComponentManager.Start] - Starting all components.");
            lineParse.ParseLogLine(@" 2008-12-22 09:16:02,734|[4904]FAIL|Hsl3");

            Assert.AreEqual(
                "Hsl.UniversalHost.|Core.Component|Manager [ComponentManager.Start] - Starting all components. 2008-12-22 09:16:02,734|[4904]FAIL|Hsl3",
                ((ParsedElementBase)lineParse.ElementsLog[0].Elements[3]).Element);
        }
Пример #10
0
 internal ServerState(
     Guid id,
     long term,
     Guid?votedFor,
     LogCollection logs)
 {
     _id       = id;
     _term     = term;
     _votedFor = votedFor;
     _logs     = logs;
 }
Пример #11
0
        private void BackupDataWithNoIntersection(
            IEnumerable <KeyValuePair <BackupDataLogKey, BackupDataLogValue> > intersectingLogs,
            BackupDataLogKey logKey, KeyValuePair <long, int> area, OnDisk.File.IFile f, string fFilename,
            ConcurrentIOPoolManager readPool, ConcurrentIOPoolManager writePool,
            RecordKey key)
        {
            string systemBackupFilename = Server.Path + DataBackupFilename;
            int    size = area.Value;

            key.Address = area.Key;

            // no intersection nor mergeable logs, add new log! backup and log the data area
            ConcurrentIOData reader = f != null
                                          ? readPool.GetInstance(f, size)
                                          : readPool.GetInstance(fFilename, null, size);

            ConcurrentIOData writer = writePool.GetInstance(systemBackupFilename, (TransactionRoot)Root);

            if (reader == null || writer == null)
            {
                throw new SopException("This program has a bug! 'didn't get reader or writer from Async IO Pool.");
            }

            LogTracer.Verbose("BackupDataWithNoIntersection: Start for Thread {0}.", Thread.CurrentThread.ManagedThreadId);


            var logValue = new BackupDataLogValue();

            logValue.DataSize      = size;
            logValue.TransactionId = Id;

            logValue.BackupFileHandle = GetLogBackupFileHandle(DataBackupFilename);

            // return the current backup file size and grow it to make room for data to be backed up...
            logValue.BackupDataAddress = GrowBackupFile(size, writer.FileStream);

            // save a record of the backed up data..
            LogCollection.Add(logKey, logValue);

            // log after data was backed up!!
            Sop.VoidFunc logBackedupData = () =>
            {
                UpdateLogger.LogLine("{0}{1}:{2} to {3}:{4} Size={5}",
                                     BackupFromToken, f != null ? f.Filename : fFilename, area.Key,
                                     DataBackupFilename, logValue.BackupDataAddress, size);
            };

            writer.FileStream.Seek(logValue.BackupDataAddress, SeekOrigin.Begin, true);
            reader.FileStream.Seek(area.Key, SeekOrigin.Begin, true);
            reader.FileStream.BeginRead(
                reader.Buffer, 0, size, ReadCallback,
                new object[] { new[] { reader, writer }, true, logKey, logBackedupData });
        }
Пример #12
0
        public static LogCollection SelectAll()
        {
            var List = new LogCollection();

            using (IDataReader rd = SqlHelper.ExecuteReader(DAL.con(), CommandType.StoredProcedure, "sp_tblLog_Select_SelectAll_linhnx"))
            {
                while (rd.Read())
                {
                    List.Add(getFromReader(rd));
                }
            }
            return(List);
        }
Пример #13
0
    // Generates the headers in a CSV format and saves them to the CSV file
    private void GenerateHeaders(LogCollection collection)
    {
        string headers = "";

        foreach (string key in collection.log.Keys)
        {
            if (headers != "")
            {
                headers += fieldSeperator;
            }
            headers += key;
        }
        SaveToFile(collection.label, headers);
    }
        //Task TransitionedHandler(Stateless.StateMachine<TState, TTrigger>.Transition transition)
        void TransitionedHandler(Stateless.StateMachine <TState, TTrigger> .Transition transition)
        {
            string Destination = transition.Destination.ToString();
            string Source      = transition.Source.ToString();
            string Trigger     = transition.Trigger.ToString();
            string IsReentry   = transition.IsReentry.ToString();

            LogCollection.VHStateDebug(string.Format("VH-[{0}] state,From:{1} to:{2} by:{3}.IsReentry:{4}"
                                                     , ID
                                                     , Source
                                                     , Destination
                                                     , Trigger
                                                     , IsReentry));
        }
Пример #15
0
        public void TestingSearchMatchFilter(string matchCase, int expectedElementsLogCount)
        {
            using (Stream fileStream = File.OpenRead(@"..\..\..\Data\Samples\TestLogParser.log"))
            {
                LogParserFilter filter = new LogParserFilter();
                filter.Match = matchCase;

                LogCollection lineParse = new LogCollection('|', "Time|ThreadId|Level|Ndc");
                lineParse.ParseFilter = filter;
                lineParse.ParseLogFile(fileStream);

                Assert.AreEqual(expectedElementsLogCount, lineParse.ElementsLog.Count);
            }
        }
Пример #16
0
        public void ParseLogFile(LogParserFilter filter)
        {
            using (Stream fileStream = File.OpenRead(file))
            {
                lineParse = new LogCollection(separator, pattern);

                if (filter != null)
                {
                    lineParse.ParseFilter = filter;
                }

                lineParse.ParseLogFile(fileStream);
            }
        }
Пример #17
0
    // Generates the headers in a CSV format and saves them to the CSV file
    private string GenerateHeaders(LogCollection collection)
    {
        string headers = "";

        foreach (string key in collection.log.Keys)
        {
            if (headers != "")
            {
                headers += fieldSeperator;
            }
            headers += key;
        }
        return(headers);
    }
Пример #18
0
        public void ParsingLog4NetFileNamespaceTesting()
        {
            using (Stream fileStream = File.OpenRead(@"..\..\..\Data\Samples\ProjectPilot.Tests.log.2"))
            {
                LogCollection lineParse = new LogCollection('|', "Time|ThreadId|Level|Namespace|Message");

                lineParse.ParseLogFile(fileStream);

                Assert.AreEqual(61, lineParse.ElementsLog.Count);
                Assert.AreEqual("Project.MyProject", ((NamespaceElement)lineParse.ElementsLog[0].Elements[3]).Element);
                Assert.AreEqual("Builds.VSSolutionBrowsing.VSProject", ((NamespaceElement)lineParse.ElementsLog[60].Elements[3]).Element);
                Assert.AreEqual("Builds.VSSolutionBrowsing.VSSolution", ((NamespaceElement)lineParse.ElementsLog[50].Elements[3]).Element);
            }
        }
Пример #19
0
        public void TestingLogIndexBoundsFilter(int?startLogIndex, int?endLogIndex, int?filterNumberOfLogItems, int expectedElementsLogCount)
        {
            using (Stream fileStream = File.OpenRead(@"..\..\..\Data\Samples\TestLogParser.log"))
            {
                LogParserFilter filter = new LogParserFilter();
                filter.StartLogIndex          = startLogIndex;
                filter.EndLogIndex            = endLogIndex;
                filter.FilterNumberOfLogItems = filterNumberOfLogItems;

                LogCollection lineParse = new LogCollection('|', "Time|ThreadId|Level|Ndc");
                lineParse.ParseFilter = filter;
                lineParse.ParseLogFile(fileStream);

                Assert.AreEqual(expectedElementsLogCount, lineParse.ElementsLog.Count);
            }
        }
Пример #20
0
        public void ParsingPartOf10MBLogFile(int readIndexStart, long readIndexEnd, int expectedElementsLogCount)
        {
            using (Stream fileStream = File.OpenRead(@"..\..\..\Data\Samples\SSM+2009-01-08.log.28"))
            {   // Size of file = 10472294
                LogCollection lineParse = new LogCollection('|', "Time|Level|Ndc");

                LogParserFilter filter = new LogParserFilter();
                filter.ReadIndexStart = readIndexStart;
                filter.ReadIndexEnd   = readIndexEnd;

                lineParse.ParseFilter = filter;
                lineParse.ParseLogFile(fileStream);

                Assert.AreEqual(expectedElementsLogCount, lineParse.ElementsLog.Count);
            }
        }
Пример #21
0
        private static LogCollection DBMapping(DBLogCollection dbCollection)
        {
            if (dbCollection == null)
            {
                return(null);
            }

            var collection = new LogCollection();

            foreach (var dbItem in dbCollection)
            {
                var item = DBMapping(dbItem);
                collection.Add(item);
            }

            return(collection);
        }
Пример #22
0
        public static LogCollectionViewModel Map(LogCollection mongoLogCollection)
        {
            if (mongoLogCollection == null)
            {
                return(null);
            }

            return(new LogCollectionViewModel
            {
                CollectionName = mongoLogCollection.CollectionName,
                LastInfo = mongoLogCollection.LastInfo.Select(r => new LogLevelInfoViewModel
                {
                    Level = r.Level,
                    Count = r.Count
                })
            });
        }
Пример #23
0
        public void Hello()
        {
            var logs = new LogCollection();

            var logger = new ConsoleLogger() + new TextFileLogger(@"C:\Temp\Logs\1.log") + new TextFileLogger(new DirectoryInfo(@"C:\Temp\Logs\Test")) + logs;

            logger.LogInfo("Hello World!");
            using (LogScope.EnterScope("Test"))
            {
                logger.LogInfo("Hello World!");
            }
            logger.LogWarning("Multiline\r\nLogs\r\n");
            logger.LogError("This has an error!");
            logger.LogError("This has an error!");
            logger.LogError("This has an error!");
            try
            {
                throw new Exception("Test exception!");
            }
            catch (Exception e)
            {
                logger.LogException(e);
            }

            Assert.AreEqual(logs.Count(), 7);

            Assert.AreEqual(logs.ElementAt(0).LogType(), LogType.Info);
            Assert.AreEqual(logs.ElementAt(1).LogType(), LogType.Info);
            Assert.AreEqual(logs.ElementAt(2).LogType(), LogType.Warning);
            Assert.AreEqual(logs.ElementAt(3).LogType(), LogType.Error);
            Assert.AreEqual(logs.ElementAt(4).LogType(), LogType.Error);
            Assert.AreEqual(logs.ElementAt(5).LogType(), LogType.Error);
            Assert.AreEqual(logs.ElementAt(6).LogType(), LogType.Exception);


            Assert.AreEqual(logs.ElementAt(0).MetaData.GetMetaData <LogScope>(), LogScope.RootScope);
            Assert.AreEqual(logs.ElementAt(1).MetaData.GetMetaData <LogScope>().Name, "Test");
            Assert.AreEqual(logs.ElementAt(2).MetaData.GetMetaData <LogScope>(), LogScope.RootScope);

            //TextLogFileManager.Flush();
        }
Пример #24
0
        public void Hello()
        {
            var logs = new LogCollection();

              var logger = new ConsoleLogger() + new TextFileLogger( @"C:\Temp\Logs\1.log" ) + new TextFileLogger( new DirectoryInfo( @"C:\Temp\Logs\Test" ) ) + logs;

              logger.LogInfo( "Hello World!" );
              using ( LogScope.EnterScope( "Test" ) )
              {
            logger.LogInfo( "Hello World!" );
              }
              logger.LogWarning( "Multiline\r\nLogs\r\n" );
              logger.LogError( "This has an error!" );
              logger.LogError( "This has an error!" );
              logger.LogError( "This has an error!" );
              try
              {
            throw new Exception( "Test exception!" );
              }
              catch ( Exception e )
              {

            logger.LogException( e );
              }

              Assert.AreEqual( logs.Count(), 7 );

              Assert.AreEqual( logs.ElementAt( 0 ).LogType(), LogType.Info );
              Assert.AreEqual( logs.ElementAt( 1 ).LogType(), LogType.Info );
              Assert.AreEqual( logs.ElementAt( 2 ).LogType(), LogType.Warning );
              Assert.AreEqual( logs.ElementAt( 3 ).LogType(), LogType.Error );
              Assert.AreEqual( logs.ElementAt( 4 ).LogType(), LogType.Error );
              Assert.AreEqual( logs.ElementAt( 5 ).LogType(), LogType.Error );
              Assert.AreEqual( logs.ElementAt( 6 ).LogType(), LogType.Exception );

              Assert.AreEqual( logs.ElementAt( 0 ).MetaData.GetMetaData<LogScope>(), LogScope.RootScope );
              Assert.AreEqual( logs.ElementAt( 1 ).MetaData.GetMetaData<LogScope>().Name, "Test" );
              Assert.AreEqual( logs.ElementAt( 2 ).MetaData.GetMetaData<LogScope>(), LogScope.RootScope );

              //TextLogFileManager.Flush();
        }
Пример #25
0
        public void LogCountModeFilterTesting()
        {
            using (Stream fileStream = File.OpenRead(@"..\..\..\Data\Samples\TestLogParser.log"))
            {
                LogParserFilter filter = new LogParserFilter();
                filter.LogCountMode = true;

                LogCollection lineParse = new LogCollection('|', "Time|ThreadId|Level|Ndc");
                lineParse.ParseFilter = filter;
                lineParse.ParseLogFile(fileStream);

                Assert.AreEqual(15, lineParse.NumberOfLogItems);

                //Results: 13,2 KB file take 2,685  seconds  (around 50 lines - 14 log entries)
                //Results: 14,2 KB file take 3,081  seconds  (around 65 lines - 14 log entries)
                //Results: 9,98 MB file take 4,770  seconds  (around 14.500 lines  - 2530 log entries)
                //Results: 35,2 MB file take 8,263  seconds  (around 50.000 lines  - 8740 log entries)
                //Results: 71,5 MB file take 12,429 seconds  (around 100.000 lines - 17.710 log entries)
                //Results:  142 MB file take 21,642 seconds  (around 200.000 lines - 35.190 log entries)
            }
        }
Пример #26
0
        public void ParsingFromLogFileWithFilter(string dateTimeStart, string dateTimeEnd, string threadId, string filterLevel, int?filterNumberOfLogItems, int expectedElementsLogCount)
        {
            using (Stream fileStream = File.OpenRead(@"..\..\..\Data\Samples\TestLogParser.log"))
            {
                LogParserFilter filter = new LogParserFilter();
                if (!string.IsNullOrEmpty(dateTimeStart) && !string.IsNullOrEmpty(dateTimeEnd))
                {
                    filter.FilterTimestampStart = DateTime.ParseExact(dateTimeStart, "yyyy-MM-dd HH:mm:ss,fff", CultureInfo.CurrentCulture);
                    filter.FilterTimestampEnd   = DateTime.ParseExact(dateTimeEnd, "yyyy-MM-dd HH:mm:ss,fff", CultureInfo.CurrentCulture);
                }

                filter.FilterThreadId         = threadId;
                filter.FilterLevel            = filterLevel;
                filter.FilterNumberOfLogItems = filterNumberOfLogItems;

                LogCollection lineParse = new LogCollection('|', "Time|ThreadId|Level|Ndc");
                lineParse.ParseFilter = filter;
                lineParse.ParseLogFile(fileStream);

                Assert.AreEqual(expectedElementsLogCount, lineParse.ElementsLog.Count);
            }
        }
Пример #27
0
 public void RefreshLogList(DatePicker datePicker)
 {
     try
     {
         DateTime selectedDate = (DateTime)datePicker.SelectedDate;
         if (selectedDate != null)
         {
             List <Log> logList = DataController.GetInstance.GetLog(selectedDate);
             lc = Application.Current.Resources["LogCollection"] as LogCollection;
             lc.Clear();
             foreach (Log log in logList)
             {
                 lc.Add(log);
             }
             Application.Current.Resources["LogCollection"] = lc;
         }
     }
     catch (MySqlException ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
Пример #28
0
        public static LogCollection ParseLog(string filePath)
        {
            LogCollection log = new LogCollection();

            using (TextReader text = new StreamReader(filePath))
            {
                while (text.Peek() > 0)
                {
                    string line = text.ReadLine();

                    var tsvIndex = line.IndexOf("\tTSV\t");

                    if (tsvIndex == -1) {
                        continue;
                    }
                }

                text.Close();
            }

            return log;
        }
Пример #29
0
        public void ThreeElementsParsing()
        {
            LogCollection lineParse = new LogCollection('|', "Time|ThreadId|Level|Ndc");

            lineParse.ParseLogLine(@"2008-12-22 09:16:02,734|[4904]|INFO|Hsl.UniversalHost.|Core.Component|Manager [ComponentManager.Start] - Starting all components.");
            lineParse.ParseLogLine(@"2008-12-22 09:16:05,577|[3152]|INFO|Hsl.UniversalHost.Core.ActiveComponent [Start Component SmsCenter] - Component 'SmsCenter' started.");
            lineParse.ParseLogLine(@"!T|ES|T!");
            lineParse.ParseLogLine(@"2008-12-22 09:37:59,977|[3368]|INFO|Hsl.Sms.Emi.Connection [Listen(1)] - Closing connection '1'.");

            Assert.AreEqual(3, lineParse.ElementsLog.Count);

            Assert.AreEqual(
                "Hsl.UniversalHost.|Core.Component|Manager [ComponentManager.Start] - Starting all components.",
                ((ParsedElementBase)lineParse.ElementsLog[0].Elements[3]).Element);

            Assert.AreEqual(
                "Hsl.UniversalHost.Core.ActiveComponent [Start Component SmsCenter] - Component 'SmsCenter' started.!T|ES|T!",
                ((ParsedElementBase)lineParse.ElementsLog[1].Elements[3]).Element);

            Assert.AreEqual(
                "Hsl.Sms.Emi.Connection [Listen(1)] - Closing connection '1'.",
                ((ParsedElementBase)lineParse.ElementsLog[2].Elements[3]).Element);
        }
Пример #30
0
        public void AppendTest()
        {
            var collection = new LogCollection();

            collection.Append("aaaaaaaaa\nbbbb");
            collection.Append("bbbb\n");
            collection.Append("ccccccc");
            collection.Append("ccccccc");
            collection.Append("ccccccc");
            collection.Append("\n");
            collection.Append("\n");
            collection.Append("dddddd");
            collection.Append("\neeeeee\n");
            collection.Append("\nfffff\nggg\nhhhh\n");
            collection.Append("iiiii");

            var expList = new []
            {
                "aaaaaaaaa",
                "bbbbbbbb",
                "ccccccccccccccccccccc",
                "",
                "dddddd",
                "eeeeee",
                "",
                "fffff",
                "ggg",
                "hhhh",
                null
            };

            foreach (var exp in expList)
            {
                var act = collection.GetFirst();
                Assert.AreEqual(exp, act);
            }
        }
Пример #31
0
 public void SearchLogList(string searchTerm)
 {
     if (searchTerm.Length == 0 || searchTerm.Equals("Search"))
     {
         llc = lc;
         Application.Current.Resources["LogListCollection"] = llc;
     }
     else
     {
         LogCollection tempList = new LogCollection();
         foreach (Log log in lc)
         {
             if (log.Log_Part_Number.ToLower().Contains(searchTerm.ToLower()) ||
                 log.Log_User.ToLower().Contains(searchTerm.ToLower()) ||
                 log.Log_Performed_Action.ToLower().Contains(searchTerm.ToLower()) ||
                 log.Log_Part_Description.ToLower().Contains(searchTerm.ToLower()) ||
                 log.Log_Job_Number.ToLower().Contains(searchTerm.ToLower()))
             {
                 tempList.Add(log);
             }
         }
         Application.Current.Resources["LogListCollection"] = tempList;
     }
 }
Пример #32
0
 /// <summary>
 /// Binds the log collection.
 /// </summary>
 /// <param name="logCollection">The log collection.</param>
 private void BindLogCollection(LogCollection logCollection)
 {
     if (logCollection.Count > 0)
     {
         dgErrorLogListing.DataSource            = logCollection;
         dgErrorLogListing.Columns[1].HeaderText = LocalizationUtility.GetText("hdrDetails");
         dgErrorLogListing.Columns[2].HeaderText = LocalizationUtility.GetText("hdrLogDate");
         dgErrorLogListing.Columns[3].HeaderText = LocalizationUtility.GetText("hdrLogLevel");
         dgErrorLogListing.Columns[4].HeaderText = LocalizationUtility.GetText("hdrScriptName");
         dgErrorLogListing.Columns[5].HeaderText = LocalizationUtility.GetText("hdrLogMessage");
         dgErrorLogListing.Columns[6].HeaderText = LocalizationUtility.GetText("hdrRemoteHost");
         HyperLinkColumn hlDetailsColumn = dgErrorLogListing.Columns[1] as HyperLinkColumn;
         if (hlDetailsColumn != null)
         {
             hlDetailsColumn.Text = LocalizationUtility.GetText("lblDetails");
         }
         dgErrorLogListing.DataBind();
     }
     else
     {
         pnlCurrentErrorLogs.Visible = false;
         Master.MessageCenter.DisplayInformationMessage(LocalizationUtility.GetText("lblNoErrorLogs"));
     }
 }
Пример #33
0
        public MainViewModel()
        {
            mainWindow = ((MainWindow)Application.Current.MainWindow);

            slc = Application.Current.Resources["StockListCollection"] as StockPartCollection;
            jlc = Application.Current.Resources["JobListCollection"] as JobCollection;
            llc = Application.Current.Resources["LogListCollection"] as LogCollection;

            CheckInList = new ObservableCollection <Part>()
            {
                new Part()
                {
                    Part_Number = ""
                }
            };

            CheckOutList = new ObservableCollection <Part>()
            {
                new Part()
                {
                    Part_Number = ""
                }
            };
        }
Пример #34
0
        /// <summary>
        /// The constructor of our class
        /// </summary>
        /// <param name="args">Arguments that contain the source and log name we want</param>
        /// <param name="iInput2"></param>
        public ImageService(string[] args)
        {
            InitializeComponent();
            //Getting the source name and log name via our arguments.
            string eventSourceName = "MySource";
            string logName         = "MyNewLog";

            if (args.Count() > 0)
            {
                eventSourceName = args[0];
            }
            if (args.Count() > 1)
            {
                logName = args[1];
            }
            eventLog1 = new System.Diagnostics.EventLog();
            if (!System.Diagnostics.EventLog.SourceExists(eventSourceName))
            {
                System.Diagnostics.EventLog.CreateEventSource(eventSourceName, logName);
            }
            eventLog1.Source = eventSourceName;
            eventLog1.Log    = logName;
            this.logs        = new LogCollection();
        }
Пример #35
0
 public LogCollection FetchByID(object LogID)
 {
     LogCollection coll = new LogCollection().Where("LogID", LogID).Load();
     return coll;
 }
Пример #36
0
 private void LoadCollections(Guid OrgID, int DeptID, int TktID, bool preloadCollections)
 {
     if (preloadCollections)
     {
         this.m_users = new TicketAssignees(OrgID, DeptID, TktID, TicketAssignmentType.User, m_UserId);
         this.m_technicians = new TicketAssignees(OrgID, DeptID, TktID, TicketAssignmentType.Technician, m_TechId);
         m_TicketLogs = new LogCollection(OrgID, DeptID, TktID);
     }
     else m_TicketLogs = new LogCollection();
 }
Пример #37
0
        public void RemoveDemoData()
        {
            ProgramCollection programCollection = new ProgramCollection();
              programCollection.GetAll();
              programCollection.DeleteAll();

              DeviceCollection deviceCollection = new DeviceCollection();
              deviceCollection.GetAll();
              deviceCollection.DeleteAll();

              ModelCollection modelCollection = new ModelCollection();
              modelCollection.GetAll();
              modelCollection.DeleteAll();

              BrandCollection brandCollection = new BrandCollection();
              brandCollection.GetAll();
              brandCollection.DeleteAll();

              LogCollection logCollection = new LogCollection();
              logCollection.GetAll();
              logCollection.DeleteAll();
        }
Пример #38
0
 /// <summary>
 /// Binds the log collection.
 /// </summary>
 /// <param name="logCollection">The log collection.</param>
 private void BindLogCollection(LogCollection logCollection)
 {
     if (logCollection.Count > 0) {
     dgErrorLogListing.DataSource = logCollection;
     dgErrorLogListing.Columns[1].HeaderText = LocalizationUtility.GetText("hdrDetails");
     dgErrorLogListing.Columns[2].HeaderText = LocalizationUtility.GetText("hdrLogDate");
     dgErrorLogListing.Columns[3].HeaderText = LocalizationUtility.GetText("hdrLogLevel");
     dgErrorLogListing.Columns[4].HeaderText = LocalizationUtility.GetText("hdrScriptName");
     dgErrorLogListing.Columns[5].HeaderText = LocalizationUtility.GetText("hdrLogMessage");
     dgErrorLogListing.Columns[6].HeaderText = LocalizationUtility.GetText("hdrRemoteHost");
     HyperLinkColumn hlDetailsColumn = dgErrorLogListing.Columns[1] as HyperLinkColumn;
     if (hlDetailsColumn != null) {
       hlDetailsColumn.Text = LocalizationUtility.GetText("lblDetails");
     }
     dgErrorLogListing.DataBind();
       }
       else {
     pnlCurrentErrorLogs.Visible = false;
     Master.MessageCenter.DisplayInformationMessage(LocalizationUtility.GetText("lblNoErrorLogs"));
       }
 }
 private void OnListLogs(LogCollection response, Dictionary <string, object> customData)
 {
     Log.Debug("ExampleAssistant.OnListLogs()", "Response: {0}", customData["json"].ToString());
     _listLogsInWorkspaceTested = true;
 }
Пример #40
0
 public LogCollection FetchByQuery(Query qry)
 {
     LogCollection coll = new LogCollection();
     coll.LoadAndCloseReader(qry.ExecuteReader());
     return coll;
 }