예제 #1
0
		public ActionResult ViewPart(ITypeMetadata typeMetadata, IPartCollection containingCollection, string format)
		{
			ViewBag.Title = typeMetadata.Name;

            return View(new PartModel
			            	{
			            		TypeMetadata = typeMetadata,
			            		NextActionName = (containingCollection.DescriptiveName == "Commands") ? "ViewCommand" : "ViewPart",
                                AgentSytemName = containingCollection.AgentSystemName,
                                PartDescriptiveName = containingCollection.DescriptiveName,
                                PartType = typeMetadata.Type.Name
			            	});
		}
예제 #2
0
        public ViewResult ViewPartCollection(IPartCollection partCollection, string format)
        {
            ViewBag.Title = string.Format("Agent {0}", partCollection.DescriptiveName);

            return View(
                new PartCollectionModel
                    {
                        Parts = partCollection,
                        NextActionName = (partCollection.DescriptiveName == "Commands") ? "ViewCommand" : "ViewPart",
                        AgentSytemName = partCollection.AgentSystemName,
                        PartDescriptiveName = partCollection.DescriptiveName
                    });
        }
예제 #3
0
		public static IMetadataFormatter GetFormatter(IPartCollection metadata)
		{
			if (typeof(ICommand).IsAssignableFrom(metadata.CollectionType))
			{
				return new CommandCollectionFormatter(metadata);
			}
			else if (typeof(IReadModel).IsAssignableFrom(metadata.CollectionType))
			{
				return new ReadModelCollectionFormatter(metadata);
			}
			else if (typeof(IQuery).IsAssignableFrom(metadata.CollectionType))
			{
				return new QueryCollectionFormatter(metadata);
			}

			throw new AgentPartFormatterNotFoundException(metadata.CollectionType.Name);
		}
		public ReadModelCollectionFormatter(IPartCollection metadata)
		{
			_metadata = metadata;
		}
예제 #5
0
		public CommandCollectionFormatter(IPartCollection metadata)
		{
			_metadata = metadata;
		}
예제 #6
0
		public QueryCollectionFormatter(IPartCollection metadata)
		{
			_metadata = metadata;
		}