Esempio n. 1
0
        /// <summary>
        /// 根据关键字创建程序对象
        /// </summary>
        /// <param name="key"></param>
        /// <param name="PluginId"></param>
        /// <returns></returns>
        public static List <object> CreateInstancesByKey(string key, string PluginId = "")
        {
            var           models      = ApplicationAssembly.ToArray();
            var           modelsByKey = models.GetModelsByKey(key);
            List <object> lstObj      = new List <object>();

            if (modelsByKey != null && modelsByKey.Count > 0)
            {
                modelsByKey.ForEach(modelByKey =>
                {
                    var assemblyPluginAttribute = modelByKey.GetAssemblyPluginAttribute();
                    if (!String.IsNullOrWhiteSpace(PluginId))
                    {
                        var obj = CreateInstanceByAssemblyIdAndPluginId(assemblyPluginAttribute.ID, PluginId);
                        lstObj.Add(obj);
                    }
                    else if (!String.IsNullOrWhiteSpace(assemblyPluginAttribute.DefaultPluginID))
                    {
                        var obj = CreateInstanceByAssemblyIdAndPluginId(assemblyPluginAttribute.ID, assemblyPluginAttribute.DefaultPluginID);
                        lstObj.Add(obj);
                    }
                });
            }
            return(lstObj);
        }
Esempio n. 2
0
File: Host.cs Progetto: 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();
        }
Esempio n. 4
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);
        }
Esempio n. 5
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;
            }
        }
Esempio n. 6
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);
        }
Esempio n. 7
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);
        }
Esempio n. 8
0
        public LayerAssemblyImpl(ApplicationAssembly applicationAssembly, String name)
        {
            this.applicationAssembly = applicationAssembly;
            this.name = name;

            this.moduleAssemblies = new List <ModuleAssembly>();
            this.uses             = new HashSet <LayerAssembly>();
        }
Esempio n. 9
0
        public LayerAssemblyImpl(ApplicationAssembly applicationAssembly, String name)
        {
            this.applicationAssembly = applicationAssembly;
            this.name = name;

            this.moduleAssemblies = new List<ModuleAssembly>();
            this.uses = new HashSet<LayerAssembly>();
        }
Esempio n. 10
0
        private static LayerAssembly CreateDomainLayer(ApplicationAssembly app)
        {
            LayerAssembly layer = app.NewLayerAssembly("DomainLayer");

            ModuleAssembly shapeModule = CreateShapeModule(layer);

            return layer;
        }
Esempio n. 11
0
        private static LayerAssembly CreateDomainLayer(ApplicationAssembly app)
        {
            LayerAssembly layer = app.NewLayerAssembly("DomainLayer");

            ModuleAssembly experimentalModule = CreateExperimentalModule(layer);

            return(layer);
        }
Esempio n. 12
0
        private static LayerAssembly CreateDomainLayer(ApplicationAssembly app)
        {
            LayerAssembly layer = app.NewLayerAssembly("DomainLayer");

            ModuleAssembly experimentalModule = CreateExperimentalModule(layer);

            return layer;
        }
Esempio n. 13
0
        /// <summary>
        /// 根据插件类型获取相同类型的所有插件
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="Type"></param>
        /// <returns></returns>
        public static List <T> CreateInstancesByPluginType <T>(string Type = "") where T : class
        {
            var models  = ApplicationAssembly.ToArray();
            var lstObjs = models.CreateInstancesByPluginType <T>(Type);

            return(lstObjs);
            //return AppDomain.CurrentDomain.GetAssemblies().CreateInstancesByPluginType<T>(Type);
        }
Esempio n. 14
0
        /// <summary>
        /// 根据ID创建对象
        /// </summary>
        /// <param name="AssemblyId"></param>
        /// <param name="PluginId"></param>
        /// <returns></returns>
        public static object CreateInstanceByAssemblyIdAndPluginId(string AssemblyId, string PluginId = "")
        {
            var models = ApplicationAssembly.ToArray();
            var obj    = models.CreateInstanceByAssemblyIdAndPluginId(AssemblyId, PluginId);

            return(obj);
            //return AppDomain.CurrentDomain.GetAssemblies().CreateInstanceByAssemblyIdAndPluginId(AssemblyId, PluginId);
        }
Esempio n. 15
0
        private static LayerAssembly CreateDomainLayer(ApplicationAssembly app)
        {
            LayerAssembly layer = app.NewLayerAssembly("DomainLayer");

            ModuleAssembly shapeModule = CreateShapeModule(layer);

            return(layer);
        }
        public void DomainLayer_DoesNotHaveDependency_ToInfrastructureLayer()
        {
            var result = Types.InAssembly(DomainAssembly)
                         .Should()
                         .NotHaveDependencyOn(ApplicationAssembly.GetName().Name)
                         .GetResult();

            AssertArchTestResult(result);
        }
Esempio n. 17
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 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;
 }
Esempio n. 19
0
 private void deriveServiceName()
 {
     if (GetType() == typeof(JasperRegistry))
     {
         ServiceName = ApplicationAssembly?.GetName().Name ?? "JasperService";
     }
     else
     {
         ServiceName = GetType().Name.Replace("JasperRegistry", "").Replace("Registry", "");
     }
 }
Esempio n. 20
0
        /// <summary>
        /// 获取所有插件内插件类插件信息
        /// </summary>
        /// <returns></returns>
        public static List <PluginAttribute> GetPluginAttributes()
        {
            //var models = AppDomain.CurrentDomain.GetAssemblies();

            var models = ApplicationAssembly.ToArray();
            List <PluginAttribute> lstObject = new List <PluginAttribute>();

            System.Threading.Tasks.Parallel.ForEach(models, model =>
            {
                model.GetPluginAttributes().ForEach(pluginAttribute => lstObject.Add(pluginAttribute));
            });
            return(lstObject);
        }
Esempio n. 21
0
        private static void Main()
        {
            var f = new ApplicationAssemblyFactory();

            ApplicationAssembly app = f.NewApplicationAssembly();

            LayerAssembly domainLayer = CreateDomainLayer(app);

            ApplicationModel applicationModel = ApplicationModel.NewModel(app);

            ApplicationInstance applicationInstance = applicationModel.NewInstance();

            Run(applicationInstance);
        }
Esempio n. 22
0
        public static ApplicationModel NewModel(ApplicationAssembly application)
        {
            var layerModels = new List <LayerModel>();

            foreach (LayerAssembly layer in application.Layers)
            {
                LayerModel layerModel = LayerModel.NewModel(layer);

                layerModels.Add(layerModel);
            }

            var app = new ApplicationModel(application.Name, application.MetaInfo, layerModels);

            return(app);
        }
Esempio n. 23
0
        public static ApplicationModel NewModel(ApplicationAssembly application)
        {
            var layerModels = new List<LayerModel>();

            foreach (LayerAssembly layer in application.Layers)
            {
                LayerModel layerModel = LayerModel.NewModel(layer);

                layerModels.Add(layerModel);
            }

            var app = new ApplicationModel(application.Name, application.MetaInfo, layerModels);

            return app;
        }
Esempio n. 24
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();
        }
Esempio n. 25
0
        /// <summary>
        /// 获取所有插件信息
        /// </summary>
        /// <returns></returns>
        public static List <AssemblyPluginAttribute> GetAssemblyPluginAttributes()
        {
            //var models = AppDomain.CurrentDomain.GetAssemblies();

            var models = ApplicationAssembly.ToArray();
            List <AssemblyPluginAttribute> lstObject = new List <AssemblyPluginAttribute>();

            System.Threading.Tasks.Parallel.ForEach(models, model =>
            {
                var assemblyPluginAttribute = model.GetAssemblyPluginAttribute();
                if (assemblyPluginAttribute != null)
                {
                    lstObject.Add(assemblyPluginAttribute);
                }
            });
            return(lstObject);
        }
Esempio n. 26
0
        public ActionResult Index()
        {
            List <PermissionViewModel> list = new List <PermissionViewModel>();
            var permissionList = ApplicationAssembly.GetAllActionByAssembly();

            foreach (var model in permissionList)
            {
                PermissionViewModel m = new PermissionViewModel();
                m.Controller  = model.Controller;
                m.Action      = model.Action;
                m.Description = model.Description;

                list.Add(m);
            }

            return(View(list));
        }
Esempio n. 27
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();
        }
Esempio n. 28
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);
        }
Esempio n. 29
0
        private void Form1_Load(object sender, EventArgs e)
        {
            var f = new ApplicationAssemblyFactory();

            ApplicationAssembly app = f.NewApplicationAssembly();

            LayerAssembly domainLayer = CreateDomainLayer(app);

            ApplicationModel applicationModel = ApplicationModel.NewModel(app);

            ApplicationInstance applicationInstance = applicationModel.NewInstance();

            Module shapeModule = applicationInstance.FindModule("DomainLayer", "ShapeModule");

            var drawing = shapeModule.TransientBuilderFactory.NewTransient <Drawing>();

            var rectangle = drawing.Create <RectangleShape>();

            drawing.Remove(rectangle);
            rectangle.SetBounds(100, 100, 200, 200);
            rectangle.Rotate(1.5);

            var ellipse = drawing.Create <EllipseShape>();

            ellipse.SetBounds(300, 100, 200, 300);

            var line = drawing.Create <LineShape>();

            line.MoveNode(0, 50, 150);
            line.MoveNode(1, 500, 300);

            var spline = drawing.Create <SplineShape>();

            spline.MoveNode(0, 50, 150);
            spline.MoveNode(1, 150, 50);
            spline.MoveNode(2, 200, 150);

            GroupShape group = drawing.Group(ellipse, rectangle, line, spline);

            this.elements.Add(group);
        }
Esempio n. 30
0
        /// <summary>
        /// 根据关键字创建程序对象
        /// </summary>
        /// <param name="key"></param>
        /// <param name="PluginId"></param>
        /// <returns></returns>
        public static object CreateInstanceByKey(string key, string PluginId = "")
        {
            var models = ApplicationAssembly.ToArray();//_AppDomain.GetAssemblies();
            var model  = models.GetModelByKey(key);

            object obj = null;

            if (model != null)
            {
                var assemblyPluginAttribute = model.GetAssemblyPluginAttribute();
                if (!String.IsNullOrWhiteSpace(PluginId))
                {
                    obj = CreateInstanceByAssemblyIdAndPluginId(assemblyPluginAttribute.ID, PluginId);
                }
                else if (!String.IsNullOrWhiteSpace(assemblyPluginAttribute.DefaultPluginID))
                {
                    obj = CreateInstanceByAssemblyIdAndPluginId(assemblyPluginAttribute.ID, assemblyPluginAttribute.DefaultPluginID);
                }
            }
            return(obj);
        }
        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);
            }
        }
Esempio n. 32
0
        /// <summary>
        /// Starts the framework with the provided IApplication object
        /// </summary>
        /// <param name="application">User implementation of IApplication. The framework controls the lifecycle of the application via calls to this object</param>
        /// <param name="frameworkMessenger">(Optional) The user may wish to provide an object that re-routes any framework messages. By default they are written to console</param>
        public static void Run(IApplication application, IFrameworkMessenger frameworkMessenger = null)
        {
            var container = new Container();

            container.RegisterInstance <IApplication>(application);

            var applicationAssembly = new ApplicationAssembly(ExtractApplicationAssembly(application));

            container.RegisterInstance <IApplicationAssembly>(applicationAssembly);

            if (frameworkMessenger == null)
            {
                container.Register <IFrameworkMessenger, ConsoleMessenger>(Lifestyle.Singleton);
            }
            else
            {
                container.RegisterInstance <IFrameworkMessenger>(frameworkMessenger);
            }

            container.Register <IGraphicsAssembly, GraphicsAssembly>(Lifestyle.Singleton);
            container.Register <ISurfaceAssembly, SurfaceAssembly>(Lifestyle.Singleton);
            container.Register <IFontsAssembly, FontsAssembly>(Lifestyle.Singleton);
            container.Register <IFileSystem, FileSystem>(Lifestyle.Singleton);
            container.Register <IDebugAnalytics, DebugAnalytics>(Lifestyle.Singleton);
            container.Register <IShutdownManager, ShutdownManager>(Lifestyle.Singleton);
            container.Register <IGraphicsShutdownManager, GraphicsShutdownManager>(Lifestyle.Singleton);
            container.Register <IResourceReinitialiser, ResourcesReinitialiser>(Lifestyle.Singleton);
            container.Register <IGraphicsResourceReinitialiser, GraphicsResourceReinitialiser>(Lifestyle.Singleton);
            container.Register <IFrameworkDebugOverlay, FrameworkDebugOverlay>(Lifestyle.Singleton);
            container.Register <IApplicationMessenger, ApplicationMessenger>(Lifestyle.Singleton);
            container.Register <ICoreMessenger, CoreMessenger>(Lifestyle.Singleton);
            container.Register <IStartupPropertiesCache, StartupPropertiesCache>(Lifestyle.Singleton);
            container.Register <ISystemComponents, SystemComponents>(Lifestyle.Singleton);
            container.Register <IVeldridWindowUpdater, VeldridWindowUpdater>(Lifestyle.Singleton);
            container.Register <ITimerFactory, StopWatchTimerFactory>(Lifestyle.Singleton);
            container.Register <IUpdatePeriodFactory, UpdatePeriodFactory>(Lifestyle.Singleton);
            container.Register <IFramesPerSecondMonitor, FramesPerSecondMonitor>(Lifestyle.Singleton);
            container.Register <IIdGenerator, IdGenerator>(Lifestyle.Singleton);
            container.Register <IGraphics, Graphics.Graphics>(Lifestyle.Singleton);
            container.Register <ISimpleCollectionFactory, SimpleDictionaryCollectionFactory>(Lifestyle.Singleton);
            container.Register <IComparerCollection, ComparerCollection>(Lifestyle.Singleton);
            container.Register <ICameraFactory, CameraFactory>(Lifestyle.Singleton);
            container.Register <ICameraManager, CameraManager>(Lifestyle.Singleton);
            container.Register <IQueueToBufferBlitter, QueueToBufferBlitter>(Lifestyle.Singleton);
            container.Register <IDrawStageBatcherTools, DrawStageBatcherTools>(Lifestyle.Singleton);
            container.Register <IDrawStageBatcherFactory, DrawStageBatcherFactory>(Lifestyle.Singleton);
            container.Register <IDrawStageBuffersFactory, DrawStageBuffersFactory>(Lifestyle.Singleton);
            container.Register <IDrawQueueGroupFactory, DrawQueueGroupFactory>(Lifestyle.Singleton);
            container.Register <IDrawQueueFactory, DrawQueueFactory>(Lifestyle.Singleton);
            container.Register <IRenderCommandQueue, RenderCommandQueue>(Lifestyle.Singleton);
            container.Register <ICommandProcessor, CommandProcessor>(Lifestyle.Singleton);
            container.Register <IRenderStageModelFactory, RenderStageModelFactory>(Lifestyle.Singleton);
            container.Register <IRenderStageManager, RenderStageManager>(Lifestyle.Singleton);
            container.Register <IRenderStageVisitor, RenderStageVisitor>(Lifestyle.Singleton);
            container.Register <IGpuSurfaceCollection, GpuSurfaceCollection>(Lifestyle.Singleton);
            container.Register <IGpuSurfaceManager, GpuSurfaceManager>(Lifestyle.Singleton);
            container.Register <IFontLoader, FontLoader>(Lifestyle.Singleton);
            container.Register <ISubFontTools, SubFontTools>(Lifestyle.Singleton);
            container.Register <ISubFontGenerator, SubFontGenerator>(Lifestyle.Singleton);
            container.Register <IFontCollection, FontCollection>(Lifestyle.Singleton);
            container.Register <IFontManager, FontManager>(Lifestyle.Singleton);
            container.Register <IPipelineFactory, PipelineFactory>(Lifestyle.Singleton);
            container.Register <IBlendStateConverter, BlendStateConverter>(Lifestyle.Singleton);
            container.Register <IShaderLoaderFunctions, ShaderLoaderFunctions>(Lifestyle.Singleton);
            container.Register <IShaderLoader, ShaderLoader>(Lifestyle.Singleton);
            container.Register <IFullNdcSpaceQuadVertexBuffer, FullNdcSpaceQuadVertices>(Lifestyle.Singleton);
            container.Register <IViewportManager, ViewportManager>(Lifestyle.Singleton);
            container.Register <IViewportFactory, ViewportFactory>(Lifestyle.Singleton);
            container.Register <IDrawStageRenderer, DrawStageRenderer>(Lifestyle.Singleton);
            container.Register <IColourEffectsStageRenderer, ColourEffectsStageRenderer>(Lifestyle.Singleton);
            container.Register <IBloomStageRenderer, BloomStageRenderer>(Lifestyle.Singleton);
            container.Register <IBloomSamplingRenderer, BloomSamplingRenderer>(Lifestyle.Singleton);
            container.Register <IBloomResultMixingRenderer, BloomResultMixingRenderer>(Lifestyle.Singleton);
            container.Register <IBlurStageRenderer, BlurStageRenderer>(Lifestyle.Singleton);
            container.Register <IBlur1DStageRenderer, Blur1DStageRenderer>(Lifestyle.Singleton);
            container.Register <IBlurResultMixingRenderer, BlurResultMixingRenderer>(Lifestyle.Singleton);
            container.Register <IDownSamplerWeightsAndOffsets, DownSamplerWeightsAndOffsets>(Lifestyle.Singleton);
            container.Register <IDownSamplingRenderer, DownSamplingRenderer>(Lifestyle.Singleton);
            container.Register <ISinglePassGaussianBlurRenderer, SinglePassGaussianBlurRenderer>(Lifestyle.Singleton);
            container.Register <IGaussianBlurWeightsAndOffsetsCache, GaussianBlurWeightsAndOffsetsCache>(Lifestyle.Singleton);
            container.Register <ICopyStageRenderer, CopyStageRenderer>(Lifestyle.Singleton);
            container.Register <IStyleEffectsStageRenderer, StyleEffectsStageRenderer>(Lifestyle.Singleton);
            container.Register <IMeshRenderStageRenderer, MeshRenderStageRenderer>(Lifestyle.Singleton);
            container.Register <IDistortionStageRenderer, DistortionStageRenderer>(Lifestyle.Singleton);
            container.Register <IDistortionHeightRenderer, DistortionHeightRenderer>(Lifestyle.Singleton);
            container.Register <IDistortionGraidentShiftRenderer, DistortionGradientShiftRenderer>(Lifestyle.Singleton);
            container.Register <IDistortionRenderer, DistortionRenderer>(Lifestyle.Singleton);
            container.Register <IMixStageRenderer, MixStageRenderer>(Lifestyle.Singleton);
            container.Register <ICustomShaderStageRenderer, CustomShaderStageRenderer>(Lifestyle.Singleton);
            container.Register <ICustomVeldridStageRenderer, CustomVeldridStageRenderer>(Lifestyle.Singleton);
            container.Register <ISurfaceCopyStageRenderer, SurfaceCopyStageRenderer>(Lifestyle.Singleton);
            container.Register <IImageSharpLoader, ImageSharpLoader>(Lifestyle.Singleton);
            container.Register <IFloatTextureBuilder, FloatTextureBuilder>(Lifestyle.Singleton);
            container.Register <IGpuSurfaceFactory, GpuSurfaceFactory>(Lifestyle.Singleton);
            container.Register <ICommonMeshBuilder, CommonMeshBuilder>(Lifestyle.Singleton);
            container.Register <IVertexLinearGridToTriangleListTool, VertexLinearGridToTriangleListTool>(Lifestyle.Singleton);
            container.Register <ICrtMeshBuilderFunctions, CrtMeshBuilderFunctions>(Lifestyle.Singleton);
            container.Register <ICrtMeshBuilder, CrtMeshBuilder>(Lifestyle.Singleton);
            container.Register <ISphericalMeshBuilder, SphericalMeshBuilder>(Lifestyle.Singleton);
            container.Register <IQuadMeshBuilder, QuadMeshBuilder>(Lifestyle.Singleton);
            container.Register <IRectangularCuboidMeshBuilder, RectangularCuboidMeshBuilder>(Lifestyle.Singleton);
            container.Register <ICommonOperations, CommonOperations>(Lifestyle.Singleton);
            container.Register <IDistortionHelper, DistortionHelper>(Lifestyle.Singleton);
            container.Register <IDistortionTextureGenerator, DistortionTextureGenerator>(Lifestyle.Singleton);
            container.Register <ISdl2EventProcessor, Sdl2EventProcessor>(Lifestyle.Singleton);
            container.Register <IInputMouseKeyboard, InputMouseKeyboard>(Lifestyle.Singleton);
            container.Register <IInputGameController, InputGameController>(Lifestyle.Singleton);
            container.Register <ICoordinateTransforms, CoordinateTransforms>(Lifestyle.Singleton);
            container.Register <IServices, Services>(Lifestyle.Singleton);
            container.Register <IBackend, Backend>(Lifestyle.Singleton);
            container.Register <IDrawing, Drawing>(Lifestyle.Singleton);
            container.Register <IDisplay, Display>(Lifestyle.Singleton);
            container.Register <IFps, Fps>(Lifestyle.Singleton);
            container.Register <IStages, Stages>(Lifestyle.Singleton);
            container.Register <ISurfaces, Surfaces>(Lifestyle.Singleton);
            container.Register <ICameras, Cameras>(Lifestyle.Singleton);
            container.Register <IRenderQueue, RenderQueue>(Lifestyle.Singleton);
            container.Register <IInput, Input.Input>(Lifestyle.Singleton);
            container.Register <IFonts, Fonts>(Lifestyle.Singleton);
            container.Register <IHelpers, Helpers>(Lifestyle.Singleton);
            container.Register <ICore, Core.Core>(Lifestyle.Singleton);

            container.Verify();

            var framework = container.GetInstance <ICore>();

            framework.Run();
        }
Esempio n. 33
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));
        }
Esempio n. 34
0
 public Form1()
 {
     InitializeComponent();
     label1.Text    = ApplicationAssembly.GetName().Version.ToString();
     _updateManager = new UpdateManager(this);
 }