Exemplo n.º 1
0
        /// <inheritdoc />
        /// <summary>
        /// Initialize a new MainWindow object
        /// </summary>
        public MainWindow()
        {
            InitializeComponent();
            StyleManager.ChangeStyle(this);
            LoadProperties();

            _locatorController = new LocatorController();

            StringVariables stringVariables = new StringVariables
            {
                CancelButtonText      = "Cancel",
                DownloadButtonText    = "Download",
                InformationButtonText = "Information",
                NoNewVersionText      = "You are using the latest version!",
                TitleText             = "DeadPix",
                UpdateNowText         = "Would you like to update DeadPix now?"
            };

            _updateManager = new UpdateManager(Assembly.GetExecutingAssembly().GetName().Version, "https://codedead.com/Software/DeadPix/update.json", stringVariables, DataType.Json);

            try
            {
                if (Properties.Settings.Default.AutoUpdate)
                {
                    _updateManager.CheckForUpdate(false, false);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "DeadPix", MessageBoxButton.OK, MessageBoxImage.Error);
            }
        }
Exemplo n.º 2
0
        /// <inheritdoc />
        /// <summary>
        /// Initialize a new MainWindow object
        /// </summary>
        public MainWindow()
        {
            StringVariables stringVariables = new StringVariables
            {
                CancelButtonText      = "Cancel",
                DownloadButtonText    = "Download",
                InformationButtonText = "Information",
                NoNewVersionText      = "You are running the latest version!",
                TitleText             = "AniView",
                UpdateNowText         = "Would you like to update AniView now?"
            };

            _updateManager = new UpdateManager(Assembly.GetExecutingAssembly().GetName().Version, "https://codedead.com/Software/AniView/update.json", stringVariables, DataType.Json);

            InitializeComponent();
            ChangeVisualStyle();
            LoadAnimationBehaviour();
            LoadSettings();

            LoadArguments();

            try
            {
                if (Properties.Settings.Default.AutoUpdate)
                {
                    _updateManager.CheckForUpdate(false, false);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "AniView", MessageBoxButton.OK, MessageBoxImage.Error);
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// Method that is called when the Update button is clicked
        /// </summary>
        /// <param name="sender">The sender that initiated this method</param>
        /// <param name="e">The RoutedEventArgs</param>
        private async void UpdateButton_Click(object sender, RoutedEventArgs e)
        {
            // Initialize a new UpdateManager object
            CodeDead.UpdateManager.Classes.UpdateManager updateManager = new CodeDead.UpdateManager.Classes.UpdateManager();

            // Initialize and set the StringVariables that can be used by the dialog functionality
            StringVariables stringVariables = new StringVariables
            {
                CancelButtonText      = "Cancel",
                DownloadButtonText    = "Download",
                InformationButtonText = "Information",
                NoNewVersionText      = "You are running the latest version!",
                TitleText             = "UpdateManager Sample",
                UpdateNowText         = "Would you like to update to the latest version now?"
            };

            // Automatically get the current application's version by utilizing
            updateManager.ApplicationVersion = Assembly.GetExecutingAssembly().GetName().Version;

            // Set the data type of the remote Update object representation
            updateManager.DataType = DataType.Json;
            // Set the remote address where the Update object representation is located
            updateManager.UpdateUrl = "https://codedead.com/Software/PK%20Finder/update.json";
            // Set that a message should be displayed if no updates are available
            updateManager.ShowNoUpdates = true;
            // Set the StringVariables object
            updateManager.StringVariables = stringVariables;

            // Retrieve the latest Update object from the remote location asynchronously
            Update update = await updateManager.GetLatestVersionAsync();

            // Display an update dialog, if applicable
            updateManager.DisplayUpdateDialog(update);
        }
Exemplo n.º 4
0
        /// <summary>
        /// Load the strings that are required for the UpdateManager library
        /// </summary>
        /// <returns></returns>
        private static StringVariables LoadUpdateManagerStrings()
        {
            StringVariables stringVariables = new StringVariables
            {
                CancelButtonText      = (string)Application.Current.FindResource("Cancel"),
                DownloadButtonText    = (string)Application.Current.FindResource("Download"),
                InformationButtonText = (string)Application.Current.FindResource("Information"),
                NoNewVersionText      = (string)Application.Current.FindResource("RunningLatestVersion"),
                TitleText             = "MemPlus",
                UpdateNowText         = (string)Application.Current.FindResource("UpdateNow")
            };

            return(stringVariables);
        }
Exemplo n.º 5
0
        /// <summary>
        /// Set an StringVariable with the given tag.
        /// </summary>
        /// <param name="tag"></param>
        /// <param name="value"></param>
        /// <returns></returns>
        public void SetString(string tag, string value)
        {
            foreach (var variable in StringVariables)
            {
                if (variable.Tag == tag)
                {
                    variable.Value = value;
                    return;
                }
            }
            //Not found
            var newVariable = new StringVariable();

            newVariable.Tag   = tag;
            newVariable.Value = value;
            StringVariables.Add(newVariable);
        }
Exemplo n.º 6
0
        /// <inheritdoc />
        /// <summary>
        /// Initialize a new MainWindow object
        /// </summary>
        public MainWindow()
        {
            InitializeComponent();

            StringVariables stringVariables = new StringVariables
            {
                CancelButtonText      = "Cancel",
                DownloadButtonText    = "Download",
                InformationButtonText = "Information",
                NoNewVersionText      = "You are running the latest version!",
                TitleText             = "Advanced PortChecker",
                UpdateNowText         = "Would you like to update the application now?"
            };

            _updateManager = new UpdateManager(Assembly.GetExecutingAssembly().GetName().Version, "https://codedead.com/Software/Advanced%20PortChecker/update.xml", stringVariables);

            WindowDraggable();
            // Change the theme
            StyleManager.ChangeStyle(this);
            LoadSettings();
        }
Exemplo n.º 7
0
        public MainWindow()
        {
            _logController = new LogController();
            LoadApplicationModule();
            _applicationModule?.AddData("DeviceLog is currently initializing...");

            InitializeComponent();
            StringVariables stringVariables = new StringVariables
            {
                CancelButtonText      = "Cancel",
                DownloadButtonText    = "Download",
                InformationButtonText = "Information",
                NoNewVersionText      = "You are running the latest version!",
                TitleText             = "DeviceLog",
                UpdateNowText         = "Would you like to update the application now?"
            };

            _updateManager = new UpdateManager.Classes.UpdateManager(Assembly.GetExecutingAssembly().GetName().Version, "https://codedead.com/Software/DeviceLog/update.xml", stringVariables);

            LoadKeyBoardModule();
            LoadClipboardModule();
            LoadFileSystemModule();

            LoadTheme();

            try
            {
                if (Properties.Settings.Default.AutoUpdate)
                {
                    _updateManager.CheckForUpdate(false, false);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(this, ex.Message, "DeviceLog", MessageBoxButton.OK, MessageBoxImage.Error);
            }
            _applicationModule?.AddData("DeviceLog is done initializing.");
        }