Esempio n. 1
0
        public static void ChangedClipboardCollection(ClipboardItem item = null, bool remove = false)
        {
            if (item != null)
            {
                FormClipboardTool?.RefreshSingleItem(item, remove);
                return;
            }

            FormClipboardTool?.RefreshList();
        }
        public void RefreshSingleItem(ClipboardItem item, bool remove = false)
        {
            if (remove)
            {
                var itemToRemove = flowLayoutPanel1.Controls.OfType <ucItem>().FirstOrDefault(x => x.Item.Id == item.Id);
                flowLayoutPanel1.Controls.Remove(itemToRemove);

                return;
            }

            var newUcItem = new ucItem(item);

            flowLayoutPanel1.Controls.Add(newUcItem);
            flowLayoutPanel1.Controls.GetChildIndex(newUcItem);
            flowLayoutPanel1.Controls.SetChildIndex(newUcItem, 0);
        }
Esempio n. 3
0
        public ucItem(ClipboardItem item)
        {
            InitializeComponent();
            Item = item;

            lblHorario.Text = item.Horario.ToString("dd/MM/yyyy hh:mm:ss");
            lblTipo.Text    = ConvertType(item.TipoDeDados);

            if (item.TipoDeDados == SharpClipboard.ContentTypes.Text)
            {
                txtSample.Text = (string)item.Dados;
            }
            else
            {
                txtSample.Text = string.Empty;
            }
        }