private void btnAction_Click(object sender, EventArgs e) { try { if (serviceBusHelper == null || ruleWrapper == null || ruleWrapper.SubscriptionDescription == null) { return; } if (btnAction.Text == RemoveText && ruleWrapper.SubscriptionDescription != null && !string.IsNullOrEmpty(ruleWrapper.SubscriptionDescription.Name) && ruleWrapper.RuleDescription != null && !string.IsNullOrEmpty(ruleWrapper.RuleDescription.Name)) { var deleteForm = new DeleteForm(ruleWrapper.RuleDescription.Name, RuleEntity.ToLower()); if (deleteForm.ShowDialog() == DialogResult.OK) { serviceBusHelper.RemoveRule(ruleWrapper.SubscriptionDescription, ruleWrapper.RuleDescription); } return; } if (btnAction.Text == AddText) { if (string.IsNullOrEmpty(txtName.Text)) { writeToLog(NameCannotBeNull); return; } var ruleDescription = new RuleDescription(txtName.Text); if (!string.IsNullOrEmpty(txtSqlFilterExpression.Text)) { ruleDescription.Filter = new SqlFilter(txtSqlFilterExpression.Text); } if (!string.IsNullOrEmpty(txtSqlFilterAction.Text)) { ruleDescription.Action = new SqlRuleAction(txtSqlFilterAction.Text); } ruleWrapper.RuleDescription = serviceBusHelper.AddRule(ruleWrapper.SubscriptionDescription, ruleDescription); InitializeData(); } } catch (Exception ex) { HandleException(ex); } }
private void deleteEntity_Click(object sender, EventArgs e) { try { Cursor.Current = Cursors.WaitCursor; if (serviceBusTreeView.SelectedNode != null) { var queueListNode = FindNode(QueueEntities, rootNode); var topicListNode = FindNode(TopicEntities, rootNode); // Root Node if (serviceBusTreeView.SelectedNode == rootNode) { var deleteForm = new DeleteForm(DeleteAllEntities); if (deleteForm.ShowDialog() == DialogResult.OK) { var queueList = new List<string>(); var topicList = new List<string>(); GetQueueList(queueList, queueListNode); GetTopicList(topicList, topicListNode); serviceBusHelper.DeleteQueues(queueList); serviceBusHelper.DeleteTopics(topicList); GetEntities(EntityType.All); } return; } // Queues Node if (serviceBusTreeView.SelectedNode == queueListNode) { var deleteForm = new DeleteForm(DeleteAllQueues); if (deleteForm.ShowDialog() == DialogResult.OK) { var queueList = new List<string>(); GetQueueList(queueList, queueListNode); serviceBusHelper.DeleteQueues(queueList); GetEntities(EntityType.Queue); } return; } // Topics Node if (serviceBusTreeView.SelectedNode == topicListNode) { var deleteForm = new DeleteForm(DeleteAllTopics); if (deleteForm.ShowDialog() == DialogResult.OK) { var topicList = new List<string>(); GetTopicList(topicList, topicListNode); serviceBusHelper.DeleteTopics(topicList); GetEntities(EntityType.Topic); } return; } // Check that serviceBusTreeView.SelectedNode.Tag is not null if (serviceBusTreeView.SelectedNode.Tag == null) { return; } // Url Segment Node if (serviceBusTreeView.SelectedNode.Tag is UrlSegmentWrapper) { var urlSegmentWrapper = serviceBusTreeView.SelectedNode.Tag as UrlSegmentWrapper; if (urlSegmentWrapper.EntityType == EntityType.Queue) { var deleteForm = new DeleteForm(string.Format(DeleteAllQueuesInPath, FormatAbsolutePathForEdit(urlSegmentWrapper.Uri))); if (deleteForm.ShowDialog() == DialogResult.OK) { var queueList = new List<string>(); GetQueueList(queueList, serviceBusTreeView.SelectedNode); serviceBusHelper.DeleteQueues(queueList); } } else { var deleteForm = new DeleteForm(string.Format(DeleteAllTopicsInPath, FormatAbsolutePathForEdit(urlSegmentWrapper.Uri))); if (deleteForm.ShowDialog() == DialogResult.OK) { var topicList = new List<string>(); GetTopicList(topicList, serviceBusTreeView.SelectedNode); serviceBusHelper.DeleteTopics(topicList); } } return; } // Queue Node if (serviceBusTreeView.SelectedNode.Tag is QueueDescription) { var queue = serviceBusTreeView.SelectedNode.Tag as QueueDescription; var deleteForm = new DeleteForm(queue.Path, QueueEntity.ToLower()); if (deleteForm.ShowDialog() == DialogResult.OK) { serviceBusHelper.DeleteQueue(queue); } return; } // Subscriptions Node if (sender == deleteTopicSubscriptionsMenuItem) { if (serviceBusTreeView.SelectedNode.Nodes.Count == 0) { return; } var subscriptionsNode = serviceBusTreeView.SelectedNode.Nodes[0]; var subscriptionDescriptions = subscriptionsNode. Nodes. Cast<TreeNode>(). Select(n => ((SubscriptionWrapper)n.Tag).SubscriptionDescription). ToList(); if (subscriptionDescriptions.Count > 0) { var deleteForm = new DeleteForm(DeleteAllSubscriptions); if (deleteForm.ShowDialog() == DialogResult.OK) { serviceBusHelper.DeleteSubscriptions(subscriptionDescriptions); } } return; } // Topic Node if (serviceBusTreeView.SelectedNode.Tag is TopicDescription) { var topic = serviceBusTreeView.SelectedNode.Tag as TopicDescription; var deleteForm = new DeleteForm(topic.Path, TopicEntity.ToLower()); if (deleteForm.ShowDialog() == DialogResult.OK) { serviceBusHelper.DeleteTopic(topic); } return; } // Subscriptions Node if (serviceBusTreeView.SelectedNode.Text == SubscriptionEntities) { var subscriptionDescriptions = serviceBusTreeView.SelectedNode. Nodes. Cast<TreeNode>(). Select(n => ((SubscriptionWrapper)n.Tag).SubscriptionDescription). ToList(); if (subscriptionDescriptions.Count > 0) { var deleteForm = new DeleteForm(DeleteAllSubscriptions); if (deleteForm.ShowDialog() == DialogResult.OK) { serviceBusHelper.DeleteSubscriptions(subscriptionDescriptions); } } return; } // Subscription Node if (serviceBusTreeView.SelectedNode.Tag is SubscriptionWrapper) { var wrapper = serviceBusTreeView.SelectedNode.Tag as SubscriptionWrapper; if (wrapper.TopicDescription != null && wrapper.SubscriptionDescription != null) { var deleteForm = new DeleteForm(wrapper.SubscriptionDescription.Name, SubscriptionEntity.ToLower()); if (deleteForm.ShowDialog() == DialogResult.OK) { serviceBusHelper.DeleteSubscription(wrapper.SubscriptionDescription); } } return; } // Rules Node if (serviceBusTreeView.SelectedNode.Text == RuleEntities) { var ruleWrappers = serviceBusTreeView.SelectedNode. Nodes. Cast<TreeNode>(). Select(n => (RuleWrapper)n.Tag). ToList(); if (ruleWrappers.Count > 0) { var deleteForm = new DeleteForm(DeleteAllRules); if (deleteForm.ShowDialog() == DialogResult.OK) { serviceBusHelper.RemoveRules(ruleWrappers); } } return; } // Rule Node if (serviceBusTreeView.SelectedNode.Tag is RuleWrapper) { var wrapper = serviceBusTreeView.SelectedNode.Tag as RuleWrapper; if (wrapper.SubscriptionDescription != null && wrapper.RuleDescription != null) { var deleteForm = new DeleteForm(wrapper.RuleDescription.Name, RuleEntity.ToLower()); if (deleteForm.ShowDialog() == DialogResult.OK) { serviceBusHelper.RemoveRule(wrapper.SubscriptionDescription, wrapper.RuleDescription); } } } } } catch (Exception ex) { HandleException(ex); } finally { Cursor.Current = Cursors.Default; } }
private void btnAction_Click(object sender, EventArgs e) { try { if (serviceBusHelper == null || wrapper == null || wrapper.TopicDescription == null) { return; } if (btnAction.Text == DeleteText && wrapper.SubscriptionDescription != null && !string.IsNullOrEmpty(wrapper.SubscriptionDescription.Name)) { var deleteForm = new DeleteForm(wrapper.SubscriptionDescription.Name, SubscriptionEntity.ToLower()); if (deleteForm.ShowDialog() == DialogResult.OK) { serviceBusHelper.DeleteSubscription(wrapper.SubscriptionDescription); } return; } if (btnAction.Text == CreateText) { if (string.IsNullOrEmpty(txtName.Text)) { writeToLog(NameCannotBeNull); return; } var subscriptionDescription = new SubscriptionDescription(wrapper.TopicDescription.Path, txtName.Text); if (!string.IsNullOrEmpty(txtMaxDeliveryCount.Text)) { int value; if (int.TryParse(txtMaxDeliveryCount.Text, out value)) { subscriptionDescription.MaxDeliveryCount = value; } else { writeToLog(MaxDeliveryCountMustBeANumber); return; } } var days = 0; var hours = 0; var minutes = 0; var seconds = 0; var milliseconds = 0; if (!string.IsNullOrEmpty(txtDefaultMessageTimeToLiveDays.Text) || !string.IsNullOrEmpty(txtDefaultMessageTimeToLiveHours.Text) || !string.IsNullOrEmpty(txtDefaultMessageTimeToLiveMinutes.Text) || !string.IsNullOrEmpty(txtDefaultMessageTimeToLiveSeconds.Text) || !string.IsNullOrEmpty(txtDefaultMessageTimeToLiveMilliseconds.Text)) { if (!string.IsNullOrEmpty(txtDefaultMessageTimeToLiveDays.Text)) { if (!int.TryParse(txtDefaultMessageTimeToLiveDays.Text, out days)) { writeToLog(DefaultMessageTimeToLiveDaysMustBeANumber); return; } } if (!string.IsNullOrEmpty(txtDefaultMessageTimeToLiveHours.Text)) { if (!int.TryParse(txtDefaultMessageTimeToLiveHours.Text, out hours)) { writeToLog(DefaultMessageTimeToLiveHoursMustBeANumber); return; } } if (!string.IsNullOrEmpty(txtDefaultMessageTimeToLiveMinutes.Text)) { if (!int.TryParse(txtDefaultMessageTimeToLiveMinutes.Text, out minutes)) { writeToLog(DefaultMessageTimeToLiveMinutesMustBeANumber); return; } } if (!string.IsNullOrEmpty(txtDefaultMessageTimeToLiveSeconds.Text)) { if (!int.TryParse(txtDefaultMessageTimeToLiveSeconds.Text, out seconds)) { writeToLog(DefaultMessageTimeToLiveSecondsMustBeANumber); return; } } if (!string.IsNullOrEmpty(txtDefaultMessageTimeToLiveMilliseconds.Text)) { if (!int.TryParse(txtDefaultMessageTimeToLiveMilliseconds.Text, out milliseconds)) { writeToLog(DefaultMessageTimeToLiveMillisecondsMustBeANumber); return; } } subscriptionDescription.DefaultMessageTimeToLive = new TimeSpan(days, hours, minutes, seconds, milliseconds); } days = 0; hours = 0; minutes = 0; seconds = 0; milliseconds = 0; if (!string.IsNullOrEmpty(txtLockDurationDays.Text) || !string.IsNullOrEmpty(txtLockDurationHours.Text) || !string.IsNullOrEmpty(txtLockDurationMinutes.Text) || !string.IsNullOrEmpty(txtLockDurationSeconds.Text) || !string.IsNullOrEmpty(txtLockDurationMilliseconds.Text)) { if (!string.IsNullOrEmpty(txtLockDurationDays.Text)) { if (!int.TryParse(txtLockDurationDays.Text, out days)) { writeToLog(LockDurationDaysMustBeANumber); return; } } if (!string.IsNullOrEmpty(txtLockDurationHours.Text)) { if (!int.TryParse(txtLockDurationHours.Text, out hours)) { writeToLog(LockDurationHoursMustBeANumber); return; } } if (!string.IsNullOrEmpty(txtLockDurationMinutes.Text)) { if (!int.TryParse(txtLockDurationMinutes.Text, out minutes)) { writeToLog(LockDurationMinutesMustBeANumber); return; } } if (!string.IsNullOrEmpty(txtLockDurationSeconds.Text)) { if (!int.TryParse(txtLockDurationSeconds.Text, out seconds)) { writeToLog(LockDurationSecondsMustBeANumber); return; } } if (!string.IsNullOrEmpty(txtLockDurationMilliseconds.Text)) { if (!int.TryParse(txtLockDurationMilliseconds.Text, out milliseconds)) { writeToLog(LockDurationMillisecondsMustBeANumber); return; } } subscriptionDescription.LockDuration = new TimeSpan(days, hours, minutes, seconds, milliseconds); } subscriptionDescription.EnableBatchedOperations = checkedListBox.GetItemChecked(EnableBatchedOperationsIndex); subscriptionDescription.EnableDeadLetteringOnFilterEvaluationExceptions = checkedListBox.GetItemChecked(EnableDeadLetteringOnFilterEvaluationExceptionsIndex); subscriptionDescription.EnableDeadLetteringOnMessageExpiration = checkedListBox.GetItemChecked(EnableDeadLetteringOnMessageExpirationIndex); subscriptionDescription.RequiresSession = checkedListBox.GetItemChecked(RequiresSessionIndex); var ruleDescription = new RuleDescription(); if (!string.IsNullOrEmpty(txtFilter.Text)) { ruleDescription.Filter = new SqlFilter(txtFilter.Text); } if (!string.IsNullOrEmpty(txtAction.Text)) { ruleDescription.Action = new SqlRuleAction(txtAction.Text); } wrapper.SubscriptionDescription = serviceBusHelper.CreateSubscription(wrapper.TopicDescription, subscriptionDescription, ruleDescription); InitializeData(); } } catch (Exception ex) { HandleException(ex); } }
private void btnAction_Click(object sender, EventArgs e) { try { if (serviceBusHelper == null) { return; } if (btnAction.Text == DeleteText) { var deleteForm = new DeleteForm(queueDescription.Path, QueueEntity.ToLower()); if (deleteForm.ShowDialog() == DialogResult.OK) { serviceBusHelper.DeleteQueue(queueDescription); } } else { if (string.IsNullOrEmpty(txtPath.Text)) { writeToLog(PathCannotBeNull); return; } var description = new QueueDescription(txtPath.Text); if (!string.IsNullOrEmpty(txtMaxQueueSizeInMegabytes.Text)) { long value; if (long.TryParse(txtMaxQueueSizeInMegabytes.Text, out value)) { description.MaxSizeInMegabytes = value; } else { writeToLog(MaxQueueSizeInBytesMustBeANumber); return; } } if (!string.IsNullOrEmpty(txtMaxDeliveryCount.Text)) { int value; if (int.TryParse(txtMaxDeliveryCount.Text, out value)) { description.MaxDeliveryCount = value; } else { writeToLog(MaxDeliveryCountMustBeANumber); return; } } var days = 0; var hours = 0; var minutes = 0; var seconds = 0; var milliseconds = 0; if (!string.IsNullOrEmpty(txtDefaultMessageTimeToLiveDays.Text) || !string.IsNullOrEmpty(txtDefaultMessageTimeToLiveHours.Text) || !string.IsNullOrEmpty(txtDefaultMessageTimeToLiveMinutes.Text) || !string.IsNullOrEmpty(txtDefaultMessageTimeToLiveSeconds.Text) || !string.IsNullOrEmpty(txtDefaultMessageTimeToLiveMilliseconds.Text)) { if (!string.IsNullOrEmpty(txtDefaultMessageTimeToLiveDays.Text)) { if (!int.TryParse(txtDefaultMessageTimeToLiveDays.Text, out days)) { writeToLog(DefaultMessageTimeToLiveDaysMustBeANumber); return; } } if (!string.IsNullOrEmpty(txtDefaultMessageTimeToLiveHours.Text)) { if (!int.TryParse(txtDefaultMessageTimeToLiveHours.Text, out hours)) { writeToLog(DefaultMessageTimeToLiveHoursMustBeANumber); return; } } if (!string.IsNullOrEmpty(txtDefaultMessageTimeToLiveMinutes.Text)) { if (!int.TryParse(txtDefaultMessageTimeToLiveMinutes.Text, out minutes)) { writeToLog(DefaultMessageTimeToLiveMinutesMustBeANumber); return; } } if (!string.IsNullOrEmpty(txtDefaultMessageTimeToLiveSeconds.Text)) { if (!int.TryParse(txtDefaultMessageTimeToLiveSeconds.Text, out seconds)) { writeToLog(DefaultMessageTimeToLiveSecondsMustBeANumber); return; } } if (!string.IsNullOrEmpty(txtDefaultMessageTimeToLiveMilliseconds.Text)) { if (!int.TryParse(txtDefaultMessageTimeToLiveMilliseconds.Text, out milliseconds)) { writeToLog(DefaultMessageTimeToLiveMillisecondsMustBeANumber); return; } } description.DefaultMessageTimeToLive = new TimeSpan(days, hours, minutes, seconds, milliseconds); } days = 0; hours = 0; minutes = 0; seconds = 0; milliseconds = 0; if (!string.IsNullOrEmpty(txtDuplicateDetectionHistoryTimeWindowDays.Text) || !string.IsNullOrEmpty(txtDuplicateDetectionHistoryTimeWindowHours.Text) || !string.IsNullOrEmpty(txtDuplicateDetectionHistoryTimeWindowMinutes.Text) || !string.IsNullOrEmpty(txtDuplicateDetectionHistoryTimeWindowSeconds.Text) || !string.IsNullOrEmpty(txtDuplicateDetectionHistoryTimeWindowMilliseconds.Text)) { if (!string.IsNullOrEmpty(txtDuplicateDetectionHistoryTimeWindowDays.Text)) { if (!int.TryParse(txtDuplicateDetectionHistoryTimeWindowDays.Text, out days)) { writeToLog(DuplicateDetectionHistoryTimeWindowDaysMustBeANumber); return; } } if (!string.IsNullOrEmpty(txtDuplicateDetectionHistoryTimeWindowHours.Text)) { if (!int.TryParse(txtDuplicateDetectionHistoryTimeWindowHours.Text, out hours)) { writeToLog(DuplicateDetectionHistoryTimeWindowHoursMustBeANumber); return; } } if (!string.IsNullOrEmpty(txtDuplicateDetectionHistoryTimeWindowMinutes.Text)) { if (!int.TryParse(txtDuplicateDetectionHistoryTimeWindowMinutes.Text, out minutes)) { writeToLog(DuplicateDetectionHistoryTimeWindowMinutesMustBeANumber); return; } } if (!string.IsNullOrEmpty(txtDuplicateDetectionHistoryTimeWindowSeconds.Text)) { if (!int.TryParse(txtDuplicateDetectionHistoryTimeWindowSeconds.Text, out seconds)) { writeToLog(DuplicateDetectionHistoryTimeWindowSecondsMustBeANumber); return; } } if (!string.IsNullOrEmpty(txtDuplicateDetectionHistoryTimeWindowMilliseconds.Text)) { if (!int.TryParse(txtDuplicateDetectionHistoryTimeWindowMilliseconds.Text, out milliseconds)) { writeToLog(DuplicateDetectionHistoryTimeWindowMillisecondsMustBeANumber); return; } } description.DuplicateDetectionHistoryTimeWindow = new TimeSpan(days, hours, minutes, seconds, milliseconds); } days = 0; hours = 0; minutes = 0; seconds = 0; milliseconds = 0; if (!string.IsNullOrEmpty(txtLockDurationDays.Text) || !string.IsNullOrEmpty(txtLockDurationHours.Text) || !string.IsNullOrEmpty(txtLockDurationMinutes.Text) || !string.IsNullOrEmpty(txtLockDurationSeconds.Text) || !string.IsNullOrEmpty(txtLockDurationMilliseconds.Text)) { if (!string.IsNullOrEmpty(txtLockDurationDays.Text)) { if (!int.TryParse(txtLockDurationDays.Text, out days)) { writeToLog(LockDurationDaysMustBeANumber); return; } } if (!string.IsNullOrEmpty(txtLockDurationHours.Text)) { if (!int.TryParse(txtLockDurationHours.Text, out hours)) { writeToLog(LockDurationHoursMustBeANumber); return; } } if (!string.IsNullOrEmpty(txtLockDurationMinutes.Text)) { if (!int.TryParse(txtLockDurationMinutes.Text, out minutes)) { writeToLog(LockDurationMinutesMustBeANumber); return; } } if (!string.IsNullOrEmpty(txtLockDurationSeconds.Text)) { if (!int.TryParse(txtLockDurationSeconds.Text, out seconds)) { writeToLog(LockDurationSecondsMustBeANumber); return; } } if (!string.IsNullOrEmpty(txtLockDurationMilliseconds.Text)) { if (!int.TryParse(txtLockDurationMilliseconds.Text, out milliseconds)) { writeToLog(LockDurationMillisecondsMustBeANumber); return; } } description.LockDuration = new TimeSpan(days, hours, minutes, seconds, milliseconds); } description.EnableBatchedOperations = checkedListBox.GetItemChecked(EnableBatchedOperationsIndex); description.EnableDeadLetteringOnMessageExpiration = checkedListBox.GetItemChecked(EnableDeadLetteringOnMessageExpirationIndex); description.RequiresDuplicateDetection = checkedListBox.GetItemChecked(RequiresDuplicateDetectionIndex); description.RequiresSession = checkedListBox.GetItemChecked(RequiresSessionIndex); queueDescription = serviceBusHelper.CreateQueue(description); InitializeData(); } } catch (Exception ex) { HandleException(ex); } }
private void btnAction_Click(object sender, EventArgs e) { try { if (serviceBusHelper == null) { return; } if (btnAction.Text == DeleteText) { var deleteForm = new DeleteForm(topic.Path, TopicEntity.ToLower()); if (deleteForm.ShowDialog() == DialogResult.OK) { serviceBusHelper.DeleteTopic(topic); } } else { if (string.IsNullOrEmpty(txtPath.Text)) { writeToLog(PathCannotBeNull); return; } var topicDescription = new TopicDescription(txtPath.Text); if (!string.IsNullOrEmpty(txtMaxTopicSizeInMegabytes.Text)) { long value; if (long.TryParse(txtMaxTopicSizeInMegabytes.Text, out value)) { topicDescription.MaxSizeInMegabytes = value; } else { writeToLog(MaxTopicSizeInBytesMustBeANumber); return; } } var days = 0; var hours = 0; var minutes = 0; var seconds = 0; var milliseconds = 0; if (!string.IsNullOrEmpty(txtDefaultMessageTimeToLiveDays.Text) || !string.IsNullOrEmpty(txtDefaultMessageTimeToLiveHours.Text) || !string.IsNullOrEmpty(txtDefaultMessageTimeToLiveMinutes.Text) || !string.IsNullOrEmpty(txtDefaultMessageTimeToLiveSeconds.Text) || !string.IsNullOrEmpty(txtDefaultMessageTimeToLiveMilliseconds.Text)) { if (!string.IsNullOrEmpty(txtDefaultMessageTimeToLiveDays.Text)) { if (!int.TryParse(txtDefaultMessageTimeToLiveDays.Text, out days)) { writeToLog(DefaultMessageTimeToLiveDaysMustBeANumber); return; } } if (!string.IsNullOrEmpty(txtDefaultMessageTimeToLiveHours.Text)) { if (!int.TryParse(txtDefaultMessageTimeToLiveHours.Text, out hours)) { writeToLog(DefaultMessageTimeToLiveHoursMustBeANumber); return; } } if (!string.IsNullOrEmpty(txtDefaultMessageTimeToLiveMinutes.Text)) { if (!int.TryParse(txtDefaultMessageTimeToLiveMinutes.Text, out minutes)) { writeToLog(DefaultMessageTimeToLiveMinutesMustBeANumber); return; } } if (!string.IsNullOrEmpty(txtDefaultMessageTimeToLiveSeconds.Text)) { if (!int.TryParse(txtDefaultMessageTimeToLiveSeconds.Text, out seconds)) { writeToLog(DefaultMessageTimeToLiveSecondsMustBeANumber); return; } } if (!string.IsNullOrEmpty(txtDefaultMessageTimeToLiveMilliseconds.Text)) { if (!int.TryParse(txtDefaultMessageTimeToLiveMilliseconds.Text, out milliseconds)) { writeToLog(DefaultMessageTimeToLiveMillisecondsMustBeANumber); return; } } topicDescription.DefaultMessageTimeToLive = new TimeSpan(days, hours, minutes, seconds, milliseconds); } days = 0; hours = 0; minutes = 0; seconds = 0; milliseconds = 0; if (!string.IsNullOrEmpty(txtDuplicateDetectionHistoryTimeWindowDays.Text) || !string.IsNullOrEmpty(txtDuplicateDetectionHistoryTimeWindowHours.Text) || !string.IsNullOrEmpty(txtDuplicateDetectionHistoryTimeWindowMinutes.Text) || !string.IsNullOrEmpty(txtDuplicateDetectionHistoryTimeWindowSeconds.Text) || !string.IsNullOrEmpty(txtDuplicateDetectionHistoryTimeWindowMilliseconds.Text)) { if (!string.IsNullOrEmpty(txtDuplicateDetectionHistoryTimeWindowDays.Text)) { if (!int.TryParse(txtDuplicateDetectionHistoryTimeWindowDays.Text, out days)) { writeToLog(DuplicateDetectionHistoryTimeWindowDaysMustBeANumber); return; } } if (!string.IsNullOrEmpty(txtDuplicateDetectionHistoryTimeWindowHours.Text)) { if (!int.TryParse(txtDuplicateDetectionHistoryTimeWindowHours.Text, out hours)) { writeToLog(DuplicateDetectionHistoryTimeWindowHoursMustBeANumber); return; } } if (!string.IsNullOrEmpty(txtDuplicateDetectionHistoryTimeWindowMinutes.Text)) { if (!int.TryParse(txtDuplicateDetectionHistoryTimeWindowMinutes.Text, out minutes)) { writeToLog(DuplicateDetectionHistoryTimeWindowMinutesMustBeANumber); return; } } if (!string.IsNullOrEmpty(txtDuplicateDetectionHistoryTimeWindowSeconds.Text)) { if (!int.TryParse(txtDuplicateDetectionHistoryTimeWindowSeconds.Text, out seconds)) { writeToLog(DuplicateDetectionHistoryTimeWindowSecondsMustBeANumber); return; } } if (!string.IsNullOrEmpty(txtDuplicateDetectionHistoryTimeWindowMilliseconds.Text)) { if (!int.TryParse(txtDuplicateDetectionHistoryTimeWindowMilliseconds.Text, out milliseconds)) { writeToLog(DuplicateDetectionHistoryTimeWindowMillisecondsMustBeANumber); return; } } topicDescription.DuplicateDetectionHistoryTimeWindow = new TimeSpan(days, hours, minutes, seconds, milliseconds); } topicDescription.EnableBatchedOperations = checkedListBox.GetItemChecked(EnableBatchedOperationsIndex); topicDescription.RequiresDuplicateDetection = checkedListBox.GetItemChecked(RequiresDuplicateDetectionIndex); topic = serviceBusHelper.CreateTopic(topicDescription); InitializeData(); } } catch (Exception ex) { HandleException(ex); } }