/// <summary> /// Creates a new form instance. /// </summary> /// <param name="application">The traceroute application.</param> public FormMain(TracerouteApplication application) { // Set the application. this.application = application; // Initialize the component. this.InitializeComponent(); // Get the theme settings. this.themeSettings = ToolStripManager.Renderer is ThemeRenderer ? (ToolStripManager.Renderer as ThemeRenderer).Settings : ThemeSettings.Default; // Intialize the controls. this.controlAddresses.Initialize(this.application); this.controlDns.Initialize(this.application); this.controlLog.Initialize(this.application); // Set the event handlers. this.application.Status.MessageChanged += this.OnStatusMessageChanged; // Call the tab changed event handler to initialize the application status. this.OnTabChanged(this, EventArgs.Empty); // Set the font. Window.SetFont(this); }
public ThemeControl() { // Set the control style. base.SetStyle( ControlStyles.UserPaint | ControlStyles.OptimizedDoubleBuffer | ControlStyles.AllPaintingInWmPaint, true); base.AutoScaleMode = AutoScaleMode.Font; // Set the theme settings. this.themeSettings = ToolStripManager.Renderer is ThemeRenderer ? (ToolStripManager.Renderer as ThemeRenderer).Settings : ThemeSettings.Default; // Set the default properties. base.Padding = new Padding(0); }
private int visibleItems = 0; // The number of visible items. #endregion Fields #region Constructors /// <summary> /// Creates a new side menu control. /// </summary> public SideMenu() { // Set the theme color table. this.themeSettings = ToolStripManager.Renderer is ThemeRenderer ? (ToolStripManager.Renderer as ThemeRenderer).Settings : ThemeSettings.Default; // Set the color matrix this.imageAttributesGrayscale.SetColorMatrix(new ColorMatrix( new float[][]{ new float[] { 0.3f, 0.3f, 0.3f, 0, 0 }, new float[] { 0.59f, 0.59f, 0.59f, 0, 0 }, new float[] { 0.11f, 0.11f, 0.11f, 0, 0 }, new float[] { 0, 0, 0, 1, 0, 0 }, new float[] { 0, 0, 0, 0, 1, 0}, new float[] { 0, 0, 0, 0, 0, 1} })); this.controlMenu.Items.AddRange(new ToolStripItem[] { this.toolStripMenuItemShowMoreButtons, this.toolStripMenuItemShowFewerButtons, this.toolStripSeparator }); this.toolStripMenuItemShowMoreButtons.Size = new Size(200, 22); this.toolStripMenuItemShowMoreButtons.Image = Resources.ArrowUp_16; this.toolStripMenuItemShowMoreButtons.Text = "Show &More Buttons"; this.toolStripMenuItemShowMoreButtons.Click += this.OnShowMoreButtonsClick; this.toolStripMenuItemShowFewerButtons.Size = new Size(200, 22); this.toolStripMenuItemShowFewerButtons.Image = Resources.ArrowDown_16; this.toolStripMenuItemShowFewerButtons.Text = "Show Fe&wer Buttons"; this.toolStripMenuItemShowFewerButtons.Click += this.OnShowFewerButtonsClick; this.DoubleBuffered = true; this.controlMenu.Closed += this.OnControlMenuClosed; // Set the items collection event handlers. this.items.BeforeCleared += this.OnBeforeItemsCleared; this.items.AfterCleared += this.OnAfterItemsCleared; this.items.AfterItemInserted += this.OnAfterItemInserted; this.items.AfterItemRemoved += this.OnAfterItemRemoved; this.items.AfterItemSet += this.OnAfterItemSet; }
/// <summary> /// Constructor for main form window. /// </summary> public FormMain(Crawler crawler) { // Initialize the component. this.InitializeComponent(); // Get the theme settings. this.themeSettings = ToolStripManager.Renderer is ThemeRenderer ? (ToolStripManager.Renderer as ThemeRenderer).Settings : ThemeSettings.Default; // Initialize the crawler this.crawler = crawler; // Create the tree view items. this.treeNodePlanetLabSites = new TreeNode("Sites", this.imageList.Images.IndexOfKey("FolderClosedGlobe"), this.imageList.Images.IndexOfKey("FolderOpenGlobe")); this.treeNodePlanetLabNodes = new TreeNode("Nodes", this.imageList.Images.IndexOfKey("FolderClosedGlobe"), this.imageList.Images.IndexOfKey("FolderOpenGlobe")); this.treeNodePlanetLabSlices = new TreeNode("Slices", this.imageList.Images.IndexOfKey("FolderClosedGlobe"), this.imageList.Images.IndexOfKey("FolderOpenGlobe")); this.treeNodePlanetLab = new TreeNode("PlanetLab", this.imageList.Images.IndexOfKey("ServersGlobe"), this.imageList.Images.IndexOfKey("ServersGlobe"), new TreeNode[] { this.treeNodePlanetLabSites, this.treeNodePlanetLabNodes, this.treeNodePlanetLabSlices }); this.treeNodeToolboxInfo = new TreeNode("Toolbox", this.imageList.Images.IndexOfKey("ServerToolbox"), this.imageList.Images.IndexOfKey("ServerToolbox") ); this.treeNodeDatabaseServers = new TreeNode("Servers", this.imageList.Images.IndexOfKey("ServersDatabase"), this.imageList.Images.IndexOfKey("ServersDatabase")); this.treeNodeSpiderStandardFeeds = new TreeNode("Standard feeds", this.imageList.Images.IndexOfKey("Cube"), this.imageList.Images.IndexOfKey("Cube")); this.treeNodeSpidersLocal = new TreeNode("Local spiders", this.imageList.Images.IndexOfKey("ServerCube"), this.imageList.Images.IndexOfKey("ServerCube"), new TreeNode[] { this.treeNodeSpiderStandardFeeds }); this.treeNodeYouTubeApi2VideoComments = new TreeNode("Comments", this.imageList.Images.IndexOfKey("FolderClosedComment"), this.imageList.Images.IndexOfKey("FolderOpenComment")); this.treeNodeYouTubeApi2Video = new TreeNode("Video", this.imageList.Images.IndexOfKey("FileVideo"), this.imageList.Images.IndexOfKey("FileVideo"), new TreeNode[] { this.treeNodeYouTubeApi2VideoComments }); this.treeNodeYouTubeApi2SearchFeed = new TreeNode("Search", this.imageList.Images.IndexOfKey("FolderClosedVideo"), this.imageList.Images.IndexOfKey("FolderOpenVideo")); this.treeNodeYouTubeApi2StandardFeed = new TreeNode("Standard feeds", this.imageList.Images.IndexOfKey("FolderClosedVideo"), this.imageList.Images.IndexOfKey("FolderOpenVideo")); this.treeNodeYouTubeApi2RelatedVideosFeed = new TreeNode("Related videos feed", this.imageList.Images.IndexOfKey("FolderClosedVideo"), this.imageList.Images.IndexOfKey("FolderOpenVideo")); this.treeNodeYouTubeApi2ResponseVideosFeed = new TreeNode("Response videos feed", this.imageList.Images.IndexOfKey("FolderClosedVideo"), this.imageList.Images.IndexOfKey("FolderOpenVideo")); this.treeNodeYouTubeApi2VideosFeedsInfo = new TreeNode("Global videos", this.imageList.Images.IndexOfKey("FolderClosedVideo"), this.imageList.Images.IndexOfKey("FolderOpenVideo"), new TreeNode[] { this.treeNodeYouTubeApi2Video, this.treeNodeYouTubeApi2SearchFeed, this.treeNodeYouTubeApi2StandardFeed, this.treeNodeYouTubeApi2RelatedVideosFeed, this.treeNodeYouTubeApi2ResponseVideosFeed }); this.treeNodeYouTubeApi2UploadsFeed = new TreeNode("Uploads feed", this.imageList.Images.IndexOfKey("FolderClosedVideo"), this.imageList.Images.IndexOfKey("FolderOpenVideo")); this.treeNodeYouTubeApi2PlaylistFeed = new TreeNode("Playlist feed", this.imageList.Images.IndexOfKey("FolderClosedVideo"), this.imageList.Images.IndexOfKey("FolderOpenVideo")); this.treeNodeYouTubeApi2Playlists = new TreeNode("Playlists", this.imageList.Images.IndexOfKey("FolderClosedPlayBlue"), this.imageList.Images.IndexOfKey("FolderOpenPlayBlue"), new TreeNode[] { this.treeNodeYouTubeApi2PlaylistFeed }); this.treeNodeYouTubeApi2FavoritesFeed = new TreeNode("Favorites feed", this.imageList.Images.IndexOfKey("FolderClosedVideo"), this.imageList.Images.IndexOfKey("FolderOpenVideo")); this.treeNodeYouTubeApi2User = new TreeNode("User", this.imageList.Images.IndexOfKey("FileUser"), this.imageList.Images.IndexOfKey("FileUser"), new TreeNode[] { this.treeNodeYouTubeApi2UploadsFeed, this.treeNodeYouTubeApi2FavoritesFeed, this.treeNodeYouTubeApi2Playlists }); this.treeNodeYouTubeApi2UserFeedsInfo = new TreeNode("User videos", this.imageList.Images.IndexOfKey("FolderClosedUser"), this.imageList.Images.IndexOfKey("FolderOpenUser"), new TreeNode[] { this.treeNodeYouTubeApi2User }); this.treeNodeYouTubeApi2VideoCategories = new TreeNode("Video categories", this.imageList.Images.IndexOfKey("Categories"), this.imageList.Images.IndexOfKey("Categories")); this.treeNodeYouTubeApi2 = new TreeNode("YouTube API version 2", this.imageList.Images.IndexOfKey("ServerBrowse"), this.imageList.Images.IndexOfKey("ServerBrowse"), new TreeNode[] { this.treeNodeYouTubeApi2VideosFeedsInfo, this.treeNodeYouTubeApi2UserFeedsInfo, this.treeNodeYouTubeApi2VideoCategories }); this.treeNodeYouTubeApi3Videos = new TreeNode("Videos", this.imageList.Images.IndexOfKey("FolderClosedVideo"), this.imageList.Images.IndexOfKey("FolderOpenVideo")); this.treeNodeYouTubeApi3 = new TreeNode("YouTube API version 3", this.imageList.Images.IndexOfKey("ServerBrowse"), this.imageList.Images.IndexOfKey("ServerBrowse"), new TreeNode[] { this.treeNodeYouTubeApi3Videos }); this.treeNodeYouTubeWebVideos = new TreeNode("Videos", this.imageList.Images.IndexOfKey("FileGraphLine"), this.imageList.Images.IndexOfKey("FileGraphLine")); this.treeNodeYouTubeWeb = new TreeNode("YouTube Web", this.imageList.Images.IndexOfKey("GlobeBrowse"), this.imageList.Images.IndexOfKey("GlobeBrowse"), new TreeNode[] { this.treeNodeYouTubeWebVideos }); this.treeNodeTasksRunning = new TreeNode("Running tasks", this.imageList.Images.IndexOfKey("FolderClosedPlayGreen"), this.imageList.Images.IndexOfKey("FolderOpenPlayGreen")); this.treeNodeTasksScheduled = new TreeNode("Scheduled tasks", this.imageList.Images.IndexOfKey("FolderClosedClock"), this.imageList.Images.IndexOfKey("FolderOpenClock")); this.treeNodeTasksAll = new TreeNode("All tasks", this.imageList.Images.IndexOfKey("FolderClosedTask"), this.imageList.Images.IndexOfKey("FolderOpenTask")); this.treeNodeTasksInfo = new TreeNode("Tasks", this.imageList.Images.IndexOfKey("ServerTask"), this.imageList.Images.IndexOfKey("ServerTask"), new TreeNode[] { this.treeNodeTasksRunning, this.treeNodeTasksScheduled, this.treeNodeTasksAll }); this.treeNodeSettings = new TreeNode("Settings", this.imageList.Images.IndexOfKey("Settings"), this.imageList.Images.IndexOfKey("Settings")); this.treeNodeCommentsVideos = new TreeNode("Videos", this.imageList.Images.IndexOfKey("CommentVideo"), this.imageList.Images.IndexOfKey("CommentVideo")); this.treeNodeCommentsUsers = new TreeNode("Users", this.imageList.Images.IndexOfKey("CommentUser"), this.imageList.Images.IndexOfKey("CommentUser")); this.treeNodeCommentsPlaylists = new TreeNode("Playlists", this.imageList.Images.IndexOfKey("CommentPlay"), this.imageList.Images.IndexOfKey("CommentPlay")); this.treeNodeComments = new TreeNode("Comments", this.imageList.Images.IndexOfKey("Comments"), this.imageList.Images.IndexOfKey("Comments"), new TreeNode[] { this.treeNodeCommentsVideos, this.treeNodeCommentsUsers, this.treeNodeCommentsPlaylists }); // Add the panel controls to the split container. this.splitContainer.Panel2.Controls.Add(this.controlPlanetLab); this.splitContainer.Panel2.Controls.Add(this.controlPlanetLabSites); this.splitContainer.Panel2.Controls.Add(this.controlPlanetLabNodes); this.splitContainer.Panel2.Controls.Add(this.controlPlanetLabSlices); this.splitContainer.Panel2.Controls.Add(this.controlDatabaseServers); this.splitContainer.Panel2.Controls.Add(this.controlToolboxInfo); this.splitContainer.Panel2.Controls.Add(this.controlSpiderInfo); this.splitContainer.Panel2.Controls.Add(this.controlSpiderStandardFeeds); this.splitContainer.Panel2.Controls.Add(this.controlYtApi2); this.splitContainer.Panel2.Controls.Add(this.controlYtApi2VideosFeedsInfo); this.splitContainer.Panel2.Controls.Add(this.controlYtApi2Video); this.splitContainer.Panel2.Controls.Add(this.controlYtApi2CommentsFeed); this.splitContainer.Panel2.Controls.Add(this.controlYtApi2StandardFeed); this.splitContainer.Panel2.Controls.Add(this.controlYtApi2Search); this.splitContainer.Panel2.Controls.Add(this.controlYtApi2RelatedFeed); this.splitContainer.Panel2.Controls.Add(this.controlYtApi2ResponseFeed); this.splitContainer.Panel2.Controls.Add(this.controlYtApi2UserFeedInfo); this.splitContainer.Panel2.Controls.Add(this.controlYtApi2Profile); this.splitContainer.Panel2.Controls.Add(this.controlYtApi2UploadsFeed); this.splitContainer.Panel2.Controls.Add(this.controlYtApi2PlaylistsFeed); this.splitContainer.Panel2.Controls.Add(this.controlYtApi2FavoritesFeed); this.splitContainer.Panel2.Controls.Add(this.controlYtApi2PlaylistFeed); this.splitContainer.Panel2.Controls.Add(this.controlYtApi2Categories); this.splitContainer.Panel2.Controls.Add(this.controlYtApi3); this.splitContainer.Panel2.Controls.Add(this.controlYtWeb); this.splitContainer.Panel2.Controls.Add(this.controlYtWebStatistics); this.splitContainer.Panel2.Controls.Add(this.controlSettings); this.splitContainer.Panel2.Controls.Add(this.controlLog); this.splitContainer.Panel2.Controls.Add(this.controlCommentsInfo); this.splitContainer.Panel2.Controls.Add(this.controlCommentsVideos); this.splitContainer.Panel2.Controls.Add(this.controlCommentsUsers); this.splitContainer.Panel2.Controls.Add(this.controlCommentsPlaylists); // Add the panel controls as tags. this.treeNodePlanetLab.Tag = this.controlPlanetLab; this.treeNodePlanetLabSites.Tag = this.controlPlanetLabSites; this.treeNodePlanetLabNodes.Tag = this.controlPlanetLabNodes; this.treeNodePlanetLabSlices.Tag = this.controlPlanetLabSlices; this.treeNodeDatabaseServers.Tag = this.controlDatabaseServers; this.treeNodeToolboxInfo.Tag = this.controlToolboxInfo; this.treeNodeSpidersLocal.Tag = this.controlSpiderInfo; this.treeNodeSpiderStandardFeeds.Tag = this.controlSpiderStandardFeeds; this.treeNodeYouTubeApi2.Tag = this.controlYtApi2; this.treeNodeYouTubeApi2VideosFeedsInfo.Tag = this.controlYtApi2VideosFeedsInfo; this.treeNodeYouTubeApi2Video.Tag = this.controlYtApi2Video; this.treeNodeYouTubeApi2VideoComments.Tag = this.controlYtApi2CommentsFeed; this.treeNodeYouTubeApi2SearchFeed.Tag = this.controlYtApi2Search; this.treeNodeYouTubeApi2StandardFeed.Tag = this.controlYtApi2StandardFeed; this.treeNodeYouTubeApi2RelatedVideosFeed.Tag = this.controlYtApi2RelatedFeed; this.treeNodeYouTubeApi2ResponseVideosFeed.Tag = this.controlYtApi2ResponseFeed; this.treeNodeYouTubeApi2UserFeedsInfo.Tag = this.controlYtApi2UserFeedInfo; this.treeNodeYouTubeApi2User.Tag = this.controlYtApi2Profile; this.treeNodeYouTubeApi2UploadsFeed.Tag = this.controlYtApi2UploadsFeed; this.treeNodeYouTubeApi2Playlists.Tag = this.controlYtApi2PlaylistsFeed; this.treeNodeYouTubeApi2FavoritesFeed.Tag = this.controlYtApi2FavoritesFeed; this.treeNodeYouTubeApi2PlaylistFeed.Tag = this.controlYtApi2PlaylistFeed; this.treeNodeYouTubeApi2VideoCategories.Tag = this.controlYtApi2Categories; this.treeNodeYouTubeApi3.Tag = this.controlYtApi3; this.treeNodeYouTubeWeb.Tag = this.controlYtWeb; this.treeNodeYouTubeWebVideos.Tag = this.controlYtWebStatistics; this.treeNodeSettings.Tag = this.controlSettings; this.controlSideLog.Tag = this.controlLog; this.treeNodeComments.Tag = this.controlCommentsInfo; this.treeNodeCommentsVideos.Tag = this.controlCommentsVideos; this.treeNodeCommentsUsers.Tag = this.controlCommentsUsers; this.treeNodeCommentsPlaylists.Tag = this.controlCommentsPlaylists; // Add the tree nodes to the side panel tree views. this.controlSidePlanetLab.Nodes.Add(this.treeNodePlanetLab); this.controlSideToolbox.Nodes.Add(this.treeNodeToolboxInfo); this.controlSideDatabase.Nodes.Add(this.treeNodeDatabaseServers); this.controlSideSpiders.Nodes.Add(this.treeNodeSpidersLocal); this.controlSideYouTube.Nodes.AddRange( new TreeNode[] { this.treeNodeYouTubeApi2, this.treeNodeYouTubeApi3, this.treeNodeYouTubeWeb }); this.controlSideTasks.Nodes.Add(this.treeNodeTasksInfo); this.controlSideConfiguration.Nodes.Add(this.treeNodeSettings); this.controlSideComments.Nodes.Add(this.treeNodeComments); // Set the status event handler. this.crawler.Status.MessageChanged += this.OnStatusMessageChanged; this.crawler.Status.LockChanged += this.OnStatusLockChanged; // Set the crawler event handlers. this.crawler.Events.PageSelected += this.OnPageSelected; this.crawler.Events.PlanetLabSitesSelected += this.OnPlanetLabSitesSelected; this.crawler.Events.PlanetLabNodesSelected += this.OnPlanetLabNodesSelected; this.crawler.Events.PlanetLabSlicesSelected += this.OnPlanetLabSlicesSelected; this.crawler.Events.YouTubeVideoFeedsSelected += this.OnYouTubeApiV2VideosFeedsInfoSelected; this.crawler.Events.YouTubeUserFeedsSelected += this.OnYouTubeApiV2UserFeedsInfoSelected; this.crawler.Events.YouTubeCategoriesSelected += this.OnYouTubeApi2VideoCategoriesSelected; this.crawler.Events.YouTubeVideoSelected += this.OnYouTubeApiV2VideoSelected; this.crawler.Events.YouTubeVideoCommentsSelected += this.OnYouTubeApiV2VideoCommentsSelected; this.crawler.Events.YouTubeSearchFeedSelected += this.OnYouTubeApiV2SearchFeedSelected; this.crawler.Events.YouTubeStandardFeedSelected += this.OnYouTubeApiV2StandardFeedSelected; this.crawler.Events.YouTubeRelatedVideosFeedSelected += this.OnYouTubeApiV2RelatedVideosFeedSelected; this.crawler.Events.YouTubeResponseVideosFeedSelected += this.OnYouTubeApiV2ResponseVideosFeedSelected; this.crawler.Events.YouTubeUserSelected += this.OnYouTubeApiV2UserSelected; this.crawler.Events.YouTubeUploadsFeedSelected += this.OnYouTubeApiV2UserUploadsSelected; this.crawler.Events.YouTubeFavoritesFeedSelected += this.OnYouTubeApiV2UserFavoritesSelected; this.crawler.Events.YouTubePlaylistsFeedSelected += this.OnYouTubeApiV2UserPlaylistsSelected; this.crawler.Events.YouTubePlaylistFeedSelected += this.OnYouTubeApiV2PlaylistVideosSelected; this.crawler.Events.YouTubeApiV2VideoOpened += this.OnYouTubeApiV2VideoOpened; this.crawler.Events.YouTubeApiV2VideoCommentOpened += this.OnYouTubeApiV2VideoCommentOpened; this.crawler.Events.YouTubeApiV2RelatedVideosOpened += this.OnYouTubeApiV2RelatedVideosOpened; this.crawler.Events.YouTubeApiV2ResponseVideosOpened += this.OnYouTubeApiV2ResponseVideosOpened; this.crawler.Events.YouTubeApiV2UserOpened += this.OnYouTubeApiV2AuthorOpened; this.crawler.Events.YouTubeApiV2UserUploadsOpened += this.OnYouTubeApiV2UserUploadsOpened; this.crawler.Events.YouTubeApiV2UserFavoritesOpened += this.OnYouTubeApiV2UserFavoritesOpened; this.crawler.Events.YouTubeApiV2UserPlaylistsOpened += this.OnYouTubeApiV2UserPlaylistsOpened; this.crawler.Events.YouTubeApiV2PlaylistOpened += this.OnYouTubeApiV2PlaylistOpened; this.crawler.Events.YouTubeWebVideosSelected += this.OnYouTubeWebVideosSelected; this.crawler.Events.YouTubeWebVideoOpened += this.OnYouTubeWebVideoOpened; this.crawler.Events.CommentsYouTubeVideosSelected += this.OnYouTubeCommentsVideosSelected; this.crawler.Events.CommentsYouTubeUsersSelected += this.OnYouTubeCommentsUsersSelected; this.crawler.Events.CommentsYouTubePlaylistsSelected += this.OnYouTubeCommentsPlaylistsSelected; this.crawler.Events.YouTubeVideoCommented += this.OnYouTubeVideoCommented; this.crawler.Events.YouTubeUserCommented += this.OnYouTubeUserCommented; this.crawler.Events.YouTubePlaylistCommented += this.OnYouTubePlaylistCommented; this.crawler.Events.SpiderStandardFeedsSelected += this.OnSpiderStandardFeedsSelected; // Initialize the controls. this.controlPlanetLab.Initialize(this.crawler); this.controlPlanetLabSites.Initialize(this.crawler); this.controlPlanetLabNodes.Initialize(this.crawler); this.controlPlanetLabSlices.Initialize(this.crawler, this.treeNodePlanetLabSlices, this.splitContainer.Panel2.Controls); this.controlDatabaseServers.Initialize(this.crawler, this.treeNodeDatabaseServers, this.splitContainer.Panel2.Controls, this.imageList); this.controlToolboxInfo.Initialize(this.crawler, this.imageList, this.treeNodeToolboxInfo, this.splitContainer.Panel2.Controls); this.controlSpiderStandardFeeds.Initialize(this.crawler); this.controlYtApi2.Initialize(this.crawler); this.controlYtApi2VideosFeedsInfo.Initialize(this.crawler); this.controlYtApi2Video.Initialize(this.crawler); this.controlYtApi2CommentsFeed.Initialize(this.crawler); this.controlYtApi2StandardFeed.Initialize(this.crawler); this.controlYtApi2Search.Initialize(this.crawler); this.controlYtApi2RelatedFeed.Initialize(this.crawler, new VideosFeedEventHandler(YouTubeUri.GetRelatedVideosFeed), "&Video:", "related videos feed", "video", "APIv2 Related Videos Feed"); this.controlYtApi2ResponseFeed.Initialize(this.crawler, new VideosFeedEventHandler(YouTubeUri.GetResponseVideosFeed), "&Video:", "response videos feed", "video", "APIv2 Response Videos Feed"); this.controlYtApi2UserFeedInfo.Initailize(this.crawler); this.controlYtApi2Profile.Initialize(this.crawler); this.controlYtApi2PlaylistsFeed.Initialize(this.crawler); this.controlYtApi2UploadsFeed.Initialize(this.crawler, new VideosFeedEventHandler(YouTubeUri.GetUploadsFeed), "&User:"******"uploads video feed", "user", "APIv2 Uploads Videos Feed"); this.controlYtApi2FavoritesFeed.Initialize(this.crawler, new VideosFeedEventHandler(YouTubeUri.GetFavoritesFeed), "&User:"******"favorites video feed", "user", "APIv2 Favorites Videos Feed"); this.controlYtApi2PlaylistFeed.Initialize(this.crawler, new VideosFeedEventHandler(YouTubeUri.GetPlaylistFeed), "&Playlist:", "playlist video feed", "user", "APIv2 Playlist Videos Feed"); this.controlYtApi2Categories.Initialize(this.crawler); this.controlYtWeb.Initialize(this.crawler); this.controlYtWebStatistics.Initialize(this.crawler); this.controlSettings.Initialize(this.crawler); this.controlLog.Initialize(this.crawler.Config, this.crawler.Log); this.controlCommentsVideos.Initialize(this.crawler.Comments.Videos, InetCrawler.Comments.CrawlerComment.CommentType.Video); this.controlCommentsUsers.Initialize(this.crawler.Comments.Users, InetCrawler.Comments.CrawlerComment.CommentType.User); this.controlCommentsPlaylists.Initialize(this.crawler.Comments.Playlists, InetCrawler.Comments.CrawlerComment.CommentType.Playlist); // Set the selected control. this.controlPanel = this.labelNotAvailable; // Initialize the side controls. this.controlSidePlanetLab.Initialize(); this.controlSideToolbox.Initialize(); this.controlSideDatabase.Initialize(); this.controlSideSpiders.Initialize(); this.controlSideYouTube.Initialize(); this.controlSideTasks.Initialize(); this.controlSideLog.Initialize(); this.controlSideConfiguration.Initialize(); this.controlSideComments.Initialize(); // Configure the side menu with the last saved configuration. this.sideMenu.VisibleItems = this.crawler.Config.ConsoleSideMenuVisibleItems; this.sideMenu.SelectedIndex = this.crawler.Config.ConsoleSideMenuSelectedItem; if (this.sideMenu.SelectedItem.HasControl && this.sideMenu.SelectedItem.Control.HasSelected()) { this.sideMenu.SelectedItem.Control.SetSelected(this.crawler.Config.ConsoleSideMenuSelectedNode); } // Create the network status event handler. this.actionNetworkStatusChanged = new EventHandler(this.OnNetworkStatusChanged); this.actionNetworkStatusChecked = new EventHandler(this.OnNetworkStatusChecked); // Set the network availability event handler. NetworkStatus.NetworkChanged += this.actionNetworkStatusChanged; NetworkStatus.NetworkChecked += this.actionNetworkStatusChecked; // Update the network status. this.OnNetworkStatusChanged(this, EventArgs.Empty); // Set the font. Window.SetFont(this); }
/// <summary> /// Creates a new control instance. /// </summary> /// <param name="container">The container.</param> public NetworkStatusToolTip(IContainer container) : base(container) { // Get the theme settings. this.themeSettings = ToolStripManager.Renderer is ThemeRenderer ? (ToolStripManager.Renderer as ThemeRenderer).Settings : ThemeSettings.Default; // Set the default properties. this.IsBalloon = false; this.OwnerDraw = true; this.UseAnimation = true; this.UseFading = true; // Set the event handlers. this.Popup += this.OnPopup; this.Draw += this.OnDraw; }
/// <summary> /// Creates a new theme renderer instance. /// </summary> /// <param name="settings">The theme color table.</param> public ThemeRenderer(ThemeSettings settings) : base(settings.ColorTable) { this.RoundedEdges = false; this.settings = settings; }
/// <summary> /// Creates a new theme tab control instance. /// </summary> public ThemeTabControl() { // Set the control style. base.SetStyle( ControlStyles.UserPaint | ControlStyles.OptimizedDoubleBuffer | ControlStyles.ResizeRedraw | ControlStyles.AllPaintingInWmPaint, true); // Set the padding. base.Padding = new Point(0, 0); // Set the paint actions. this.actionsPaint = new Action<PaintEventArgs>[] { this.OnPaintTop, this.OnPaintBottom }; // Set the invalidate tabs actions. this.actionsInvalidateTabs = new Action[] { this.OnInvalidateTabsTop, this.OnInvalidateTabsBottom }; // Set the theme settings. this.themeSettings = ToolStripManager.Renderer is ThemeRenderer ? (ToolStripManager.Renderer as ThemeRenderer).Settings : ThemeSettings.Default; }