示例#1
0
        private void Form1_Load(object sender, EventArgs e)
        {
            Log.PatchList   = lstPatches;
            Log.AddButton   = btnAdd;
            Log.ProgressBar = proBar;
            Log.RTB         = rtbLogs;
            Log.W("Duh herro...");

            patches = new Patches();

            lstPatches.DataSource = patches.List;

            PatchNotes.AutoUpdate = false;
            PatchNotes.OnLoaded   = UpdateNotes;
            PatchNotes.Load();
        }
示例#2
0
        public void UpdateNotes()
        {
            PatchNotes.Note n  = PatchNotes.Get(lstPatches.Text);
            StringBuilder   sb = new StringBuilder();

            sb.Append("{\\rtf1\\ansi Notes for " + n.patch + ", written by " + n.writtenBy + "\\line");

            string[] lines = n.data.Split('\n');
            foreach (string line in lines)
            {
                if (line.StartsWith("-> "))
                {
                    sb.Append("-" + line + "\\line");
                }
                else
                {
                    sb.Append("\\line\\b " + line + "\\b0\\line");
                }
            }
            sb.Append("}");

            rtbNote.Rtf = sb.ToString().Replace("\\line\\line\\line", "\\line\\line");
        }