Exemplo n.º 1
0
        private static bool Login(Uri uri, bool masterOnly = false)
        {
            try
            {
                SDKEnvironment.Login(uri);
                return(true);
            }
            catch (Exception exception)
            {
                if (exception.Message.Length != 0)
                {
                    Program.Logger.Log.Error(exception.Message);
                }

                SDKEnvironment.RemoveServer(uri);
            }

            try
            {
                SDKEnvironment.Login(uri, true);
                return(true);
            }
            catch (Exception exception)
            {
                if (exception.Message.Length != 0)
                {
                    Program.Logger.Log.Error(exception.Message);
                }

                SDKEnvironment.RemoveServer(uri);
            }

            return(false);
        }
Exemplo n.º 2
0
        private static bool Login(Uri uri, bool masterOnly = false)
        {
            if (EnvironmentManager.Instance.MasterSite.ServerId.ServerType == VideoOS.Platform.ServerId.EnterpriseServerType)
            {
                Console.WriteLine("Bookmark is not supported on this product.");
                Console.ReadKey();
                return(true);
            }

            try
            {
                SDKEnvironment.Login(uri);
                return(true);
            }
            catch (Exception exception)
            {
                if (exception.Message.Length != 0)
                {
                    Program.Log.Info($"{Environment.NewLine}URI: {uri}{Environment.NewLine}Source: {exception.Source}{Environment.NewLine}Message: {exception.Message}{Environment.NewLine}Exception: {exception.ToString()}");
                    if (exception.InnerException != null)
                    {
                        Program.Log.Info($"{Environment.NewLine}Inner Exception:{Environment.NewLine}Message: {exception.InnerException.Message}{Environment.NewLine}Source: {exception.InnerException.Source}{Environment.NewLine}");
                    }
                }

                SDKEnvironment.RemoveServer(uri);
            }

            try
            {
                SDKEnvironment.Login(uri, true);
                return(true);
            }
            catch (Exception exception)
            {
                if (exception.Message.Length != 0)
                {
                    Program.Log.Info($"{Environment.NewLine}URI (true): {uri}{Environment.NewLine}Source: {exception.Source}{Environment.NewLine}Message: {exception.Message}{Environment.NewLine}Exception: {exception.ToString()}");
                    if (exception.InnerException != null)
                    {
                        Program.Log.Info($"{Environment.NewLine}Inner Exception:{Environment.NewLine}Message: {exception.InnerException.Message}{Environment.NewLine}Source: {exception.InnerException.Source}{Environment.NewLine}");
                    }
                }

                SDKEnvironment.RemoveServer(uri);
            }

            return(false);
        }