Beispiel #1
0
        public void OnDomainAddedEvent(object sender, DomainEventArgs args)
        {
            if (removedDomains.ContainsKey(args.DomainID))
            {
                removedDomains.Remove(args.DomainID);
            }

            if (curDomains.ContainsKey(args.DomainID))
            {
                // Somehow we've already got this domain in our list, so
                // just update it.
                TreeIter iter = (TreeIter)curDomains[args.DomainID];
                AccTreeStore.SetValue(iter, 0, args.DomainID);
            }
            else
            {
                // This is a new domain we don't have in the list yet
                TreeIter iter = AccTreeStore.AppendValues(args.DomainID);
                curDomains[args.DomainID] = iter;

                // Highlight the new account
                TreeSelection tSelect = AccTreeView.Selection;
                if (tSelect != null)
                {
                    tSelect.SelectIter(iter);
                }
            }
        }
Beispiel #2
0
        private void DomainEventPublished(object sender, DomainEventArgs e)
        {
            switch (e)
            {
            case OnBankCreatedEventArgs args:
            {
                OnBankCreated.Handle(_dbContext, args);
                break;
            }

            case OnManagerCreatedEventArgs args:
            {
                OnManagerCreated.Handle(_dbContext, args);
                break;
            }

            case OnAtmCreatedEventArgs args:
            {
                OnAtmCreated.Handle(_dbContext, args);
                break;
            }

            case OnCashBalanceChangedEventArgs args:
            {
                OnCashBalanceChanged.Handle(_dbContext, args);
                break;
            }
            }
        }
Beispiel #3
0
        void DomainItemChangedHandler(object sender, DomainEventArgs e)
        {
            if (isDone)
            {
                return;
            }
            switch (e.CacheActivity)
            {
            case CacheActivity.AlreadyExists:
                alreadyExistsCount++;
                break;

            case CacheActivity.Underused:
                underusedCount++;
                break;

            case CacheActivity.Removed:
                removedCount++;
                break;

            case CacheActivity.DependencyChanged:
                dependencyCount++;
                break;

            case CacheActivity.Expired:
                expiredCount++;
                break;
            }
        }
Beispiel #4
0
        internal static void OnPublished(DomainEventArgs args)
        {
            if (Published == null)
            {
                throw new NotImplementedException("No one has subscribed to this event.");
            }

            Published.Invoke(null, args);
        }
Beispiel #5
0
        public void InvokeDomainStateChangedEvent(Authentication authentication, Domain domain)
        {
            var args = new DomainEventArgs(authentication, domain);

            this.Dispatcher.InvokeAsync(() =>
            {
                this.OnDomainStateChanged(args);
            });
        }
 private void OnCreateNewDomainCompleted(object sender, DomainEventArgs e)
 {
     _securityManager.SetProjectManagerGroupAssociationsAsync("New Domain", NewDomainPermissionAssisgned,
                                                              new GlymaSecurableObject
     {
         SecurableParentUid = Guid.Empty,
         SecurableObjectUid = e.Domain
     });
 }
 private void OnDomainDeleted(object sender, DomainEventArgs args)
 {
     // Make sure that the domain event is for the domain this dialog is showing
     if (args.DomainID == domain.ID)
     {
         // Close and destroy this window since this domain is no longer valid
         this.Hide();
         this.Destroy();
     }
 }
 public void OnDomainInactivated(object sender, DomainEventArgs args)
 {
     // Make sure that the domain event is for the domain this dialog is showing
     if (args.DomainID == domain.ID)
     {
         EnableAccountButton.Toggled -= new EventHandler(OnEnableAccountToggled);
         EnableAccountButton.Active   = false;
         EnableAccountButton.Toggled += new EventHandler(OnEnableAccountToggled);
     }
 }
Beispiel #9
0
 public void OnDomainDeletedEvent(object sender, DomainEventArgs args)
 {
     if (removedDomains.ContainsKey(args.DomainID))
     {
         removedDomains.Remove(args.DomainID);
         return;
     }
     else
     {
         RemoveDomain(args.DomainID);
     }
 }
        private void Domains_DomainStateChanged(object sender, DomainEventArgs e)
        {
            var exceptionMemberID = e.MemberID;
            var callbackInfo      = new CallbackInfo()
            {
                Index = this.index++, SignatureDate = e.SignatureDate
            };
            var domainID    = e.DomainInfo.DomainID;
            var domainState = e.DomainState;

            this.InvokeEvent(() => this.Callback?.OnDomainStateChanged(callbackInfo, domainID, domainState));
        }
Beispiel #11
0
        private void DomainContext_DomainInfoChanged(object sender, DomainEventArgs e)
        {
            var userID          = this.authentication.ID;
            var exceptionUserID = e.UserID;
            var signatureDate   = e.SignatureDate;
            var domainID        = e.DomainInfo.DomainID;
            var domainInfo      = e.DomainInfo;

            if (this.resettings.Contains(domainInfo.DataBaseID))
            {
                return;
            }
            this.InvokeEvent(userID, exceptionUserID, () => this.Callback.OnDomainInfoChanged(signatureDate, domainID, domainInfo));
        }
Beispiel #12
0
        public void InvokeDomainCreatedEvent(Authentication authentication, Domain domain)
        {
            var args       = new DomainEventArgs(authentication, domain);
            var eventLog   = EventLogBuilder.Build(authentication, this, nameof(InvokeDomainCreatedEvent), domain);
            var comment    = EventMessageBuilder.BeginDomain(authentication, domain);
            var domainInfo = domain.DomainInfo;

            this.Dispatcher.InvokeAsync(() =>
            {
                this.CremaHost.Debug(eventLog);
                this.CremaHost.Info(comment);
                this.OnDomainCreated(args);
                this.Context.InvokeItemsCreatedEvent(authentication, new IDomainItem[] { domain }, new object[] { domainInfo });
            });
        }
Beispiel #13
0
        void OnCreateDomainCompleted(object sender, Service.CreateDomainCompletedEventArgs e)
        {
            DomainEventArgs domainEventArgs = new DomainEventArgs();

            foreach (Service.CH mapChange in e.Result.C)
            {
                if (mapChange.N != null)
                {
                    domainEventArgs.Domain = mapChange.N.D;
                    break;
                }
            }

            CreateDomainCompleted.FireEvent(Guid.Empty, this, domainEventArgs);
        }
Beispiel #14
0
        private void DomainContext_DomainStateChanged(object sender, DomainEventArgs e)
        {
            var userID          = this.authentication.ID;
            var exceptionUserID = e.UserID;
            var signatureDate   = e.SignatureDate;
            var domainID        = e.DomainInfo.DomainID;
            var domainState     = e.DomainState;

            if (this.resettings.Contains(e.DomainInfo.DataBaseID))
            {
                return;
            }
            System.Diagnostics.Trace.WriteLine("DomainContext_DomainStateChanged");
            this.InvokeEvent(userID, exceptionUserID, () => this.Callback.OnDomainStateChanged(signatureDate, domainID, domainState));
        }
        public void OnDomainLoggedOut(object sender, DomainEventArgs args)
        {
            // Make sure that the domain event is for the domain this dialog is showing
            if (args.DomainID == domain.ID)
            {
                // Reset the values to the original
                ServerAddressEntry.Changed -= new EventHandler(OnServerAddressChanged);
                ServerAddressEntry.Text     = GetHostUrl(domain.HostUrl);
                bServerAddressChanged       = false;
                ServerAddressEntry.Changed += new EventHandler(OnServerAddressChanged);

                // Allow the user to modify the address
                ServerAddressEntry.Sensitive  = true;
                ServerAddressEntry.IsEditable = true;
            }
        }
        ///
        /// Event Handlers
        ///
        public void OnDomainHostModified(object sender, DomainEventArgs args)
        {
            // Make sure that the domain event is for the domain this dialog is showing
            if (args.DomainID == domain.ID)
            {
                DomainInformation updatedDomain =
                    domainController.GetDomain(args.DomainID);
                if (updatedDomain != null)
                {
                    domain = updatedDomain;

                    ServerAddressEntry.Changed -= new EventHandler(OnServerAddressChanged);
                    ServerAddressEntry.Text     = GetHostUrl(domain.HostUrl);
                    bServerAddressChanged       = false;
                    ServerAddressEntry.Changed += new EventHandler(OnServerAddressChanged);
                }
            }
        }
Beispiel #17
0
        private void Domains_DomainDeleted(object sender, DomainEventArgs e)
        {
            if (e.DomainInfo.DataBaseID != this.dataBaseID)
            {
                return;
            }

            var domainInfo = e.DomainInfo;

            if (domainInfo.ItemType == nameof(TableContent))
            {
                this.Dispatcher?.InvokeAsync(() =>
                {
                    foreach (var item in this.domainItems.ToArray())
                    {
                        if (item.Value.DataBaseID == domainInfo.DataBaseID)
                        {
                            this.domainItems.Remove(item.Key);
                        }
                    }
                });
            }
        }
Beispiel #18
0
        private void Domains_DomainCreated(object sender, DomainEventArgs e)
        {
            var domains = sender as IDomainCollection;
            var domain  = domains[e.DomainInfo.DomainID];

            if (domain == null || domain.DataBaseID != this.dataBaseID)
            {
                return;
            }

            if (domain.Host is TableContent content)
            {
                var contents   = EnumerableUtility.Friends(content, content.Childs);
                var tableNames = contents.Select(item => item.Table.Name).ToArray();
                this.Dispatcher.InvokeAsync(() =>
                {
                    foreach (var item in tableNames)
                    {
                        this.domainItems.Add(item, domain);
                    }
                });
            }
        }
Beispiel #19
0
        public void InvokeDomainStateChangedEvent(Authentication authentication, Domain domain)
        {
            var args = new DomainEventArgs(authentication, domain);

            this.OnDomainStateChanged(args);
        }
 private void Domains_DomainInfoChanged(object sender, DomainEventArgs e)
 {
     this.Invoke(null);
 }
Beispiel #21
0
 private void Domains_DomainDeleted(object sender, DomainEventArgs e)
 {
     this.Invoke(null);
 }
Beispiel #22
0
        private void OnDomainLoggedOutEvent(object sender, DomainEventArgs args)
        {
//Debug.PrintLine("iFolderController.OnDomainLoggedOutEvent() entered");
        }
Beispiel #23
0
 public void OnDomainLoggedInEvent(object sender, DomainEventArgs args)
 {
     //UpdateDomainStatus(args.DomainID);
     //iFolderData ifdata = iFolderData.GetData();
     //ifdata.Refresh();
 }
Beispiel #24
0
 public void OnDomainLoggedOutEvent(object sender, DomainEventArgs args)
 {
     //UpdateDomainStatus(args.DomainID);
 }
Beispiel #25
0
 protected virtual void OnDomainStateChanged(DomainEventArgs e)
 {
     this.domainStateChanged?.Invoke(this, e);
 }
Beispiel #26
0
 public void OnDomainInactivatedEvent(object sender, DomainEventArgs args)
 {
     //UpdateDomainStatus(args.DomainID);
 }