Class UtilityExtensions
Defines a set of utility extension methods.
Inheritance
Inherited Members
Namespace: Quark.CMSAdapters.Core
Assembly: Quark.CMSAdapters.Core.dll
Syntax
public static class UtilityExtensions
Fields
PRODUCT_LINE_INFO_KEY
Defines the PRODUCT_LINE_INFO_KEY string constant
Declaration
public const string PRODUCT_LINE_INFO_KEY = "ProductLine"
Field Value
Type | Description |
---|---|
System.String |
READ_ONLY_ACCESS
Defines the READ_ONLY_ACCESS string constant
Declaration
public static string READ_ONLY_ACCESS
Field Value
Type | Description |
---|---|
System.String |
Methods
ActivateInvisibleMode(Window)
Activates the invisible mode.
Declaration
public static void ActivateInvisibleMode(this Window window)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Window | window | The window. |
ApplyTransform(XmlNode, String)
Applies the transform.
Declaration
public static XmlDocument ApplyTransform(this XmlNode xmlNode, string xsltFilePath)
Parameters
Type | Name | Description |
---|---|---|
System.Xml.XmlNode | xmlNode | The XML node. |
System.String | xsltFilePath | The XSLT file path. |
Returns
Type | Description |
---|---|
System.Xml.XmlDocument | The transformed xml document |
ApplyTransform(XmlNode, String, XsltArgumentList)
Applies the transform.
Declaration
public static XmlDocument ApplyTransform(this XmlNode xmlNode, string xsltFilePath, XsltArgumentList parameters)
Parameters
Type | Name | Description |
---|---|---|
System.Xml.XmlNode | xmlNode | The XML node. |
System.String | xsltFilePath | The XSLT file path. |
System.Xml.Xsl.XsltArgumentList | parameters | The parameters. |
Returns
Type | Description |
---|---|
System.Xml.XmlDocument | The transformed xml document |
ConvertToBoolAttributeValue(Boolean)
Converts to bool attribute value.
Declaration
public static string ConvertToBoolAttributeValue(this bool value)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | value | if set to |
Returns
Type | Description |
---|---|
System.String |
ConvertToDateAttributeValue(DateTime, String, IFormatProvider)
Converts to date attribute value.
Declaration
public static string ConvertToDateAttributeValue(this DateTime value, string format = null, IFormatProvider formatProvider = null)
Parameters
Type | Name | Description |
---|---|---|
System.DateTime | value | The value. |
System.String | format | The format. In case of null value "Short date pattern" is applied. |
System.IFormatProvider | formatProvider | The format provider. |
Returns
Type | Description |
---|---|
System.String |
ConvertToDateTimeAttributeValue(DateTime, String, IFormatProvider)
Converts to date time attribute value.
Declaration
public static string ConvertToDateTimeAttributeValue(this DateTime value, string format = null, IFormatProvider formatProvider = null)
Parameters
Type | Name | Description |
---|---|---|
System.DateTime | value | The value. |
System.String | format | The format. In case of null value "Combination of the short date and long time pattern, separated by a space" is applied. |
System.IFormatProvider | formatProvider | The format provider. |
Returns
Type | Description |
---|---|
System.String |
ConvertToList(String, Char, Boolean)
Converts to list.
Declaration
public static List<string> ConvertToList(this string stringValue, char separator, bool trimValues = true)
Parameters
Type | Name | Description |
---|---|---|
System.String | stringValue | The string value. |
System.Char | separator | The separator. |
System.Boolean | trimValues | if set to |
Returns
Type | Description |
---|---|
System.Collections.Generic.List<System.String> |
ConvertToList(String, String, Boolean)
Converts to list.
Declaration
public static List<string> ConvertToList(this string stringValue, string separator, bool trimValues = true)
Parameters
Type | Name | Description |
---|---|---|
System.String | stringValue | The string value. |
System.String | separator | The separator. |
System.Boolean | trimValues | if set to |
Returns
Type | Description |
---|---|
System.Collections.Generic.List<System.String> |
ConvertToTimeAttributeValue(DateTime, String, IFormatProvider)
Converts to time attribute value.
Declaration
public static string ConvertToTimeAttributeValue(this DateTime value, string format = null, IFormatProvider formatProvider = null)
Parameters
Type | Name | Description |
---|---|---|
System.DateTime | value | The value. |
System.String | format | The format. In case of null value "Long time pattern" is applied. |
System.IFormatProvider | formatProvider | The format provider. |
Returns
Type | Description |
---|---|
System.String |
Copy(DirectoryInfo, DirectoryInfo)
Copies the specified folder recursively to a given folder.
Declaration
public static void Copy(this DirectoryInfo folder, DirectoryInfo destination)
Parameters
Type | Name | Description |
---|---|---|
System.IO.DirectoryInfo | folder | The folder. |
System.IO.DirectoryInfo | destination | The destination. |
CreateAllInstances(Type, String)
Creates all the instances of this interface type.
Declaration
public static object[] CreateAllInstances(this Type interfaceType, string assemblyName)
Parameters
Type | Name | Description |
---|---|---|
System.Type | interfaceType | Type of the interface. |
System.String | assemblyName | Name of the assembly. |
Returns
Type | Description |
---|---|
System.Object[] |
CreateNamespaceManager(XmlNode, Boolean)
Creates the namespace manager.
Declaration
public static XmlNamespaceManager CreateNamespaceManager(this XmlNode node, bool includeReferenceAttributeNamespaces = false)
Parameters
Type | Name | Description |
---|---|---|
System.Xml.XmlNode | node | The node. |
System.Boolean | includeReferenceAttributeNamespaces | if set to |
Returns
Type | Description |
---|---|
System.Xml.XmlNamespaceManager |
DeactivateInvisibleMode(Window)
Deactivates the invisible mode.
Declaration
public static void DeactivateInvisibleMode(this Window window)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Window | window | The window. |
DecodeDataString(String)
Converts data string that has been encoded into a decoded data string.
Declaration
public static string DecodeDataString(this string dataString)
Parameters
Type | Name | Description |
---|---|---|
System.String | dataString | The value. |
Returns
Type | Description |
---|---|
System.String |
DecodeFilePath(String)
Converts file path that has been encoded into a decoded file path.
Declaration
public static string DecodeFilePath(this string value)
Parameters
Type | Name | Description |
---|---|---|
System.String | value | The value. |
Returns
Type | Description |
---|---|
System.String |
DecodeQueryParameter(String)
Converts a query parameter value that has been encoded into a decoded value.
Declaration
public static string DecodeQueryParameter(this string value)
Parameters
Type | Name | Description |
---|---|---|
System.String | value | The value. |
Returns
Type | Description |
---|---|
System.String |
DecodeXml(String)
Converts a XML string that has been encoded into a decoded string.
Declaration
public static string DecodeXml(this string xmlString)
Parameters
Type | Name | Description |
---|---|---|
System.String | xmlString | The XML string. |
Returns
Type | Description |
---|---|
System.String |
DeepClone<T>(T)
Creates deep copy of serializable object.
Declaration
public static T DeepClone<T>(this T obj)
where T : class
Parameters
Type | Name | Description |
---|---|---|
T | obj | The obj. |
Returns
Type | Description |
---|---|
T | The copied object. |
Type Parameters
Name | Description |
---|---|
T | The type. |
DeleteHierarchy(DirectoryInfo)
Deletes this instance of a System.IO.DirectoryInfo along with subdirectories and files including read-only files.
Declaration
public static void DeleteHierarchy(this DirectoryInfo folder)
Parameters
Type | Name | Description |
---|---|---|
System.IO.DirectoryInfo | folder | The folder. |
EncodeDataString(String, Char[])
Replaces invalid characters in the data string with their valid equivalent.
Declaration
public static string EncodeDataString(this string dataString, char[] reservedCharacters = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | dataString | The data string. |
System.Char[] | reservedCharacters | The reserved characters. |
Returns
Type | Description |
---|---|
System.String |
EncodeFilePath(String)
Replaces invalid characters in the file path with their valid equivalent.
Declaration
public static string EncodeFilePath(this string filePath)
Parameters
Type | Name | Description |
---|---|---|
System.String | filePath | The file path. |
Returns
Type | Description |
---|---|
System.String |
EncodeQueryParameter(String)
Replaces invalid characters in the query parameter value with their valid equivalent.
Declaration
public static string EncodeQueryParameter(this string value)
Parameters
Type | Name | Description |
---|---|---|
System.String | value | The value. |
Returns
Type | Description |
---|---|
System.String |
EncodeXml(String)
Replaces invalid XML characters in a string with their valid XML equivalent.
Declaration
public static string EncodeXml(this string xmlString)
Parameters
Type | Name | Description |
---|---|---|
System.String | xmlString | The XML string. |
Returns
Type | Description |
---|---|
System.String |
EvaluateXPath(XmlNode, String, String, Boolean)
Evaluates the Xpath.
Declaration
public static List<string> EvaluateXPath(this XmlNode node, string xpath, string transform = "", bool ignoreWhiteSpace = true)
Parameters
Type | Name | Description |
---|---|---|
System.Xml.XmlNode | node | The node. |
System.String | xpath | The xpath. |
System.String | transform | The transform. |
System.Boolean | ignoreWhiteSpace | if set to |
Returns
Type | Description |
---|---|
System.Collections.Generic.List<System.String> |
ExecuteInSTAThread(ThreadStart, CultureInfo)
Executes delegate in STA thread.
Declaration
public static void ExecuteInSTAThread(this ThreadStart threadStartMethod, CultureInfo cultureInfo = null)
Parameters
Type | Name | Description |
---|---|---|
System.Threading.ThreadStart | threadStartMethod | The thread start method. |
System.Globalization.CultureInfo | cultureInfo | The culture information. |
FindLogicalAncestor<T>(DependencyObject)
Finds the logical ancestor.
Declaration
public static T FindLogicalAncestor<T>(this DependencyObject dependencyObject)
where T : class
Parameters
Type | Name | Description |
---|---|---|
System.Windows.DependencyObject | dependencyObject | The dependency object. |
Returns
Type | Description |
---|---|
T |
Type Parameters
Name | Description |
---|---|
T |
GetAbsolutePath(String, DirectoryInfo)
Gets the absolute path.
Declaration
public static string GetAbsolutePath(this string path, DirectoryInfo baseDirectory)
Parameters
Type | Name | Description |
---|---|---|
System.String | path | The path. |
System.IO.DirectoryInfo | baseDirectory | The base directory. |
Returns
Type | Description |
---|---|
System.String |
GetAbsolutePath(String, Assembly)
Gets the absolute path.
Declaration
public static string GetAbsolutePath(this string path, Assembly baseAssembly)
Parameters
Type | Name | Description |
---|---|---|
System.String | path | The path. |
System.Reflection.Assembly | baseAssembly | The base assembly. |
Returns
Type | Description |
---|---|
System.String |
GetAbsolutePath(String, String)
Gets the absolute path.
Declaration
public static string GetAbsolutePath(this string path, string baseFilePath = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | path | The path. |
System.String | baseFilePath | The base file path. If this path is not specified, API creates path relative to the Globals.OverriddenConfigurationPath. If file is not present at this location then returns path relative to the Globals.LaunchConfigurationPath. |
Returns
Type | Description |
---|---|
System.String |
GetCMSId(XmlElement)
Gets the CMS id of the specified element.
Declaration
public static string GetCMSId(this XmlElement element)
Parameters
Type | Name | Description |
---|---|---|
System.Xml.XmlElement | element | The element. |
Returns
Type | Description |
---|---|
System.String | The CMS id of the specified element. |
GetCMSInfo(XmlElement)
Gets the cmsInfo attribute data.
Declaration
public static Dictionary<string, string> GetCMSInfo(this XmlElement element)
Parameters
Type | Name | Description |
---|---|---|
System.Xml.XmlElement | element | The element. |
Returns
Type | Description |
---|---|
System.Collections.Generic.Dictionary<System.String, System.String> |
GetCMSInfo(XmlElement, String)
Gets the cmsInfo attribute value for specified key.
Declaration
public static string GetCMSInfo(this XmlElement element, string key)
Parameters
Type | Name | Description |
---|---|---|
System.Xml.XmlElement | element | The element. |
System.String | key | The key. |
Returns
Type | Description |
---|---|
System.String |
GetCMSTemplateId(XmlElement)
Gets the id of the CMS template.
Declaration
public static string GetCMSTemplateId(this XmlElement element)
Parameters
Type | Name | Description |
---|---|---|
System.Xml.XmlElement | element | The element. |
Returns
Type | Description |
---|---|
System.String |
GetDraftInfo(XmlElement)
Gets the draft information.
Declaration
public static string GetDraftInfo(this XmlElement element)
Parameters
Type | Name | Description |
---|---|---|
System.Xml.XmlElement | element | The element. |
Returns
Type | Description |
---|---|
System.String |
GetExeConfiguration(Assembly)
Gets the executable configuration.
Declaration
public static Configuration GetExeConfiguration(this Assembly assembly)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.Assembly | assembly | The assembly. |
Returns
Type | Description |
---|---|
System.Configuration.Configuration | API returns configuration at path relative to the Globals.OverriddenConfigurationPath. If file is not present at this location then returns configuration at path relative to the Globals.LaunchConfigurationPath. |
GetExeConfigurationFilePath(Assembly)
Gets the executable configuration file path.
Declaration
public static string GetExeConfigurationFilePath(this Assembly assembly)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.Assembly | assembly | The assembly. |
Returns
Type | Description |
---|---|
System.String | API returns path relative to the Globals.OverriddenConfigurationPath. If file is not present at this location then returns path relative to the Globals.LaunchConfigurationPath. |
GetIcon(ContentTypes)
Gets the icon.
Declaration
public static ImageSource GetIcon(this ContentTypes contentType)
Parameters
Type | Name | Description |
---|---|---|
ContentTypes | contentType | Type of the content. |
Returns
Type | Description |
---|---|
System.Windows.Media.ImageSource |
GetIdAttribute(XmlElement)
Gets the identifier attribute.
Declaration
public static XmlAttribute GetIdAttribute(this XmlElement element)
Parameters
Type | Name | Description |
---|---|---|
System.Xml.XmlElement | element | The element. |
Returns
Type | Description |
---|---|
System.Xml.XmlAttribute |
GetImage(String)
Gets the image.
Declaration
public static ImageSource GetImage(this string imageName)
Parameters
Type | Name | Description |
---|---|---|
System.String | imageName | Name of the image. |
Returns
Type | Description |
---|---|
System.Windows.Media.ImageSource |
GetImage(String, Int32, Int32)
Gets the image.
Declaration
public static ImageSource GetImage(this string imageName, int width, int height)
Parameters
Type | Name | Description |
---|---|---|
System.String | imageName | Name of the image. |
System.Int32 | width | The width. |
System.Int32 | height | The height. |
Returns
Type | Description |
---|---|
System.Windows.Media.ImageSource |
GetImage(Uri)
Gets the image.
Declaration
public static ImageSource GetImage(this Uri uri)
Parameters
Type | Name | Description |
---|---|---|
System.Uri | uri | The URI. |
Returns
Type | Description |
---|---|
System.Windows.Media.ImageSource |
GetImage(Uri, Int32, Int32)
Gets the image.
Declaration
public static ImageSource GetImage(this Uri uri, int width, int height)
Parameters
Type | Name | Description |
---|---|---|
System.Uri | uri | The URI. |
System.Int32 | width | The width. |
System.Int32 | height | The height. |
Returns
Type | Description |
---|---|
System.Windows.Media.ImageSource |
GetMimeType(Stream)
Gets the type of the MIME.
Declaration
public static string GetMimeType(this Stream stream)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | stream | The stream. |
Returns
Type | Description |
---|---|
System.String |
GetMimeType(String)
Gets the type of the MIME.
Declaration
public static string GetMimeType(this string fileName)
Parameters
Type | Name | Description |
---|---|---|
System.String | fileName | Name of the file. |
Returns
Type | Description |
---|---|
System.String |
GetOutputFormatQueryParameter(OfficeComponentInfo, out String)
Gets the output format query parameter.
Declaration
public static string GetOutputFormatQueryParameter(this OfficeComponentInfo componentInfo, out string outputFormatPropertiesParameter)
Parameters
Type | Name | Description |
---|---|---|
OfficeComponentInfo | componentInfo | The component information. |
System.String | outputFormatPropertiesParameter | The output format properties parameter. |
Returns
Type | Description |
---|---|
System.String |
GetProductLine(XmlDocument)
Gets the product line.
Declaration
public static string GetProductLine(this XmlDocument xmlDocument)
Parameters
Type | Name | Description |
---|---|---|
System.Xml.XmlDocument | xmlDocument | The XML document. |
Returns
Type | Description |
---|---|
System.String |
GetProductLine(XmlElement)
Gets the product line specified in the cmsInfo attribute.
Declaration
public static string GetProductLine(this XmlElement element)
Parameters
Type | Name | Description |
---|---|---|
System.Xml.XmlElement | element | The element. |
Returns
Type | Description |
---|---|
System.String |
GetPublishingOutputFormatParameter(OfficeComponentInfo)
Gets the output format query parameter.
Declaration
public static string GetPublishingOutputFormatParameter(this OfficeComponentInfo componentInfo)
Parameters
Type | Name | Description |
---|---|---|
OfficeComponentInfo | componentInfo | The component information. |
Returns
Type | Description |
---|---|
System.String |
GetQueryParameters(String)
Gets the query parameters.
Declaration
public static NameValueCollection GetQueryParameters(this string urn)
Parameters
Type | Name | Description |
---|---|---|
System.String | urn | The urn. |
Returns
Type | Description |
---|---|
System.Collections.Specialized.NameValueCollection |
GetRefAttribute(XmlElement)
Gets the reference attribute specified for the element. It might be href, or specified in the configuration
Declaration
public static XmlAttributeInfo GetRefAttribute(this XmlElement element)
Parameters
Type | Name | Description |
---|---|---|
System.Xml.XmlElement | element | The element. |
Returns
Type | Description |
---|---|
XmlAttributeInfo | The reference attribute e.g. href, conref. If not found then null is returned. |
GetResourceUri(String, String)
Gets the resource URI.
Declaration
public static Uri GetResourceUri(this string path, string assemblyName)
Parameters
Type | Name | Description |
---|---|---|
System.String | path | The path. |
System.String | assemblyName | Name of the assembly. |
Returns
Type | Description |
---|---|
System.Uri |
GetReviewOptions(XmlElement)
Gets the review options.
Declaration
public static ReviewOptions GetReviewOptions(this XmlElement element)
Parameters
Type | Name | Description |
---|---|---|
System.Xml.XmlElement | element | The element. |
Returns
Type | Description |
---|---|
ReviewOptions |
GetServerInfo(XmlElement)
Gets the server information.
Declaration
public static string GetServerInfo(this XmlElement element)
Parameters
Type | Name | Description |
---|---|---|
System.Xml.XmlElement | element | The element. |
Returns
Type | Description |
---|---|
System.String |
GetTypeQueryParameterName(OfficeComponentInfo)
Gets the name of the "type" query parameter.
Declaration
public static string GetTypeQueryParameterName(this OfficeComponentInfo componentInfo)
Parameters
Type | Name | Description |
---|---|---|
OfficeComponentInfo | componentInfo | The component information. |
Returns
Type | Description |
---|---|
System.String |
GetUrn(XmlElement)
Gets the urn of the specified element.
Declaration
public static string GetUrn(this XmlElement element)
Parameters
Type | Name | Description |
---|---|---|
System.Xml.XmlElement | element | The element. |
Returns
Type | Description |
---|---|
System.String | The urn |
GetXPathToNode(XmlNode)
Gets the XPath to node.
Declaration
public static string GetXPathToNode(this XmlNode node)
Parameters
Type | Name | Description |
---|---|---|
System.Xml.XmlNode | node | The node. |
Returns
Type | Description |
---|---|
System.String | XPath of the given node. |
Handle(WebException)
Handles the specified web exception.
Declaration
public static void Handle(this WebException webException)
Parameters
Type | Name | Description |
---|---|---|
System.Net.WebException | webException | The web exception. |
Exceptions
Type | Condition |
---|---|
System.Exception | |
System.IO.StreamReader |
InvokeAndRetry(Action, Int32, Int32)
Invokes multiple times until it is successful.
Declaration
public static void InvokeAndRetry(this Action function, int retryCount = 5, int retryDelayInMs = 200)
Parameters
Type | Name | Description |
---|---|---|
System.Action | function | The function. |
System.Int32 | retryCount | The number of retries. |
System.Int32 | retryDelayInMs | The number of milliseconds to wait before retry. |
IsMethodImplemented(Object, String)
Determines whether a method is implemented.
Declaration
public static bool IsMethodImplemented(this object objectType, string methodName)
Parameters
Type | Name | Description |
---|---|---|
System.Object | objectType | Type of the object. |
System.String | methodName | Name of the method. |
Returns
Type | Description |
---|---|
System.Boolean |
LoadWithOutExternalResources(XmlDocument, String)
Loads the XML document from the specified URL ignoring external resources e.g dtd.
Declaration
public static void LoadWithOutExternalResources(this XmlDocument xmlDocument, string fileName)
Parameters
Type | Name | Description |
---|---|---|
System.Xml.XmlDocument | xmlDocument | The XML document. |
System.String | fileName | Name of the file. |
LoadXmlWithOutExternalResources(XmlDocument, String)
Loads the XML document from the specified string ignoring external resources e.g dtd.
Declaration
public static void LoadXmlWithOutExternalResources(this XmlDocument xmlDocument, string xml)
Parameters
Type | Name | Description |
---|---|---|
System.Xml.XmlDocument | xmlDocument | The XML document. |
System.String | xml | The XML. |
LogError(Object, String)
Logs the error.
Declaration
public static string LogError(this object exception, string message)
Parameters
Type | Name | Description |
---|---|---|
System.Object | exception | The exception. |
System.String | message | The message. |
Returns
Type | Description |
---|---|
System.String | The error message string. |
MarkAsCMSAsset(XmlElement, String)
Marks as CMS asset.
Declaration
public static void MarkAsCMSAsset(this XmlElement element, string urn)
Parameters
Type | Name | Description |
---|---|---|
System.Xml.XmlElement | element | The element. |
System.String | urn | The urn. |
MarkAsCMSTemplateBasedAsset(XmlElement, String)
Marks as CMS template based asset.
Declaration
public static void MarkAsCMSTemplateBasedAsset(this XmlElement element, string urn)
Parameters
Type | Name | Description |
---|---|---|
System.Xml.XmlElement | element | The element. |
System.String | urn | The urn. |
ParseAttributeValueAsBool(String)
Parses the attribute value as bool.
Declaration
public static bool? ParseAttributeValueAsBool(this string attributeValue)
Parameters
Type | Name | Description |
---|---|---|
System.String | attributeValue | The attribute value. |
Returns
Type | Description |
---|---|
System.Nullable<System.Boolean> |
|
ParseAttributeValueAsDate(String, String, IFormatProvider)
Parses the attribute value as date.
Declaration
public static DateTime? ParseAttributeValueAsDate(this string attributeValue, string format = null, IFormatProvider formatProvider = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | attributeValue | The attribute value. |
System.String | format | The format. In case of null value "Short date pattern" is applied. |
System.IFormatProvider | formatProvider | The format provider. |
Returns
Type | Description |
---|---|
System.Nullable<System.DateTime> | System.Nullable{DateTime}. |
Exceptions
Type | Condition |
---|---|
System.Exception | Invalid date string. Expected date format: + format |
ParseAttributeValueAsDateTime(String, String, IFormatProvider)
Parses the attribute value as date time.
Declaration
public static DateTime? ParseAttributeValueAsDateTime(this string attributeValue, string format = null, IFormatProvider formatProvider = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | attributeValue | The attribute value. |
System.String | format | The format. In case of null value "Combination of the short date and long time pattern, separated by a space" is applied. |
System.IFormatProvider | formatProvider | The format provider. |
Returns
Type | Description |
---|---|
System.Nullable<System.DateTime> | System.Nullable{DateTime}. |
Exceptions
Type | Condition |
---|---|
System.Exception | Invalid date time string. Expected date time format: + format |
ParseAttributeValueAsTime(String, String, IFormatProvider)
Parses the attribute value as time.
Declaration
public static DateTime? ParseAttributeValueAsTime(this string attributeValue, string format = null, IFormatProvider formatProvider = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | attributeValue | The attribute value. |
System.String | format | The format. In case of null value "Long time pattern" is applied. |
System.IFormatProvider | formatProvider | The format provider. |
Returns
Type | Description |
---|---|
System.Nullable<System.DateTime> | System.Nullable{DateTime}. |
Exceptions
Type | Condition |
---|---|
System.Exception | Invalid time string. Expected time format: + format |
RemoveAccessMode(XmlDocument)
Removes the access mode.
Declaration
public static void RemoveAccessMode(this XmlDocument xmlDocument)
Parameters
Type | Name | Description |
---|---|---|
System.Xml.XmlDocument | xmlDocument | The XML document. |
RemoveCMSId(XmlElement)
Removes the CMS id.
Declaration
public static void RemoveCMSId(this XmlElement element)
Parameters
Type | Name | Description |
---|---|---|
System.Xml.XmlElement | element | The element. |
RemoveCMSInfo(XmlElement)
Removes the cmsInfo attribute.
Declaration
public static void RemoveCMSInfo(this XmlElement element)
Parameters
Type | Name | Description |
---|---|---|
System.Xml.XmlElement | element | The element. |
RemoveCMSInfo(XmlElement, String)
Sets the specified value in the cmsInfo attribute.
Declaration
public static void RemoveCMSInfo(this XmlElement element, string key)
Parameters
Type | Name | Description |
---|---|---|
System.Xml.XmlElement | element | The element. |
System.String | key | The key. |
RemoveCMSTemplateId(XmlElement)
Removes the CMS template id.
Declaration
public static void RemoveCMSTemplateId(this XmlElement element)
Parameters
Type | Name | Description |
---|---|---|
System.Xml.XmlElement | element | The element. |
RemoveDraftInfo(XmlElement)
Removes the draft information.
Declaration
public static void RemoveDraftInfo(this XmlElement element)
Parameters
Type | Name | Description |
---|---|---|
System.Xml.XmlElement | element | The element. |
RemoveReviewOptions(XmlElement)
Removes the review options.
Declaration
public static void RemoveReviewOptions(this XmlElement element)
Parameters
Type | Name | Description |
---|---|---|
System.Xml.XmlElement | element | The element. |
ReplaceInvalidFileNameChars(String)
Replaces the invalid file name chars.
Declaration
public static string ReplaceInvalidFileNameChars(this string fileName)
Parameters
Type | Name | Description |
---|---|---|
System.String | fileName | Name of the file. |
Returns
Type | Description |
---|---|
System.String |
SaveWithPreserveWhitespace(XmlDocument, String)
Saves the document with true value of PreserveWhitespace.
Declaration
public static void SaveWithPreserveWhitespace(this XmlDocument xmlDocument, string fileName)
Parameters
Type | Name | Description |
---|---|---|
System.Xml.XmlDocument | xmlDocument | The XML document. |
System.String | fileName | Name of the file. |
SelectAllRefNodes(XmlNode)
Selects all ref nodes. It includes local and cms references.
Declaration
public static XmlNodeList SelectAllRefNodes(this XmlNode node)
Parameters
Type | Name | Description |
---|---|---|
System.Xml.XmlNode | node | The node. |
Returns
Type | Description |
---|---|
System.Xml.XmlNodeList | XmlNode list |
SelectEditableRefNodes(XmlNode)
Selects the editable ref nodes.
Declaration
public static XmlNodeList SelectEditableRefNodes(this XmlNode node)
Parameters
Type | Name | Description |
---|---|---|
System.Xml.XmlNode | node | The node. |
Returns
Type | Description |
---|---|
System.Xml.XmlNodeList | The editable nodes. |
SelectEditableRefNodes(XmlNode, String)
Selects the editable ref nodes with specified CMS IDs.
Declaration
public static XmlNodeList SelectEditableRefNodes(this XmlNode node, string cmsId)
Parameters
Type | Name | Description |
---|---|---|
System.Xml.XmlNode | node | The node. |
System.String | cmsId | The CMS identifier. |
Returns
Type | Description |
---|---|
System.Xml.XmlNodeList | The editable nodes. |
SelectLocalRefNodes(XmlNode)
Selects the local ref nodes.
Declaration
public static XmlNodeList SelectLocalRefNodes(this XmlNode node)
Parameters
Type | Name | Description |
---|---|---|
System.Xml.XmlNode | node | The node. |
Returns
Type | Description |
---|---|
System.Xml.XmlNodeList | The local ref nodes. |
SelectNode(XmlNode, String)
Selects the single node.
Declaration
public static XmlNode SelectNode(this XmlNode node, string xpath)
Parameters
Type | Name | Description |
---|---|---|
System.Xml.XmlNode | node | The node. |
System.String | xpath | The xpath. |
Returns
Type | Description |
---|---|
System.Xml.XmlNode |
SelectRefNodes(XmlNode, String)
Selects the ref nodes.
Declaration
public static XmlNodeList SelectRefNodes(this XmlNode node, string urnPrefix = null)
Parameters
Type | Name | Description |
---|---|---|
System.Xml.XmlNode | node | The node. |
System.String | urnPrefix | The urn prefix. |
Returns
Type | Description |
---|---|
System.Xml.XmlNodeList | The ref nodes. |
SetAttribute(XmlElement, XmlAttributeInfo, String)
Sets the attribute.
Declaration
public static void SetAttribute(this XmlElement xmlElement, XmlAttributeInfo xmlAttributeInfo, string value)
Parameters
Type | Name | Description |
---|---|---|
System.Xml.XmlElement | xmlElement | The XML element. |
XmlAttributeInfo | xmlAttributeInfo | The XML attribute information. |
System.String | value | The value. |
SetAttributes(XmlElement, Dictionary<XmlAttributeInfo, String>)
Sets the attributes.
Declaration
public static void SetAttributes(this XmlElement xmlElement, Dictionary<XmlAttributeInfo, string> attributeValues)
Parameters
Type | Name | Description |
---|---|---|
System.Xml.XmlElement | xmlElement | The XML element. |
System.Collections.Generic.Dictionary<XmlAttributeInfo, System.String> | attributeValues | The attribute values. |
SetCMSInfo(XmlElement, Dictionary<String, String>)
Sets the cmsInfo attribute.
Declaration
public static void SetCMSInfo(this XmlElement element, Dictionary<string, string> cmsInfo)
Parameters
Type | Name | Description |
---|---|---|
System.Xml.XmlElement | element | The element. |
System.Collections.Generic.Dictionary<System.String, System.String> | cmsInfo | The CMS information. |
SetCMSInfo(XmlElement, String, String)
Sets the specified value in the cmsInfo attribute.
Declaration
public static void SetCMSInfo(this XmlElement element, string key, string value)
Parameters
Type | Name | Description |
---|---|---|
System.Xml.XmlElement | element | The element. |
System.String | key | The key. |
System.String | value | The value. |
SetCultureInfo(Thread, CultureInfo)
Sets the culture information.
Declaration
public static void SetCultureInfo(this Thread thread, CultureInfo cultureInfo)
Parameters
Type | Name | Description |
---|---|---|
System.Threading.Thread | thread | The thread. |
System.Globalization.CultureInfo | cultureInfo | The culture information. |
SetDraftInfo(XmlElement, String)
Sets the draft information.
Declaration
public static void SetDraftInfo(this XmlElement element, string info)
Parameters
Type | Name | Description |
---|---|---|
System.Xml.XmlElement | element | The element. |
System.String | info | The information. |
SetOwner(Window)
Sets the main window as owner.
Declaration
public static void SetOwner(this Window window)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Window | window | The window. |
SetOwner(Window, WindowOwner)
Sets the owner.
Declaration
public static void SetOwner(this Window window, WindowOwner owner)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Window | window | The window. |
WindowOwner | owner | The owner. |
SetProductLine(XmlDocument, String)
Sets the product line.
Declaration
public static void SetProductLine(this XmlDocument xmlDocument, string productLine)
Parameters
Type | Name | Description |
---|---|---|
System.Xml.XmlDocument | xmlDocument | The XML document. |
System.String | productLine | The product line. |
SetProductLine(XmlElement, String)
Sets the product line in the cmsInfo attribute.
Declaration
public static void SetProductLine(this XmlElement element, string productLine)
Parameters
Type | Name | Description |
---|---|---|
System.Xml.XmlElement | element | The element. |
System.String | productLine | The product line. |
SetReviewOptions(XmlElement, ReviewOptions)
Sets the review options.
Declaration
public static bool SetReviewOptions(this XmlElement element, ReviewOptions reviewOptions)
Parameters
Type | Name | Description |
---|---|---|
System.Xml.XmlElement | element | The element. |
ReviewOptions | reviewOptions | The review options. |
Returns
Type | Description |
---|---|
System.Boolean |
SetServerInfo(XmlElement, String)
Sets the server information.
Declaration
public static void SetServerInfo(this XmlElement element, string serverInfo)
Parameters
Type | Name | Description |
---|---|---|
System.Xml.XmlElement | element | The element. |
System.String | serverInfo | The server information. |
SetXPathValue(XmlDocument, String, List<String>)
Sets the X path value.
Declaration
public static bool SetXPathValue(this XmlDocument node, string xpath, List<string> values)
Parameters
Type | Name | Description |
---|---|---|
System.Xml.XmlDocument | node | The node. |
System.String | xpath | The xpath. |
System.Collections.Generic.List<System.String> | values | The values. |
Returns
Type | Description |
---|---|
System.Boolean |
ShowAndLogError(Object)
Shows and logs the error.
Declaration
public static void ShowAndLogError(this object exception)
Parameters
Type | Name | Description |
---|---|---|
System.Object | exception | The exception. |
ShowAndLogError(Object, String, Window, String, String)
Shows the and log error.
Declaration
public static bool? ShowAndLogError(this object exception, string message, Window owner = null, string acceptButtonText = "", string cancelButtonText = "")
Parameters
Type | Name | Description |
---|---|---|
System.Object | exception | The exception. |
System.String | message | The message. |
System.Windows.Window | owner | The owner. |
System.String | acceptButtonText | The accept button text. |
System.String | cancelButtonText | The cancel button text. |
Returns
Type | Description |
---|---|
System.Nullable<System.Boolean> | user action |
ShowAndLogError(Object, Window)
Shows and logs the error.
Declaration
public static void ShowAndLogError(this object exception, Window owner)
Parameters
Type | Name | Description |
---|---|---|
System.Object | exception | The exception. |
System.Windows.Window | owner | The owner. |
ShowAndLogWarning(String, String)
Shows and logs the warning.
Declaration
public static void ShowAndLogWarning(this string message, string description)
Parameters
Type | Name | Description |
---|---|---|
System.String | message | The message. |
System.String | description | The description. |
ShowAndLogWarning(String, String, Window)
Shows and logs the warning.
Declaration
public static void ShowAndLogWarning(this string message, string description, Window owner)
Parameters
Type | Name | Description |
---|---|---|
System.String | message | The message. |
System.String | description | The description. |
System.Windows.Window | owner | The owner. |
ShowProgressAsync(AppProgressDialog, ThreadStart, WindowOwner)
Shows the progress dialog and executes specified method in STA thread.
Declaration
public static void ShowProgressAsync(this AppProgressDialog dialog, ThreadStart threadStartMethod, WindowOwner owner)
Parameters
Type | Name | Description |
---|---|---|
AppProgressDialog | dialog | The dialog. |
System.Threading.ThreadStart | threadStartMethod | The thread start method. |
WindowOwner | owner | The owner. |
ShowProgressAsync(AppProgressDialog, ThreadStart, Window)
Shows the progress dialog and executes specified method in STA thread.
Declaration
public static void ShowProgressAsync(this AppProgressDialog dialog, ThreadStart threadStartMethod, Window owner = null)
Parameters
Type | Name | Description |
---|---|---|
AppProgressDialog | dialog | The dialog. |
System.Threading.ThreadStart | threadStartMethod | The thread start method. |
System.Windows.Window | owner | The owner. |
ToComponentInfo(NameValueCollection)
Converts query parameters to OfficeComponentInfo
Declaration
public static OfficeComponentInfo ToComponentInfo(this NameValueCollection queryParameters)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Specialized.NameValueCollection | queryParameters | The query parameters. |
Returns
Type | Description |
---|---|
OfficeComponentInfo |
ToImageSource(Bitmap)
Returns a managed BitmapSource
Declaration
public static ImageSource ToImageSource(this Bitmap bitmap)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.Bitmap | bitmap | The bitmap. |
Returns
Type | Description |
---|---|
System.Windows.Media.ImageSource | The managed BitmapSource. |
ToOfficeContext(OfficeComponentInfo)
Converts OfficeComponentInfo to the query parameters.
Declaration
public static string ToOfficeContext(this OfficeComponentInfo componentInfo)
Parameters
Type | Name | Description |
---|---|---|
OfficeComponentInfo | componentInfo | The component information. |
Returns
Type | Description |
---|---|
System.String |
ToQueryParameters(OfficeComponentInfo)
Converts ComponentInfo to the query parameters.
Declaration
public static string ToQueryParameters(this OfficeComponentInfo componentInfo)
Parameters
Type | Name | Description |
---|---|---|
OfficeComponentInfo | componentInfo | The component information. |
Returns
Type | Description |
---|---|
System.String |
ToValidatedFileName(String)
Any occurrence of , /, :, *, ?, ", > and | character is replaced by '_' as these characters are not allowed in the file name.
Declaration
public static string ToValidatedFileName(this string fileName)
Parameters
Type | Name | Description |
---|---|---|
System.String | fileName | Name of the file. |
Returns
Type | Description |
---|---|
System.String |
Transform(XmlNode, String, XsltArgumentList)
Transforms the specified XML node.
Declaration
public static string Transform(this XmlNode xmlNode, string xsltFilePath, XsltArgumentList parameters)
Parameters
Type | Name | Description |
---|---|---|
System.Xml.XmlNode | xmlNode | The XML node. |
System.String | xsltFilePath | The XSLT file path. |
System.Xml.Xsl.XsltArgumentList | parameters | The parameters. |
Returns
Type | Description |
---|---|
System.String |