Ejemplo n.º 1
0
 public GroupElement(Group group, ConfigLocation location, Library representing)
     : base(@group.Name, null)
 {
     Group = group;
     Location = location;
     Representing = representing;
 }
Ejemplo n.º 2
0
        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();
        }
Ejemplo n.º 3
0
 public AutoConfigClassAttribute(ConfigLocation location = ConfigLocation.Local, string subdir = "")
 {
     Location = location;
     if (!subdir.EndsWith("\\") && !subdir.EndsWith("/"))
     {
         subdir += "\\";
     }
     Subdirectory = subdir;
 }
Ejemplo n.º 4
0
            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();
            }
Ejemplo n.º 5
0
 protected bool Equals(ConfigLocation other)
 {
     return LineNum == other.LineNum && string.Equals(LineText, other.LineText);
 }