示例#1
0
        internal static PreviousItemState GetPreviousContentState(ContentInstallStep contentInstallStep)
        {
            var version = contentInstallStep.Manifest.PackageInfo.Version;

            var exists = ContentManager.Path.IsPathExists(contentInstallStep.ContentPath);

            return(exists ? PreviousItemState.UserCreated : PreviousItemState.NotInstalled);
        }
示例#2
0
		private void TreeWalker(string path)
		{
			var containerPath = TransformFileToContent(path);

			var dirs = Directory.GetDirectories(path);
			var files = new List<string>(Directory.GetFiles(path));
			var contentFiles = new List<string>(Directory.GetFiles(path, "*.content"));
			if (containerPath.ToLower() == "/root/system/schema/contenttypes")
			{
				foreach(var file in files)
					_manifest.AddContentType(new ContentTypeInstallStep(_manifest, null) { ResourceName = file });
				return;
			}

			foreach (string contentFile in contentFiles)
			{
				files.Remove(contentFile);
				var contentInfo = new ContentInstallStep(_manifest, contentFile, containerPath);
				_manifest.AddContent(contentInfo);
				contentInfo.Initialize();

				foreach (var attachment in contentInfo.Content.Attachments)
				    files.Remove(attachment.FileName);
			}
			while (files.Count > 0)
			{
				var filePath = files[0];
				var fileInfo = new FileInstallStep(_manifest, filePath, containerPath);
				_manifest.AddContent(fileInfo);
				files.RemoveAt(0);
			}

			foreach (string subPath in dirs)
				TreeWalker(subPath);
		}
示例#3
0
		internal void AddContent(ContentInstallStep step)
		{
			_contents.Add(step);
		}