Beispiel #1
0
            public override async void OnBindViewHolder(RecyclerView.ViewHolder holder, int position)
            {
                var simpleHolder = holder as SimpleViewHolder;

                simpleHolder.mBoundString = mValues[position];
                simpleHolder.nick.Text    = mValues[position];

                int drawableID = GetIcon(mTypes[position]);

                BitmapFactory.Options options = new BitmapFactory.Options();

                if (mCalculatedSizes.ContainsKey(drawableID))
                {
                    options.InSampleSize = mCalculatedSizes[drawableID];
                }

                else
                {
                    options.InJustDecodeBounds = true;

                    BitmapFactory.DecodeResource(mResource, drawableID, options);

                    options.InSampleSize       = ConnectAccount.CalculateInSampleSize(options, 100, 100);
                    options.InJustDecodeBounds = false;

                    mCalculatedSizes.Add(drawableID, options.InSampleSize);
                }


                var bitMap = await BitmapFactory.DecodeResourceAsync(mResource, drawableID, options);

                simpleHolder.platform.SetImageBitmap(bitMap);
            }
        public LoginTests()
        {
            AzureSessionInitializer.InitializeAzureSession();
            ProtectedProfileProvider.InitializeResourceManagerProfile();

            ContextAutosaveSettings settings = null;

            AzureSession.Modify((session) => EnableAutosave(session, true, out settings));
            ProtectedProfileProvider.InitializeResourceManagerProfile(true);

            _cmdlet                       = new ConnectAccount();
            _cmdlet.TenantId              = _tenantId;
            _cmdlet.SubscriptionId        = _subscriptionId;
            _cmdlet.SubscriptionName      = _subscriptionName;
            _cmdlet.UserName              = _userName;
            _cmdlet.Password              = _password;
            _cmdlet.ApplicationId         = _applicationId;
            _cmdlet.CertificateThumbprint = _certificateThumbprint;
            _cmdlet.CommandRuntime        = new MockCommandRuntime();
        }
        public LoginTests()
        {
            AzureSessionInitializer.InitializeAzureSession();
            ProtectedProfileProvider.InitializeResourceManagerProfile();
            IServicePrincipalKeyStore keyStore = new AzureRmServicePrincipalKeyStore(AzureRmProfileProvider.Instance.Profile);

            AzureSession.Instance.RegisterComponent(ServicePrincipalKeyStore.Name, () => keyStore);

            ContextAutosaveSettings settings = null;

            AzureSession.Modify((session) => EnableAutosave(session, true, out settings));
            ProtectedProfileProvider.InitializeResourceManagerProfile(true);

            _cmdlet                       = new ConnectAccount();
            _cmdlet.TenantId              = _tenantId;
            _cmdlet.SubscriptionId        = _subscriptionId;
            _cmdlet.SubscriptionName      = _subscriptionName;
            _cmdlet.UserName              = _userName;
            _cmdlet.Password              = _password;
            _cmdlet.ApplicationId         = _applicationId;
            _cmdlet.CertificateThumbprint = _certificateThumbprint;
            _cmdlet.CommandRuntime        = new MockCommandRuntime();
        }