コード例 #1
0
ファイル: Actor.cs プロジェクト: NikolaColic/EvaluationSeries
        public override int GetHashCode()
        {
            int hash = 1;

            if (ActorId != 0)
            {
                hash ^= ActorId.GetHashCode();
            }
            if (Name.Length != 0)
            {
                hash ^= Name.GetHashCode();
            }
            if (Surname.Length != 0)
            {
                hash ^= Surname.GetHashCode();
            }
            if (Biography.Length != 0)
            {
                hash ^= Biography.GetHashCode();
            }
            if (WikiUrl.Length != 0)
            {
                hash ^= WikiUrl.GetHashCode();
            }
            if (ImageUrl.Length != 0)
            {
                hash ^= ImageUrl.GetHashCode();
            }
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
コード例 #2
0
        private async Task <string> Validate()
        {
            if (string.IsNullOrWhiteSpace(WikiUrl) || string.IsNullOrWhiteSpace(Username))
            {
                await Task.Delay(500);

                LoginError("You must supply a wiki url and username.");
                return(null);
            }

            string url = WikiUrl.ToLowerInvariant();

            if (!url.StartsWith("http://") && !url.StartsWith("https://"))
            {
                url = "https://" + url;
            }

            if (!Uri.IsWellFormedUriString(url, UriKind.Absolute) || url.IndexOf('?') != -1)
            {
                await Task.Delay(500);

                LoginError("Invalid wiki url");
                return(null);
            }

            if (url.StartsWith("http://") && !_dialogs.ConfirmInsecureLoginDialog())
            {
                return(null);
            }

            return(url);
        }
コード例 #3
0
ファイル: LoginViewModel.cs プロジェクト: Aspallar/Wiki-Up
        private async Task <string> Validate()
        {
            if (string.IsNullOrWhiteSpace(WikiUrl) || string.IsNullOrWhiteSpace(Username))
            {
                await _helpers.Wait(500);

                LoginError(Resources.LoginErrorNoWikiOrUsername);
                return(null);
            }

            var url = WikiUrl.ToLowerInvariant();

            if (!url.StartsWith("http://") && !url.StartsWith("https://"))
            {
                url = "https://" + url;
            }

            if (!Uri.IsWellFormedUriString(url, UriKind.Absolute) || url.IndexOf('?') != -1)
            {
                await _helpers.Wait(500);

                LoginError(Resources.LoginErrorInvalidWikiUrl);
                return(null);
            }

            if (url.StartsWith("http://") && !_dialogs.ConfirmInsecureLoginDialog())
            {
                return(null);
            }

            return(url);
        }