public GroupElement(Group group, ConfigLocation location, Library representing) : base(@group.Name, null) { Group = group; Location = location; Representing = representing; }
public override void Load() { Bind <ICradiatorView>().ToConstant(_view); Bind <IConfigSettings>().ToConstant(_configSettings); Bind <IWebClientFactory>().To <WebClientFactory>().InSingletonScope(); Bind <IAudioPlayer>().To <AudioPlayer>().InSingletonScope(); Bind <ICountdownTimer>().To <CountdownTimer>().InSingletonScope(); Bind <IPollTimer>().To <PollTimer>().InSingletonScope(); Bind <ISpeechSynthesizer>().To <CradiatorSpeechSynthesizer>().InSingletonScope(); Bind <ISkinLoader>().To <SkinLoader>().InSingletonScope(); Bind <IScreenUpdater>().To <ScreenUpdater>().InSingletonScope(); Bind <ISettingsWindow>().To <SettingsWindow>().InSingletonScope(); Bind <ISpeechTextParser>().To <SpeechTextParser>().InSingletonScope(); Bind <IAppLocation>().To <AppLocation>().InSingletonScope(); IConfigLocation configLocation = new ConfigLocation(); Bind <IConfigLocation>().ToConstant(configLocation).InSingletonScope(); Bind <IConfigFileWatcher>().ToConstant(new ConfigFileWatcher(_configSettings, configLocation.FileName)); Bind <IBuildBuster>().To <BuildBuster>() .WhenTargetHas <InjectBuildBusterAttribute>().InSingletonScope(); Bind <IBuildBuster>().To <BuildBusterImageDecorator>() .WhenTargetHas <InjectBuildBusterImageDecoratorAttribute>().InSingletonScope(); Bind <IBuildBuster>().To <BuildBusterFullNameDecorator>() .WhenTargetHas <InjectBuildBusterFullNameDecoratorAttribute>().InSingletonScope(); Bind <CradiatorPresenter>().ToSelf().InSingletonScope(); BindConfigChangeHandlers(); }
public AutoConfigClassAttribute(ConfigLocation location = ConfigLocation.Local, string subdir = "") { Location = location; if (!subdir.EndsWith("\\") && !subdir.EndsWith("/")) { subdir += "\\"; } Subdirectory = subdir; }
public JSONFile(string name, ConfigLocation location = ConfigLocation.Data, string path = null, string extension = ".json", bool saveOnUnload = false) { SaveOnUnload = saveOnUnload; _name = name.Replace(".json", ""); _location = location; switch (location) { case ConfigLocation.Data: { _path = $"{Oxide.Core.Interface.Oxide.DataDirectory}/{name}{extension}"; break; } case ConfigLocation.Config: { _path = $"{Oxide.Core.Interface.Oxide.ConfigDirectory}/{name}{extension}"; break; } case ConfigLocation.Logs: { _path = $"{Oxide.Core.Interface.Oxide.LogDirectory}/{name}{extension}"; break; } case ConfigLocation.Lang: { _path = $"{Oxide.Core.Interface.Oxide.LangDirectory}/{name}{extension}"; break; } case ConfigLocation.Custom: { _path = $"{path}/{name}{extension}"; break; } } _file = new DynamicConfigFile(_path); _file.Settings = new JsonSerializerSettings() { ReferenceLoopHandling = ReferenceLoopHandling.Ignore }; Init(); }
protected bool Equals(ConfigLocation other) { return LineNum == other.LineNum && string.Equals(LineText, other.LineText); }