ana
ana
CC#
Created by ana on 5/27/2023 in #help
❔ Creating a transparent form with fully visible (100% opacity) controls like panels
Title, I'm trying to make a GUI in WinForms using .NET 4.8 and can't find a viable solution to do this...
20 replies
CC#
Created by ana on 3/19/2023 in #help
❔ ✅ Using a list
I am writing a program in which you can save configurations, which would save if a specific feature is enabled, and if it is, write "whatever=true".
public class ConfigManager
{
FeatureManager featureManager = new FeatureManager();
StreamWriter sw = new StreamWriter(ConfigFile);

public void writeConfig()
{
foreach (Feature feature in featureManager.getRegistered())
{
sw.WriteLine(feature.getName() + "=" + feature.isEnabled());
}
}
}
public class ConfigManager
{
FeatureManager featureManager = new FeatureManager();
StreamWriter sw = new StreamWriter(ConfigFile);

public void writeConfig()
{
foreach (Feature feature in featureManager.getRegistered())
{
sw.WriteLine(feature.getName() + "=" + feature.isEnabled());
}
}
}
I am using this code to try and write text to a config file, and ConfigFile variable is a path. FeatureManager code:
public class FeatureManager
{
public List<Feature> registered = new List<Feature>();

public void init()
{
register(new AutoTyper());
register(new AntiLag());
register(new AntiMail());
}

protected void register(Feature feature)
{
registered.Add(feature);
}

public List<Feature> getRegistered()
{
return registered;
}
}
public class FeatureManager
{
public List<Feature> registered = new List<Feature>();

public void init()
{
register(new AutoTyper());
register(new AntiLag());
register(new AntiMail());
}

protected void register(Feature feature)
{
registered.Add(feature);
}

public List<Feature> getRegistered()
{
return registered;
}
}
And a feature:
public class AutoTyper : Feature
{

public AutoTyper() : base("AutoTyper", "Automatically type stuff", Category.Casino) { }
// ^ NAME ^ DESCRIPTION ^ CATEGORY

// Here would be the feature's actual feature. For this, unneeded.
}
public class AutoTyper : Feature
{

public AutoTyper() : base("AutoTyper", "Automatically type stuff", Category.Casino) { }
// ^ NAME ^ DESCRIPTION ^ CATEGORY

// Here would be the feature's actual feature. For this, unneeded.
}
This code has no errors, but the items (features) in the registered List aren't recognized in the writeConfig method. (Meaning, when writing config it thinks there is no items, even though they were added) The output i want into the ConfigFile:
AutoTyper=true
AntiLag=true //these don't actually have to be true, but an output like this depending whether they are enabled or not
AntiMail=true
AutoTyper=true
AntiLag=true //these don't actually have to be true, but an output like this depending whether they are enabled or not
AntiMail=true
Hopefully this is understandable, and someone can help :D
19 replies