예제 #1
0
        private void listBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            ListBox lb = sender as ListBox;

            if (ReferenceEquals(lb, null))
            {
                return;
            }

            if (lb.SelectedItems.Count != 1)
            {
                return;
            }

            FileBasedLogEntry item = lb.SelectedItems[0] as FileBasedLogEntry;

            if (ReferenceEquals(item, null))
            {
                return;
            }

            string extension = Path.GetExtension(item.Filepath);

            if (extension == null)
            {
                return;
            }

            switch (extension.ToLower())
            {
            case ".xml":
            case ".mkv":
                //todo: make it async
                MatroskaTags tags = MatroskaLoader.ReadTag(item.Filepath);
                textEditor.Text = MatroskaLoader.GetXML(tags);
                break;
            }
        }
예제 #2
0
        private void listBox_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            ListBox lb = sender as ListBox;

            if (ReferenceEquals(lb, null))
            {
                return;
            }

            if (lb.SelectedItems.Count != 1)
            {
                return;
            }

            FileBasedLogEntry item = lb.SelectedItems[0] as FileBasedLogEntry;

            if (ReferenceEquals(item, null))
            {
                return;
            }

            item.OpenExplorerFileSelected();
        }