コード例 #1
0
        public override string ToString()
        {
            string pzlName = PuzzleName.Contains('\0') ? PuzzleName.Substring(0, PuzzleName.IndexOf('\0')) : PuzzleName;
            string pckName = PackName.Contains('\0') ? PackName.Substring(0, PackName.IndexOf('\0')) : PackName;

            return("Original Puzzle #" + IndexForGui.ToString("D3") + " - " + pckName + " - " + pzlName);
        }
コード例 #2
0
        public PackOperationsViewModel(string packFilePath)
        {
            FilePath = packFilePath;
            PackName = Path.GetFileName(FilePath);

            var match = Regex.Match(PackName, PackFileTestRegex).Value;

            IsSequenceTargetable = match == PackName;

            if (PackName.Contains("_to_"))
            {
                var matchRegex = @"(_\d+)";
                match = Regex.Match(PackName, matchRegex).Value;
                var toMatch = match.Replace("_", "");

                var packVersion = 0;

                int.TryParse(toMatch, out packVersion);

                PackVersion = packVersion;
                return;
            }

            if (PackName.Contains("full"))
            {
                var matchRegex = @"(\d+_)";
                match = Regex.Match(PackName, matchRegex).Value;
                var fromMatch = match.Replace("_", "");

                var packVersion = 0;

                int.TryParse(fromMatch, out packVersion);

                PackVersion = packVersion;
                return;
            }

            PackVersion = -1;
        }