[corlib] CoreRT System.Threading.Tasks (#6672)
[mono-project.git] / mcs / class / System.ComponentModel.Composition.4.5 / src / ComponentModel / ContractAdditions.cs
blobcc3fcddc640d7917756974b9c4f59c882efbfba3
1 // -----------------------------------------------------------------------
2 // Copyright (c) Microsoft Corporation. All rights reserved.
3 // -----------------------------------------------------------------------
4 using System;
5 using System.Collections.Generic;
6 using System.ComponentModel.Composition;
7 using System.ComponentModel.Composition.Primitives;
8 using System.Linq;
10 namespace System.Diagnostics.Contracts
12 #if CONTRACTS_FULL
13 [ContractClassFor(typeof(ComposablePart))]
14 internal abstract class ComposablePartContract : ComposablePart
16 public override IEnumerable<ExportDefinition> ExportDefinitions
18 get
20 Contract.Ensures(Contract.Result<IEnumerable<ExportDefinition>>() != null);
22 throw new NotImplementedException();
26 public override IEnumerable<ImportDefinition> ImportDefinitions
28 get
30 Contract.Ensures(Contract.Result<IEnumerable<ImportDefinition>>() != null);
32 throw new NotImplementedException();
36 public override object GetExportedValue(ExportDefinition definition)
38 Contract.Requires(definition != null);
40 throw new NotImplementedException();
43 public override void SetImport(ImportDefinition definition, IEnumerable<Export> exports)
45 Contract.Requires(definition != null);
46 Contract.Requires(exports != null);
48 throw new NotImplementedException();
52 [ContractClassFor(typeof(ComposablePartDefinition))]
53 internal abstract class ComposablePartDefinitionContract : ComposablePartDefinition
55 public override IEnumerable<ExportDefinition> ExportDefinitions
57 get
59 Contract.Ensures(Contract.Result<IEnumerable<ExportDefinition>>() != null);
60 Contract.Ensures(Contract.ForAll(Contract.Result<IEnumerable<ExportDefinition>>(), e => e != null));
62 throw new NotImplementedException();
66 public override IEnumerable<ImportDefinition> ImportDefinitions
68 get
70 Contract.Ensures(Contract.Result<IEnumerable<ImportDefinition>>() != null);
71 Contract.Ensures(Contract.ForAll(Contract.Result<IEnumerable<ImportDefinition>>(), i => i != null));
73 throw new NotImplementedException();
77 public override ComposablePart CreatePart()
79 Contract.Ensures(Contract.Result<ComposablePart>() != null);
80 throw new NotImplementedException();
84 [ContractClassFor(typeof(ICompositionElement))]
85 internal abstract class ICompositionElementContract : ICompositionElement
87 public string DisplayName
89 get
91 Contract.Ensures(!string.IsNullOrEmpty(Contract.Result<string>()));
93 throw new NotImplementedException();
97 public ICompositionElement Origin
99 get { throw new NotImplementedException(); }
103 [ContractClassFor(typeof(ICompositionService))]
104 internal abstract class ICompositionServiceContract : ICompositionService
106 public void SatisfyImportsOnce(ComposablePart part)
108 Contract.Requires(part != null);
109 throw new NotImplementedException();
112 #endif