Esempio n. 1
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            // check for updates
            if (Convert.ToBoolean(StaticHelper.GetApplicationSetting("AutoUpdate")))
            {
                if (string.IsNullOrEmpty(StaticHelper.GetApplicationSetting("LastUpdateCheckDate")))
                {
                    StaticHelper.CheckForMenuXmlUpdates();
                }
                else
                {
                    DateTime lastcheck = Convert.ToDateTime(StaticHelper.GetApplicationSetting("LastUpdateCheckDate"));
                    TimeSpan t         = DateTime.Now - lastcheck;
                    if (t.Days >= Convert.ToInt32(StaticHelper.GetApplicationSetting("UpdateCheckFrequency")))
                    {
                        StaticHelper.CheckForMenuXmlUpdates();
                    }
                }
            }

            // get the buttons
            StaticHelper.LogMessage(MessageType.Info, "Getting buttons");
            menu[] buttons = StaticHelper.GetControlledVocabularyMenus();

            // build the buttons
            StaticHelper.LogMessage(MessageType.Info, "Building menu");
            this.BuildMenu(buttons);

            if (this.menu1.Items.Count == 0)
            {
                this.ShowManager();
            }
        }
Esempio n. 2
0
 private void buttonCheckForUpdates_Click(object sender, RoutedEventArgs e)
 {
     if (StaticHelper.CheckForMenuXmlUpdates())
     {
         MessageBox.Show("Update is complete", "Finished", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
     else
     {
         MessageBox.Show("Update failed. Check your Event Log", "Finished", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }