- mvvm.zip
- CompositeApp.sln
- Galador.Application.Tests
- Galador.Applications
- Galador.Version.cs
- MVVM.html
- MVVMDemo
- DemoApp
- MEFedMVVMDemo
- MVVMSamples.txt
- Phone
- StockTrader
- ChartControls
- StockTraderRI.Infrastructure
- StockTraderRI.Modules.Market
- StockTraderRI.Modules.News
- StockTraderRI.Modules.Position
- StockTraderRI.Modules.WatchList
- StockTraderRI
|
// -----------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
// -----------------------------------------------------------------------
using System;
using System.Collections.Generic;
using System.ComponentModel.Composition.Hosting;
using System.ComponentModel.Composition.Primitives;
using System.ComponentModel.Composition.ReflectionModel;
using System.Globalization;
using System.Reflection;
using Microsoft.Internal;
using Microsoft.Internal.Collections;
using System.Threading;
namespace System.ComponentModel.Composition.ReflectionModel
{
internal class ReflectionMemberExportDefinition : ExportDefinition, ICompositionElement
{
private readonly LazyMemberInfo _member;
private readonly ExportDefinition _exportDefinition;
private readonly ICompositionElement _origin;
private IDictionary<string, object> _metadata;
public ReflectionMemberExportDefinition(LazyMemberInfo member, ExportDefinition exportDefinition, ICompositionElement origin)
{
Assumes.NotNull(exportDefinition);
this._member = member;
this._exportDefinition = exportDefinition;
this._origin = origin;
}
public override string ContractName
{
get { return this._exportDefinition.ContractName; }
}
public LazyMemberInfo ExportingLazyMember
{
get { return this._member; }
}
public override IDictionary<string, object> Metadata
{
get
{
if (this._metadata == null)
{
this._metadata = this._exportDefinition.Metadata.AsReadOnly();
}
return this._metadata;
}
}
string ICompositionElement.DisplayName
{
get { return this.GetDisplayName(); }
}
ICompositionElement ICompositionElement.Origin
{
get { return this._origin; }
}
public override string ToString()
{
return this.GetDisplayName();
}
public ExportingMember ToExportingMember()
{
return new ExportingMember(this, this.ToReflectionMember());
}
private ReflectionMember ToReflectionMember()
{
return this.ExportingLazyMember.ToReflectionMember();
}
private string GetDisplayName()
{
return string.Format(CultureInfo.CurrentCulture,
"{0} (ContractName=\"{1}\")", // NOLOC
this.ToReflectionMember().GetDisplayName(),
this.ContractName);
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
The Australia born French man who went back to Australia later in life...
Finally got over life long (and mostly hopeless usually, yay!) chronic sicknesses.
Worked in Sydney, Brisbane, Darwin, Billinudgel, Darwin and Melbourne.