private void frmSettings_Load(object sender, EventArgs e)
        {
            InitPictures();

            NetIconImage.IconStyle iconStyle = AppRegistry.GetIconStyle(
                Application.CompanyName, Application.ProductName,
                "NetworkNotificationIconStyle", NetIconImage.IconStyle.Grow);
            switch (iconStyle)
            {
            case NetIconImage.IconStyle.Lines:
                optLines.Checked = true;
                break;

            case NetIconImage.IconStyle.Grow:
                optGrow.Checked = true;
                break;
            }

            int intTimerInterval = AppRegistry.GetIntValue(
                Application.CompanyName, Application.ProductName,
                "NetworkNotificationTimerInterval", NetworkAnimation.DEFAULT_TIMER_INTERVAL);

            timer1.Interval = intTimerInterval;
            timer1.Start();
            trackBarTimerInterval.Value   = Convert.ToInt32(intTimerInterval / TIME_INTERVAL_GRANULARITY_MS);
            trackBarTimerInterval.Minimum = 100 / TIME_INTERVAL_GRANULARITY_MS;  // 100 ms
            trackBarTimerInterval.Maximum = 4000 / TIME_INTERVAL_GRANULARITY_MS; // 4 seconds
            trackBarTimerInterval_Scroll(this, EventArgs.Empty);                 // Trigger change and UI update


            int intIndicatorPacketSize = AppRegistry.GetIntValue(
                Application.CompanyName, Application.ProductName,
                "NetworkNotificatioIndicatorPacketSize", NetworkAnimation.DEFAULT_INDICATOR_PACKET_SIZE);

            trackBarIndicatorPacketSize.Value   = Convert.ToInt32(intIndicatorPacketSize / PACKET_SIZE_GRANULARITY_MS);
            trackBarIndicatorPacketSize.Minimum = 128 / PACKET_SIZE_GRANULARITY_MS;  // 128 bytes
            trackBarIndicatorPacketSize.Maximum = 8192 / PACKET_SIZE_GRANULARITY_MS; // 8 MB
            trackBarIndicatorPacketSize_Scroll(this, EventArgs.Empty);               // Trigger change and UI update
        }
Example #2
0
        internal static NetIconImage.IconStyle GetIconStyle(string companyName, string applicationProductName,
                                                            string name, NetIconImage.IconStyle defaultIconStyle)
        {
            int defaultValue = Convert.ToInt32(NetIconImage.IconStyle.Grow);

            RegistryKey key         = Registry.CurrentUser;
            int         returnValue = 0;

            int.TryParse(key.GetValue(name, defaultValue).ToString(), out returnValue);
            switch (returnValue)
            {
            case 0:
                return(NetIconImage.IconStyle.Lines);

            // break;
            case 1:
                return(NetIconImage.IconStyle.Grow);

            // break;
            default:
                throw new Exception("Wrong registry value for: " + name);
            }
        }
Example #3
0
 public IconStyleChangedEventArgs(NetIconImage.IconStyle newIconStye)
 {
     m_iconStyle = newIconStye;
 }
Example #4
0
        internal static void SaveIconType(string companyName, string applicationProductName, string name, NetIconImage.IconStyle value)
        {
            RegistryKey key = Registry.CurrentUser;

            key.SetValue(name, Convert.ToInt32(value));
        }
        internal void SetIconStyle(NetIconImage.IconStyle selectedIconStyle)
        {
            IconStyleChangedEventArgs eventArgs = new IconStyleChangedEventArgs(selectedIconStyle);

            OnIconStyleChanged(eventArgs);
        }