Beispiel #1
0
        public static IEnumerable <IPackItem> Create(EntityToken entityToken)
        {
            var dataEntityToken = entityToken as DataEntityToken;

            if (dataEntityToken == null)
            {
                yield break;
            }

#pragma warning disable 618
            if (typeof(IPageFolderData).IsAssignableFrom(dataEntityToken.InterfaceType)
#pragma warning restore 618
                || typeof(IPageDataFolder).IsAssignableFrom(dataEntityToken.InterfaceType))
            {
                yield return(new PCDataItem(dataEntityToken.Data));
            }
            else if (SkipTypes.Contains(dataEntityToken.InterfaceType))
            {
                // Nothing
            }
            else
            {
                var data = dataEntityToken.Data;
                var id   = PCExclude.GetId(data);
                if (id != Guid.Empty)
                {
                    yield return(new PCDataItem(data));
                }
            }
        }
Beispiel #2
0
        public IEnumerable <IPackItem> GetItems(Type type, XElement config)
        {
            XNamespace ns       = PackageCreator.pc;
            XName      itemName = "Add";

            foreach (var category in typeof(PCExclude).GetCategoryAllNames())
            {
                foreach (var element in config.Elements(ns + category).Elements(itemName))
                {
                    var name = element.IndexAttributeValue();
                    PCExclude.Exclude exludeType;
                    Enum.TryParse(element.AttributeValue("type"), true, out exludeType);
                    var label = element.Value;
                    var item  = new PCExclude(name, exludeType, label);
                    yield return(item);
                }
            }
            ;;
        }
Beispiel #3
0
		public IEnumerable<IPackItem> GetItems(Type type, XElement config)
		{
			XNamespace ns = PackageCreator.pc;
			XName itemName = "Add";
			foreach (var category in typeof(PCExclude).GetCategoryAllNames())
			{
				foreach (var element in config.Elements(ns + category).Elements(itemName))
				{
					var name = element.IndexAttributeValue();
					PCExclude.Exclude exludeType;
					Enum.TryParse(element.AttributeValue("type"), true, out exludeType);
					var label = element.Value;
					var item = new PCExclude(name, exludeType, label);
					yield return item;
				}
			}; ;
		}