Пример #1
0
        public ThreadViewer(FaceLog log, ChatThread chat)
        {
            this.log  = log;
            this.chat = chat;
            InitializeComponent();

            for (int i = 0; i < chat.messages.Count; i++)
            {
                if (i >= 100)
                {
                    break;
                }

                Message msg = chat.messages[i];

                Label labelMsg = new Label();

                labelMsg.Content = msg.author.ToString() + " : " + msg.text;

                chatPanel.Children.Add(labelMsg);
            }

            TimelineDataController dataController = new TimelineDataController(chat.messages, log.beginScope, log.endScope, log.owner);

            timeViewer = new TimelineViewer(chat.messages, log.beginScope, log.endScope, log.owner, dataController);
            timelineControl.Content = timeViewer;
        }
Пример #2
0
        public static FaceLog LoadLog(string location)
        {
            //Check if preprocessed log is present

            //HTML SOLUTION
            FaceLog log = new FaceLog();

            log.location = location;

            log.loadFromHtmlv2();
            return(log);
        }
Пример #3
0
        public static FaceLog LoadLogAssynchronous(string location)
        {
            FaceLog log = new FaceLog();

            log.location = location;

            Thread loader = new Thread(log.loadFromHtmlv2);

            loader.Start();

            return(log);
        }
        public LoadingLogViewer(string location)
        {
            this.location = location;
            InitializeComponent();


            log = FaceLog.LoadLogAssynchronous(location);

            updateTicker           = new System.Timers.Timer();
            updateTicker.Interval  = 50;
            updateTicker.AutoReset = true;
            updateTicker.Elapsed  += UpdateTicker_Elapsed;
            updateTicker.Start();
        }
        public LogViewer(FaceLog log)
        {
            this.log = log;
            InitializeComponent();

            selfLabel.Content = log.owner.name;

            SolidColorBrush threadColor = new SolidColorBrush(Colors.LightCyan);

            for (int i = 0; i < log.threads.Count; i++)
            {
                ChatThread thread = log.threads[i];
                if (thread.messages.Count >= 100 || (thread.people.Count == 3 && thread.messages.Count >= 50))
                {
                    Button threadBut = new Button();

                    string names = "";
                    for (int k = 0; k < thread.people.Count; k++)
                    {
                        if (thread.people[k] != log.owner)
                        {
                            names += thread.people[k] + "\n";
                        }
                    }
                    names = names.Substring(0, names.Length - 1);

                    threadBut.Content     = names;
                    threadBut.DataContext = i;
                    threadBut.Background  = threadColor;
                    threadBut.Click      += ThreadBut_Click;

                    threadBut.Margin = new Thickness(1);

                    peoplePanel.Children.Add(threadBut);
                }
            }

            dataController = new TimelineDataController(log.allMessages, log.beginScope, log.endScope, log.owner);

            timeViewer = new TimelineViewer(log.allMessages, log.beginScope, log.endScope, log.owner, dataController);
            timelineControl.Content = timeViewer;

            Timer updateTicker = new Timer();

            updateTicker.Interval  = 50;
            updateTicker.AutoReset = true;
            updateTicker.Elapsed  += UpdateTicker_Elapsed;;
            updateTicker.Start();
        }