public override IEnumerable <DeploymentObjectProvider> GetChildProviders()
        {
            string physicalPath = ServicePathHelper.GetPhysicalPath(providerContext.Path);

            string childProviderName = _isDirectory ? "dirPath" : "filePath";

            yield return(CreateProvider(childProviderName, physicalPath, Name));
        }
        DeploymentObjectProvider CreateDirPathProvider()
        {
            var providerOptions = new DeploymentProviderOptions("dirPath");

            providerOptions.Path = ServicePathHelper.GetPhysicalPath(Path);

            DeploymentObjectProvider provider = CreateProvider(providerOptions, ObjectName + LibFolderName);

            return(provider);
        }
 public override IEnumerable <DeploymentObjectProvider> GetChildProviders()
 {
     if (_isDirectory)
     {
         yield return(CreateDirPathProvider());
     }
     else
     {
         string physicalPath = ServicePathHelper.GetPhysicalPath(Path);
         yield return(CreateProvider("filePath", physicalPath, Name));
     }
 }
        public override void Add(DeploymentObject source, bool whatIf)
        {
            ServicePathHelper.GetPhysicalPath(providerContext.Path);

            foreach (var deploymentObject in source.GetChildren())
            {
                if (deploymentObject.Name == "dirPath")
                {
                    _isDirectory = true;
                    break;
                }
            }
        }
        public override DeploymentObjectProvider AddChild(DeploymentObject source, int position, bool whatIf)
        {
            string physicalPath = ServicePathHelper.GetPhysicalPath(Path);

            if (source.Name == "contentPathLib")
            {
                return(CreateProvider("contentPathLib", Path, "ContentPathLib"));
            }

            if (source.Name == "dirPath" && !_isDirectory)
            {
                throw new DeploymentException(Resources.FileAlreadyExists, physicalPath);
            }

            throw new DeploymentException(Resources.DirectoryAlreadyExists, physicalPath);
        }
 internal void EnsureNodeExists(out bool isDirectory)
 {
     isDirectory = false;
     EnsureNodeExists(ServicePathHelper.GetPhysicalPath(Path), out isDirectory);
 }
 public override void GetAttributes(DeploymentAddAttributeContext addContext)
 {
     EnsureNodeExists(ServicePathHelper.GetPhysicalPath(Path), out _isDirectory);
 }