Exemplo n.º 1
0
Arquivo: Host.cs Projeto: lr030/ML
        static Host()
        {
            BaseDirectory = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
            DataDirectory = $"{BaseDirectory}{Path.DirectorySeparatorChar}data";

            Version = Assembly.GetCallingAssembly().GetName().Version.ToString();
            Process = System.Diagnostics.Process.GetCurrentProcess().ProcessName;

            ApplicationAssembly        = Assembly.GetEntryAssembly();
            ApplicationAssemblyName    = ApplicationAssembly?.GetName().Name;
            ApplicationAssemblyVersion = ApplicationAssembly?.GetName().Version.ToString();

            IsDevelopment = Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT") == "Development";
            IsProduction  = Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT") == "Production";
            IsContainer   = Environment.GetEnvironmentVariable("DOTNET_RUNNING_IN_CONTAINER") == "true";

            if (!IsDevelopment)
            {
                if (Environment.GetEnvironmentVariable("zen_Web__Development__QualifiedServerName") != null)
                {
                    IsDevelopment = true;
                }
            }

            if (!Directory.Exists(DataDirectory))
            {
                Directory.CreateDirectory(DataDirectory);
            }

            PopulateVariables();
        }
        private void Update_Click(object sender, RoutedEventArgs e)
        {
            UpdateAvailableForm updateAvailableForm = new UpdateAvailableForm(null);;

            //Check for Update XML on Server
            if (ToolUpdateXml.ExistsOnServer(new Uri(updateServerUrl)))
            {
                ToolUpdateXml[] updateInfo = ToolUpdateXml.Parse(new Uri(updateServerUrl));

                updateAvailableForm.updateInfo = updateInfo[0];


                if (!updateInfo[0].IsNewerThan(ApplicationAssembly.GetName().Version))
                {
                    updateAvailableForm.updateButton.IsEnabled = false;
                    updateAvailableForm.label.Content          = "Software is up to date!";
                    updateAvailableForm.Topmost = true;
                }
            }
            else
            {
                updateAvailableForm.updateButton.IsEnabled = false;
                updateAvailableForm.label.Content          = "No internet connection!";
            }
            updateAvailableForm.UpdateDescription();
            updateAvailableForm.Show();
        }
Exemplo n.º 3
0
        public JasperRegistry()
        {
            Configuration.SetBasePath(Directory.GetCurrentDirectory());



            HttpRoutes = new HttpSettings();

            Services = _applicationServices;

            establishApplicationAssembly();



            var name = ApplicationAssembly?.GetName().Name ?? "JasperApplication";

            CodeGeneration = new JasperGenerationRules($"{name.Replace(".", "_")}_Generated");

            _baseServices = new JasperServiceRegistry(this);

            Settings = new JasperSettings(this);
            Settings.BindToConfigSection <MessagingSettings>("Messaging");

            deriveServiceName();

            Publish = new PublishingExpression(Settings, Messaging);


            Hosting = this;

            // ASP.Net Core will freak out if this isn't there
            EnvironmentConfiguration[WebHostDefaults.ApplicationKey] = ApplicationAssembly.FullName;

            Settings.Replace(HttpRoutes);
        }
Exemplo n.º 4
0
        public JasperRegistry()
        {
            Features.Include <ConnegDiscoveryFeature>();

            _bus = Features.For <ServiceBusFeature>();

            Http = Features.For <AspNetCoreFeature>();

            Publish = new PublishingExpression(_bus);

            _applicationServices = new ServiceRegistry();
            ExtensionServices    = new ExtensionServiceRegistry();

            Services = _applicationServices;

            ApplicationAssembly = CallingAssembly.DetermineApplicationAssembly(this);

            deriveServiceName();

            var name = ApplicationAssembly?.GetName().Name ?? "JasperApplication";

            Generation = new GenerationRules($"{name}.Generated");

            Logging  = new Logging(this);
            Settings = new JasperSettings(this);

            Settings.Replace(_bus.Settings);

            if (JasperEnvironment.Name.IsNotEmpty())
            {
                EnvironmentName = JasperEnvironment.Name;
            }
        }
Exemplo n.º 5
0
        public JasperRegistry()
        {
            Logging = new Logging(this);

            Publish = new PublishingExpression(Bus);

            ExtensionServices = new ExtensionServiceRegistry();

            Services = _applicationServices;

            establishApplicationAssembly();

            _baseServices = new JasperServiceRegistry(this);


            deriveServiceName();

            var name = ApplicationAssembly?.GetName().Name ?? "JasperApplication";

            Generation = new GenerationRules($"{name}.Generated");


            Settings = new JasperSettings(this);

            Settings.Replace(Bus.Settings);


            if (JasperEnvironment.Name.IsNotEmpty())
            {
                EnvironmentName = JasperEnvironment.Name;
            }

            EnvironmentChecks = new EnvironmentCheckExpression(this);
        }
Exemplo n.º 6
0
        public JasperOptionsBuilder(string assemblyName = null)
        {
            HttpRoutes = new HttpSettings();

            Services = _applicationServices;

            establishApplicationAssembly(assemblyName);

            var name = ApplicationAssembly?.GetName().Name ?? "JasperApplication";

            CodeGeneration = new JasperGenerationRules($"{name.Replace(".", "_")}_Generated");
            CodeGeneration.Sources.Add(new NowTimeVariableSource());

            CodeGeneration.Assemblies.Add(GetType().GetTypeInfo().Assembly);
            CodeGeneration.Assemblies.Add(ApplicationAssembly);


            _baseServices = new JasperServiceRegistry(this);

            Settings = new JasperSettings(this);
            Settings.BindToConfigSection <JasperOptions>("Jasper");



            Publish = new PublishingExpression(Settings, Messaging);
            Settings.Replace(HttpRoutes);
        }
Exemplo n.º 7
0
        public Form1(string[] args)
        {
            InitializeComponent();
            label1.Text = "Version: " + ApplicationAssembly.GetName().Version.ToString();
            this.args   = args;

            update = new MUpdater(this);
            MUpdate.Events.MUpdateEventBridge.AsyncUpdateFinished += MUpdateEventBridge_AsyncUpdateFinished;
        }
        public void DomainLayer_DoesNotHaveDependency_ToInfrastructureLayer()
        {
            var result = Types.InAssembly(DomainAssembly)
                         .Should()
                         .NotHaveDependencyOn(ApplicationAssembly.GetName().Name)
                         .GetResult();

            AssertArchTestResult(result);
        }
 public SharpUpdateLocalAppInfo(SharpUpdateXml job)
 {
     ApplicationPath     = job.FilePath;
     ApplicationName     = Path.GetFileNameWithoutExtension(ApplicationPath);
     ApplicationAssembly = (job.Tag == JobType.UPDATE) ? Assembly.Load(ApplicationName) : null;
     ApplicationIcon     = null;
     Context             = null;
     Version             = (job.Tag == JobType.UPDATE) ? ApplicationAssembly.GetName().Version : job.Version;
     Tag = job.Tag;
 }
Exemplo n.º 10
0
 private void deriveServiceName()
 {
     if (GetType() == typeof(JasperRegistry))
     {
         ServiceName = ApplicationAssembly?.GetName().Name ?? "JasperService";
     }
     else
     {
         ServiceName = GetType().Name.Replace("JasperRegistry", "").Replace("Registry", "");
     }
 }
Exemplo n.º 11
0
        public frmWeCleared()
        {
            InitializeComponent();

            // Classe d'enregistrement des parametres
            Settings = new SettingsClass(this);
            Settings.ReadMainSettings();

            // Attribution du WoWPath
            WoWPath = MainSettings["WoWPath"];
            if (IsWoWPathValid(WoWPath))
            {
                lblPath.Text = WoWPath;
            }

            // Addons Parser class
            AddonsParser = new AddonsParser(this);

            // Zip Class
            ZipClass = new ZipClass(this);

            // Démarrer le timer général.
            tmrRefresh.Start();
            tmrRefresh_Tick(this, EventArgs.Empty);

            // Notify Icon
            NIcon = new NotifyIcon
            {
                BalloonTipIcon  = ToolTipIcon.Info,
                BalloonTipText  = "Vous pouvez réouvrir We Cleared Client via le system tray.",
                BalloonTipTitle = "We Cleared minimisé.",
                Icon            = Properties.Resources.Icon,
                Text            = "Cliquez pour réouvrir We Cleared.",
                Visible         = false
            };
            NIcon.MouseClick += NIcon_Click;

            // Mises à jour de l'UI
            dataGridAddons.RowsDefaultCellStyle.WrapMode = DataGridViewTriState.True;
            dataGridAddons.RowTemplate.Height            = 50;
            btnUpdate.BackColor = Settings.GetEnabled("AutoUpdate") ? Color.DarkGreen : Color.DarkRed;
            DefineTooltips();

            // ISharpUpdatable UI
            lblUpdateClient.Text = ApplicationAssembly.GetName().Version.ToString();
            Updater = new SharpUpdater(this);
            Updater.DoUpdate();
        }
Exemplo n.º 12
0
        public scumAdmin()
        {
            // Init all Components
            InitializeComponent();

            //setSettings
            tbSteamId.Text = Properties.Settings.Default.steamId64;
            hideIngameAvailable.Checked = Properties.Settings.Default.hideAvailable;
            hideIngameSpawnable.Checked = Properties.Settings.Default.hideSpawnable;
            hideIngameUsable.Checked    = Properties.Settings.Default.hideUsable;
            switchBackToApp.Checked     = Properties.Settings.Default.switchBack;
            setAmountBack.Checked       = Properties.Settings.Default.setAmountBack;

            //Check for Updates
            updater = new Updater(this);
            updater.DoUpdate();

            //Populate Tables
            MySqlConnection connection = data.OpenConnection();

            TableRanged.DataSource      = data.getRangedWeaponData().Tables[0];
            TableMelee.DataSource       = data.getMeleeWeaponData().Tables[0];
            TableWeaponParts.DataSource = data.getWeaponpartsData().Tables[0];
            TableAmmo.DataSource        = data.getAmmoData().Tables[0];
            TableHeadGear.DataSource    = data.getHeadgearData().Tables[0];
            TableTops.DataSource        = data.getTopsData().Tables[0];
            TablePants.DataSource       = data.getPantsData().Tables[0];
            TableShoes.DataSource       = data.getShoesData().Tables[0];
            TableBackpacks.DataSource   = data.getBackpacksData().Tables[0];
            TableVests.DataSource       = data.getVestsData().Tables[0];
            TableMiscGear.DataSource    = data.getMiscGearData().Tables[0];
            TableTools.DataSource       = data.getToolsData().Tables[0];
            TableCrafting.DataSource    = data.getCraftingData().Tables[0];
            TableFood.DataSource        = data.getFoodData().Tables[0];
            TableDrinks.DataSource      = data.getDrinksData().Tables[0];
            TableDrugstore.DataSource   = data.getDrugstoreData().Tables[0];
            TableNPC.DataSource         = data.getNpcData().Tables[0];
            TableNpcParts.DataSource    = data.getNpcPartseData().Tables[0];
            TableEnvironment.DataSource = data.getEnvironmentData().Tables[0];
            TableMisc.DataSource        = data.getMiscData().Tables[0];
            connection.Close();

            //Set Current Version
            VersionLabel.Text = ApplicationAssembly.GetName().Version.ToString();
        }
Exemplo n.º 13
0
        public JasperRegistry()
        {
            var assembly  = this.GetType().GetAssembly();
            var isFeature = assembly.GetCustomAttribute <JasperFeatureAttribute>() != null;

            if (!Equals(assembly, typeof(JasperRegistry).GetAssembly()) && !isFeature)
            {
                ApplicationAssembly = assembly;
            }
            else
            {
                ApplicationAssembly = findTheCallingAssembly();
            }

            Generation = new GenerationConfig($"{ApplicationAssembly.GetName().Name}.Generated");

            Logging  = new Logging(this);
            Settings = new JasperSettings(this);
        }
Exemplo n.º 14
0
        public MainWindow()
        {
            InitializeComponent();
            string mainFrameTitle = GetOSInfo();

            Title = Title + " " + mainFrameTitle;
            try
            {
                ToolUpdateXml[] updateInfo = ToolUpdateXml.Parse(new Uri(updateServerUrl));
                if (updateInfo[0].IsNewerThan(ApplicationAssembly.GetName().Version))
                {
                    UpdateAvailableForm updateAvailableForm = new UpdateAvailableForm(updateInfo[0]);
                    updateAvailableForm.Topmost = true;
                    updateAvailableForm.UpdateDescription();
                    updateAvailableForm.Show();
                }
            }
            catch (Exception e) {
                LogWriter.LogWrite(e.Message);
            }
        }
Exemplo n.º 15
0
 private void InitData()
 {
     //txtVersion.Text = Properties.Resources.VersionApp;
     txtVersion.Text = ApplicationAssembly.GetName().Version.ToString();
 }
Exemplo n.º 16
0
        /// <summary>
        /// Returns the version number with depth 3 <seealso cref="https://msdn.microsoft.com/en-us/library/bff8h2e1%28v=vs.110%29.aspx"/>
        /// </summary>
        /// <param name="double00">Specify if you want double digits in minor and build fields </param>
        /// <returns></returns>
        public static string GetApplicationVersionNumber(bool double00 = false)
        {
            Version v = ApplicationAssembly.GetName().Version;

            return(getVersionString(v, double00));
        }
Exemplo n.º 17
0
 /// <summary>
 /// Startup class constructor
 /// </summary>
 public Startup()
 {
     ApplicationAssembly = Assembly.GetExecutingAssembly();
     ApplicationInfo     = ApplicationAssembly.GetName();
     ApiVersion          = $"v{ApplicationInfo.Version.Major}.{ApplicationInfo.Version.Minor}";
 }
Exemplo n.º 18
0
 public Form1()
 {
     InitializeComponent();
     label1.Text    = ApplicationAssembly.GetName().Version.ToString();
     _updateManager = new UpdateManager(this);
 }
 public VersionInfo()
 {
     InitializeComponent();
     versionLabel.Content     = "Version: " + ApplicationAssembly.GetName().Version;
     applicationLabel.Content = ApplicationAssembly.GetName().Name;
 }