Beispiel #1
0
        protected override void OnDelete(SyncStatus status)
        {
            var deleted   = false;
            var serverDto = GetServerDto();
            var auth      = SnapInContext.Instance.AuthTokenManager.GetAuthToken(serverDto, DisplayName);

            ActionHelper.Execute(delegate
            {
                if (ErrorMessageDisplayHelper.Confirm("Delete Tenant " + DisplayName + " permenantly?"))
                {
                    var service = ScopeNodeExtensions.GetServiceGateway(auth.ServerDto.ServerName);
                    service.Tenant.Delete(auth.ServerDto, DisplayName, auth.Token);
                    deleted = true;

                    var parent = ((ServerNode)Parent);
                    for (var i = 0; i < parent.Children.Count; i++)
                    {
                        if (parent.Children[i].DisplayName == DisplayName)
                        {
                            parent.Children.RemoveAt(i);
                            break;
                        }
                    }
                }
            }, auth);
            if (deleted)
            {
                base.OnDelete(status);
            }
        }
Beispiel #2
0
        protected override void OnDelete(SyncStatus status)
        {
            var deleted = false;

            ActionHelper.Execute(delegate
            {
                if (ErrorMessageDisplayHelper.Confirm("Remove Server " + _serverDto.ServerName + "?"))
                {
                    (Parent as SnapInNode).RemoveChild(_serverDto.ServerName);
                    SnapInContext.Instance.AuthTokenManager.RemoveAuthTokens(_serverDto.ServerName);
                    deleted = true;
                }
            }, null);
            if (deleted)
            {
                base.OnDelete(status);
            }
        }
        protected override void  OnDelete(SyncStatus status)
        {
            if (!ErrorMessageDisplayHelper.Confirm("Delete domain " + _provider.Name + "?"))
            {
                return;
            }

            ActionHelper.Execute(delegate()
            {
                var serverDto = GetServerDTO();
                var service   = this.GetServiceGateway();
                var auth      = SnapInContext.Instance.AuthTokenManager.GetAuthToken(serverDto.ServerName);
                if (this.GetServiceGateway().IdentityProvider.Delete(serverDto, _tenantName, _provider.Name, auth.Token))
                {
                    Parent.Children.Remove(this);
                }
            });
        }