예제 #1
0
        /// <summary>
        /// Das tttool kann OID-Muster in verschiedenen Formaten erzeugen – das brauchst du dann, wenn du deine eigenen
        ///Tiptoi-Produkte gestalten willst.Es versteht dazu mehrere Befehle, je nach dem woher es wissen soll, zu welche
        /// Codes es die Muster erzeugen soll, und mehrere Optionen, die steuern, wie die Muster auszusehen haben.
        /// </summary>
        /// <param name="tttSettings"></param>
        /// <param name="yamlFile"></param>
        /// <returns></returns>
        public static string CreateOidCodes(TTToolSettings tttSettings, string yamlFile, string outPath = "")
        {
            var path = TTGRegistry.Read("tttoolPath");
            var yf   = yamlFile.EndsWith(".yaml") ? "yamlFile" : $"{yamlFile}.yaml";
            var arg  = $"{ConvertSettingsToArguments(tttSettings)} oid-codes {yf}";

            if (!string.IsNullOrEmpty(outPath))
            {
                arg = $"{arg} \"{outPath}\"";
            }
            return(CMD.GetMultiline(path, arg));
        }
예제 #2
0
        public static string Play(string yamlFile)
        {
            if (!File.Exists(yamlFile))
            {
                return($"{yamlFile} file not exists");
            }

            var path = TTGRegistry.Read("tttoolPath");

            var arg = $"assemble \"{fileExtension(yamlFile, "yaml")}\"";

            return(CMD.GetMultiline(path, arg));
        }
예제 #3
0
        /// <summary>
        /// Das tttool kann OID-Muster in verschiedenen Formaten erzeugen – das brauchst du dann, wenn du deine eigenen
        /// Tiptoi-Produkte gestalten willst.Es versteht dazu mehrere Befehle, je nach dem woher es wissen soll, zu welche
        /// Codes es die Muster erzeugen soll, und mehrere Optionen, die steuern, wie die Muster auszusehen haben.
        /// </summary>
        /// <param name="tttSettings"></param>
        /// <param name="code"></param>
        public static string CreateOidCodes(TTToolSettings tttSettings, short code, string workdir = "")
        {
            var path = TTGRegistry.Read("tttoolPath");
            var arg  = $"{ConvertSettingsToArguments(tttSettings)} oid-code {code}";

            if (string.IsNullOrEmpty(workdir))
            {
                CMD.GetMultiline(path, arg);
                return(Path.Combine(Assembly.GetAssembly(typeof(MainForm)).Location, $"oid-{code}.png"));
            }
            else
            {
                CMD.GetMultiline(path, workdir, arg);
                return(Path.Combine(workdir, $"oid-{code}.png"));
            }
        }
예제 #4
0
        public static string ExtractMediaFromGME(string gmeFile, string mediaPath = "")
        {
            if (!File.Exists(gmeFile))
            {
                return($"{gmeFile} file not exists");
            }

            var path = TTGRegistry.Read("tttoolPath");
            var arg  = $" media {gmeFile}";

            if (!string.IsNullOrEmpty(mediaPath))
            {
                arg = $"{arg} -d {mediaPath}";
            }
            return(CMD.GetMultiline(path, arg));
        }
예제 #5
0
        public static string Assemble(string yamlFile, string gmeFile = "")
        {
            if (!File.Exists(yamlFile))
            {
                return($"{yamlFile} file not exists");
            }

            var path = TTGRegistry.Read("tttoolPath");

            var arg = $"assemble \"{fileExtension(yamlFile, "yaml")}\"";

            if (!string.IsNullOrEmpty(gmeFile))
            {
                arg = $"{arg} \"{fileExtension(gmeFile, "gme")}\"";
            }
            return(CMD.GetMultiline(path, arg));
        }
예제 #6
0
        private void Button2_Click(object sender, EventArgs e)
        {
            string s = CMD.GetMultiline(textBox1.Text, "-h");

            button2.ForeColor = Color.Red;
            if (string.IsNullOrEmpty(s))
            {
                return;
            }
            textBox2.Text = s;

            if (s.Contains("Usage: tttool.exe"))
            {
                button2.ForeColor = Color.Green;
                TTGRegistry.Write("tttoolPath", textBox1.Text);
            }
        }
예제 #7
0
        public static string ExtractYamlFromGME(string gmeFile, string yamlFile = "")
        {
            var f = fileExtension(gmeFile, "gme");

            if (!File.Exists(f))
            {
                return($"{f} file not exists");
            }

            var path = TTGRegistry.Read("tttoolPath");
            var arg  = $" export {gmeFile}";

            if (!string.IsNullOrEmpty(yamlFile))
            {
                arg = $"{arg} \"{fileExtension(yamlFile, "yaml")}\"";
            }
            return(CMD.GetMultiline(path, arg));
        }
예제 #8
0
        /// <summary>
        /// Das tttool kann OID-Muster in verschiedenen Formaten erzeugen – das brauchst du dann, wenn du deine eigenen
        ///Tiptoi-Produkte gestalten willst.Es versteht dazu mehrere Befehle, je nach dem woher es wissen soll, zu welche
        /// Codes es die Muster erzeugen soll, und mehrere Optionen, die steuern, wie die Muster auszusehen haben.
        /// </summary>
        /// <param name="tttSettings"></param>
        /// <param name="from"></param>
        /// <param name="to"></param>
        /// <returns></returns>
        public static string CreateOidCodes(TTToolSettings tttSettings, short from, short to, string workdir = "")
        {
            if (from < to)
            {
                var t = from;
                from = to;
                to   = t;
            }

            var path = TTGRegistry.Read("tttoolPath");
            var arg  = $"{ConvertSettingsToArguments(tttSettings)} oid-code {from}-{to}";

            if (string.IsNullOrEmpty(workdir))
            {
                return(CMD.GetMultiline(path, arg));
            }
            return(CMD.GetMultiline(path, workdir, arg));
        }