コード例 #1
0
ファイル: Main.cs プロジェクト: Nalindar/CopyDisPasta
        private void btnAddButton_Click(object sender, EventArgs e)
        {
            var editor = new ButtonEditor();

            editor.TabName = tcButtonHousing.SelectedTab.Name;
            if (editor.ShowDialog() != DialogResult.OK)
            {
                return;
            }
            var info = new ButtonInfo()
            {
                TabName     = editor.TabName,
                Title       = editor.ButtonTitle,
                Description = editor.ButtonDescription
            };

            _AllButtons.Buttons.Add(info);
            using (StreamWriter writer = new StreamWriter("DynamicButtons.txt"))
            {
                ButtonSet.WriteButtons(writer, _AllButtons);
            }
            this.LoadButtons("");
            return;

            var process = Process.Start("notepad.exe", "DynamicButtons.txt");

            process.EnableRaisingEvents = true;
            process.Exited += Process_Exited;
        }
コード例 #2
0
ファイル: ButtonSet.cs プロジェクト: Nalindar/CopyDisPasta
        private static ButtonInfo ReadButtonLine(string line)
        {
            var info = new ButtonInfo();

            char[]   delimiters = new char[] { '|' };
            string[] fragments  = line.Split(delimiters);
            if (fragments.Length < 2)
            {
                return(null);
            }
            int i = 0;

            if (fragments.Length < 3)
            {
                info.TabName = "Main";
            }
            else
            {
                info.TabName = fragments[i++];
            }
            info.Title       = fragments[i++];
            info.Description = fragments[i++];
            return(info);
        }
コード例 #3
0
ファイル: ButtonSet.cs プロジェクト: Nalindar/CopyDisPasta
 public static string WriteLine(ButtonInfo info)
 {
     return(string.Format("{0}|{1}|{2}", Encode(info.TabName), Encode(info.Title), Encode(info.Description)));
 }