Пример #1
0
        /**
         * This constructor should only be called from SemanticsScope's constructor!
         *
         * @param _metadataTranslationScope
         */
        public MetaMetadataRepositoryInit(SimplTypesScope metadataTranslationScope, string repoLocation, EventHandler <EventArgs> onCompleted)
        {
            //		    if (SingletonApplicationEnvironment.isInUse() && !SingletonApplicationEnvironment.runningInEclipse())
            //		    {
            //			    AssetsRoot mmAssetsRoot = new AssetsRoot(
            //					    EnvironmentGeneric.configDir().getRelative(SEMANTICS),
            //					    Files.newFile(PropertiesAndDirectories.thisApplicationDir(), SEMANTICS + "/repository")
            //					    );
            //
            //			    METAMETADATA_REPOSITORY_DIR_FILE    = Assets.getAsset(mmAssetsRoot, null, "repository", null, !USE_ASSETS_CACHE, SemanticsAssetVersions.METAMETADATA_ASSET_VERSION);
            //		    }
            //		    else

            MetametadataRepositoryDirFile = repoLocation;

            this._metadataTranslationScope = metadataTranslationScope;
            Debug.WriteLine("\t\t-- Reading meta_metadata from " + MetametadataRepositoryDirFile);

            if (onCompleted != null)
            {
                this.RepositoryLoaded += onCompleted;
            }


            _generatedDocumentTranslations = metadataTranslationScope.GetAssignableSubset(
                SemanticNames.RepositoryDocumentTranslations,
                typeof(Document));
            _generatedMediaTranslations = metadataTranslationScope.GetAssignableSubset(
                SemanticNames.RepositoryMediaTranslations,
                typeof(ClippableDocument));
            _repositoryClippingTranslations = metadataTranslationScope.GetAssignableSubset(
                SemanticNames.RepositoryClippingTranslations,
                typeof(Clipping <>));

            _noAnnotationsScope = metadataTranslationScope.GetSubtractedSubset(
                SemanticNames.RepositoryNoAnnotationsTypeScope,
                typeof(TextSelfmade));



            _generatedMediaTranslations.AddTranslation(typeof(Clipping <>));
            _generatedMediaTranslations.AddTranslation(typeof(TextSelfmade));
            _generatedMediaTranslations.AddTranslation(typeof(HtmlText));
        }