Esempio n. 1
0
        public MainApp()
        {
            System.Text.Encoding.RegisterProvider(System.Text.CodePagesEncodingProvider.Instance);
            Container = Configure();
            using (var scope = Container.BeginLifetimeScope())
            {
                jsonLoader = scope.Resolve <IJsonLoader>();
                //--------------------------------------------------------------------------------
                // a Error Class that will have all error message tracking
                //---------------------------------------------------------------------------
                Erinfo = scope.Resolve <IErrorsInfo>();
                //--------------------------------------------------------------------------------
                // a Log Manager
                //---------------------------------------------------------------------------
                lg = scope.Resolve <IDMLogger>();
                lg.WriteLog("App started");

                // a Utility Class for helping in Doing Different functions for  Data Managment

                util = scope.Resolve <IUtil>();
                //--------------------------------------------------------------------------------


                //-------------------------------------------------------------------------------
                // a onfiguration class for assembly, addin's and  drivers loading into the
                // application
                //---------------------------------------------------------------------------
                Config_editor = scope.Resolve <IConfigEditor>();


                // Setup the Database Connection Screen
                // a "Work Flow" class will control all the workflow between different data source
                // and automation
                WorkFlowEditor = scope.Resolve <IWorkFlowEditor>();
                eTL            = scope.Resolve <IETL>();
                //-------------------------------------------------------------------------------
                // The Main Class for Data Manager
                //---------------------------------------------------------------------------
                DMEEditor = scope.Resolve <IDMEEditor>();
                //-------------------------------------------------------------------------------
                // this is the assembly loader for loading from Addin Folder and Projectdrivers Folder
                //---------------------------------------------------------------------------
                // LLoader = scope.Resolve<IAssemblyLoader>();
                LLoader                   = scope.Resolve <IAssemblyHandler>();
                LLoader.DMEEditor         = DMEEditor;
                DMEEditor.assemblyHandler = LLoader;

                //-------------------------------------------------------------------------------
                // The Main Visualization Class tha control the visual aspect of the system
                //---------------------------------------------------------------------------
                vis = scope.Resolve <IVisUtil>();

                //tree = scope.Resolve<ITree>();
                //vis.treeEditor = tree;
                //ITreeView treeView = (ITreeView)tree;
                //treeView.Visutil = vis;
                //tree.DMEEditor = DMEEditor;
                //-------------------------------------------------------------------------------
                // this Editor will help Generate user controls for visulization
                Controleditor = scope.Resolve <IControlEditor>();
                //-------------------------------------------------------------------------------
                // a tree class will be main visualization control for the system

                vis.controlEditor = Controleditor;

                //---------------------------------------------------------------------------
                // This has to be last step so that all Configuration is ready for Addin's
                // to be able to use
                //---------------------------------------------------------------------------
                AppDomainSetup pluginsDomainSetup = new AppDomainSetup
                {
                    ApplicationBase = AppDomain.CurrentDomain.BaseDirectory,
                    PrivateBinPath  = @"ConnectionDrivers;ProjectClasses"
                };
                LLoader.LoadAllAssembly();
                Config_editor.LoadedAssemblies = LLoader.Assemblies.Select(c => c.DllLib).ToList();
                // Setup the Entry Screen
                // the screen has to be in one the Addin DLL's loaded by the Assembly loader

                if (Config_editor.Config.SystemEntryFormName == null)
                {
                    //(LLoader.AddIns.Where(x => x.)
                    Config_editor.Config.SystemEntryFormName = @"Frm_MainDisplayForm";
                }
                vis.ShowMainDisplayForm();
                //if (DMEEditor.ErrorObject.Flag== Errors.Failed)
                //{
                //    Controleditor.MsgBox("Beep", $"Could not Startup Screen {DMEEditor.ErrorObject.Ex.Message}");

                //}
            }
        }
Esempio n. 2
0
        public MainApp()
        {
            Container = Configure();
            using (var scope = Container.BeginLifetimeScope())
            {
                // jsonLoader= scope.Resolve<IJsonLoader>();
                //--------------------------------------------------------------------------------
                // a Error Class that will have all error message tracking
                //---------------------------------------------------------------------------
                //  Erinfo = scope.Resolve<IErrorsInfo>();
                //--------------------------------------------------------------------------------
                // a Log Manager
                //---------------------------------------------------------------------------
                //  lg = scope.Resolve<IDMLogger>();
                //  lg.WriteLog("App started");

                // a Utility Class for helping in Doing Different functions for  Data Managment

                //  util = scope.Resolve<IUtil>();
                //--------------------------------------------------------------------------------
                // this is the assembly loader for loading from Addin Folder and Projectdrivers Folder
                //---------------------------------------------------------------------------
                // LLoader = scope.Resolve<IAssemblyLoader>();
                LLoader = scope.Resolve <IAssemblyHandler>();

                //-------------------------------------------------------------------------------
                // a onfiguration class for assembly, addin's and  drivers loading into the
                // application
                //---------------------------------------------------------------------------
                // Config_editor = scope.Resolve<IConfigEditor>();

                // Setup the Entry Screen
                // the screen has to be in one the Addin DLL's loaded by the Assembly loader


                // Setup the Database Connection Screen
                // a "Work Flow" class will control all the workflow between different data source
                // and automation
                //   WorkFlowEditor = scope.Resolve<IWorkFlowEditor>();
                //  eTL= scope.Resolve<IETL>();
                //-------------------------------------------------------------------------------
                // The Main Class for Data Manager
                //---------------------------------------------------------------------------
                DMEEditor = scope.Resolve <IDMEEditor>();
                //-------------------------------------------------------------------------------
                // LLoader.DMEEditor = DMEEditor;
                // util.DME = DMEEditor;
                //-------------------------------------------------------------------------------
                // The Main Visualization Class tha control the visual aspect of the system
                //---------------------------------------------------------------------------
                vis = scope.Resolve <IVisUtil>();
                //-------------------------------------------------------------------------------
                // this Editor will help Generate user controls for visulization
                Controleditor = scope.Resolve <IControlEditor>();
                //-------------------------------------------------------------------------------
                // a tree class will be main visualization control for the system

                vis.controlEditor = Controleditor;

                //---------------------------------------------------------------------------
                // This has to be last step so that all Configuration is ready for Addin's
                // to be able to use
                //---------------------------------------------------------------------------
                AppDomainSetup pluginsDomainSetup = new AppDomainSetup
                {
                    ApplicationBase = AppDomain.CurrentDomain.BaseDirectory,
                    PrivateBinPath  = @"ConnectionDrivers;ProjectClasses"
                };

                LLoader.LoadAllAssembly();
                Config_editor.LoadedAssemblies = LLoader.Assemblies.Select(c => c.DllLib).ToList();

                // you start you application from an Calling an Addin
                Config_editor.Config.SystemEntryFormName = @"Form1";
                //  Config_editor.Config.SystemEntryFormName = @"Frm_MainDisplayForm";
                if (Config_editor.Config.SystemEntryFormName != null)
                {
                    // Config_editor.Config.SystemEntryFormName = @"Frm_MainDisplayForm";
                    vis.ShowMainDisplayForm();
                }
                else
                {
                    Controleditor.MsgBox("Beep", "Could not Find any Startup Screen");
                }
            }
        }