Partilhar via


Moniker Class

Contains an expression used to map to its element.

Inheritance Hierarchy

System.Object
  Microsoft.VisualStudio.Modeling.Moniker

Namespace:  Microsoft.VisualStudio.Modeling
Assembly:  Microsoft.VisualStudio.Modeling.Sdk.10.0 (in Microsoft.VisualStudio.Modeling.Sdk.10.0.dll)

Syntax

'Declaração
<SerializableAttribute> _
Public NotInheritable Class Moniker _
    Implements IComparable(Of Moniker)
[SerializableAttribute]
public sealed class Moniker : IComparable<Moniker>
[SerializableAttribute]
public ref class Moniker sealed : IComparable<Moniker^>
[<Sealed>]
[<SerializableAttribute>]
type Moniker =  
    class
        interface IComparable<Moniker>
    end
public final class Moniker implements IComparable<Moniker>

The Moniker type exposes the following members.

Constructors

  Name Description
Public method Moniker(MonikerKey, Store) Constructor
Public method Moniker(String, Guid, Guid, Store) Constructor

Top

Properties

  Name Description
Public property Column Even though a Moniker is a concept in the model that doesn't tie to a physical location in serialized format, it is usually used in serialization/deserialization. The location of the moniker in the serialized format can greatly help analyze problems with unresolved monikers, so we store the column number of where the moniker is stored in serialized format.
Public property DomainClassInfo The DomainClassInfo of the DomainClass that this moniker should resolve to.
Public property DomainModelFullName The name of the DomainModel that the element represented by this Moniker resides in. This is used to find the MonikerResolver.
Public property DomainRelationshipInfo The DomainRelationshipInfo this moniker participates in
Public property Id The Id of this Moniker.
Public property Key The key of the Moniker
Public property Line Even though a Moniker is a concept in the model that doesn't tie to a physical location in serialized format, it is usually used in serialization/deserialization. The location of the moniker in the serialized format can greatly help analyze problems with unresolved monikers, so we store the line number of where the moniker is stored in serialized format.
Public property Link Gets or sets the link which contains role player for this moniker.
Public property Location Even though a Moniker is a concept in the model that doesn't tie to a physical location in serialized format, it is usually used in serialization/deserialization. The location of the moniker in the serialized format can greatly help analyze problems with unresolved monikers, so we store the location of where the moniker is stored in serialized format. The location is optional, and can be null if not available (e.g. Moniker created in memory).
Public property ModelElement The model element the moniker resolves to.
Public property MonikerName The name of the Moniker
Public property Resolved Set/Get moniker resolve state
Public property Store The Store that the Moniker is created within.

Top

Methods

  Name Description
Public method CompareTo Compares two Monikers based upon their Id
Public method ConnectElement Connects the element represented by this moniker to the element link
Public method Delete Remove the moniker
Public method DeleteLink Disconnect the moniker's resolved element from the element link, and delete the link
Public method DisconnectElement Disconnects the element represented by this moniker to the element link
Public method Equals(Object) Compares this Moniker instance to the object passed as parameter. If the object is another Moniker, it compares them based upon their ID to determine if they are equal. Omitting Equals violates rule: OverrideMethodsOnComparableTypes. (Overrides Object.Equals(Object).)
Public method Equals(Moniker) Compares two Monikers based upon their ID to determine if they are equal
Protected method Finalize Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public method GetHashCode Uses the ID to generate the HashCode so that 2 Moniker's with the same ID's will return the same HashCode. Omitting this violates rule: OverrideGetHashCodeOnOverridingEquals. (Overrides Object.GetHashCode().)
Public method GetType Gets the Type of the current instance. (Inherited from Object.)
Protected method MemberwiseClone Creates a shallow copy of the current Object. (Inherited from Object.)
Public method Resurrect Resurrect this moniker.
Public method ToString Returns a string that represents the current object. (Inherited from Object.)

Top

Operators

  Name Description
Public operatorStatic member Equality Compares two Monikers based upon their ID to determine if they are equal. Overriding operator == to satisfy CA1036:OverrideMethodsOnComparableTypes
Public operatorStatic member GreaterThan Compares two Monikers based upon their ID to determine if moniker1's ID is greater than moniker2. Overriding operator > to satisfy CA1036:OverrideMethodsOnComparableTypes
Public operatorStatic member Inequality Compares two Monikers based upon their ID to determine if they are unequal. Overriding operator != to satisfy CA1036:OverrideMethodsOnComparableTypes
Public operatorStatic member LessThan

Top

Remarks

The MonikerName property value must be unique and represent only one element.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Reference

Microsoft.VisualStudio.Modeling Namespace