Пример #1
0
        private async void Initialize()
        {
            try
            {
                this.BeginProgress(Resources.Message_LoadingData);
                await TableContentDescriptorUtility.BeginEditAsync(this.authentication, this.contentDescriptor);

                if (this.contentDescriptor.TargetDomain is IDomain domain && domain.Source is CremaDataSet dataSet)
                {
                    foreach (var item in this.Tables)
                    {
                        item.Source = dataSet.Tables[item.Name];
                        item.Domain = domain;
                    }
                }
            }
            catch (Exception e)
            {
                await AppMessageBox.ShowErrorAsync(e);

                this.EndProgress();
                this.DetachEvent();
                this.Tables.Clear();
                await this.TryCloseAsync();

                return;
            }

            this.EndProgress();
            this.NotifyOfPropertyChange(nameof(this.Tables));
            this.NotifyOfPropertyChange(nameof(this.SelectedTable));
            this.NotifyOfPropertyChange(nameof(this.IsProgressing));
        }
Пример #2
0
        protected override async Task CloseAsync()
        {
            if (this.Tables.Any() == true)
            {
                await TableContentDescriptorUtility.EndEditAsync(this.authentication, this.contentDescriptor);

                this.DetachEvent();
            }
        }
Пример #3
0
        protected override async Task CloseAsync()
        {
            if (this.Tables.Any() == true)
            {
                try
                {
                    await TableContentDescriptorUtility.EndEditAsync(this.authentication, this.contentDescriptor);

                    this.DetachEvent();
                }
                catch (Exception e)
                {
                    AppMessageBox.ShowError(e);
                }
            }
        }