chef 3784 Posted August 27, 2017 Share Posted August 27, 2017 (edited) I have understood the new layout in plugins, I get it. I'm not sure why it was changed.... whatever.... But now I want to update my plugin configuration form the C# side of things. I just keep getting errors. Can someone give me a hand please. var options = new PluginConfiguration.MessageOptions[]{}; options[0].Messages = tempMessageList; Plugin.Instance.UpdateConfiguration(new PluginConfiguration(){Options = options}); Why can't I add my new option parameters to my plugin config? Is it because it is a Generic List<String> as an element in an array? Edited August 27, 2017 by chef Link to comment Share on other sites More sharing options...
rhodges 41 Posted August 28, 2017 Share Posted August 28, 2017 (edited) looks like you are creating an empty array. Arrays are sized when you create them try something like var options = new PluginConfiguration.MessageOptions[1]{}; options[0] = new PluginConfiguration.MessageOptions { Messages = tempMessageList }; or the full intializer syntax (untested) var config = new PluginConfiguration { Options = new [] { new PluginConfiguration.MessageOptions { Messages = tempMessageList } } }; Plugin.Instance.UpdateConfiguration(config); Edited August 28, 2017 by rhodges Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now