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 }); }
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 }); }
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; }
public CommandCollectionFormatter(IPartCollection metadata) { _metadata = metadata; }
public QueryCollectionFormatter(IPartCollection metadata) { _metadata = metadata; }