Example #1
0
        private void RaiseEvents(Operation op, int itemIndex, T oldItem, T newItem)
        {
            switch (op)
            {
            case Operation.OP_ADD:
                OnInsert?.Invoke(objects.Count - 1, newItem);
                break;

            case Operation.OP_CLEAR:
                OnClear?.Invoke();
                break;

            case Operation.OP_INSERT:
                OnInsert?.Invoke(itemIndex, newItem);
                break;

            case Operation.OP_REMOVEAT:
                OnRemove?.Invoke(itemIndex, oldItem);
                break;

            case Operation.OP_SET:
                OnSet?.Invoke(itemIndex, oldItem, newItem);
                break;
            }
        }
Example #2
0
        public new TValue this[TKey key]
        {
            get
            {
                return(base[key]);
            }
            set
            {
                Boolean succesfull = TryGetValue(key, out TValue val);

                if (succesfull && val?.Equals(value) == true)
                {
                    return;
                }

                base[key] = value;

                if (succesfull)
                {
                    OnChange?.Invoke(key, value);
                }
                else
                {
                    OnAdd?.Invoke(key, value);
                }

                OnSet?.Invoke(key, value);
                ItemsChanged?.Invoke();
            }
        }
Example #3
0
 public new void Add(TKey key, TValue value)
 {
     base.Add(key, value);
     OnAdd?.Invoke(key, value);
     OnSet?.Invoke(key, value);
     ItemsChanged?.Invoke();
 }
Example #4
0
        /// <summary>
        /// Function to set updated time to now, and fire OnSet event.
        /// </summary>
        private void SetValue()
        {
            if (!_lastUpdated.HasValue)
            {
                _lastUpdated = DateTime.Now;
            }

            OnSet?.Invoke(this);
        }
Example #5
0
 public override TValue this[TKey key]
 {
     get
     {
         return(base[key]);
     }
     set
     {
         base[key] = value;
         OnSet?.Invoke(key, value);
     }
 }
Example #6
0
 public new T this[Int32 index]
 {
     get
     {
         return(base[index]);
     }
     set
     {
         base[index] = value;
         OnSet?.Invoke(ref value);
     }
 }
Example #7
0
        private void DeserializeSet(NetworkReader reader, bool apply)
        {
            TKey   key  = reader.Read <TKey>();
            TValue item = reader.Read <TValue>();

            if (apply)
            {
                TValue oldItem = objects[key];
                objects[key] = item;
                OnSet?.Invoke(key, oldItem, item);
            }
        }
Example #8
0
        private void DeserializeSet(NetworkReader reader, bool apply)
        {
            int index   = (int)reader.ReadPackedUInt32();
            T   newItem = reader.Read <T>();

            if (apply)
            {
                T oldItem = objects[index];
                objects[index] = newItem;
                OnSet?.Invoke(index, oldItem, newItem);
            }
        }
Example #9
0
        public async Task SetSharedAccounts()
        {
            Breadcrumbs = new List <Breadcrumb>()
            {
                new Breadcrumb()
                {
                    Active = true, Content = "Shared Accounts"
                }
            };

            if (OnSet != null)
            {
                await OnSet.Invoke(Breadcrumbs);
            }
        }
Example #10
0
        public async Task SetHardwareVaults()
        {
            Breadcrumbs = new List <Breadcrumb>()
            {
                new Breadcrumb()
                {
                    Active = true, Content = "Hardware Vaults"
                }
            };

            if (OnSet != null)
            {
                await OnSet.Invoke(Breadcrumbs);
            }
        }
Example #11
0
 public void SetValue(bool newState)
 {
     if (state && !newState)
     {
         digit0.text = "1";
         digit1.text = "0";
     }
     else if (!state && newState)
     {
         digit0.text = "0";
         digit1.text = "1";
     }
     state = newState;
     OnSet?.Invoke();
 }
Example #12
0
        public async Task SetDisable2fa()
        {
            Breadcrumbs = new List <Breadcrumb>()
            {
                new Breadcrumb()
                {
                    Active = true, Content = "Disable 2FA"
                }
            };

            if (OnSet != null)
            {
                await OnSet.Invoke(Breadcrumbs);
            }
        }
Example #13
0
        public async Task SetWorkstations()
        {
            Breadcrumbs = new List <Breadcrumb>()
            {
                new Breadcrumb()
                {
                    Active = true, Content = "Workstations"
                }
            };

            if (OnSet != null)
            {
                await OnSet.Invoke(Breadcrumbs);
            }
        }
Example #14
0
        public async Task SetEnableAuthenticator()
        {
            Breadcrumbs = new List <Breadcrumb>()
            {
                new Breadcrumb()
                {
                    Active = true, Content = "Enable Authenticator"
                }
            };

            if (OnSet != null)
            {
                await OnSet.Invoke(Breadcrumbs);
            }
        }
Example #15
0
        public async Task SetProfile()
        {
            Breadcrumbs = new List <Breadcrumb>()
            {
                new Breadcrumb()
                {
                    Active = true, Content = "Profile"
                }
            };

            if (OnSet != null)
            {
                await OnSet.Invoke(Breadcrumbs);
            }
        }
Example #16
0
        public async Task SetGenerateRecoveryCodes()
        {
            Breadcrumbs = new List <Breadcrumb>()
            {
                new Breadcrumb()
                {
                    Active = true, Content = "Generate Recovery Codes"
                }
            };

            if (OnSet != null)
            {
                await OnSet.Invoke(Breadcrumbs);
            }
        }
Example #17
0
        public async Task SetDashboard()
        {
            Breadcrumbs = new List <Breadcrumb>()
            {
                new Breadcrumb()
                {
                    Active = true, Content = "Dashboard"
                }
            };

            if (OnSet != null)
            {
                await OnSet.Invoke(Breadcrumbs);
            }
        }
Example #18
0
        public async Task SetTwoFactorAuthentication()
        {
            Breadcrumbs = new List <Breadcrumb>()
            {
                new Breadcrumb()
                {
                    Active = true, Content = "Two Factor Authentication"
                }
            };

            if (OnSet != null)
            {
                await OnSet.Invoke(Breadcrumbs);
            }
        }
Example #19
0
        public async Task SetDeletePersonalData()
        {
            Breadcrumbs = new List <Breadcrumb>()
            {
                new Breadcrumb()
                {
                    Active = true, Content = "Delete Personal Data"
                }
            };

            if (OnSet != null)
            {
                await OnSet.Invoke(Breadcrumbs);
            }
        }
Example #20
0
        public async Task SetAdministrators()
        {
            Breadcrumbs = new List <Breadcrumb>()
            {
                new Breadcrumb()
                {
                    Active = true, Content = "Administrators"
                }
            };

            if (OnSet != null)
            {
                await OnSet.Invoke(Breadcrumbs);
            }
        }
Example #21
0
        public async Task SetTemplates()
        {
            Breadcrumbs = new List <Breadcrumb>()
            {
                new Breadcrumb()
                {
                    Active = true, Content = "Templates"
                }
            };

            if (OnSet != null)
            {
                await OnSet.Invoke(Breadcrumbs);
            }
        }
Example #22
0
        public async Task SetParameters()
        {
            Breadcrumbs = new List <Breadcrumb>()
            {
                new Breadcrumb()
                {
                    Active = true, Content = "Settings"
                },
                new Breadcrumb()
                {
                    Active = true, Content = "Parameters"
                }
            };

            if (OnSet != null)
            {
                await OnSet.Invoke(Breadcrumbs);
            }
        }
Example #23
0
        public async Task SetOrgStructure()
        {
            Breadcrumbs = new List <Breadcrumb>()
            {
                new Breadcrumb()
                {
                    Active = true, Content = "Settings"
                },
                new Breadcrumb()
                {
                    Active = true, Content = "OrgStructure"
                }
            };

            if (OnSet != null)
            {
                await OnSet.Invoke(Breadcrumbs);
            }
        }
Example #24
0
        public async Task SetAuditSummaries()
        {
            Breadcrumbs = new List <Breadcrumb>()
            {
                new Breadcrumb()
                {
                    Active = true, Content = "Audit"
                },
                new Breadcrumb()
                {
                    Active = true, Content = "Summaries"
                }
            };

            if (OnSet != null)
            {
                await OnSet.Invoke(Breadcrumbs);
            }
        }
Example #25
0
        public async Task SetHardwareVaultProfiles()
        {
            Breadcrumbs = new List <Breadcrumb>()
            {
                new Breadcrumb()
                {
                    Active = true, Content = "Settings"
                },
                new Breadcrumb()
                {
                    Active = true, Content = "Hardware Vault Access Profiles"
                }
            };

            if (OnSet != null)
            {
                await OnSet.Invoke(Breadcrumbs);
            }
        }
Example #26
0
        public async Task SetDataProtection()
        {
            Breadcrumbs = new List <Breadcrumb>()
            {
                new Breadcrumb()
                {
                    Active = true, Content = "Settings"
                },
                new Breadcrumb()
                {
                    Active = true, Content = "Data Protection"
                }
            };

            if (OnSet != null)
            {
                await OnSet.Invoke(Breadcrumbs);
            }
        }
Example #27
0
        public async Task SetEmployeeDetails(string name)
        {
            Breadcrumbs = new List <Breadcrumb>()
            {
                new Breadcrumb()
                {
                    Active = false, Link = "/Employees", Content = "Employees"
                },
                new Breadcrumb()
                {
                    Active = true, Content = name
                }
            };

            if (OnSet != null)
            {
                await OnSet.Invoke(Breadcrumbs);
            }
        }
Example #28
0
        public PlayerInventory(int slotCount, int maxWeight)
        {
            CurrentSelected = -1;
            Slots           = new Dictionary <int, InventorySlot>();
            for (int i = 0; i < slotCount; ++i)
            {
                InventorySlot inventorySlot = new InventorySlot(i, maxWeight);
                inventorySlot.OnSet                    = (id, item) => { OnSet.Invoke(id, item); };
                inventorySlot.OnSetCount               = (id, count) => { OnSetCount.Invoke(id, count); };
                inventorySlot.OnUse                    = (item) => { OnItemUse.Invoke(item); };
                inventorySlot.OnEmptyHighlight        += (id) => { OnEmptyHighlight.Invoke(id); };
                inventorySlot.OnAvailableHighlight    += (id) => { OnAvailableHighlight.Invoke(id); };
                inventorySlot.OnInaccessibleHighlight += (id) => { OnInaccessibleHighlight.Invoke(id); };
                inventorySlot.OnOffHighlight          += (id) => { OnOffHighlight.Invoke(id); };

                HighlightSlot    += inventorySlot.Highlight;
                OffHighlightSlot += inventorySlot.OffHighlight;

                Slots.Add(i, inventorySlot);
            }
        }
Example #29
0
        private void RaiseEvents(Operation op, TKey key, TValue value, TValue oldValue)
        {
            switch (op)
            {
            case Operation.OP_ADD:
                OnInsert?.Invoke(key, value);
                break;

            case Operation.OP_CLEAR:
                OnClear?.Invoke();
                break;

            case Operation.OP_REMOVE:
                OnRemove?.Invoke(key, value);
                break;

            case Operation.OP_SET:
                OnSet?.Invoke(key, oldValue, value);
                break;
            }
        }
 public void Set(string key, Value value)
 {
     _metadataDictionary[_prefix + key] = value;
     OnSet?.Invoke();
 }