private async Task PublishingAllAsync(IOrganizationServiceExtented service)
        {
            using (service.Lock())
            {
                try
                {
                    _iWriteToOutput.WriteToOutput(service.ConnectionData
                                                  , Properties.OutputStrings.PublishingAllFormat2
                                                  , service.ConnectionData.Name
                                                  , DateTime.Now.ToString("G", System.Globalization.CultureInfo.CurrentCulture)
                                                  );

                    var repository = new PublishActionsRepository(service);

                    await repository.PublishAllXmlAsync();

                    _iWriteToOutput.WriteToOutput(service.ConnectionData
                                                  , Properties.OutputStrings.PublishingAllCompletedFormat2
                                                  , service.ConnectionData.Name
                                                  , DateTime.Now.ToString("G", System.Globalization.CultureInfo.CurrentCulture)
                                                  );
                }
                catch (Exception ex)
                {
                    _iWriteToOutput.WriteErrorToOutput(service.ConnectionData, ex);

                    _iWriteToOutput.WriteToOutput(service.ConnectionData
                                                  , Properties.OutputStrings.PublishingAllFailedFormat2
                                                  , service.ConnectionData.Name
                                                  , DateTime.Now.ToString("G", System.Globalization.CultureInfo.CurrentCulture)
                                                  );
                }
            }
        }
Ejemplo n.º 2
0
        protected WindowWithSingleConnection(
            IWriteToOutput iWriteToOutput
            , IOrganizationServiceExtented service
            ) : base(iWriteToOutput)
        {
            this._service = service;

            this._serviceLock = _service.Lock();
        }