Пример #1
0
        internal ContentReference <T> GetContentReference <T>(int index) where T : class
        {
            if (index == ChunkReference.NullIdentifier)
            {
                return(null);
            }

            var chunkReference = GetChunkReference(index);

            var contentReference = new ContentReference <T>(chunkReference.Location);

            ContentReferences.Add(contentReference);

            return(contentReference);
        }
Пример #2
0
        internal int AddContentReference(ContentReference reference)
        {
            if (reference == null)
            {
                return(ChunkReference.NullIdentifier);
            }

            // TODO: This behavior should be controllable
            if (reference.State != ContentReferenceState.NeverLoad && reference.ObjectValue != null)
            {
                // Auto-generate URL if necessary
                BuildUrl(reference);
                //Executor.ProcessObject(this, reference.Type, reference);
                ContentReferences.Add(reference);
            }

            return(AddChunkReference(reference.Location, reference.Type));
        }
Пример #3
0
        public int AddContentReference(ContentReference contentReference)
        {
            if (contentReference == null)
            {
                return(ChunkReference.NullIdentifier);
            }

            // TODO: This behavior should be controllable
            if (contentReference.State != ContentReferenceState.NeverLoad && contentReference.ObjectValue != null)
            {
                // Auto-generate URL if necessary
                var serializer = AssetManager.Serializer.GetSerializer(null, contentReference.ObjectValue.GetType());
                BuildUrl(contentReference, serializer.ActualType);
                //Executor.ProcessObject(this, contentReference.Type, contentReference);
                ContentReferences.Add(contentReference);
            }

            return(AddChunkReference(contentReference.Location, contentReference.Type));
        }