private void SetProperties()

in Configurator/UI/Dialogs/InfoDialog.cs [1156:1215]


    private void SetProperties(InfoDialogProperties properties = null)
    {
      // Initialize the properties if none were sent as argument.
      if (properties == null)
      {
        properties = new InfoDialogProperties();
      }

      // Set the dialog's icon if possible if set in the ApplicationIcon
      if (ApplicationIcon != null)
      {
        Icon = ApplicationIcon;
        ShowIcon = true;
      }

      // Set properties dependent on the InfoType
      switch (properties.InfoType)
      {
        case InfoType.Error:
          LogoImage = properties.LogoImage ?? (ErrorLogo ?? Resources.MainLogo);
          Text =  string.IsNullOrEmpty(properties.TitleBarText)
            ? (string.IsNullOrEmpty(ApplicationName) ? Resources.ErrorText : ApplicationName)
            : properties.TitleBarText;
          break;

        case InfoType.Info:
          LogoImage = properties.LogoImage ??  (InformationLogo ?? Resources.MainLogo);
          Text = string.IsNullOrEmpty(properties.TitleBarText)
            ? (string.IsNullOrEmpty(ApplicationName) ? Resources.InformationText : ApplicationName)
            : properties.TitleBarText;
          break;

        case InfoType.Success:
          LogoImage = properties.LogoImage ?? (SuccessLogo ?? Resources.MainLogo);
          Text = string.IsNullOrEmpty(properties.TitleBarText)
            ? (string.IsNullOrEmpty(ApplicationName) ? Resources.SuccessText : ApplicationName)
            : properties.TitleBarText;
          break;

        case InfoType.Warning:
          LogoImage = properties.LogoImage ?? (WarningLogo ?? Resources.MainLogo);
          Text = string.IsNullOrEmpty(properties.TitleBarText)
            ? (string.IsNullOrEmpty(ApplicationName) ? Resources.WarningsText : ApplicationName)
            : properties.TitleBarText;
          break;
      }

      // Set other properties
      DetailSubText = properties.DetailSubText;
      DetailText = properties.DetailText;
      ExpandedState = properties.IsExpanded;
      MoreInfoText = properties.MoreInfoText;
      MoreInfoWidthAlignedWithButton1 = properties.MoreInfoWidthAlignedWithButton1;
      TitleText = properties.TitleText;
      TruncatedTextAction = properties.FitTextStrategy;
      WordWrapMoreInfo = properties.WordWrapMoreInfo;

      // Set command area properties
      SetCommandAreaProperties(properties.CommandAreaProperties);
    }