C# Class DLaB.CrmSvcUtilExtensions.NamingService

Inheritance: INamingService
Show file Open project: daryllabar/DLaB.Xrm.XrmToolBoxTools

Private Properties

Property Type Description
AppendState string
AppendValueForDuplicateOptionSetValueNames string
GetDuplicateNameValues bool>.Dictionary
GetValidCSharpName string
IsLabelPopulated bool
Transliterate string
UpdateCasingForCustomGlobalOptionSets string
UpdateCasingForGlobalOptionSets string

Public Methods

Method Description
GetNameForAttribute ( EntityMetadata entityMetadata, AttributeMetadata attributeMetadata, IServiceProvider services ) : string

Allows for Specified Attribute Nmaes to be used to set the generated attribute name

GetNameForEntity ( EntityMetadata entityMetadata, IServiceProvider services ) : string
GetNameForEntitySet ( EntityMetadata entityMetadata, IServiceProvider services ) : string
GetNameForMessagePair ( Microsoft.Crm.Services.Utility.SdkMessagePair messagePair, IServiceProvider services ) : string
GetNameForOption ( OptionSetMetadataBase optionSetMetadata, OptionMetadata optionMetadata, IServiceProvider services ) : string
GetNameForOptionSet ( EntityMetadata entityMetadata, OptionSetMetadataBase optionSetMetadata, IServiceProvider services ) : string

Provide a new implementation for finding a name for an OptionSet. If the OptionSet is not global, we want the name to be the concatenation of the Entity's name and the Attribute's name. Otherwise, we can use the default implementation.

GetNameForRelationship ( EntityMetadata entityMetadata, RelationshipMetadataBase relationshipMetadata, EntityRole reflexiveRole, IServiceProvider services ) : string
GetNameForRequestField ( Microsoft.Crm.Services.Utility.SdkMessageRequest request, Microsoft.Crm.Services.Utility.SdkMessageRequestField requestField, IServiceProvider services ) : string
GetNameForResponseField ( Microsoft.Crm.Services.Utility.SdkMessageResponse response, Microsoft.Crm.Services.Utility.SdkMessageResponseField responseField, IServiceProvider services ) : string
GetNameForServiceContext ( IServiceProvider services ) : string
NamingService ( INamingService defaultService ) : System

Private Methods

Method Description
AppendState ( OptionMetadata option, string name ) : string
AppendValueForDuplicateOptionSetValueNames ( OptionSetMetadataBase optionSetMetadata, string name, int value, IServiceProvider services ) : string

Appends the value of the optionset for options with duplicatenames.

GetDuplicateNameValues ( OptionSetMetadataBase metadata, IServiceProvider services ) : bool>.Dictionary

Checks to make sure that the name does not already exist for the OptionSetto be generated.

GetValidCSharpName ( string name ) : string

Checks to make sure that the name begins with a valid character. If the name does not begin with a valid character, then add an underscore to the beginning of the name.

IsLabelPopulated ( string label ) : bool

Determines whether the name is null, or empty, or "UnknownLabel"

Transliterate ( OptionMetadata optionMetadata, string defaultName ) : string
UpdateCasingForCustomGlobalOptionSets ( string name, OptionSetMetadataBase optionSetMetadata ) : string
UpdateCasingForGlobalOptionSets ( string name, OptionSetMetadataBase optionSetMetadata ) : string

Method Details

GetNameForAttribute() public method

Allows for Specified Attribute Nmaes to be used to set the generated attribute name
public GetNameForAttribute ( EntityMetadata entityMetadata, AttributeMetadata attributeMetadata, IServiceProvider services ) : string
entityMetadata EntityMetadata The entity metadata.
attributeMetadata AttributeMetadata The attribute metadata.
services IServiceProvider The services.
return string

GetNameForEntity() public method

public GetNameForEntity ( EntityMetadata entityMetadata, IServiceProvider services ) : string
entityMetadata EntityMetadata
services IServiceProvider
return string

GetNameForEntitySet() public method

public GetNameForEntitySet ( EntityMetadata entityMetadata, IServiceProvider services ) : string
entityMetadata EntityMetadata
services IServiceProvider
return string

GetNameForMessagePair() public method

public GetNameForMessagePair ( Microsoft.Crm.Services.Utility.SdkMessagePair messagePair, IServiceProvider services ) : string
messagePair Microsoft.Crm.Services.Utility.SdkMessagePair
services IServiceProvider
return string

GetNameForOption() public method

public GetNameForOption ( OptionSetMetadataBase optionSetMetadata, OptionMetadata optionMetadata, IServiceProvider services ) : string
optionSetMetadata OptionSetMetadataBase
optionMetadata OptionMetadata
services IServiceProvider
return string

GetNameForOptionSet() public method

Provide a new implementation for finding a name for an OptionSet. If the OptionSet is not global, we want the name to be the concatenation of the Entity's name and the Attribute's name. Otherwise, we can use the default implementation.
public GetNameForOptionSet ( EntityMetadata entityMetadata, OptionSetMetadataBase optionSetMetadata, IServiceProvider services ) : string
entityMetadata EntityMetadata
optionSetMetadata OptionSetMetadataBase
services IServiceProvider
return string

GetNameForRelationship() public method

public GetNameForRelationship ( EntityMetadata entityMetadata, RelationshipMetadataBase relationshipMetadata, EntityRole reflexiveRole, IServiceProvider services ) : string
entityMetadata EntityMetadata
relationshipMetadata RelationshipMetadataBase
reflexiveRole EntityRole
services IServiceProvider
return string

GetNameForRequestField() public method

public GetNameForRequestField ( Microsoft.Crm.Services.Utility.SdkMessageRequest request, Microsoft.Crm.Services.Utility.SdkMessageRequestField requestField, IServiceProvider services ) : string
request Microsoft.Crm.Services.Utility.SdkMessageRequest
requestField Microsoft.Crm.Services.Utility.SdkMessageRequestField
services IServiceProvider
return string

GetNameForResponseField() public method

public GetNameForResponseField ( Microsoft.Crm.Services.Utility.SdkMessageResponse response, Microsoft.Crm.Services.Utility.SdkMessageResponseField responseField, IServiceProvider services ) : string
response Microsoft.Crm.Services.Utility.SdkMessageResponse
responseField Microsoft.Crm.Services.Utility.SdkMessageResponseField
services IServiceProvider
return string

GetNameForServiceContext() public method

public GetNameForServiceContext ( IServiceProvider services ) : string
services IServiceProvider
return string

NamingService() public method

public NamingService ( INamingService defaultService ) : System
defaultService INamingService
return System