Example #1
0
        private void NetworkEvents()
        {
            NetworkDelegates.Add(delegate(MResponse ServerResponse)
            {
                var Accesses = Package.Unpacking <MAccess[]>(ServerResponse.DataBytes);

                foreach (var Access in Accesses)
                {
                    AccessCollecton.Add(new WAccess
                    {
                        Key         = Access.Key,
                        Description = Access.Description,
                        IsSelected  = false
                    });
                }

                Sender.SendToServer("Team.Access.GetAll", TGroup.Id);
            }, Dispatcher, -1, "Access.GetAll.Confirm", "TeamEditAccessPage");

            NetworkDelegates.Add(delegate(MResponse ServerResponse)
            {
                var Privileges = Package.Unpacking <TeamPrivilege[]>(ServerResponse.DataBytes);

                for (int i = 0; i < AccessCollecton.Count; i++)
                {
                    WAccess Access = AccessCollecton[i];

                    foreach (var DbAccess in Privileges)
                    {
                        if (Access.Key == DbAccess.Privilege)
                        {
                            Access.IsSelected = true;
                            break;
                        }
                    }
                }

                DataGrid_Access.Items.Refresh();
                DataGrid_Access.IsEnabled = true;
            }, Dispatcher, -1, "Team.Access.GetAll.Confirm", "TeamEditAccessPage");

            NetworkDelegates.Add(delegate(MResponse ServerResponse)
            {
                new AlertWindow("Оповещение", AlertWindow.AlertCode.UpdateConfirm, () =>
                {
                    DataGrid_Access.IsEnabled = true;
                });
            }, Dispatcher, -1, "Team.Access.Update.Confirm", "TeamEditAccessPage");
        }
Example #2
0
 public DynamicModelAccess(WAccess Access)
 {
     this.Access = Access;
 }
Example #3
0
 public DynamicModelAccess()
 {
     Access = new WAccess();
 }