public HandleRuleControl(MainForm mainForm, WriteToLogDelegate writeToLog, ServiceBusHelper serviceBusHelper, RuleWrapper ruleWrapper, bool? isFirstRule)
 {
     this.mainForm = mainForm;
     this.writeToLog = writeToLog;
     this.serviceBusHelper = serviceBusHelper;
     this.ruleWrapper = ruleWrapper;
     this.isFirstRule = isFirstRule;
     InitializeComponent();
     InitializeData();
 }
Ejemplo n.º 2
0
 public ConnectForm(ServiceBusHelper serviceBusHelper)
 {
     InitializeComponent();
     this.serviceBusHelper = serviceBusHelper;
     cboServiceBusNamespace.Items.Add(SelectServiceBusNamespace);
     if (serviceBusHelper.ServiceBusNamespaces != null)
     {
         cboServiceBusNamespace.Items.AddRange(serviceBusHelper.ServiceBusNamespaces.Keys.ToArray());
     }
     cboServiceBusNamespace.SelectedIndex = 0;
     btnOk.Enabled = false;
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Initializes a new instance of the MainForm class.
 /// </summary>
 public MainForm()
 {
     InitializeComponent();
     mainSplitterDistance = mainSplitContainer.SplitterDistance;
     splitterContainerDistance = splitContainer.SplitterDistance;
     treeViewFontSize = serviceBusTreeView.Font.Size;
     logFontSize = lstLog.Font.Size;
     Trace.Listeners.Add(new LogTraceListener());
     mainForm = this;
     serviceBusHelper = new ServiceBusHelper(WriteToLog);
     serviceBusHelper.OnCreate += serviceBusHelper_OnCreate;
     serviceBusHelper.OnDelete += serviceBusHelper_OnDelete;
     serviceBusTreeView.TreeViewNodeSorter = new TreeViewHelper();
     eventClickFieldInfo = typeof(ToolStripItem).GetField(EventClick, BindingFlags.NonPublic | BindingFlags.Static);
     eventsPropertyInfo = typeof(Component).GetProperty(EventsProperty, BindingFlags.NonPublic | BindingFlags.Instance);
     GetServiceBusNamespacesFromConfiguration();
     GetServiceBusNamespaceSettingsFromConfiguration();
 }
 public HandleSubscriptionControl(MainForm mainForm, WriteToLogDelegate writeToLog, ServiceBusHelper serviceBusHelper, SubscriptionWrapper wrapper)
 {
     this.mainForm = mainForm;
     this.writeToLog = writeToLog;
     this.serviceBusHelper = serviceBusHelper;
     this.wrapper = wrapper;
     InitializeComponent();
     InitializeData();
 }
 public TestQueueControl(MainForm mainForm,
                         WriteToLogDelegate writeToLog,
                         ServiceBusHelper serviceBusHelper,
                         QueueDescription queueDescription)
 {
     this.mainForm = mainForm;
     this.writeToLog = writeToLog;
     this.serviceBusHelper = serviceBusHelper;
     this.queueDescription = queueDescription;
     InitializeComponent();
     InitializeControls();
 }
Ejemplo n.º 6
0
        public ContainerForm(ServiceBusHelper serviceBusHelper, MainForm mainForm, FormTypeEnum formTypeType, QueueDescription queueDescription)
        {
            try
            {
                InitializeComponent();
                this.mainForm = mainForm;
                mainSplitterDistance = mainSplitContainer.SplitterDistance;
                SuspendLayout();
                panelMain.SuspendDrawing();
                panelMain.Controls.Clear();
                panelMain.BackColor = SystemColors.GradientInactiveCaption;
                testQueueControl = new TestQueueControl(mainForm, WriteToLog, new ServiceBusHelper(WriteToLog, serviceBusHelper), queueDescription)
                                       {
                                           Location = new Point(1, panelMain.HeaderHeight + 1)
                                       };

                if (formTypeType == FormTypeEnum.Send)
                {
                    testQueueControl.mainTabControl.TabPages.RemoveAt(2);
                    testQueueControl.receiverEnabledCheckBox.Checked = false;
                    Text = string.Format(SendMessagesFormat, queueDescription.Path);
                }
                else
                {
                    Text = string.Format(TestQueueFormat, queueDescription.Path);
                    logTraceListener = new LogTraceListener(WriteToLog);
                    Trace.Listeners.Add(logTraceListener);
                }

                testQueueControl.btnCancel.Text = CloseLabel;
                testQueueControl.btnCancel.Click -= testQueueControl.btnCancel_Click;
                testQueueControl.btnCancel.Click += BtnCancelOnClick;
                testQueueControl.Focus();

                panelMain.HeaderText = string.Format(HeaderTextTestQueueFormat, queueDescription.Path);
                panelMain.Controls.Add(testQueueControl);
                SetStyle(ControlStyles.ResizeRedraw, true);
            }
            finally
            {
                panelMain.ResumeDrawing();
                ResumeLayout();
            }
        }
Ejemplo n.º 7
0
        public ContainerForm(ServiceBusHelper serviceBusHelper, MainForm mainForm, SubscriptionWrapper subscriptionWrapper)
        {
            try
            {
                InitializeComponent();
                this.mainForm = mainForm;
                mainSplitterDistance = mainSplitContainer.SplitterDistance;
                SuspendLayout();
                panelMain.SuspendDrawing();
                panelMain.Controls.Clear();
                panelMain.BackColor = SystemColors.GradientInactiveCaption;

                testSubscriptionControl = new TestSubscriptionControl(mainForm, WriteToLog, new ServiceBusHelper(WriteToLog, serviceBusHelper), subscriptionWrapper)
                                              {
                                                  Location = new Point(1, panelMain.HeaderHeight + 1)
                                              };

                testSubscriptionControl.btnCancel.Click -= testSubscriptionControl.btnCancel_Click;
                testSubscriptionControl.btnCancel.Click += BtnCancelOnClick;
                testSubscriptionControl.Focus();

                Text = string.Format(TestSubscriptionFormat, subscriptionWrapper.SubscriptionDescription.Name);

                panelMain.HeaderText = string.Format(HeaderTextTestSubscriptionFormat, subscriptionWrapper.SubscriptionDescription.Name);
                panelMain.Controls.Add(testSubscriptionControl);
                SetStyle(ControlStyles.ResizeRedraw, true);
            }
            finally
            {
                panelMain.ResumeDrawing();
                ResumeLayout();
            }
        }
 /// <summary>
 /// Initializes a new instance of the ServiceBusHelper class.
 /// </summary>
 /// <param name="writeToLog">WriteToLog method.</param>
 /// <param name="serviceBusHelper">Base ServiceBusHelper.</param>
 public ServiceBusHelper(WriteToLogDelegate writeToLog, ServiceBusHelper serviceBusHelper)
 {
     this.writeToLog = writeToLog;
     traceEnabled = serviceBusHelper.TraceEnabled;
     AtomFeedUri = serviceBusHelper.AtomFeedUri;
     IssuerName = serviceBusHelper.IssuerName;
     IssuerSecret = serviceBusHelper.IssuerSecret;
     MessageDeferProviderType = serviceBusHelper.MessageDeferProviderType;
     MessagingFactory = serviceBusHelper.MessagingFactory;
     Namespace = serviceBusHelper.Namespace;
     NamespaceUri = serviceBusHelper.NamespaceUri;
     IssuerSecret = serviceBusHelper.IssuerSecret;
     MessageDeferProviderType = serviceBusHelper.MessageDeferProviderType;
     MessagingFactory = serviceBusHelper.MessagingFactory;
     Namespace = serviceBusHelper.Namespace;
     Scheme = serviceBusHelper.Scheme;
     ServiceBusNamespaces = serviceBusHelper.ServiceBusNamespaces;
     ServicePath = serviceBusHelper.ServicePath;
     TokenProvider = serviceBusHelper.TokenProvider;
     TraceEnabled = serviceBusHelper.TraceEnabled;
 }
 public TestTopicControl(MainForm mainForm,
                         WriteToLogDelegate writeToLog,
                         ServiceBusHelper serviceBusHelper, 
                         TopicDescription topic, 
                         List<SubscriptionDescription> subscriptionList)
 {
     this.mainForm = mainForm;
     this.writeToLog = writeToLog;
     this.serviceBusHelper = serviceBusHelper;
     this.topic = topic;
     this.subscriptionList = subscriptionList;
     InitializeComponent();
     InitializeControls();
 }
 public HandleTopicControl(MainForm mainForm, WriteToLogDelegate writeToLog, ServiceBusHelper serviceBusHelper, TopicDescription topic, string path)
 {
     this.mainForm = mainForm;
     this.writeToLog = writeToLog;
     this.serviceBusHelper = serviceBusHelper;
     this.topic = topic;
     this.path = path;
     InitializeComponent();
     InitializeData();
 }
 public TestRelayServiceControl(MainForm mainForm, 
                                WriteToLogDelegate writeToLog, 
                                RelayServiceWrapper relayServiceWrapper, 
                                ServiceBusHelper serviceBusHelper)
 {
     this.mainForm = mainForm;
     this.writeToLog = writeToLog;
     this.relayServiceWrapper = relayServiceWrapper;
     this.serviceBusHelper = serviceBusHelper;
     InitializeComponent();
     InitializeControls();
 }
 public HandleQueueControl(MainForm mainForm, WriteToLogDelegate writeToLog, ServiceBusHelper serviceBusHelper, QueueDescription queueDescription, string path)
 {
     this.mainForm = mainForm;
     this.writeToLog = writeToLog;
     this.serviceBusHelper = serviceBusHelper;
     this.path = path;
     this.queueDescription = queueDescription;
     InitializeComponent();
     InitializeData();
 }