Exemple #1
0
        /// <summary>
        /// Création des compteurs réseau
        /// </summary>
        private void CreateNetwork()
        {
            UserControlCounter userControlCounter = AddCounterControl(CounterFactory.CreateNetworkCounter(),
                                                                      Color.Gold,
                                                                      "userControlCounterNetwork",
                                                                      "Network");

            userControlCounter.CounterHistory.Counter.DisplayCoef = 1F / 1024F;
            userControlCounter.CounterHistory.Counter.Unit        = "Ko";
        }
Exemple #2
0
        /// <summary>
        /// Création des compteurs mémoire physique
        /// </summary>
        private void CreatePhysicalMemory()
        {
            UserControlCounter userControlCounter = AddCounterControl(CounterFactory.CreatePhysicalMemoryCounter(),
                                                                      Color.RoyalBlue,
                                                                      "userControlCounterPhysicalMemory",
                                                                      "Physical Memory");

            userControlCounter.CounterHistory.Counter.DisplayCoef = 1F / 1024F / 1024F / 1024F;
            userControlCounter.CounterHistory.Counter.Unit        = "Go";
        }
Exemple #3
0
        /// <summary>
        /// Création des compteurs mémoire virtuelle
        /// </summary>
        private void CreateVirtualMemory()
        {
            UserControlCounter userControlCounter = AddCounterControl(
                CounterFactory.CreateVirtualMemoryCounter(),
                Color.LimeGreen,
                "userControlCounterVirtualMemory",
                "Virtual Memory");

            userControlCounter.CounterHistory.Counter.DisplayCoef = 1F / 1024F / 1024F / 1024F;
            userControlCounter.CounterHistory.Counter.Unit        = "Go";
        }
Exemple #4
0
        private UserControlCounter AddCounterControl(SimpleCounter counter, Color color, string name, string internalName)
        {
            UserControlCounter userControlCounter = new UserControlCounter();

            userControlCounter.CounterHistory = new CounterHistory(counter);
            userControlCounter.CounterHistory.Counter.Name = internalName;
            userControlCounter.BackColor             = System.Drawing.Color.Transparent;
            userControlCounter.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None;
            userControlCounter.Color    = System.Drawing.Color.FromArgb(0, color);
            userControlCounter.ImeMode  = System.Windows.Forms.ImeMode.Disable;
            userControlCounter.Location = new System.Drawing.Point(0, 21);
            userControlCounter.Margin   = new System.Windows.Forms.Padding(0, 0, 1, 1);
            userControlCounter.Name     = name;
            userControlCounter.Size     = new System.Drawing.Size(40, 20);
            flowLayoutPanel.Controls.Add(userControlCounter);

            // Remonter les actions souris des contrôles à nous-mêmes
            userControlCounter.MouseDown += new MouseEventHandler(Monitor_MouseDown);
            userControlCounter.MouseMove += new MouseEventHandler(Monitor_MouseMove);
            userControlCounter.MouseUp   += new MouseEventHandler(Monitor_MouseUp);

            return(userControlCounter);
        }
Exemple #5
0
		private UserControlCounter AddCounterControl(SimpleCounter counter, Color color, string name, string internalName)
		{
			UserControlCounter userControlCounter = new UserControlCounter();
			userControlCounter.CounterHistory = new CounterHistory(counter);
			userControlCounter.CounterHistory.Counter.Name = internalName;
			userControlCounter.BackColor = System.Drawing.Color.Transparent;
			userControlCounter.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None;
			userControlCounter.Color = System.Drawing.Color.FromArgb(0, color);
			userControlCounter.ImeMode = System.Windows.Forms.ImeMode.Disable;
			userControlCounter.Location = new System.Drawing.Point(0, 21);
			userControlCounter.Margin = new System.Windows.Forms.Padding(0, 0, 1, 1);
			userControlCounter.Name = name;
			userControlCounter.Size = new System.Drawing.Size(40, 20);
			flowLayoutPanel.Controls.Add(userControlCounter);

			// Remonter les actions souris des contrôles à nous-mêmes
			userControlCounter.MouseDown += new MouseEventHandler(Monitor_MouseDown);
			userControlCounter.MouseMove += new MouseEventHandler(Monitor_MouseMove);
			userControlCounter.MouseUp += new MouseEventHandler(Monitor_MouseUp);

			return userControlCounter;
		}