예제 #1
0
파일: Wood.cs 프로젝트: thalber/BOI
        public static void Write(object o)
        {
            if (LogPath == null || !File.Exists(LogPath) || !LogPath.EndsWith(".txt"))
            {
                LogPath = Path.Combine(Directory.GetCurrentDirectory(), "BOILOG.txt");
            }
            FileInfo lf = new FileInfo(LogPath);

            try
            {
                string result = o?.ToString() ?? "null";
                File.AppendAllText(LogPath, result);
            }
            catch (IOException)
            {
            }
        }
예제 #2
0
        public LogDetailViewModel(string logPath)
        {
            LogPath           = Path.Combine(FolderFactory.LogFolder, logPath);
            CanExecuteClose   = true;
            CanExecuteExport  = true;
            ShowScoreItems    = Visibility.Collapsed;
            ShowActivityItems = Visibility.Collapsed;

            if (File.Exists(LogPath) && LogPath.EndsWith(".xml"))
            {
                if (LogPath.Contains("Score"))
                {
                    LogType        = LogTypes.Score;
                    ScoreItems     = GetScoreItems();
                    ShowScoreItems = Visibility.Visible;
                }
                else if (LogPath.Contains("Activity"))
                {
                    LogType           = LogTypes.Activity;
                    ActivityItems     = GetActivityItems();
                    ShowActivityItems = Visibility.Visible;
                }
            }
        }