Configuration of Custom Reader


Author
Message
sitob80
sitob80
Junior Member (91 reputation)Junior Member (91 reputation)Junior Member (91 reputation)Junior Member (91 reputation)Junior Member (91 reputation)Junior Member (91 reputation)Junior Member (91 reputation)Junior Member (91 reputation)Junior Member (91 reputation)
Group: Forum Members
Posts: 18, Visits: 105
Hi all,

i've written some custom reader that parses some binary files in our own format. This works very well except one point.
We need some configuration here as each version of the binary file has some sort of schema file that needs to be read in order to parse the binary file correctly. Now unfortunately each developer stores the schema files in different locations and we have to make it configurable but therefore the current option with a text box and the arguments in the Initialize method is not sufficient as we have a lot of versions and to maintain these versions in the text box is a mess.
I would really appreciate to have an extra Interface or an extension to the ILogReader interface that provides a custom configuration dialog.
Maybe some extension like an enum ConfigSetting.Simple and ConfigSetting.Custom in the ILogReader interface and dependent on that you show the simple text box or a "configure"-button.  If we press the configure button everything is under the control of the plugin. Including Storing/Restoring the configuration options. If the simple settings is used it's handled as today by logviewplus.
Would something like this be possible?


LogViewPlus Support
LogViewPlus Support
Supreme Being (5.3K reputation)Supreme Being (5.3K reputation)Supreme Being (5.3K reputation)Supreme Being (5.3K reputation)Supreme Being (5.3K reputation)Supreme Being (5.3K reputation)Supreme Being (5.3K reputation)Supreme Being (5.3K reputation)Supreme Being (5.3K reputation)
Group: Moderators
Posts: 1.1K, Visits: 3.7K
Hi,

The problem you are having makes sense and I can see why a simple text box is insufficient.

I don't think we will need to modify the custom reader interface.  It might be better create a new interface called, say, ICustomConfiguration which gives a reference to the current object as well as the current window.  This interface could then be reused for custom filters (which have the same problem).  Your class will implement both interfaces. 

This will take some thought on our end, but I think we should be able to get a new API in for the next release.  Once we have a prototype interface, I will post it here..

Thanks for the feedback,

Toby
LogViewPlus Support
LogViewPlus Support
Supreme Being (5.3K reputation)Supreme Being (5.3K reputation)Supreme Being (5.3K reputation)Supreme Being (5.3K reputation)Supreme Being (5.3K reputation)Supreme Being (5.3K reputation)Supreme Being (5.3K reputation)Supreme Being (5.3K reputation)Supreme Being (5.3K reputation)
Group: Moderators
Posts: 1.1K, Visits: 3.7K
In the latest BETA release of LogViewPlus (v2.3.8) we have introduced the following two new interfaces:

  /// <summary>
  /// Used to implement a custom configuration which can be used to create or
  /// edit complex configuration strings. Note that custom configuration may
  /// be in the form of a dialog.
  ///
  /// Implementing custom configuration will prevent direct editing of the
  /// filter or parser arguments.
  /// </summary>
  public interface ICustomConfiguration
  {
   /// <summary>
   /// Used to provide a custom configuration option when configuring a
   /// ILogParser or ILogFilter.
   /// </summary>
   /// <param name="parentWindow">The current parent window. This will
   /// be of type IWin32Window and can be used to show a dialog.</param>
   /// <param name="configuration">The string used to represent the target
   /// configuration. Null when a new configuration is requested. We
   /// recommend a base64 string for advanced configuration.</param>
   /// <returns>The configuration string that should be passed to our
   /// ILogParser or ILogFilter.</returns>
   string Configure(object parentWindow, string configuration);
  }

  /// <summary>
  /// Implement on custom parsers or filters if you need custom configuration.
  ///
  /// Note that custom code can also implement ICustomConfiguration directly so this
  /// interface is not strictly necessary. The advantage of using
  /// IHasCustomConfiguration is that it helps separate configuration code from
  /// the filter or parser implementation.
  /// </summary>
  public interface IHasCustomConfiguration
  {
   /// <summary>
   /// Returns a custom configuration implementation. This may be a dialog.
   /// </summary>
   ICustomConfiguration GetConfigurationManager();
  }


After implementing these interfaces on your ILogFilter or ILogParser, you should see a new 'Configure' command appear next to the arguments in the respective configuration screen.

I have also updated the customization sample code to include examples of ICustomConfiguration in a filter and parser.  Please see:
http://www.logviewplus.com/dist/LogViewPlus_Samples.zip
https://www.logviewplus.com/docs/running_the_samples.html

Hopefully, these new interfaces will meet your needs.  Online documentation is still pending, but please do let me know if you have any further questions or issues.

Thanks,

Toby

sitob80
sitob80
Junior Member (91 reputation)Junior Member (91 reputation)Junior Member (91 reputation)Junior Member (91 reputation)Junior Member (91 reputation)Junior Member (91 reputation)Junior Member (91 reputation)Junior Member (91 reputation)Junior Member (91 reputation)
Group: Forum Members
Posts: 18, Visits: 105
This looks good for a filter and is what I had in mind.
Unfortunately it seems that this doesn't work for a custom reader that implements the ILogReader interface.
If I understand you right it's only implemented for the ILogFilter and ILogParser interace, isn't it?

Would be good to have it - as this thread subject implies - also on the ILogReader interface Hehe

LogViewPlus Support
LogViewPlus Support
Supreme Being (5.3K reputation)Supreme Being (5.3K reputation)Supreme Being (5.3K reputation)Supreme Being (5.3K reputation)Supreme Being (5.3K reputation)Supreme Being (5.3K reputation)Supreme Being (5.3K reputation)Supreme Being (5.3K reputation)Supreme Being (5.3K reputation)
Group: Moderators
Posts: 1.1K, Visits: 3.7K
Apologies for the oversight.  I can confirm that this is not yet implemented on the ILogReader interface.  This is an easy fix for us and I should be able to push out a fix tomorrow.

Thanks, 

Toby
LogViewPlus Support
LogViewPlus Support
Supreme Being (5.3K reputation)Supreme Being (5.3K reputation)Supreme Being (5.3K reputation)Supreme Being (5.3K reputation)Supreme Being (5.3K reputation)Supreme Being (5.3K reputation)Supreme Being (5.3K reputation)Supreme Being (5.3K reputation)Supreme Being (5.3K reputation)
Group: Moderators
Posts: 1.1K, Visits: 3.7K
We have just released LogViewPlus v2.3.9 which adds custom configuration support for ILogReader implementations.

We have also updated the code samples to demonstrate the new API.  Sample code is available here:
https://www.logviewplus.com/dist/LogViewPlus_Samples.zip

Please let me know if you have any further questions or issues  

Thanks,  

Toby

sitob80
sitob80
Junior Member (91 reputation)Junior Member (91 reputation)Junior Member (91 reputation)Junior Member (91 reputation)Junior Member (91 reputation)Junior Member (91 reputation)Junior Member (91 reputation)Junior Member (91 reputation)Junior Member (91 reputation)
Group: Forum Members
Posts: 18, Visits: 105
Sorry for the delay.
It's working with the 2.3.9 version and looks good.
The only thing that immediately comes into my mind is that the skin is not applied to the configuration dialog but that's more a cosmetic thing.
The functionality is there and is working.
Thanks a lot
LogViewPlus Support
LogViewPlus Support
Supreme Being (5.3K reputation)Supreme Being (5.3K reputation)Supreme Being (5.3K reputation)Supreme Being (5.3K reputation)Supreme Being (5.3K reputation)Supreme Being (5.3K reputation)Supreme Being (5.3K reputation)Supreme Being (5.3K reputation)Supreme Being (5.3K reputation)
Group: Moderators
Posts: 1.1K, Visits: 3.7K
Thanks for the update.  Glad to hear the new API is working for you.

Skinning is going to be a tricky problem to solve without complicating the API, but I am open to suggestions.  For example, we could pass you a boolean value to indicate if the skin is light or dark.

Thanks again,

Toby
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Login

Explore
Messages
Mentions
Search