示例#1
0
        private void Dialog_Closing(PublishedProjectService publishedProjectService, ConfigurationService configurationService, object sender, System.ComponentModel.CancelEventArgs e)
        {
            if (sender != null && sender is PublishNotifierDialog)
            {
                var publishNotifierDialog = (sender as PublishNotifierDialog);
                if (publishNotifierDialog.isNotify)
                {
                    configurationService.SaveConfiguration(publishedProjectService.GetConfigurationFileFullPath(), publishNotifierDialog.configurationModel);

                    if (!string.IsNullOrEmpty(publishNotifierDialog.configurationModel.slackWebhookUrl))
                    {
                        using (var slackService = new SlackService(publishNotifierDialog.configurationModel.slackWebhookUrl, publishedProjectService.GetProjectName()))
                        {
                        }
                    }

                    if (!string.IsNullOrEmpty(publishNotifierDialog.configurationModel.hipChatIntegrationUrl))
                    {
                        using (var hipChatService = new HipChatService(publishNotifierDialog.configurationModel.hipChatIntegrationUrl, publishedProjectService.GetProjectName()))
                        {
                        }
                    }
                }
            }
        }
示例#2
0
 private void PublishEvents_OnPublishDone(bool Success)
 {
     using (var publishedProjectService = new PublishedProjectService(application))
     {
         var selectedItem = publishedProjectService.GetSelectedItem();
         if (selectedItem != null)
         {
             using (var configurationService = new ConfigurationService(selectedItem, publishedProjectService.GetConfigurationFileFullPath()))
             {
                 PublishNotifierDialog dialog = new PublishNotifierDialog(configurationService.GetConfigurationModel());
                 dialog.Closing += (sender, e) => Dialog_Closing(publishedProjectService, configurationService, sender, e);
                 dialog.ShowModal();
             }
         }
     }
 }