Пример #1
0
            public object OnResolved(object resolvedObject)
            {
                if (resolvedObject != null)
                {
                    // Sync site setting
                    if (resolvedObject is SiteManager)
                    {
                        ISiteProvider siteProvider = EngineContext.Current.Resolve<ISiteProvider>();
                        IRepositoryProvider repositoryProvider = EngineContext.Current.Resolve<IRepositoryProvider>();

                        SiteManagerWrapper siteManagerWrapper = new SiteManagerWrapper(siteProvider, repositoryProvider);
                        return siteManagerWrapper;
                    }
                }

                return resolvedObject;
            }
Пример #2
0
            public object OnResolved(object resolvedObject)
            {
                if (resolvedObject != null)
                {
                    // Sync content folder
                    if (resolvedObject is TextFolderManager)
                    {
                        ITextFolderProvider textFolderProvider = EngineContext.Current.Resolve<ITextFolderProvider>();
                        TextFolderManager textFolderManager = (TextFolderManager)resolvedObject;
                        ISiteProvider siteProvider = EngineContext.Current.Resolve<ISiteProvider>();

                        return new TextFolderManagerWrapper(textFolderProvider, textFolderManager, siteProvider);
                    }

                    // Sync content schema
                    if (resolvedObject is ISchemaProvider)
                    {
                        ISchemaProvider schemaProvider = (ISchemaProvider)resolvedObject;
                        ISiteProvider siteProvider = EngineContext.Current.Resolve<ISiteProvider>();

                        return new SchemaProviderWrapper(schemaProvider, siteProvider);
                    }

                    if (resolvedObject is SchemaManager)
                    {
                        ISchemaProvider schemaProvider = EngineContext.Current.Resolve<ISchemaProvider>();
                        SchemaManager schemaManager = (SchemaManager)resolvedObject;
                        ISiteProvider siteProvider = EngineContext.Current.Resolve<ISiteProvider>();

                        return new SchemaManagerWrapper(schemaProvider, schemaManager, siteProvider);
                    }

                    // Sync site setting
                    if (resolvedObject is SiteManager)
                    {
                        ISiteProvider siteProvider = EngineContext.Current.Resolve<ISiteProvider>();
                        IRepositoryProvider repositoryProvider = EngineContext.Current.Resolve<IRepositoryProvider>();

                        SiteManagerWrapper siteManagerWrapper = new SiteManagerWrapper(siteProvider, repositoryProvider);
                        return siteManagerWrapper;
                    }
                }

                return resolvedObject;
            }