Ejemplo n.º 1
0
        /// <summary>
        /// Attempts to create a StorageMappingItemCollection from the specified metadata file, EdmItemCollection, and StoreItemCollection
        /// </summary>
        public bool TryCreateStorageMappingItemCollection(string sourcePath, EdmItemCollection edmItemCollection, StoreItemCollection storeItemCollection, out StorageMappingItemCollection storageMappingItemCollection)
        {
            storageMappingItemCollection = null;

            if (!ValidateInputPath(sourcePath, _textTransformation))
            {
                return(false);
            }

            if (edmItemCollection == null)
            {
                throw new ArgumentNullException("edmItemCollection");
            }

            if (storeItemCollection == null)
            {
                throw new ArgumentNullException("storeItemCollection");
            }

            ItemCollection itemCollection = null;
            StorageMappingItemCollectionBuilder collectionBuilder = new StorageMappingItemCollectionBuilder(_textTransformation, edmItemCollection, storeItemCollection);

            if (collectionBuilder.TryCreateItemCollection(_textTransformation.Host.ResolvePath(sourcePath), out itemCollection))
            {
                storageMappingItemCollection = (StorageMappingItemCollection)itemCollection;
            }
            return(storageMappingItemCollection != null);
        }
Ejemplo n.º 2
0
        /// <summary>
        ///     Attempts to create a StorageMappingItemCollection from the specified metadata file, EdmItemCollection, and StoreItemCollection
        /// </summary>
        public bool TryCreateStorageMappingItemCollection(string sourcePath, EdmItemCollection edmItemCollection, StoreItemCollection storeItemCollection, out StorageMappingItemCollection storageMappingItemCollection)
        {
            storageMappingItemCollection = null;

            if(String.IsNullOrEmpty(sourcePath))
                throw new ArgumentException("sourcePath");

            if(edmItemCollection == null)
                throw new ArgumentNullException("edmItemCollection");

            if(storeItemCollection == null)
                throw new ArgumentNullException("storeItemCollection");

            ItemCollection itemCollection = null;
            var collectionBuilder = new StorageMappingItemCollectionBuilder(_textTransformation, edmItemCollection, storeItemCollection);
            if(collectionBuilder.TryCreateItemCollection(_textTransformation.Host.ResolvePath(sourcePath), out itemCollection))
                storageMappingItemCollection = (StorageMappingItemCollection) itemCollection;
            return storageMappingItemCollection != null;
        }
        /// <summary>
        /// Attempts to create a StorageMappingItemCollection from the specified metadata file, EdmItemCollection, and StoreItemCollection
        /// </summary>
        public bool TryCreateStorageMappingItemCollection(string sourcePath, EdmItemCollection edmItemCollection, StoreItemCollection storeItemCollection, out StorageMappingItemCollection storageMappingItemCollection)
        {
            storageMappingItemCollection = null;

            if (!ValidateInputPath(sourcePath, _textTransformation))
            {
                return false;
            }

            if (edmItemCollection == null)
            {
                throw new ArgumentNullException("edmItemCollection");
            }

            if (storeItemCollection == null)
            {
                throw new ArgumentNullException("storeItemCollection");
            }

            ItemCollection itemCollection = null;
            StorageMappingItemCollectionBuilder collectionBuilder = new StorageMappingItemCollectionBuilder(_textTransformation, edmItemCollection, storeItemCollection);
            if (collectionBuilder.TryCreateItemCollection(_textTransformation.Host.ResolvePath(sourcePath), out itemCollection))
            {
                storageMappingItemCollection = (StorageMappingItemCollection)itemCollection;
            }
            return storageMappingItemCollection != null;
        }