Naming Conventions (Lync Model API)

Microsoft Lync 2010 API is a framework that exposes a collection of interfaces, delegates, and enumerations. The naming convention used by the Lync 2010 API framework gives you a simple method to distinguish one type from another.

The Microsoft.Lync.Model assembly that is installed with the SDK provides the full Lync 2010 API organized into six namespaces. These namespaces group the individual classes and enumerations of the API by feature area. The base namespace is Microsoft.Lync.Model and contains classes encapsulating the basic features of the API. The other five namespaces are:

  • .Conversation

  • .Conversation.AudioVideo

  • .Device

  • .Extensibility

  • .Group

The feature areas of the classes contained in these namespaces are self-evident.

Classes

Class names in the Lync API follow the conventions of .NET development. That is, class names are Pascal cased and are noun or noun phrases. Where a namespace provides derived classes, the derived class is named such the derivation precedes the base class name. For example, the CustomGroup class is derived from the Group class and exposes methods and properties unique to a user-defined (or "custom") class.

The name of an instance of a Lync 2010 API class obtained as an event argument has three parts. The first part indicates either an entity such as a collection or an event whose state is exposed by the class instance. The second part is a past-tense verb that describes the event resulting in a new state. Finally, event-related class instance name appends "EventArgs" to indicate the class exposes the changed state of the type that raised the event. For example, ContactInformationChangedEventArgs is an event-specific class that is surfaced by an event raised on the Contact class when a contact has published updated contact information.

Enumerations

Lync 2010 API enumerations are not prefixed and represent allowed property values, method parameter values, entity states and entity types. The enumeration name is formed by combining a noun representing the type and an adjective representing the use of the enumeration. An example of this is the ConversationState enumeration. This enumeration describes the current state of a conversation type. Individual properties of a conversation are enumerated by ConversationProperty..

Enumerations that let you pass appended types as a single method parameter are appended with "s". For example, an instance of the Automation class exposes the BeginStartConversation member method. You specify the modalities to be used in the conversation by appending individual enumerator flags of the AutomationModalities enumeration. The appendix syntax looks like AutomationModalities MyChosenMode = AutomationModalities.FileTransfer | AutomationModalities.InstantMessage; where MyChosenMode is passed as the first argument of BeginStartConversation.

Events

Lync 2010 API framework uses the System.EventHandler delegate to implement the events that can be raised by a Lync 2010 API class. Event names indicate the class instance whose state changed and the nature of the state change that triggers an event. The event is indicated in the event name by appending an action verb in the past tense. For example, ConversationAdded is raised by ConversationManager when a conversation entity has been added to the conversation managers collection of conversations.