public static void LaunchConditionalNavigationScenario(ExchangeInfoConditionalNavigation exchangeInfoConditionalNavigation, IActionItemSuscriber actionItem) { ExchangeInfo exchangeInfo = null; if (exchangeInfoConditionalNavigation.ConditionalNavigationInfo.Count == 1) { exchangeInfo = exchangeInfoConditionalNavigation.ConditionalNavigationInfo[0].ExchangeInfo; } else { Form lScenario = CreateScenarioInstance(exchangeInfoConditionalNavigation); Initialize(lScenario, exchangeInfoConditionalNavigation); lScenario.ShowDialog(MainForm); if ((exchangeInfoConditionalNavigation != null) && (exchangeInfoConditionalNavigation.DestinationInfo != null)) { exchangeInfo = exchangeInfoConditionalNavigation.DestinationInfo.ExchangeInfo; } } if (exchangeInfo != null) { switch (exchangeInfo.ExchangeType) { case ExchangeType.Navigation: LaunchNavigationScenario(exchangeInfo as ExchangeInfoNavigation, null); break; case ExchangeType.Action: LaunchActionScenario(exchangeInfo as ExchangeInfoAction, actionItem); break; } } }
public static void LaunchConditionalNavigationScenario(ExchangeInfoConditionalNavigation exchangeInfoConditionalNavigation, IActionItemSuscriber actionItem) { ExchangeInfo exchangeInfo = null; if (exchangeInfoConditionalNavigation.ConditionalNavigationInfo.Count == 1) { exchangeInfo = exchangeInfoConditionalNavigation.ConditionalNavigationInfo[0].ExchangeInfo; } else { Form lScenario = CreateScenarioInstance(exchangeInfoConditionalNavigation); Initialize(lScenario, exchangeInfoConditionalNavigation); lScenario.ShowDialog(MainForm); if ((exchangeInfoConditionalNavigation != null) && (exchangeInfoConditionalNavigation.DestinationInfo != null)) { exchangeInfo = exchangeInfoConditionalNavigation.DestinationInfo.ExchangeInfo; } } if (exchangeInfo != null) { switch (exchangeInfo.ExchangeType) { case ExchangeType.Navigation: LaunchNavigationScenario(exchangeInfo as ExchangeInfoNavigation, null); break; case ExchangeType.Action: LaunchActionScenario(exchangeInfo as ExchangeInfoAction, actionItem); break; } } }
public IUController Initialize(ExchangeInfo exchangeInfo) { // ExchangeInfo with Destinations mExchangeInfoConditional = exchangeInfo as ExchangeInfoConditionalNavigation; if (mExchangeInfoConditional != null) { this.SuspendLayout(); Text = CultureManager.TranslateString(LanguageConstantKeys.L_QUESTION, LanguageConstantValues.L_QUESTION, Text); lblQuestion.Text = mExchangeInfoConditional.ConditionalNavigationInfo.Question; int lCount = 0; int lnexty = 0; int lseedy = 19; int lgrBox = 0; foreach (DestinationInfo lDestinationInfo in mExchangeInfoConditional.ConditionalNavigationInfo) { #region radioButton01 if (lCount == 0) { radioButton01.AutoSize = true; radioButton01.Size = new System.Drawing.Size(14, 13); radioButton01.Location = new System.Drawing.Point(12, lseedy); radioButton01.TabIndex = lCount; radioButton01.TabStop = true; radioButton01.UseVisualStyleBackColor = true; radioButton01.Text = lDestinationInfo.AssociatedText; radioButton01.Tag = lCount; lnexty = radioButton01.Location.Y; } #endregion radioButton01 else { lnexty += lseedy; // // radioButton // RadioButton rb = new RadioButton(); rb.AutoSize = true; rb.Location = new System.Drawing.Point(12, lnexty); rb.Size = new System.Drawing.Size(14, 13); rb.Location = new System.Drawing.Point(12, lnexty); rb.Name = "radioButton" + lCount.ToString(); rb.TabIndex = lCount; rb.TabStop = true; rb.UseVisualStyleBackColor = true; rb.Text = lDestinationInfo.AssociatedText; rb.Tag = lCount; grpBoxDestinations.Controls.Add(rb); lgrBox += (lnexty + 10); } lCount++; } // Adjust the form size this.Size = new Size(this.Size.Width, grpBoxDestinations.Top + panel2.Height + (lCount + 2) * lseedy); // Select the first option radioButton01.Checked = true; this.ResumeLayout(); } return null; }
public IUController Initialize(ExchangeInfo exchangeInfo) { // ExchangeInfo with Destinations mExchangeInfoConditional = exchangeInfo as ExchangeInfoConditionalNavigation; if (mExchangeInfoConditional != null) { this.SuspendLayout(); Text = CultureManager.TranslateString(LanguageConstantKeys.L_QUESTION, LanguageConstantValues.L_QUESTION, Text); lblQuestion.Text = mExchangeInfoConditional.ConditionalNavigationInfo.Question; int lCount = 0; int lnexty = 0; int lseedy = 19; int lgrBox = 0; foreach (DestinationInfo lDestinationInfo in mExchangeInfoConditional.ConditionalNavigationInfo) { #region radioButton01 if (lCount == 0) { radioButton01.AutoSize = true; radioButton01.Size = new System.Drawing.Size(14, 13); radioButton01.Location = new System.Drawing.Point(12, lseedy); radioButton01.TabIndex = lCount; radioButton01.TabStop = true; radioButton01.UseVisualStyleBackColor = true; radioButton01.Text = lDestinationInfo.AssociatedText; radioButton01.Tag = lCount; lnexty = radioButton01.Location.Y; } #endregion radioButton01 else { lnexty += lseedy; // // radioButton // RadioButton rb = new RadioButton(); rb.AutoSize = true; rb.Location = new System.Drawing.Point(12, lnexty); rb.Size = new System.Drawing.Size(14, 13); rb.Location = new System.Drawing.Point(12, lnexty); rb.Name = "radioButton" + lCount.ToString(); rb.TabIndex = lCount; rb.TabStop = true; rb.UseVisualStyleBackColor = true; rb.Text = lDestinationInfo.AssociatedText; rb.Tag = lCount; grpBoxDestinations.Controls.Add(rb); lgrBox += (lnexty + 10); } lCount++; } // Adjust the form size this.Size = new Size(this.Size.Width, grpBoxDestinations.Top + panel2.Height + (lCount + 2) * lseedy); // Select the first option radioButton01.Checked = true; this.ResumeLayout(); } return(null); }