示例#1
0
        public override void Initialize(OptimusMiniSettingsList currentSettings)
        {
            _Bitmap = new Bitmap(96, 96, PixelFormat.Format16bppRgb565);
              _Graphic = Graphics.FromImage(_Bitmap);
              _Data = new WeatherData();
              _DataProvider = new WeatherDataProvider();

              _TitleFont = new Font("Tahoma", 12f, FontStyle.Bold, GraphicsUnit.Pixel);
              _SmallFont = SystemFonts.DefaultFont;

              _DisplayType = -1;

              if (currentSettings["ShowToday"] == "") { _ShowToday = true; }
            else { _ShowToday = (currentSettings["ShowToday"] == "1"); }
              if (currentSettings["ShowTomorrow"] == "") { _ShowTomorrow = true; }
            else { _ShowTomorrow = (currentSettings["ShowTomorrow"] == "1"); }
              if (currentSettings["ShowDayAfterTomorrow"] == "") { _ShowDayAfterTomorrow = true; }
            else { _ShowDayAfterTomorrow = (currentSettings["ShowDayAfterTomorrow"] == "1"); }
              if (currentSettings["ShowWeekend"] == "") { _ShowWeekend = true; }
            else { _ShowWeekend = (currentSettings["ShowWeekend"] == "1"); }

              if (currentSettings["Wait"] != "") { _Wait = int.Parse(currentSettings["Wait"]); } else { _Wait = 30; }
              _LocationCode = currentSettings["LocationCode"];
              _Unit = currentSettings["Unit"];
              if (_Unit == "") { _Unit = "m"; }
              if (_Unit == "m") { _UnitSign = "°"; } else { _UnitSign = "°F"; }

              RequestNextUpdate(new TimeSpan(0, 0, 3)); // Slight delay to display logo once
        }
示例#2
0
        public Config(OptimusMiniSettingsList currentSettings)
        {
            InitializeComponent();
              _Settings = currentSettings;
              _LocationDataProvider = new LocationDataProvider();

              // Unit
              if (_Settings["Unit"] != "")
              {
            if (_Settings["Unit"] == "m") { radioMetricUnit.Checked = true; }
              else { radioEnglishUnit.Checked = true; }
              }

              // Show
              if (currentSettings["ShowToday"] != "") { checkToday.Checked = (currentSettings["ShowToday"] == "1"); }
              if (currentSettings["ShowTomorrow"] != "") { checkTomorrow.Checked = (currentSettings["ShowTomorrow"] == "1"); }
              if (currentSettings["ShowDayAfterTomorrow"] != "") { checkDayAfterTomorrow.Checked = (currentSettings["ShowDayAfterTomorrow"] == "1"); }
              if (currentSettings["ShowWeekend"] != "") { checkWeekend.Checked = (currentSettings["ShowWeekend"] == "1"); }

              // Wait
              if (currentSettings["Wait"] != "") { textWait.Text = currentSettings["Wait"]; }

              // Location
              if (currentSettings["LocationCode"] != "")
              {
            labelCurrentLocation.Text = currentSettings["LocationCode"];
              }
              else
              {
            labelCurrentLocation.Text = "not set";
              }
        }
示例#3
0
        public WorldTimeConfig(OptimusMiniSettingsList currentSettings)
        {
            InitializeComponent();

              _Settings = currentSettings;
              _Items = new List<TimezoneItem>();

              // ----- Fill select box with all timezones
              foreach (TimeZoneInformation lTimezone in TimeZoneInformation.TimeZones)
              {
            selectTimezone.Items.Add(lTimezone.DisplayName);
              }
              selectTimezone.SelectedIndex = 0;

              // ----- Add stored timezones
              for (int i = 0; i < 5; i++)
              {
            string lTimezone = _Settings["Timezone" + i.ToString()];
            if (TimeZoneInformation.ContainsTimeZone(lTimezone))
            {
              TimezoneItem lItem = new TimezoneItem(TimeZoneInformation.GetTimeZone(lTimezone), _Settings["Label" + i.ToString()]);
              _Items.Add(lItem);
              listTimezones.Items.Add(string.Format("{0}: {1}", lItem.Label, lItem.Timezone.DisplayName));
            }
              }
              if (_Items.Count > 0) { listTimezones.Items[0].Selected = true; }

              // ----- Update controls
              UpdateActions();
        }
示例#4
0
        public override void Initialize(OptimusMiniSettingsList currentSettings)
        {
            _Bitmap = new Bitmap(96, 96, PixelFormat.Format16bppRgb565);
              _Graphic = Graphics.FromImage(_Bitmap);

              _TitleFont = new Font("Tahoma", 12f, FontStyle.Bold, GraphicsUnit.Pixel);
              _DefaultFont = new Font("Tahoma", 11f, GraphicsUnit.Pixel);
              _SmallFont = new Font("Tahoma", 10f, FontStyle.Bold, GraphicsUnit.Pixel);

              _Settings = currentSettings;

              _User = _Settings["User"];
              if (!string.IsNullOrEmpty(_User)) { _User += "@gmail.com"; }
              _Password = _Settings["Password"];
              _Execute = _Settings["Execute"];

              _CheckIntervalSeconds = 300;
              if (_Settings["CheckInterval"] != "")
              {
            _CheckIntervalSeconds = int.Parse(_Settings["CheckInterval"]);
              }

              _ItemIntervalSeconds = 5;
              if (_Settings["ItemInterval"] != "")
              {
            _ItemIntervalSeconds = int.Parse(_Settings["ItemInterval"]);
              }

              _FeedItems = new List<Item>();
              _CurrentItem = -1;

              RequestNextUpdate(new TimeSpan(0, 0, 0));
        }
示例#5
0
        public override void Initialize(OptimusMiniSettingsList currentSettings)
        {
            _Bitmap = new Bitmap(96, 96, PixelFormat.Format16bppRgb565);
              _Graphic = Graphics.FromImage(_Bitmap);

              _TitleFont = new Font("Tahoma", 12f, FontStyle.Bold, GraphicsUnit.Pixel);
              _SmallFont = SystemFonts.DefaultFont;

              _Settings = currentSettings;
              _Accounts = new List<AccountPop3>();

              int lAccountsCounts = 0;
              if (_Settings["AccountsCount"] != "")
              {
            lAccountsCounts = int.Parse(_Settings["AccountsCount"]);
              }

              for (int i = 0; i < lAccountsCounts; i++)
              {
            string lAccountConfig = _Settings["Account" + i.ToString()];
            string[] lAccountConfigValues = lAccountConfig.Split(';');
            AccountPop3 lAccount = new AccountPop3();
            lAccount.Server = lAccountConfigValues[0];
            lAccount.User = lAccountConfigValues[1];
            lAccount.Password = lAccountConfigValues[2];
            lAccount.Secure = (lAccountConfigValues[3] == "1");
            lAccount.Execute = lAccountConfigValues[4];
            _Accounts.Add(lAccount);

            string lAccountKnownIds = _Settings["AccountKnownIds" + i.ToString()];
            string[] lAccountKnownIdsValues = lAccountKnownIds.Split(';');
            foreach (string lId in lAccountKnownIdsValues)
            {
              lAccount._KnownMessages.Add(lId);
            }
              }

              _CheckIntervalSeconds = 60;
              if (_Settings["CheckInterval"] != "")
              {
            _CheckIntervalSeconds = int.Parse(_Settings["CheckInterval"]);
              }

              _MessageIntervalSeconds = 5;
              if (_Settings["MessageInterval"] != "")
              {
            _MessageIntervalSeconds = int.Parse(_Settings["MessageInterval"]);
              }

              _NewMessages = new List<Message>();
              _CurrentMessage = -1;

              RequestNextUpdate(new TimeSpan(0, 0, 0));
        }
        public OldSchoolHitCounterConfig(OptimusMiniSettingsList settings)
        {
            InitializeComponent();

              _Settings = settings;
              if (_Settings["Url"] != "")
              {
            fieldUrl.Text = _Settings["Url"];
              }
              else
              {
            fieldUrl.Text = "http://optimus.toolz.at/count.txt";
              }
        }
示例#7
0
        /// <summary>
        /// Assigns passed plugin to specified key.
        /// </summary>
        /// <param name="index">0-based index of key.</param>
        /// <param name="plugin">Plugin to assign.</param>
        /// <returns>0 if successful, otherwise an error code.</returns>
        public int AddPlugin(byte index, OptimusMiniPluginWorkerBase plugin, OptimusMiniSettingsList settings)
        {
            // ----- If there's already a plugin assigned remove it
            RemovePlugin(index);


            // ----- Add new plugin
            _Plugins[index] = plugin;
            plugin.Initialize(settings);
            plugin.Repaint();


            // ----- Result
            return(0);
        }
示例#8
0
        public Config(OptimusMiniSettingsList currentSettings)
        {
            InitializeComponent();

              _Settings = currentSettings;

              textUser.Text = _Settings["User"];
              textPassword.Text = _Settings["Password"];
              textExecute.Text = _Settings["Execute"];

              int lCheckInterval = 300;
              if (_Settings["CheckInterval"] != "")
              {
            lCheckInterval = int.Parse(_Settings["CheckInterval"]);
              }
              textCheckInterval.Text = lCheckInterval.ToString();

              int lItemInterval = 5;
              if (_Settings["ItemInterval"] != "")
              {
            lItemInterval = int.Parse(_Settings["ItemInterval"]);
              }
              textItemInterval.Text = lItemInterval.ToString();
        }
示例#9
0
 public override Form CreateConfiguration(OptimusMiniSettingsList currentSettings)
 {
     return new Config(currentSettings);
 }
 /// <summary>
 /// Creates a new instance of the configuration form and returns it.
 /// </summary>
 /// <param name="currentSettings">Current settings.</param>
 public virtual Form CreateConfiguration(OptimusMiniSettingsList currentSettings)
 {
     return(null);
 }
 /// <summary>
 /// Called before plugin is added.
 /// </summary>
 /// <param name="currentSettings">Current settings.</param>
 /// <remarks>
 /// This is the place to do necessary initialization, e.g. loading
 /// settings and requesting call of Update method.
 /// </remarks>
 public abstract void Initialize(OptimusMiniSettingsList currentSettings);
 /// <summary>
 /// Creates a new instance of the <see cref="OptimusMiniSettingsSection" /> class and returns it.
 /// </summary>
 /// <param name="name"></param>
 public OptimusMiniSettingsSection(string name)
 {
     _Name = name;
       _List = new OptimusMiniSettingsList();
 }
示例#13
0
 public override void Initialize(OptimusMiniSettingsList currentSettings)
 {
     RequestNextUpdate(TimeSpan.MinValue);
 }
 /// <summary>
 /// Called before plugin is added.
 /// </summary>
 /// <param name="currentSettings">Current settings.</param>
 /// <remarks>
 /// This is the place to do necessary initialization, e.g. loading
 /// settings and requesting call of Update method.
 /// </remarks>
 public abstract void Initialize(OptimusMiniSettingsList currentSettings);
 /// <summary>
 /// Creates a new instance of the <see cref="OptimusMiniSettingsSection" /> class and returns it.
 /// </summary>
 /// <param name="name"></param>
 public OptimusMiniSettingsSection(string name)
 {
     _Name = name;
     _List = new OptimusMiniSettingsList();
 }
示例#16
0
        public override void Initialize(OptimusMiniSettingsList currentSettings)
        {
            _Timezones = new TimezoneItem[5];

              for (int i = 0; i < 5; i++)
              {
            string lTimezone = currentSettings["Timezone" + i.ToString()];
            string lLabel = currentSettings["Label" + i.ToString()];

            if (lTimezone != "" && TimeZoneInformation.ContainsTimeZone(lTimezone))
            {
              TimezoneItem lItem = new TimezoneItem(TimeZoneInformation.GetTimeZone(lTimezone), lLabel);
              _Timezones[i] = lItem;
            }
            else
            {
              _Timezones[i] = null;
            }

              }

              RequestNextUpdate(new TimeSpan(0, 0, 0));
        }