コード例 #1
0
ファイル: BuildApk.cs プロジェクト: dora0825/xamarin-android
        void AddNativeLibraries(ArchiveFileList files, string supportedAbis, System.Collections.Generic.IEnumerable <LibInfo> libs)
        {
            if (libs.Any(lib => lib.Abi == null))
            {
                Log.LogCodedWarning(
                    "4301",
                    "Could not determine abi of some native libraries, ignoring those: " +
                    string.Join(", ", libs.Where(lib => lib.Abi == null).Select(lib => lib.Path)));
            }
            libs = libs.Where(lib => lib.Abi != null);

            var abis = supportedAbis.Split(new char[] { ',', ';' }, StringSplitOptions.RemoveEmptyEntries);

            libs = libs.Where(lib => abis.Contains(lib.Abi));
            foreach (var arm in ArmAbis)
            {
                foreach (var info in libs.Where(lib => lib.Abi == arm))
                {
                    AddNativeLibrary(files, info.Path, info.Abi);
                }
            }
            foreach (var info in libs.Where(lib => !ArmAbis.Contains(lib.Abi)))
            {
                AddNativeLibrary(files, info.Path, info.Abi);
            }
        }
コード例 #2
0
ファイル: BuildApk.cs プロジェクト: elix22/xamarin-android
		void AddNativeLibraries (ArchiveFileList files, string [] supportedAbis, System.Collections.Generic.IEnumerable<LibInfo> libs)
		{
			if (libs.Any (lib => lib.Abi == null))
				Log.LogCodedWarning (
						"XA4301",
						Properties.Resources.XA4301_ABI_Ignoring,
						string.Join (", ", libs.Where (lib => lib.Abi == null).Select (lib => lib.Path)));
			libs = libs.Where (lib => lib.Abi != null);
			libs = libs.Where (lib => supportedAbis.Contains (lib.Abi));
			foreach (var info in libs)
				AddNativeLibrary (files, info.Path, info.Abi, info.ArchiveFileName);
		}
コード例 #3
0
        public IActionResult Get(int id)
        {
            IEnumerable <HouseViewModel> foundHouse = Houses.Where(Houses => Houses.Id == id);

            if (foundHouse.Count() > 0)
            {
                return(Ok(foundHouse));
            }
            return(NotFound());
        }
コード例 #4
0
    private static int[,] CheckCrossingElements(int[,] index)
    {
        int i = 2;

        System.Collections.Generic.IEnumerable <int> newRange = Enumerable.Range(index[0, 0], index[0, 1] - index[0, 0] + 1);
        System.Collections.Generic.IEnumerable <int> oldRange = Enumerable.Range(index[i, 0], index[i, 1] - index[i, 0] + 1);
        IEnumerable <int> both = newRange.Intersect(oldRange);

        foreach (var o in both)
        {
            oldRange.Where(old => old != o);
        }
        return(index);
    }
コード例 #5
0
ファイル: Healer.cs プロジェクト: Vakuu/CSharp
        public override Character GetTarget(System.Collections.Generic.IEnumerable <Character> targetsList)
        {
            var targetsFromAlianceTeam = targetsList
                                         .Where(t => t.Team == this.Team);

            if (targetsFromAlianceTeam.Count() == 0)
            {
                return(null);
            }

            int minHp = int.MaxValue;

            foreach (var aliance in targetsFromAlianceTeam)
            {
                if (aliance.HealthPoints < minHp && aliance != this)
                {
                    minHp = aliance.HealthPoints;
                }
            }

            return(targetsFromAlianceTeam.FirstOrDefault(t => t.HealthPoints == minHp));
        }
コード例 #6
0
        public async Task <ProcessConsentResult> ProcessConsent(ConsentInputModel model)
        {
            ProcessConsentResult result = new ProcessConsentResult();

            ConsentResponse grantedConsent = null;

            // user clicked 'no' - send back the standard 'access_denied' response
            if (model.Button == "no")
            {
                grantedConsent = ConsentResponse.Denied;
            }
            // user clicked 'yes' - validate the data
            else if (model.Button == "yes" && model != null)
            {
                // if the user consented to some scope, build the response model
                if (model.ScopesConsented != null && model.ScopesConsented.Any())
                {
                    System.Collections.Generic.IEnumerable <string> scopes = model.ScopesConsented;
                    if (ConsentOptions.EnableOfflineAccess == false)
                    {
                        scopes = scopes.Where(x => x != IdentityServer4.IdentityServerConstants.StandardScopes.OfflineAccess);
                    }

                    grantedConsent = new ConsentResponse {
                        RememberConsent = model.RememberConsent,
                        ScopesConsented = scopes.ToArray()
                    };
                }
                else
                {
                    result.ValidationError = ConsentOptions.MustChooseOneErrorMessage;
                }
            }
            else
            {
                result.ValidationError = ConsentOptions.InvalidSelectionErrorMessage;
            }

            if (grantedConsent != null)
            {
                // validate return url is still valid
                AuthorizationRequest request = await this._interaction.GetAuthorizationContextAsync(model.ReturnUrl);

                if (request == null)
                {
                    return(result);
                }

                // communicate outcome of consent back to identityserver
                await this._interaction.GrantConsentAsync(request, grantedConsent);

                // indicate that's it ok to redirect back to authorization endpoint
                result.RedirectUri = model.ReturnUrl;
            }
            else
            {
                // we need to redisplay the consent UI
                result.ViewModel = await this.BuildViewModelAsync(model.ReturnUrl, model);
            }

            return(result);
        }
コード例 #7
0
 private static void Client_OnClientEnterView(object sender, System.Collections.Generic.IEnumerable <ClientEnterView> e)
 {
     e.Where(x => x.ClientType != ClientType.Query)
     .OrderBy(x => x.TargetChannelId)
     .ForEach(x => Console.WriteLine($"[{x.TargetChannelId}] {x.Name}"));
 }