コード例 #1
0
ファイル: AgentsController.cs プロジェクト: smhinsey/Euclid
		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
ファイル: AgentsController.cs プロジェクト: smhinsey/Euclid
        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);
		}
コード例 #4
0
		public ReadModelCollectionFormatter(IPartCollection metadata)
		{
			_metadata = metadata;
		}
コード例 #5
0
		public CommandCollectionFormatter(IPartCollection metadata)
		{
			_metadata = metadata;
		}
コード例 #6
0
		public QueryCollectionFormatter(IPartCollection metadata)
		{
			_metadata = metadata;
		}