Aug 7, 2015 12:31 AM
(This post was last modified: Aug 7, 2015 12:33 AM by BahNahNah.)
My first attempt at a plugin system was terrible, i had no idea what i was doing, i want using interfaces property ect. So after doing some research on plugin systems i have tried again.
Source: Github
Example plugin (included in source): Github
Gif:
![[Image: YHoBSZE.gif]](https://i.imgur.com/YHoBSZE.gif)
Any feedback is appreciated.
Lotta blood to let, peace to make, give a fuk about a check
Parameter*
It looks nice, I know you've been working on it for a while.
Aug 7, 2015 12:56 AM
(This post was last modified: Aug 7, 2015 01:00 AM by iNCEPTiON_V.)
Code private void Plugin_OnException(LoadedPlugin parent, Exception ex)
{
string PluginName = "Unknowen";
if(parent != null)
{
PluginName = parent.Details.Name;
}
var exceptionItem = new ListViewItem(PluginName);
exceptionItem.SubItems.Add(ex.Message);
pluginExceptionList.Items.Add(exceptionItem);
}
I really liked what youre doing with your exceptions :)
I also store them in a list and then when applications ends i need to log them.
Are you logging them to ?
(Aug 7, 2015 12:56 AM)iNCEPTiON_V Wrote: Code private void Plugin_OnException(LoadedPlugin parent, Exception ex)
{
string PluginName = "Unknowen";
if(parent != null)
{
PluginName = parent.Details.Name;
}
var exceptionItem = new ListViewItem(PluginName);
exceptionItem.SubItems.Add(ex.Message);
pluginExceptionList.Items.Add(exceptionItem);
}
I really liked what youre doing with your exceptions :)
I also store them in a list and then when applications ends i need to log them.
Are you logging them to ?
Im not logging to a file, but i might add a context option to export the exceptions.
Lotta blood to let, peace to make, give a fuk about a check
Aug 7, 2015 12:59 AM
(This post was last modified: Aug 7, 2015 01:00 AM by iNCEPTiON_V.)
Ok makes sense :) If i could i would rep you for your SaveSettings() function! Beatiful code right there :) Exactly like my saveSettings() function !
(Aug 7, 2015 12:59 AM)iNCEPTiON_V Wrote: Ok makes sense :) If i could i would rep you for your SaveSettings() function! Beatiful code right there :) Exactly like my saveSettings() function !
Uhm, not to shit on anyone's parade or anything, but that SaveSettings function is pretty shit.
Why not just use the project settings and have it be stored in the .exe.config? That way you're not having to deal with managed code and is incredibly easy to use.
(Aug 7, 2015 01:06 AM)Serux Wrote: Uhm, not to shit on anyone's parade or anything, but that SaveSettings function is pretty shit.
Why not just use the project settings and have it be stored in the .exe.config? That way you're not having to deal with managed code and is incredibly easy to use.
Because arnt the project settings stored in appdata? i prefer my settings to be in the same folder, also i know exactly what its doing. I prefer making my own.
Lotta blood to let, peace to make, give a fuk about a check
Aug 7, 2015 01:08 AM
(This post was last modified: Aug 7, 2015 01:14 AM by iNCEPTiON_V.)
(Aug 7, 2015 01:06 AM)Serux Wrote: Uhm, not to shit on anyone's parade or anything, but that SaveSettings function is pretty shit.
Why not just use the project settings and have it be stored in the .exe.config? That way you're not having to deal with managed code and is incredibly easy to use.
Then Please feel free to explain us why that function is "shit".
Our company saves settings like that since ages, never had any problems with that .
EDIT: nice answer from StackOverflow
The registry is a no-go. You're not sure whether the user which uses your application, has sufficient rights to write to the registry.
You can use the app.config file to save application-level settings (that are the same for each user who uses your application).
I would store user-specific settings in an XML file, which would be saved in Isolated Storage or in the Application Folder
Next to that, as from .NET 2.0, it is possible to store values back to the app.config file.
(Aug 7, 2015 01:08 AM)iNCEPTiON_V Wrote: Then Please feel free to explain us why that function is "shit".
Our company saves settings like that since ages, never had any problems with that .
EDIT: nice answer from StackOverflow
The registry is a no-go. You're not sure whether the user which uses your application, has sufficient rights to write to the registry.
You can use the app.config file to save application-level settings (that are the same for each user who uses your application).
I would store user-specific settings in an XML file, which would be saved in Isolated Storage or in the Application Folder
Next to that, as from .NET 2.0, it is possible to store values back to the app.config file.
If you move the file or modify it in anyway, the settings gets cleared.
(Aug 8, 2015 12:36 PM)kemwelly Wrote: If you move the file or modify it in anyway, the settings gets cleared.
What? No.
If you edit the settings file and make it invalid, then yes, the settings get cleared. But why would you want to edit it anyway?
Lotta blood to let, peace to make, give a fuk about a check
(Aug 8, 2015 03:43 PM)BahNahNah Wrote: What? No.
If you edit the settings file and make it invalid, then yes, the settings get cleared. But why would you want to edit it anyway?
I meant the exe, not the file. Sorry
Aug 8, 2015 07:11 PM
(This post was last modified: Aug 8, 2015 07:46 PM by BahNahNah.)
(Aug 8, 2015 06:23 PM)kemwelly Wrote: I meant the exe, not the file. Sorry
So your saying if you move the file the settings get cleared? Why not just move the settings file also? what if i wanted to have the option of multiple saves?
This is like saying if you moved the exe without the plugin folder, the plugins wont work. Of course they wont, just move the plugins aswell.
Lotta blood to let, peace to make, give a fuk about a check
|