Example #1
0
        /// <summary>
        /// Gets the form object.
        /// </summary>
        /// <param name="assemblyName">Name of the assembly.</param>
        /// <param name="formTypeName">Name of the form.</param>
        /// <returns></returns>
        private IForm GetFormObject(String multiKey)
        {
            IForm result = null;

            try
            {
                if (!String.IsNullOrWhiteSpace(multiKey))
                {
                    if (FormWrapper.loadedForms.ContainsKey(multiKey))
                    {
                        result = FormWrapper.loadedForms[multiKey];
                    }
                    else
                    {
                        result = Microkernel.CreateInstance <IForm>(multiKey);
                        FormWrapper.loadedForms.Add(multiKey, result);
                    }
                }
            }
            catch (Exception ex)
            {
                ESolutions.AccessBridge.DotNet.Tracer.TraceException(ex);
            }

            return(result);
        }
Example #2
0
        public void Initialize(
            String dataPath,
            Int32 loggedUser,
            String loggedUserName,
            String dBHost,
            String dBName,
            String dBUser,
            String dBPassword)
        {
            try
            {
                if (String.IsNullOrWhiteSpace(dataPath))
                {
                    dataPath = Directory.GetCurrentDirectory();
                }

                var microkernelConfig = new FileInfo(Path.Combine(dataPath, "Microkernel.Mappings.xml"));
                Microkernel.Initialize(microkernelConfig);

                this.applicationSettings = new ApplicationSettings(
                    dataPath,
                    loggedUser,
                    loggedUserName,
                    dBHost,
                    dBName,
                    dBUser,
                    dBPassword);
            }
            catch (Exception ex)
            {
                ESolutions.AccessBridge.DotNet.Tracer.TraceException(ex);
            }
        }