// public event Action Disabling;

/*    private void Awake()
 *  {
 *      for(int i=0;i<NumberOfSlots; i++)
 *      {
 *          GameObject instance = Instantiate(slotPrefab);
 *          instance.transform.SetParent(slopPanel);
 *          uIItems.Add(instance.GetComponentInChildren<UIItem>());
 *
 *      }
 *  }*/

    private void OnEnable()
    {
        for (int i = 0; i < NumberOfSlots; i++)
        {
            GameObject instance = Instantiate(slotPrefab);
            instance.transform.SetParent(slopPanel);
            instance.transform.localScale = new Vector3(1, 1, 1);
            UIItem tempUIItem = instance.GetComponentInChildren <UIItem>();
            tempUIItem.Initialization(singletonInventory);
            uIItems.Add(tempUIItem);
        }
        Cursor.visible = true;
        Enabling?.Invoke();
    }
        /// <summary>
        /// Update gambling payments control
        /// </summary>
        /// <param name="cardUid">Required parameter: Card uid of the targeted card</param>
        /// <param name="body">Required parameter: Whether gambling payments should be allowed. Set to false to block, true to allow.</param>
        /// <return>Returns the void response from the API call</return>
        public async Task UpdateEnableGamblingPaymentsAsync(Guid cardUid, Enabling body)
        {
            //validating required parameters
            if (null == body)
            {
                throw new ArgumentNullException(nameof(body), "The parameter \"body\" is a required parameter and cannot be null.");
            }

            //the base uri for api requests
            var baseUri = Configuration.GetBaseURI();

            //prepare query string for API call
            var queryBuilder = new StringBuilder(baseUri);

            queryBuilder.Append("/api/v2/cards/{cardUid}/controls/gambling-enabled");

            //process optional template parameters
            APIHelper.AppendUrlWithTemplateParameters(queryBuilder, new Dictionary <string, object>
            {
                { "cardUid", cardUid }
            });


            //validate and preprocess url
            var queryUrl = APIHelper.CleanUrl(queryBuilder);

            //append request with appropriate headers and parameters
            var headers = APIHelper.GetContentRequestHeaders();

            //append body params
            var serializedBody = APIHelper.JsonSerialize(body);

            //prepare the API call request to fetch the response
            var request = ClientInstance.PutBody(queryUrl, headers, serializedBody);

            //invoke request and get response
            var response = (HttpStringResponse)await ClientInstance.ExecuteAsStringAsync(request).ConfigureAwait(false);

            var context = new HTTPContext(request, response);

            //handle errors
            ValidateResponse(response, context);
        }
Beispiel #3
0
        public void Convert(Entity entity, EntityManager dstManager, GameObjectConversionSystem conversionSystem)
        {
            var data = new Enabling();

            dstManager.AddComponentData(entity, data);
        }
Beispiel #4
0
        /// <summary>
        /// Enable or disable a Local User
        /// </summary>
        /// <param name="user">
        /// A <see cref="LocalUser"/> object representing the user to enable or disable.
        /// </param>
        /// <param name="enable">
        /// One of the <see cref="Enabling"/> enumeration values, indicating whether to
        /// enable or disable the user.
        /// </param>
        internal void EnableLocalUser(LocalUser user, Enabling enable)
        {
            context = new Context(enable == Enabling.Enable ? ContextOperation.Enable
                                                            : ContextOperation.Disable,
                                  ContextObjectType.User, user.Name,
                                  user);

            if (user.SID == null)
                context.target = user = GetLocalUser(user.Name);

            EnableUser(user.SID, enable);
        }
Beispiel #5
0
        /// <summary>
        /// Enable or disable a Local User
        /// </summary>
        /// <param name="sid">
        /// A <see cref="SecurityIdentifier"/> object identifying the user to enable or disable.
        /// </param>
        /// <param name="enable">
        /// One of the <see cref="Enabling"/> enumeration values, indicating whether to
        /// enable or disable the user.
        /// </param>
        internal void EnableLocalUser(SecurityIdentifier sid, Enabling enable)
        {
            context = new Context(enable == Enabling.Enable ? ContextOperation.Enable
                                                            : ContextOperation.Disable,
                                  ContextObjectType.User, sid.ToString(),
                                  sid);

            EnableUser(sid, enable);
        }
Beispiel #6
0
        /// <summary>
        /// Enable or disable a user.
        /// </summary>
        /// <param name="sid">
        /// A <see cref="SecurityIdentifier"/> object identifying the user to be
        /// enabled or disabled.
        /// </param>
        /// <param name="enable">
        /// One of the <see cref="Enabling"/> enumeration values indicating
        /// whether the user is to be enabled or disabled.
        /// </param>
        private void EnableUser(SecurityIdentifier sid, Enabling enable)
        {
            IntPtr userHandle = IntPtr.Zero;
            IntPtr buffer = IntPtr.Zero;
            UInt32 status = 0;

            var sre = GetUserSre(sid);

            status = SamApi.SamOpenUser(sre.domainHandle,
                                        Win32.MAXIMUM_ALLOWED,
                                        sre.RelativeId,
                                        out userHandle);
            ThrowOnFailure(status);

            try
            {
                USER_ALL_INFORMATION info;

                status = SamApi.SamQueryInformationUser(userHandle,
                                                        USER_INFORMATION_CLASS.UserAllInformation,
                                                        out buffer);
                ThrowOnFailure(status);
                info = ClrFacade.PtrToStructure<USER_ALL_INFORMATION>(buffer);
                status = SamApi.SamFreeMemory(buffer);
                buffer = IntPtr.Zero;

                UInt32 uac = info.UserAccountControl;
                UInt32 enabled_state = uac & SamApi.USER_ACCOUNT_DISABLED;

                if (enable == Enabling.Enable && enabled_state == SamApi.USER_ACCOUNT_DISABLED)
                    uac &= ~SamApi.USER_ACCOUNT_DISABLED;
                else if (enable == Enabling.Disable && enabled_state != SamApi.USER_ACCOUNT_DISABLED)
                    uac |= SamApi.USER_ACCOUNT_DISABLED;
                else
                    return;

                if (uac != info.UserAccountControl)
                {
                    info.UserAccountControl = uac;
                    info.WhichFields = SamApi.USER_ALL_USERACCOUNTCONTROL;

                    buffer = Marshal.AllocHGlobal(Marshal.SizeOf(info));
                    Marshal.StructureToPtr(info, buffer, false);
                    status = SamApi.SamSetInformationUser(userHandle,
                                                          USER_INFORMATION_CLASS.UserAllInformation,
                                                          buffer);
                    ClrFacade.DestroyStructure<USER_ALL_INFORMATION>(buffer);
                    Marshal.FreeHGlobal(buffer);
                    buffer = IntPtr.Zero;
                    ThrowOnFailure(status);
                }
            }
            finally
            {
                if (buffer != IntPtr.Zero)
                    Marshal.FreeHGlobal(buffer);
                if (userHandle != IntPtr.Zero)
                    status = SamApi.SamCloseHandle(userHandle);
            }
        }
        /// <summary>
        /// Update mobile wallet payments control
        /// </summary>
        /// <param name="cardUid">Required parameter: Card uid of the targeted card</param>
        /// <param name="body">Required parameter: Whether mobile wallet payments should be allowed. Set to false to block, true to allow.</param>
        /// <return>Returns the void response from the API call</return>
        public void UpdateEnableMobileWallet(Guid cardUid, Enabling body)
        {
            var t = UpdateEnableMobileWalletAsync(cardUid, body);

            APIHelper.RunTaskSynchronously(t);
        }
        /// <summary>
        /// Update gambling payments control
        /// </summary>
        /// <param name="cardUid">Required parameter: Card uid of the targeted card</param>
        /// <param name="body">Required parameter: Whether gambling payments should be allowed. Set to false to block, true to allow.</param>
        /// <return>Returns the void response from the API call</return>
        public void UpdateEnableGamblingPayments(Guid cardUid, Enabling body)
        {
            var t = UpdateEnableGamblingPaymentsAsync(cardUid, body);

            APIHelper.RunTaskSynchronously(t);
        }
        /// <summary>
        /// Update ATM withdrawal control
        /// </summary>
        /// <param name="cardUid">Required parameter: Card uid of the targeted card</param>
        /// <param name="body">Required parameter: Whether ATM withdrawals should be allowed. Set to false to block, true to allow.</param>
        /// <return>Returns the void response from the API call</return>
        public void UpdateEnableAtm(Guid cardUid, Enabling body)
        {
            var t = UpdateEnableAtmAsync(cardUid, body);

            APIHelper.RunTaskSynchronously(t);
        }
        /// <summary>
        /// Update magstripe payments control
        /// </summary>
        /// <param name="cardUid">Required parameter: Card uid of the targeted card</param>
        /// <param name="body">Required parameter: Whether magstripe payments should be allowed. Set to false to block, true to allow.</param>
        /// <return>Returns the void response from the API call</return>
        public void UpdateEnableMagStripePayment(Guid cardUid, Enabling body)
        {
            var t = UpdateEnableMagStripePaymentAsync(cardUid, body);

            APIHelper.RunTaskSynchronously(t);
        }