Skip to main content
View as Markdown

Utils class

No description yet.

public class Utils

Namespace: DXP · Assembly: Altium.SDK

Fields​

NameTypeValue
LockedFilesRecordNamestring"LockedFiles.loc"
SectionNamestring"LockedFile"
LockedFileNamestring"Filename"
ComputerNamestring"ComputerName"
UserNamestring"UserName"
ProcessIDstring"ProcessID"
LockFileExtensionSuffixstring"loc"
LockFileNamePrefixstring"~$"
MaxPathint260
AltiumSystemPath (static)string

Properties​

PropertyTypeAccessDescription
IsRunningOn32Bitboolget

IsRunningOn32Bit​

No description yet.

bool IsRunningOn32Bit { get; }

Type: bool · Access: read-only

Methods​

MethodReturnsDescription
AddSlashstring
AddWorkspaceMessagevoid
CenterControlOnActiveMonitorvoid
ConfirmNoYesbool
ConfirmNoYesCancelbool
ConfirmNoYesWithCaptionbool
ConfirmOKCancelbool
CreateNewDocumentFromDocumentKindIServerDocument
CurrentPercentStateTPercentState
CutNotificationLeftstring
DXPNavigateInNewWindowvoid
DXPNavigateTovoid
FileOwnershipCleanDanglingOwnershipFilevoid
FileOwnershipDetailsbool
FileOwnershipIsOwnedByOtherbool
FileOwnershipRegisterAcquisitionFileStream
FileOwnershipReportAcquisitionMessagevoid
FileOwnershipUnRegisterAcquisitionvoid
FileOwnershipWarnOwnedByOthervoid
FileOwnershipWarnOwnedByOtherDialogvoid
FileOwnershipWarnOwnedByOtherMessagevoid
GetDownloadsFolderPathstring
GetDXPSDKModuleHandleIntPtr
GetDXPServerManagerIEDMS_DXPServerManager
GetFileMD5Hashstring
GetFxHashCodeint
GetLogManagerILogManager
GetMainModuleHandleIntPtr
GetOwnershipFileNamestring
GetParamterValuebool
GetProjectOfDocumentIDXPProject
GetRedableFileSizestring
GetRevisionDisplayNamestring
GetStringMD5Hashstring
GetStringPrefixAndIndexbool
GetStrParameterValuestring
GetTemporaryFileNamestring
IsActiveServerFeatureAllowedbool
IsAltiumViewerbool
IsConnectedToProjectServerbool
IsFeatureAllowedbool
IsLongPathsSupportedbool
IsSuffixedFeatureAllowedbool
IsTargetServerConnectedbool
MarqueeActivebool
MessageRouterGetCommandEnabledbool
MessageRouterGetCommandStatevoid
MessageRouterGetStateMainWindowHandleIntPtr
MessageRouterPostCommandToModulevoid
MessageRouterSendCommandToModulevoid
NotificationStartsFrombool
OwnershipFileIsDanglingbool
PercentActivebool
PercentBeginComplexOperationvoid
PercentBeginUndeterminedOperationvoid
PercentEndComplexOperationvoid
PercentEndUndeterminedOperationvoid
PercentFinishvoid
PercentInitvoid
PercentUpdatevoid
PercentUpdateByNumbervoid
PercentUpdateSetNumbervoid
ProcessKeyByClientbool
RunCommandvoid
RunTaskDialogTaskDialogResult
RunTaskDialogExTaskDialogResult
ServerOptionsReaderIOptionsReader
ServerOptionsWriterIOptionsWriter
SetParamterValuevoid
ShowErrorvoid
ShowInfovoid
ShowMessagevoid
ShowWarningvoid
SpecialFolderMyDesignsstring
StatusBarGetStatestring
StatusBarPopStatusvoid
StatusBarPushStatusvoid
StatusBarSetStatevoid
StatusBarSetStateDefaultvoid
StringReplacestring
SupportsServicebool
TerminateHosttIfTestModevoid
ToIntPtrIntPtr

AddSlash​

No description yet.

static string AddSlash(string argStr, char argSlash);
ParameterTypePassing
argStrstringvalue
argSlashcharvalue

Returns: string

AddWorkspaceMessage​

No description yet.

static void AddWorkspaceMessage(string message, string source, string document, TErrorLevel errorLevel, bool showMessages, string callbackProcess, string callbackParameters, string callbackProcess2, string callbackParameters2);
static void AddWorkspaceMessage(string messageClass, string message, string source, string document, int imageIndex, bool showMessages, string callbackProcess, string callbackParameters, string callbackProcess2, string callbackParameters2);

Overload 1: static void AddWorkspaceMessage(string message, string source, string document, TErrorLevel errorLevel, bool showMessages, string callbackProcess, string callbackParameters, string callbackProcess2, string callbackParameters2)

ParameterTypePassing
messagestringvalue
sourcestringvalue
documentstringvalue
errorLevelTErrorLevelvalue
showMessagesboolvalue
callbackProcessstringvalue
callbackParametersstringvalue
callbackProcess2stringvalue
callbackParameters2stringvalue

Returns nothing (void).

Overload 2: static void AddWorkspaceMessage(string messageClass, string message, string source, string document, int imageIndex, bool showMessages, string callbackProcess, string callbackParameters, string callbackProcess2, string callbackParameters2)

ParameterTypePassing
messageClassstringvalue
messagestringvalue
sourcestringvalue
documentstringvalue
imageIndexintvalue
showMessagesboolvalue
callbackProcessstringvalue
callbackParametersstringvalue
callbackProcess2stringvalue
callbackParameters2stringvalue

Returns nothing (void).

CenterControlOnActiveMonitor​

No description yet.

static void CenterControlOnActiveMonitor(Control argControl);
ParameterTypePassing
argControlControlvalue

Returns: nothing (void)

ConfirmNoYes​

No description yet.

static bool ConfirmNoYes(string argText);
ParameterTypePassing
argTextstringvalue

Returns: bool

ConfirmNoYesCancel​

No description yet.

static bool ConfirmNoYesCancel(string argText);
ParameterTypePassing
argTextstringvalue

Returns: bool

ConfirmNoYesWithCaption​

No description yet.

static bool ConfirmNoYesWithCaption(string argCaption, string argText);
ParameterTypePassing
argCaptionstringvalue
argTextstringvalue

Returns: bool

ConfirmOKCancel​

No description yet.

static bool ConfirmOKCancel(string argText);
ParameterTypePassing
argTextstringvalue

Returns: bool

CreateNewDocumentFromDocumentKind​

No description yet.

static IServerDocument CreateNewDocumentFromDocumentKind(string argDocumentKind);
static IServerDocument CreateNewDocumentFromDocumentKind(ref string argDocumentKind);

Overload 1: static IServerDocument CreateNewDocumentFromDocumentKind(string argDocumentKind)

ParameterTypePassing
argDocumentKindstringvalue

Returns IServerDocument.

Overload 2: static IServerDocument CreateNewDocumentFromDocumentKind(ref string argDocumentKind)

ParameterTypePassing
argDocumentKindstringref

Returns IServerDocument.

CurrentPercentState​

No description yet.

static TPercentState CurrentPercentState();

Returns: TPercentState

CutNotificationLeft​

No description yet.

static string CutNotificationLeft(string argStr, string argSubStr);
ParameterTypePassing
argStrstringvalue
argSubStrstringvalue

Returns: string

DXPNavigateInNewWindow​

No description yet.

static void DXPNavigateInNewWindow(string link);
ParameterTypePassing
linkstringvalue

Returns: nothing (void)

DXPNavigateTo​

No description yet.

static void DXPNavigateTo(string link);
ParameterTypePassing
linkstringvalue

Returns: nothing (void)

FileOwnershipCleanDanglingOwnershipFile​

No description yet.

static void FileOwnershipCleanDanglingOwnershipFile(string argDataFileName);
ParameterTypePassing
argDataFileNamestringvalue

Returns: nothing (void)

FileOwnershipDetails​

No description yet.

static bool FileOwnershipDetails(string argDataFileName, TFileOwnershipDetails argDetails);
ParameterTypePassing
argDataFileNamestringvalue
argDetailsTFileOwnershipDetailsvalue

Returns: bool

FileOwnershipIsOwnedByOther​

No description yet.

static bool FileOwnershipIsOwnedByOther(string argDataFileName, out string argComputerName, out string argUserName);
ParameterTypePassing
argDataFileNamestringvalue
argComputerNamestringout
argUserNamestringout

Returns: bool

FileOwnershipRegisterAcquisition​

No description yet.

static FileStream FileOwnershipRegisterAcquisition(string argDataFileName);
ParameterTypePassing
argDataFileNamestringvalue

Returns: FileStream

FileOwnershipReportAcquisitionMessage​

No description yet.

static void FileOwnershipReportAcquisitionMessage(string argFullFileName, string argComputerName, string argUserName);
ParameterTypePassing
argFullFileNamestringvalue
argComputerNamestringvalue
argUserNamestringvalue

Returns: nothing (void)

FileOwnershipUnRegisterAcquisition​

No description yet.

static void FileOwnershipUnRegisterAcquisition(string argDataFileName, FileStream argLockFileHandle);
ParameterTypePassing
argDataFileNamestringvalue
argLockFileHandleFileStreamvalue

Returns: nothing (void)

FileOwnershipWarnOwnedByOther​

No description yet.

static void FileOwnershipWarnOwnedByOther(string argFullFileName, string argComputerName, string argUserName, TFileOwnershipWarningLevel argFileOwnershipWarningLevel);
ParameterTypePassing
argFullFileNamestringvalue
argComputerNamestringvalue
argUserNamestringvalue
argFileOwnershipWarningLevelTFileOwnershipWarningLevelvalue

Returns: nothing (void)

FileOwnershipWarnOwnedByOtherDialog​

No description yet.

static void FileOwnershipWarnOwnedByOtherDialog(string argFullFileName, string argComputerName, string argUserName);
ParameterTypePassing
argFullFileNamestringvalue
argComputerNamestringvalue
argUserNamestringvalue

Returns: nothing (void)

FileOwnershipWarnOwnedByOtherMessage​

No description yet.

static void FileOwnershipWarnOwnedByOtherMessage(string argFullFileName, string argComputerName, string argUserName);
ParameterTypePassing
argFullFileNamestringvalue
argComputerNamestringvalue
argUserNamestringvalue

Returns: nothing (void)

GetDownloadsFolderPath​

No description yet.

static string GetDownloadsFolderPath();

Returns: string

GetDXPSDKModuleHandle​

No description yet.

static IntPtr GetDXPSDKModuleHandle();

Returns: IntPtr

GetDXPServerManager​

No description yet.

static IEDMS_DXPServerManager GetDXPServerManager();

Returns: IEDMS_DXPServerManager

GetFileMD5Hash​

No description yet.

static string GetFileMD5Hash(string fullFileName);
ParameterTypePassing
fullFileNamestringvalue

Returns: string

GetFxHashCode​

No description yet.

static int GetFxHashCode(string str);
ParameterTypePassing
strstringvalue

Returns: int

GetLogManager​

No description yet.

static ILogManager GetLogManager();

Returns: ILogManager

GetMainModuleHandle​

No description yet.

static IntPtr GetMainModuleHandle();

Returns: IntPtr

GetOwnershipFileName​

No description yet.

static string GetOwnershipFileName(string argDataFileName);
ParameterTypePassing
argDataFileNamestringvalue

Returns: string

GetParamterValue​

No description yet.

static bool GetParamterValue(string argParams, string argParamName, ref string argVal);
ParameterTypePassing
argParamsstringvalue
argParamNamestringvalue
argValstringref

Returns: bool

GetProjectOfDocument​

No description yet.

static IDXPProject GetProjectOfDocument(string argDocPath);
ParameterTypePassing
argDocPathstringvalue

Returns: IDXPProject

GetRedableFileSize​

No description yet.

static string GetRedableFileSize(string fullFileName);
ParameterTypePassing
fullFileNamestringvalue

Returns: string

GetRevisionDisplayName​

No description yet.

static string GetRevisionDisplayName(IULB_ItemRevision revision);
ParameterTypePassing
revisionIULB_ItemRevisionvalue

Returns: string

GetStringMD5Hash​

No description yet.

static string GetStringMD5Hash(string value);
ParameterTypePassing
valuestringvalue

Returns: string

GetStringPrefixAndIndex​

No description yet.

static bool GetStringPrefixAndIndex(string argStr, string argPrefix, out int argIndex);
ParameterTypePassing
argStrstringvalue
argPrefixstringvalue
argIndexintout

Returns: bool

GetStrParameterValue​

No description yet.

static string GetStrParameterValue(string parameters, string paramName);
ParameterTypePassing
parametersstringvalue
paramNamestringvalue

Returns: string

GetTemporaryFileName​

No description yet.

static string GetTemporaryFileName();
static string GetTemporaryFileName(string argBaseFolder);

Overload 1: static string GetTemporaryFileName()

Returns string.

Overload 2: static string GetTemporaryFileName(string argBaseFolder)

ParameterTypePassing
argBaseFolderstringvalue

Returns string.

IsActiveServerFeatureAllowed​

No description yet.

static bool IsActiveServerFeatureAllowed(string featureName);
ParameterTypePassing
featureNamestringvalue

Returns: bool

IsAltiumViewer​

No description yet.

static bool IsAltiumViewer();

Returns: bool

IsConnectedToProjectServer​

No description yet.

static bool IsConnectedToProjectServer(IDXPProject project);
ParameterTypePassing
projectIDXPProjectvalue

Returns: bool

IsFeatureAllowed​

No description yet.

static bool IsFeatureAllowed(IEDMS_Vault vault, string featureName);
ParameterTypePassing
vaultIEDMS_Vaultvalue
featureNamestringvalue

Returns: bool

IsLongPathsSupported​

No description yet.

static bool IsLongPathsSupported();

Returns: bool

IsSuffixedFeatureAllowed​

No description yet.

static bool IsSuffixedFeatureAllowed(IEDMS_Vault vault, string featureName);
ParameterTypePassing
vaultIEDMS_Vaultvalue
featureNamestringvalue

Returns: bool

IsTargetServerConnected​

No description yet.

static bool IsTargetServerConnected(string serverGUID);
ParameterTypePassing
serverGUIDstringvalue

Returns: bool

MarqueeActive​

No description yet.

static bool MarqueeActive();

Returns: bool

MessageRouterGetCommandEnabled​

No description yet.

static bool MessageRouterGetCommandEnabled(string argProcess, string argParameters, IServerDocumentView argDocumentView);
ParameterTypePassing
argProcessstringvalue
argParametersstringvalue
argDocumentViewIServerDocumentViewvalue

Returns: bool

MessageRouterGetCommandState​

No description yet.

static void MessageRouterGetCommandState(string argProcess, ref string argParameters, IServerDocumentView argDocumentView, ref bool argEnabled, ref bool argChecked, ref bool argVisible, ref string argCaption, ref string argImageFile);
ParameterTypePassing
argProcessstringvalue
argParametersstringref
argDocumentViewIServerDocumentViewvalue
argEnabledboolref
argCheckedboolref
argVisibleboolref
argCaptionstringref
argImageFilestringref

Returns: nothing (void)

MessageRouterGetStateMainWindowHandle​

No description yet.

static IntPtr MessageRouterGetStateMainWindowHandle();

Returns: IntPtr

MessageRouterPostCommandToModule​

No description yet.

static void MessageRouterPostCommandToModule(string argProcess, ref string argParameters, IServerDocumentView argDocumentView);
ParameterTypePassing
argProcessstringvalue
argParametersstringref
argDocumentViewIServerDocumentViewvalue

Returns: nothing (void)

MessageRouterSendCommandToModule​

No description yet.

static void MessageRouterSendCommandToModule(string argProcess, ref string argParameters, IServerDocumentView argDocumentView);
static void MessageRouterSendCommandToModule(string argProcess, string argParameters, IServerDocumentView argDocumentView);

Overload 1: static void MessageRouterSendCommandToModule(string argProcess, ref string argParameters, IServerDocumentView argDocumentView)

ParameterTypePassing
argProcessstringvalue
argParametersstringref
argDocumentViewIServerDocumentViewvalue

Returns nothing (void).

Overload 2: static void MessageRouterSendCommandToModule(string argProcess, string argParameters, IServerDocumentView argDocumentView)

ParameterTypePassing
argProcessstringvalue
argParametersstringvalue
argDocumentViewIServerDocumentViewvalue

Returns nothing (void).

NotificationStartsFrom​

No description yet.

static bool NotificationStartsFrom(string argStr, string argSubStr);
ParameterTypePassing
argStrstringvalue
argSubStrstringvalue

Returns: bool

OwnershipFileIsDangling​

No description yet.

static bool OwnershipFileIsDangling(string argLockFileName);
ParameterTypePassing
argLockFileNamestringvalue

Returns: bool

PercentActive​

No description yet.

static bool PercentActive();

Returns: bool

PercentBeginComplexOperation​

No description yet.

static void PercentBeginComplexOperation(string argInitialString);
ParameterTypePassing
argInitialStringstringvalue

Returns: nothing (void)

PercentBeginUndeterminedOperation​

No description yet.

static void PercentBeginUndeterminedOperation(string argInitialString);
ParameterTypePassing
argInitialStringstringvalue

Returns: nothing (void)

PercentEndComplexOperation​

No description yet.

static void PercentEndComplexOperation();

Returns: nothing (void)

PercentEndUndeterminedOperation​

No description yet.

static void PercentEndUndeterminedOperation();

Returns: nothing (void)

PercentFinish​

No description yet.

static void PercentFinish();

Returns: nothing (void)

PercentInit​

No description yet.

static void PercentInit(string argInitialString, int argTotalCount);
ParameterTypePassing
argInitialStringstringvalue
argTotalCountintvalue

Returns: nothing (void)

PercentUpdate​

No description yet.

static void PercentUpdate();

Returns: nothing (void)

PercentUpdateByNumber​

No description yet.

static void PercentUpdateByNumber(int argAmountToIncrement);
ParameterTypePassing
argAmountToIncrementintvalue

Returns: nothing (void)

PercentUpdateSetNumber​

No description yet.

static void PercentUpdateSetNumber(int argAmountToSet);
ParameterTypePassing
argAmountToSetintvalue

Returns: nothing (void)

ProcessKeyByClient​

No description yet.

static bool ProcessKeyByClient(ushort keyID);
ParameterTypePassing
keyIDushortvalue

Returns: bool

RunCommand​

No description yet.

static void RunCommand(string argIdString, ref string argSpecialParameter);
static void RunCommand(string argIdString, string argSpecialParameter);
static void RunCommand(string argIdString, string argSpecialParameter, IServerDocumentView argDocumentView);

Overload 1: static void RunCommand(string argIdString, ref string argSpecialParameter)

ParameterTypePassing
argIdStringstringvalue
argSpecialParameterstringref

Returns nothing (void).

Overload 2: static void RunCommand(string argIdString, string argSpecialParameter)

ParameterTypePassing
argIdStringstringvalue
argSpecialParameterstringvalue

Returns nothing (void).

Overload 3: static void RunCommand(string argIdString, string argSpecialParameter, IServerDocumentView argDocumentView)

ParameterTypePassing
argIdStringstringvalue
argSpecialParameterstringvalue
argDocumentViewIServerDocumentViewvalue

Returns nothing (void).

RunTaskDialog​

No description yet.

static TaskDialogResult RunTaskDialog(string title, string instruction, List<string> commandButtons, TaskDialogIcon icon, bool hideCancelButton);
ParameterTypePassing
titlestringvalue
instructionstringvalue
commandButtonsList<string>value
iconTaskDialogIconvalue
hideCancelButtonboolvalue

Returns: TaskDialogResult

RunTaskDialogEx​

No description yet.

static TaskDialogResult RunTaskDialogEx(string title, string instruction, List<string> commandButtons, TaskDialogIcon icon, bool hideCancelButton, string verifyCaption, ref bool verifyValue);
ParameterTypePassing
titlestringvalue
instructionstringvalue
commandButtonsList<string>value
iconTaskDialogIconvalue
hideCancelButtonboolvalue
verifyCaptionstringvalue
verifyValueboolref

Returns: TaskDialogResult

ServerOptionsReader​

No description yet.

static IOptionsReader ServerOptionsReader(string serverName);
ParameterTypePassing
serverNamestringvalue

Returns: IOptionsReader

ServerOptionsWriter​

No description yet.

static IOptionsWriter ServerOptionsWriter(string serverName);
ParameterTypePassing
serverNamestringvalue

Returns: IOptionsWriter

SetParamterValue​

No description yet.

static void SetParamterValue(ref string result, string argParamName, string argVal);
ParameterTypePassing
resultstringref
argParamNamestringvalue
argValstringvalue

Returns: nothing (void)

ShowError​

No description yet.

static void ShowError(string argText, string argCaption);
ParameterTypePassing
argTextstringvalue
argCaptionstringvalue

Returns: nothing (void)

ShowInfo​

No description yet.

static void ShowInfo(string argText, string argCaption);
ParameterTypePassing
argTextstringvalue
argCaptionstringvalue

Returns: nothing (void)

ShowMessage​

No description yet.

static void ShowMessage(string argText);
ParameterTypePassing
argTextstringvalue

Returns: nothing (void)

ShowWarning​

No description yet.

static void ShowWarning(string argText, string argCaption);
ParameterTypePassing
argTextstringvalue
argCaptionstringvalue

Returns: nothing (void)

SpecialFolderMyDesigns​

No description yet.

static string SpecialFolderMyDesigns();

Returns: string

StatusBarGetState​

No description yet.

static string StatusBarGetState(int argIndex);
ParameterTypePassing
argIndexintvalue

Returns: string

StatusBarPopStatus​

No description yet.

static void StatusBarPopStatus();

Returns: nothing (void)

StatusBarPushStatus​

No description yet.

static void StatusBarPushStatus();

Returns: nothing (void)

StatusBarSetState​

No description yet.

static void StatusBarSetState(int argIndex, string argStr);
ParameterTypePassing
argIndexintvalue
argStrstringvalue

Returns: nothing (void)

StatusBarSetStateDefault​

No description yet.

static void StatusBarSetStateDefault();

Returns: nothing (void)

StringReplace​

No description yet.

static string StringReplace(string argStr, string argOldPattern, string argNewPattern, bool argReplaceAll, bool argIgnoreCase);
ParameterTypePassing
argStrstringvalue
argOldPatternstringvalue
argNewPatternstringvalue
argReplaceAllboolvalue
argIgnoreCaseboolvalue

Returns: string

SupportsService​

No description yet.

static bool SupportsService(object obj, string serviceName, Action<Exception> exceptionHandler);
ParameterTypePassing
objobjectvalue
serviceNamestringvalue
exceptionHandlerAction<Exception>value

Returns: bool

TerminateHosttIfTestMode​

No description yet.

static void TerminateHosttIfTestMode(Func<string> outMessageToConsoleOnTerminate);
ParameterTypePassing
outMessageToConsoleOnTerminateFunc<string>value

Returns: nothing (void)

ToIntPtr​

No description yet.

static IntPtr ToIntPtr(UIntPtr ptr);
ParameterTypePassing
ptrUIntPtrvalue

Returns: IntPtr