static MessagePropertyInfo()
 {
     Properties = MessageAndPropertiesHelper.ReadProperties() ?? new List <MessagePropertyInfo>
     {
         new MessagePropertyInfo("MachineName", "String", Environment.MachineName),
         new MessagePropertyInfo("UserName", "String", Environment.UserName)
     };
 }
        static MainSettings GetMainSettingsUsingConfiguration(TwoFilesConfiguration configuration,
                                                              MainSettings currentSettings, WriteToLogDelegate writeToLog)
        {
            var resultProperties = new MainSettings();

            resultProperties.LogFontSize = configuration.GetDecimalValue(ConfigurationParameters.LogFontSize,
                                                                         currentSettings.LogFontSize, writeToLog);

            resultProperties.TreeViewFontSize = configuration.GetDecimalValue(ConfigurationParameters.TreeViewFontSize,
                                                                              currentSettings.TreeViewFontSize, writeToLog);

            resultProperties.RetryCount = configuration.GetIntValue(ConfigurationParameters.RetryCountParameter,
                                                                    currentSettings.RetryCount, writeToLog);

            resultProperties.RetryTimeout = configuration.GetIntValue(ConfigurationParameters.RetryTimeoutParameter,
                                                                      currentSettings.RetryTimeout, writeToLog);

            resultProperties.ReceiveTimeout = configuration.GetIntValue(ConfigurationParameters.ReceiveTimeoutParameter,
                                                                        currentSettings.ReceiveTimeout, writeToLog);

            resultProperties.ServerTimeout = configuration.GetIntValue(ConfigurationParameters.ServerTimeoutParameter,
                                                                       currentSettings.ServerTimeout, writeToLog);

            resultProperties.PrefetchCount = configuration.GetIntValue(ConfigurationParameters.PrefetchCountParameter,
                                                                       currentSettings.PrefetchCount, writeToLog);

            resultProperties.TopCount = configuration.GetIntValue(ConfigurationParameters.TopParameter,
                                                                  currentSettings.TopCount, writeToLog);

            resultProperties.SenderThinkTime = configuration.GetIntValue
                                                   (ConfigurationParameters.SenderThinkTimeParameter, currentSettings.SenderThinkTime, writeToLog);

            resultProperties.ReceiverThinkTime = configuration.GetIntValue
                                                     (ConfigurationParameters.ReceiverThinkTimeParameter, currentSettings.ReceiverThinkTime, writeToLog);

            resultProperties.MonitorRefreshInterval = configuration.GetIntValue
                                                          (ConfigurationParameters.MonitorRefreshIntervalParameter,
                                                          currentSettings.MonitorRefreshInterval, writeToLog);

            resultProperties.ShowMessageCount = configuration.GetBoolValue
                                                    (ConfigurationParameters.ShowMessageCountParameter,
                                                    currentSettings.ShowMessageCount, writeToLog);

            resultProperties.UseAscii = configuration.GetBoolValue(ConfigurationParameters.UseAsciiParameter,
                                                                   currentSettings.UseAscii, writeToLog);

            resultProperties.SaveMessageToFile = configuration.GetBoolValue
                                                     (ConfigurationParameters.SaveMessageToFileParameter, currentSettings.SaveMessageToFile, writeToLog);

            resultProperties.SavePropertiesToFile = configuration.GetBoolValue
                                                        (ConfigurationParameters.SavePropertiesToFileParameter,
                                                        currentSettings.SavePropertiesToFile, writeToLog);

            resultProperties.SaveCheckpointsToFile = configuration.GetBoolValue
                                                         (ConfigurationParameters.SaveCheckpointsToFileParameter,
                                                         currentSettings.SaveCheckpointsToFile, writeToLog);

            resultProperties.Label = configuration.GetStringValue(ConfigurationParameters.LabelParameter,
                                                                  MainSettings.DefaultLabel);

            MessageAndPropertiesHelper.GetMessageTextAndFile(configuration,
                                                             out string messageText, out string messageFile);
            resultProperties.MessageText = messageText;
            resultProperties.MessageFile = messageFile;

            resultProperties.SelectedEntities = ConfigurationHelper.GetSelectedEntities(configuration);

            resultProperties.MessageBodyType = configuration.GetStringValue(ConfigurationParameters.MessageBodyType,
                                                                            BodyType.Stream.ToString());

            resultProperties.ConnectivityMode = configuration.GetEnumValue
                                                    (ConfigurationParameters.ConnectivityMode, currentSettings.ConnectivityMode, writeToLog);

            resultProperties.EncodingType = configuration.GetEnumValue
                                                (ConfigurationParameters.Encoding, currentSettings.EncodingType, writeToLog);

            return(resultProperties);
        }