示例#1
0
        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);
        }
示例#3
0
        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);
            }
        }
示例#4
0
        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);
        }