Example #1
0
        private MyCookie ItemToMyCookie(ListViewItem item)
        {
            string   name = item.Text;
            MyCookie ck   = new MyCookie(name, item.SubItems[1].Text);

            ck.path           = item.SubItems[2].Text;
            ck.domain         = item.SubItems[3].Text;
            ck.expirationDate = item.SubItems[4].Text;
            ck.sameSite       = item.SubItems[5].Text;
            ck.hostOnly       = bool.Parse(item.SubItems[6].Text);
            ck.httpOnly       = bool.Parse(item.SubItems[7].Text);
            ck.secure         = bool.Parse(item.SubItems[8].Text);
            ck.session        = bool.Parse(item.SubItems[9].Text);
            ck.storeId        = item.SubItems[10].Text;
            return(ck);
        }
Example #2
0
        private void AddCookieToView(MyCookie ck)
        {
            ListViewItem item = new ListViewItem(ck.name);

            item.SubItems.Add(ck.value);
            item.SubItems.Add(ck.path);
            item.SubItems.Add(ck.domain);
            item.SubItems.Add(ck.expirationDate);
            item.SubItems.Add(ck.sameSite);
            item.SubItems.Add(ck.hostOnly.ToString());
            item.SubItems.Add(ck.httpOnly.ToString());
            item.SubItems.Add(ck.secure.ToString());
            item.SubItems.Add(ck.session.ToString());
            item.SubItems.Add(ck.storeId);
            listView1.Items.Add(item);
        }