コード例 #1
0
ファイル: MainForm.cs プロジェクト: eb-choc/SharesWatcher
        private void AddKeysToFile(string create_time, string rich_text)
        {
            KeysHelper kh = new KeysHelper();

            string[] keys = kh.GetAllText("keys");
            if (keys != null && keys.Length > 0)
            {
                foreach (string k in keys)
                {
                    if (!string.IsNullOrEmpty(k) && rich_text.IndexOf(k) > -1)
                    {
                        string text = create_time + ">" + rich_text;
                        kh.AddTextToFile(k, text, true);
                        for (int i = 0; i < tabControl1.TabPages.Count; i++)
                        {
                            if (tabControl1.TabPages[i].Text == k)
                            {
                                string[] es = new string[] { Convert.ToDateTime(create_time).ToString("HH:mm:ss"), rich_text };
                                for (int j = 0; j < tabControl1.TabPages[i].Controls.Count; j++)
                                {
                                    if (tabControl1.TabPages[i].Controls[j] is ListView)
                                    {
                                        (tabControl1.TabPages[i].Controls[j] as ListView).Items.Insert(0, new ListViewItem(es));
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
コード例 #2
0
        private void AddKeyToFile(string key)
        {
            KeysHelper kh = new KeysHelper();

            kh.AddTextToFile("keys", key);
        }