Ejemplo n.º 1
0
 public InstanceReport( RulesRepository builderRules )
 {
     this.builderRules = builderRules;
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Performs several actions integral to ReportBuilder:
        /// <para> - Synchronize (extract) the embedded resources (if necessary). (See <see cref="RulesEngineUtils.SynchronizeResources()" />)</para>
        /// <para> - Loads "TaxonomyAddongManager.xml" in order to look up well-known Documentation and References</para>
        /// <para> - Loads the RulesFile and rule-file references.</para>
        /// <remarks>A rules file can be named in the constructor, or using reportBuilderInstance.<see cref="SetRulesFile"/></remarks>
        /// </summary>
        private void InitializeReportBuilder()
        {
            lock( synchronizedResourcesLock )
            {
                if( !SynchronizedResources )
                {
                    bool isSynchronized = RulesEngineUtils.SynchronizeResources();
                    SetSynchronizedResources( isSynchronized );
                }

                if( SynchronizedResources && _defRefHelper == null )
                {
                    string taConfig = RulesEngineUtils.GetResourcePath( string.Empty, "TaxonomyAddonManager.xml" );

                    TaxonomyAddonManager tam;
                    if( TaxonomyAddonManager.TryLoadFile( taConfig, out tam ) )
                    {
                        TaxonomyAddonManager.BasePath = RulesEngineUtils.GetBaseResourcePath();
                        _defRefHelper = tam;
                    }
                }
            }

            string rulesFolder = RulesEngineUtils.GetRulesFolder();
            DirectoryInfo di = new DirectoryInfo( rulesFolder );

            BuilderRules = new RulesRepository( rulesFileName, di );
            BuilderRules.TryLoadExistingRulesList();
        }