public void Initilize(CkernelGateway in_krnGateway) { Name = "sharedListView"; krnGateway=in_krnGateway; krnGateway.OnRefreshShared+=new RefreshEvent(m_InvokeOnRefreshShared); krnGateway.OnNewSharedFile+=new FileEvent(m_InvokeOnNewSharedFile); krnGateway.OnRemovedSharedFile+=new FileEvent(m_InvokeOnRemovedSharedFile); Columns.Add("File Name",190,false); Columns.Add("Size",75,false); Columns.Add("Priority",60,false); Columns.Add("Progress",60,true); ContextMenuShared = new ContextMenu(); ContextMenuShared.MenuItems.Add("Open file",new EventHandler(OnOpenFile)); ContextMenuShared.MenuItems.Add("Delete file",new EventHandler(OnDeleteFile)); ContextMenuShared.MenuItems.Add("-"); ContextMenuShared.MenuItems.Add("Copy eLink to clipboard",new EventHandler(OnCopyLink)); ContextMenuShared.MenuItems.Add("Copy eLink to clipboard (HTML)", new EventHandler(OnCopyLinkHTML)); ContextMenuShared.MenuItems.Add("Copy eLink to clipboard (Sources)", new EventHandler(OnCopyLinkSources)); ContextMenuShared.MenuItems.Add("-"); PriorityMenu = new MenuItem( "&Priority"); ContextMenuShared.MenuItems.Add(PriorityMenu); PriorityMenu.MenuItems.Add("Very high Priority",new EventHandler(OnReleasePriority)); PriorityMenu.MenuItems.Add("High Priority",new EventHandler(OnHighPriority)); PriorityMenu.MenuItems.Add("Normal Priority",new EventHandler(OnNormalPriority)); PriorityMenu.MenuItems.Add("Low Priority",new EventHandler(OnLowPriority)); PriorityMenu.MenuItems.Add("Very low Priority",new EventHandler(OnVeryLowPriority)); ContextMenuShared.MenuItems.Add("-"); MenuItem MenuItemInfo=new MenuItem("Search more info"); ContextMenuShared.MenuItems.Add(MenuItemInfo); MenuInfo=new CMenuInfo(MenuItemInfo); ContextMenu=ContextMenuShared; ContextMenuShared.Popup+=new System.EventHandler(myContextMenuPopup); TheColumnSorter=new ColumnSorter(); TheColumnSorter.CurrentColumn=1; TheColumnSorter.sortOrder=-1; this.ClickHeader+=new HeaderEventHandler(myColumnClick); this.DoubleClick+=new EventHandler(OnOpenFile); this.KeyDown+=new KeyEventHandler(OnKeyDown); m_DefaultWidths=new int[] {190,75,60,60}; m_Globalize(); m_LoadWidths(); SmallImageList=HathiForm.SystemIconsList.list; SelectedIndexChanged+=new EventHandler(sharedListView_SelectedIndexChanged); ReloadList(false); }
public void Initilize(CkernelGateway in_krnGateway) { Name="listViewQueue"; AlreadyDownloadingItemColor=Color.Red; AlreadyDownloadedItemColor=Color.Green; try { Font=new Font("Microsoft Sans Serif",8.25F,GraphicsUnit.Point); } catch { Font=(Font)this.Parent.Font.Clone(); } krnGateway=in_krnGateway; Columns.Add("File Name",400,true); Columns.Add("Size",80,true); Columns.Add("Sources",60,true); Columns.Add("Codec",60,false); Columns.Add("Length",60,false); Columns.Add("Bitrate",60,false); Columns.Add("File type",90,false); ContextMenuSearch = new ContextMenu(); ContextMenuSearch.MenuItems.Add("Download",new EventHandler(OnDownloadFile)); ContextMenuSearch.MenuItems.Add("Download (Stopped)",new EventHandler(OnDownloadFileStopped)); ContextMenuSearch.MenuItems.Add("-"); ContextMenuSearch.MenuItems.Add("Copy eLink to clipboard", new EventHandler(OnCopyLink)); ContextMenuSearch.MenuItems.Add("Copy eLink to clipboard (HTML)", new EventHandler(OnCopyLinkHTML)); ContextMenuSearch.MenuItems.Add("-"); MenuItem MenuItemInfo=new MenuItem("Search more info"); ContextMenuSearch.MenuItems.Add(MenuItemInfo); MenuInfo=new CMenuInfo(MenuItemInfo); ContextMenu=ContextMenuSearch; ContextMenuSearch.Popup+=new System.EventHandler(myContextMenuPopup); TheColumnSorter=new SearchColumnSorter(); TheColumnSorter.CurrentColumn=1; TheColumnSorter.sortOrder=-1; this.ClickHeader+=new HeaderEventHandler(myColumnClick); this.DoubleClick+=new EventHandler(OnDownloadFile); this.KeyDown+=new KeyEventHandler(OnKeyDown); m_DefaultWidths=new int[] {400,80,60,60,60,60,90}; m_Globalize(); m_LoadWidths(); this.SelectedIndexChanged+=new EventHandler(searchListView_SelectedIndexChanged); }