コード例 #1
0
 public override bool Equals(Object obj)
 {
     if (obj is FileFolderEntry)
     {
         FileFolderEntry castedObj = obj as FileFolderEntry;
         return(this.shortContent == castedObj.shortContent);
     }
     else
     {
         return(false);
     }
 }
コード例 #2
0
        public void AddEntry(System.Collections.Specialized.StringCollection item)
        {
            Entry entry = new FileFolderEntry(item, INDEX.ToString());
            INDEX++;

            if (entries.Contains(entry))
            {
                entries.Remove(entry);
            }

            entries.Add(entry);
        }
コード例 #3
0
        public void AddEntry(System.Collections.Specialized.StringCollection item)
        {
            Entry entry = new FileFolderEntry(item, INDEX.ToString());

            INDEX++;

            if (entries.Contains(entry))
            {
                entries.Remove(entry);
            }

            entries.Add(entry);
        }
コード例 #4
0
ファイル: Form1.cs プロジェクト: bokiscout/clipboard-manager
        // put content back to the clipboard on context menu item click
        private void contextMenu_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
        {
            if (e.ClickedItem != contextMenu.Items[0] && e.ClickedItem != contextMenu.Items[1])
            {
                String id    = e.ClickedItem.Tag.ToString();
                Entry  entry = document.getById(id);

                if (entry is TextEntry)
                {
                    TextEntry castedEntry = entry as TextEntry;
                    Clipboard.SetText(castedEntry.GetContent());
                }
                else if (entry is FileFolderEntry)
                {
                    FileFolderEntry castedEntry = entry as FileFolderEntry;
                    Clipboard.SetFileDropList(castedEntry.GetContent());
                }
            }
        }