Show / Hide Table of Contents

Class ModelHelper

Inheritance
object
ModelHelper
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: NMF.Models
Assembly: NMF.Models.dll
Syntax
public static class ModelHelper

Methods

| Edit this page View Source

CreatePath(string)

Creates a relative Uri for the given reference name

Declaration
public static string CreatePath(string reference)
Parameters
Type Name Description
string reference

The name of the reference

Returns
Type Description
string

A relative Uri for the given reference

| Edit this page View Source

CreatePath(string, int)

Creates a Uri for an ordered reference where the child element has the given index

Declaration
public static string CreatePath(string reference, int index)
Parameters
Type Name Description
string reference

The reference of the child element

int index

The index inside the child element

Returns
Type Description
string

A relative Uri for the reference with the given index

| Edit this page View Source

IndexOfReference<T>(IList<T>, IModelElement)

Gets the index of the given element inside the given reference or -1 if the element is not contained in the reference

Declaration
public static int IndexOfReference<T>(IList<T> reference, IModelElement element) where T : class, IModelElement
Parameters
Type Name Description
IList<T> reference

The reference list

IModelElement element

The element that should be looked for

Returns
Type Description
int

The index of the element or -1, if the reference does not contain the given element

Type Parameters
Name Description
T

The element type for the reference

| Edit this page View Source

ParseIdentifierSegment(string, out string, out string, out string)

Parses the given relative Uri for a identifier reference

Declaration
public static bool ParseIdentifierSegment(string segment, out string reference, out string identifierReference, out string identifier)
Parameters
Type Name Description
string segment

The relative Uri

string reference

The reference that corresponds to the Uri. This is never null.

string identifierReference

The identifier reference. This is never null.

string identifier

The identifier. This is never null.

Returns
Type Description
bool

True, if the segment was parsed successfully, otherwise false

| Edit this page View Source

ParseSegment(string, out string, out int)

Parses the given relative Uri

Declaration
public static bool ParseSegment(string segment, out string reference, out int index)
Parameters
Type Name Description
string segment

the relative Uri

string reference

The reference that corresponds to the Uri. This is never null.

int index

The element index of the Uri or 0 if no index is given

Returns
Type Description
bool

True, if the segment was parsed successfully, otherwise false

| Edit this page View Source

Parse<T>(string)

Declaration
public static T Parse<T>(string text)
Parameters
Type Name Description
string text
Returns
Type Description
T
Type Parameters
Name Description
T
  • Edit this page
  • View Source
In this article
Back to top Generated by DocFX