Exemplo n.º 1
0
        private static void OnConfigurationCreated(object sender, CrmSectionCreatedEventArgs args)
        {
            if (CrmConnectionExists())
            {
                return;
            }

            args.Configuration.ConnectionStrings.Add(GetConnectionString());
        }
        private static CrmSection CreateConfiguration()
        {
            var configuration = ConfigurationManager.GetSection(CrmSection.SectionName) as CrmSection ?? new CrmSection();
            var args          = new CrmSectionCreatedEventArgs {
                Configuration = configuration
            };

            var handler = ConfigurationCreated;

            if (handler != null)
            {
                handler(null, args);
            }

            return(args.Configuration);
        }