예제 #1
0
        /// <summary>Shows or Hides the selected update.</summary>
        /// <param name="sender">The object that called the event.</param>
        /// <param name="e">The <c>System.Windows.RoutedEventArgs</c> instance containing the event data.</param>
        void ShowOrHideUpdate(object sender, RoutedEventArgs e)
        {
            int appIndex = this.appIndices[this.lvUpdates.SelectedIndex];

            var update = this.lvUpdates.SelectedItem as Update;

            if (update == null)
            {
                return;
            }

            var hnh = new Suh(update.Name, Core.Applications[appIndex].AppInfo.Publisher, update.Description)
            {
                HelpUrl     = Core.Applications[appIndex].AppInfo.HelpUrl,
                InfoUrl     = update.InfoUrl,
                AppUrl      = Core.Applications[appIndex].AppInfo.AppUrl,
                ReleaseDate = update.ReleaseDate,
                Status      = UpdateStatus.Hidden,
                UpdateSize  = Core.GetUpdateSize(update.Files),
                Importance  = update.Importance,
            };

            if (!update.Hidden)
            {
                if (WcfService.HideUpdate(hnh))
                {
                    update.Hidden   = true;
                    update.Selected = false;
                }
            }
            else
            {
                if (WcfService.ShowUpdate(hnh))
                {
                    update.Hidden = false;
                }
            }
        }