コード例 #1
0
        protected override void Supply(
            IRenderContext renderContext,
            IDataContext dataContext,
            IDataDependency dependency)
        {
            SiteMap.Project         project    = null;
            SiteMap.Document        document   = null;
            SiteMap.Repository      repository = null;
            SiteMap.RepositoryOwner owner      = null;

            if (dependency != null && dependency.DataType == typeof(SiteMap.Project))
            {
                project = GetProject(renderContext);
                if (project != null)
                {
                    document   = project.Document;
                    repository = project.Repository;
                    if (repository != null)
                    {
                        owner = repository.Owner;
                    }
                }
            }

            dataContext.Set(project);
            dataContext.Set(document);
            dataContext.Set(repository);
            dataContext.Set(owner);
        }
コード例 #2
0
        protected override void Supply(
            IRenderContext renderContext,
            IDataContext dataContext,
            IDataDependency dependency)
        {
            if (dependency == null || dependency.DataType != typeof(SiteMap.Repository))
            {
                return;
            }

            SiteMap.Repository      repository = null;
            SiteMap.RepositoryOwner owner      = null;

            repository = GetRepository(renderContext);
            if (repository != null)
            {
                owner = repository.Owner;
            }

            dataContext.Set(repository);
            dataContext.Set(owner);
        }