internal static string GetClientToken() { var clientToken = Configuration.ClientToken; if (string.IsNullOrEmpty(clientToken)) { throw ExpectedIssues.GetException(ExpectedIssues.ClientTokenNotSet); } return(clientToken); }
internal static IssueLevel ToIssueLevel(this Issue.ExceptionIssueLevel issueLevel) { IssueLevel il; if (!Enum.TryParse(issueLevel.ToString(), true, out il)) { throw ExpectedIssues.GetException(ExpectedIssues.CannotParseIssueLevelException).AddData("IssueLevel", issueLevel); } return(il); }
internal static void SetFirstAssembly(Assembly firstAssembly) { if (_firstAssembly == null) { lock (SyncRoot) { if (_firstAssembly == null) { _firstAssembly = firstAssembly; } } } if (_firstAssembly != firstAssembly) { throw ExpectedIssues.GetException(ExpectedIssues.CannotChangeFirstAssembly).AddData("From", _firstAssembly.GetName().FullName).AddData("To", firstAssembly.GetName().FullName); } }
private static Assembly GetFirstAssembly() { if (_firstAssembly == null) { lock (SyncRoot) { if (_firstAssembly == null) { _firstAssembly = Assembly.GetEntryAssembly(); if (_firstAssembly == null) { throw ExpectedIssues.GetException(ExpectedIssues.CannotAutomaticallyRetrieveAssembly); } } } } return(_firstAssembly); }