1
// -----------------------------------------------------------------------
2 // Copyright (c) Microsoft Corporation. All rights reserved.
3 // -----------------------------------------------------------------------
5 using System
.Collections
.Generic
;
6 using System
.ComponentModel
.Composition
;
7 using System
.ComponentModel
.Composition
.Primitives
;
10 namespace System
.Diagnostics
.Contracts
13 [ContractClassFor(typeof(ComposablePart
))]
14 internal abstract class ComposablePartContract
: ComposablePart
16 public override IEnumerable
<ExportDefinition
> ExportDefinitions
20 Contract
.Ensures(Contract
.Result
<IEnumerable
<ExportDefinition
>>() != null);
22 throw new NotImplementedException();
26 public override IEnumerable
<ImportDefinition
> ImportDefinitions
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
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
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
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();