Sitecore 5.0 API

MainUtil Methods

The methods of the MainUtil class are listed below. For a complete list of MainUtil class members, see the MainUtil Members topic.

Public Static (Shared) Methods

AcquireLockAcquires a named lock.
AddArraysConcatenates two arrays.
AppendMissingIDBraceAppends a mssing closing brace "}" if a path starts with a brace "{".
BoolToStringConverts a boolean to "true" or "false".
BuildHashtableBuilds the hashtable.
CapitalizeObsolete. Uppercases the first letter of a string and lowercases the remaining letters.
ClearBitResets a bit in an integer.
CompactArrayOverloaded. Compacts an object array by removing null values.
CompareVersionNumbersCompares two Sitecore version numbers.
ConvertArrayConverts an array to another type.
ConvertToHashtableConverts an array list to a hashtable.
ConvertToNameValuesOverloaded. Converts an array list to a name/value collection.
ConvertToStringOverloaded. Converts an array list of strings to a single string.
CopyArrayInserts an array into another array.
CreateObjectOverloaded. Creates an instance of an object.
DecodeNameDecodes an item name.
EncodeNameEncodes an item name.
EncodePathEncodes an item path.
EscapePlingEscapes plings (') or quotes (") in a HTML tag attribute value.
ExpandArrayOverloaded. Expands the array.
ExpandSitecorePathExpands the sitecore path.
FindStartTagFinds an end tag in a string.
FormatSizeFormats a number into a size string.
GarbageCollectPerforms garbage collection to keep memory usage down.
GenerateShortIDGenerates a short unique ID.
GetArrayListGets an array list of strings.
GetAssemblyNameGets the name of the assembly containing a type.
GetBackupFilenameGets a filename for a backup file.
GetBoolOverloaded. Gets the boolean value of a string.
GetCallerMethodGets a reference to a method on the call stack.
GetCallerNameGets name of the calling method.
GetCallerTypeGets the caller type.
GetDotNetFolderGets the root folder of the current .NET Framework.
GetDotNetVersionGets the version of the current .NET Framework.
GetExceptionMessageGets the message from an exception.
GetExtraEntriesGets the extra entries in one hashtable compared to another.
GetFileLockObsolete. Gets file specific lock object.
GetFileTimeObsolete. Gets the last modified time of a file.
GetFileWriteTimeObsolete. Gets the last modified time of a file.
GetGuidOverloaded. Gets a guid from a string.
GetHashtableGets a Hashtable from a list of objects.
GetIDOverloaded. Gets the ID.
GetImageOverloaded. Gets an image HTML tag.
GetIntGets the integer value of a string.
GetMemoryUsedUses the get memory.
GetNameValuesOverloaded. Converts a string to a name/value collection.
GetNewIDGenerates a new GUID.
GetNextSequenceGets next value of the sequencer.
GetNextVarNameSequenceGets next value of the variable name sequencer, optionally resetting it if it has reached a certain maximum.
GetObjectGets an object reference.
GetPagefileUsageGets current page file usage.
GetProcessInfoGet current process info.
GetProcessMemoryInfoWin32 memory method.
GetRequestFlagGets a boolean flag from the query string.
GetRequestIntGets an integer from the query string.
GetSequencerGets the current sequencer value.
GetSortKeyOverloaded. Generates a unique sort key.
GetSpacerOverloaded. Gets an image HTML tag with a blank image.
GetStringOverloaded. Gets the string value of an object.
GetStringListGets an array list of strings.
GetThreadIDGets the current thread ID.
GetTristateGets the tristate.
GetWebItemSourceOverloaded. Gets the web item data source from the query string.
GetWordGets n'th word from a string.
GetWorkFileNameGets a unique filename.
GetWorkingSetSizeGets size of current working set.
GuidToStringOverloaded. Converts guid to string.
HexToColorHexs color of the to.
HexToIntHexs to integer.
HtmlWrites a line of HTML to the Response output stream.
IndexOfGets the index of an object in an array.
IntToHexInts to hex.
IsBitSetGets a value indicating whether the current instance is bit set.
IsEmptyGets a value indicating whether the current instance is empty.
IsFullPathGets a value indicating whether the current instance is full path.
IsIDChecks if string is a valid GUID.
IsTypeChecks if an object is of a given type
IsXPathChecks if a string contains an XPath expression.
JoinOverloaded. Joins two strings excluding any empty string from the result.
MakeFilePathOverloaded. Builds a file path from a folder and a file.
MakePathObsolete. Makes a path from two filename parts.
MapPathMaps a virtual file path to a physical file path.
MsgBoxOverloaded. Shows a message box.
NormalizeGuidOverloaded. Normalizes a GUID.
NormalizeItemNameNormalizes an item name.
OutOverloaded. Writes a line of HTML to the Response output stream.
ReadFromFileObsolete. Reads a text file.
ReleaseLockRelease a named lock
RemoveEmptyStringsRemoves the empty strings.
RemoveEndRemoves a number of characters from the end of a string.
RemoveFromArrayRemoves from array.
RemoveStartRemove the first characters from a string.
ReplaceItemIDsReplaces all item IDs in an XML document with new GUIDs.
ReplacePostfixReplaces the postfix of a string.
ReplacePrefixReplaces the prefix of a string.
SendMailSends the mail.
SetBitSets the bit.
ShortenGuidShortens a GUID by removing braces and hyphens.
ShrinkArrayOverloaded. Compacts an object array by removing nulls.
SplitOverloaded. Splits a string into an array of strings.
SplitPathSplits a Sitecore path into parts, optionally expanding it to include the root.
StringToBoolConverts a string to boolean.
SubstringOverloaded. Retrieves a substring from a string. The substring starts at a specified character position and has a specified length.
ThemedImageOverloaded. Gets a themed image path.
TraceWrites a message to the trace.
TraceIfConditionally writes a message to the trace.
TristateToStringStres tristate to.
UnmapPathMaps a physical path to a virtual path.
UnquoteObsolete. Removes enclosing single and double quotes from a string.
WarnWrites a warning message to the trace.
WriteToFileOverloaded.  

Public Instance Methods

Equals (inherited from Object) Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) Gets the Type of the current instance.
ToString (inherited from Object) Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) Creates a shallow copy of the current Object.

See Also

MainUtil Class | Sitecore Namespace | DateUtil | FileUtil | HtmlUtil | SqlUtil | StringUtil | WebUtil | XmlUtil