Exemplo n.º 1
0
        private void Application_Startup(object sender, StartupEventArgs e)
        {
            ExceptionlessClient.Default.Configuration.DefaultData.Add("Locale",
                                                                      Thread.CurrentThread.CurrentUICulture.Name);
            ExceptionlessClient.Default.Startup(Settings.Default.ExceptionlessKey);

            Parser.Default.ParseArguments <CommandLineOptions>(e.Args).WithParsed(o => CurrentOptions = o);

            if (string.IsNullOrEmpty(CurrentOptions.Path))
            {
                CurrentOptions.Path = Environment.CurrentDirectory;
            }

            UpdaterSettings = UpdaterSettings.Load(CurrentOptions.Path ?? Environment.CurrentDirectory);
            Exit           += (s, ea) =>
                              UpdaterSettings.Save(UpdaterSettings, CurrentOptions.Path ?? Environment.CurrentDirectory);

            if (CurrentOptions.CurrentVersion != null)
            {
                return;
            }

            string dllPath = IOPath.Combine(CurrentOptions.Path, "ClassicAssist.dll");

            try
            {
                CurrentOptions.CurrentVersion = VersionHelpers.GetProductVersion(dllPath).ToString();
            }
            catch (Exception)
            {
                CurrentOptions.Force = true;
            }
        }
Exemplo n.º 2
0
        public AboutControlViewModel()
        {
            Assembly assembly = Assembly.GetExecutingAssembly();

            Version   = VersionHelpers.GetProductVersion(assembly);
            BuildDate = $"{GetBuildDateTime( assembly ).ToLongDateString()}";

            Engine.ConnectedEvent            += OnConnectedEvent;
            Engine.DisconnectedEvent         += OnDisconnectedEvent;
            Engine.PlayerInitializedEvent    += PlayerInitializedEvent;
            Engine.Items.CollectionChanged   += ItemsOnCollectionChanged;
            Engine.Mobiles.CollectionChanged += MobilesOnCollectionChanged;

            IncomingPacketHandlers.MobileUpdatedEvent += OnMobileUpdatedEvent;
        }