private void InternalConfig(ViewerConfiguration viewerConfig)
        {
            if (viewerConfig == null)
            {
                return;
            }

            foreach (KeyValueConfigurationElement keyValue in viewerConfig.Plugins)
            {
                string type       = keyValue.Value;
                Type   pluginType = Type.GetType(type, false);
                if (pluginType != null && typeof(IJsonViewerPlugin).IsAssignableFrom(pluginType))
                {
                    continue;
                }
                try
                {
                    IJsonViewerPlugin plugin = (IJsonViewerPlugin)Activator.CreateInstance(pluginType);
                    AddPlugin(plugin);
                }
                catch
                {
                    //Silently ignore any errors in plugin creation
                }
            }
        }
        private void InitControl(TextEditorControlEx ctrol, Configuration config)
        {
            ViewerConfiguration viewerConfig = (ViewerConfiguration)config.GetSection("jsonViewer");

            foreach (KeyValueConfigurationElement item in viewerConfig.TextEditor)
            {
                switch (item.Key)
                {
                case "SyntaxHighlighting":
                    ctrol.SyntaxHighlighting = item.Value;
                    break;

                case "ShowInvalidLines":
                    ctrol.ShowInvalidLines = bool.TryParse(item.Value, out bool lines) ? lines : true;
                    break;

                case "ShowHRuler":
                    ctrol.ShowHRuler = bool.TryParse(item.Value, out bool ruler) ? ruler : true;
                    break;

                default:
                    break;
                }
            }
        }
 public void Initialize()
 {
     try
     {
         Configuration config = ConfigurationManager.OpenExeConfiguration(Assembly.GetExecutingAssembly().Location);
         if (config == null)
         {
             InitDefaults();
         }
         ViewerConfiguration viewerConfig = (ViewerConfiguration)config.GetSection("jsonViewer");
         InternalConfig(viewerConfig);
     }
     catch
     {
         InitDefaults();
     }
 }