当前位置: 首页>>代码示例>>C#>>正文


C# Config.RegisterAttributes方法代码示例

本文整理汇总了C#中Config.RegisterAttributes方法的典型用法代码示例。如果您正苦于以下问题:C# Config.RegisterAttributes方法的具体用法?C# Config.RegisterAttributes怎么用?C# Config.RegisterAttributes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Config的用法示例。


在下文中一共展示了Config.RegisterAttributes方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Initialize

        public virtual void Initialize()
        {
            MessageDispatcher.RegisterSharedAssembly(Context.PluginAssembly);

            if (UseConfig)
            {
                Config = new Config(ConfigPath);
                Config.BindAssembly(Context.PluginAssembly);
                Config.RegisterAttributes(Context.PluginAssembly);
                Config.Load();
            }
        }
开发者ID:Torf,项目名称:BehaviorIsManaged,代码行数:12,代码来源:PluginBase.cs

示例2: Initialize

        public static void Initialize()
        {
            if (Initialized)
                return;

            if (!Debugger.IsAttached) // the debugger handle the unhandled exceptions
                AppDomain.CurrentDomain.UnhandledException += OnUnhandledException;

            AppDomain.CurrentDomain.ProcessExit += OnProcessExit;

            Config = new Config(ConfigPath);

            foreach (var assembly in m_hierarchy)
            {
                Config.BindAssembly(assembly);
                Config.RegisterAttributes(assembly);
            }

            Config.Load();

            logger.Info("{0} loaded", Path.GetFileName(Config.FilePath));

            var d2oSource = new D2OSource();
            d2oSource.AddReaders(DofusDataPath);
            DataProvider.Instance.AddSource(d2oSource);

            var maps = new D2PSource(new D2pFile(DofusMapsD2P));
            DataProvider.Instance.AddSource(maps);

            // todo : langs
            var d2iSource = new D2ISource(Languages.English);
            d2iSource.AddReaders(DofusI18NPath);
            DataProvider.Instance.AddSource(d2iSource);

            MITM = new MITM.MITM(new MITMConfiguration
                                     {
                                         FakeAuthHost = BotAuthHost,
                                         FakeAuthPort = BotAuthPort,
                                         FakeWorldHost = BotWorldHost,
                                         FakeWorldPort = BotWorldPort,
                                         RealAuthHost = RealAuthHost,
                                         RealAuthPort = RealAuthPort
                                     });

            MessageDispatcher.DefineHierarchy(m_hierarchy);

            foreach (var assembly in m_hierarchy)
            {
                MessageDispatcher.RegisterSharedAssembly(assembly);
            }

            PluginManager.Instance.LoadAllPlugins();

            DispatcherTask = new DispatcherTask(new MessageDispatcher(), MITM);
            DispatcherTask.Start(); // we have to start it now to dispatch the initialization msg

            var msg = new HostInitializationMessage();
            DispatcherTask.Dispatcher.Enqueue(msg, MITM);

            msg.Wait();

            Initialized = true;
        }
开发者ID:Seth-,项目名称:BehaviorIsManaged,代码行数:63,代码来源:Host.cs

示例3: Initialize

        public static void Initialize()
        {
            if (Initialized)
                return;

            UIManager.Instance.SetBusy(true);
            try
            {

                if (!Debugger.IsAttached) // the debugger handle the unhandled exceptions
                    AppDomain.CurrentDomain.UnhandledException += OnUnhandledException;

                AppDomain.CurrentDomain.ProcessExit += OnProcessExit;


                UIManager.Instance.BusyMessage = "Load config ...";
                Config = new Config(ConfigPath);

                foreach (Assembly assembly in m_hierarchy)
                {
                    Config.BindAssembly(assembly);
                    Config.RegisterAttributes(assembly);
                }

                Config.Load();

                logger.Info("{0} loaded", Path.GetFileName(Config.FilePath));


                UIManager.Instance.BusyMessage = "Loading D2O files ...";
                ObjectDataManager.Instance.AddReaders(Path.Combine(GetDofusPath(), DofusDataPath));
                I18NDataManager.Instance.DefaultLanguage = Languages.English;

                I18NDataManager.Instance.AddReaders(Path.Combine(GetDofusPath(), DofusI18NPath));
                IconsManager.Instance.Initialize(Path.Combine(GetDofusPath(), DofusItemIconPath));


                UIManager.Instance.BusyMessage = "Starting redis server ...";
                logger.Info("Starting redis server ...");
                RedisServerHost.Instance.ExecutablePath = RedisServerExe;
                RedisServerHost.Instance.StartOrFindProcess();

                UIManager.Instance.BusyMessage = string.Format("Loading {0}...", MapsManager.MapsDataFile);
                logger.Info("Loading {0}...", MapsManager.MapsDataFile);
                ProgressionCounter progression = MapsManager.Instance.Initialize(Path.Combine(GetDofusPath(), DofusMapsD2P));
                if (progression != null)
                    ExecuteProgress(progression);

                UIManager.Instance.BusyMessage = "Loading maps positions ...";
                logger.Info("Loading maps positions ...");
                progression = MapsPositionManager.Instance.Initialize();
                if (progression != null)
                    ExecuteProgress(progression);

                UIManager.Instance.BusyMessage = "Loading submaps ...";
                logger.Info("Loading submaps ...");
                progression = SubMapsManager.Instance.Initialize();
                if (progression != null)
                    ExecuteProgress(progression);


                MITM = new MITM.MITM(new MITMConfiguration
                    {
                        FakeAuthHost = BotAuthHost,
                        FakeAuthPort = BotAuthPort,
                        FakeWorldHost = BotWorldHost,
                        FakeWorldPort = BotWorldPort,
                        RealAuthHost = RealAuthHost,
                        RealAuthPort = RealAuthPort
                    });

                MessageDispatcher.DefineHierarchy(m_hierarchy);

                foreach (Assembly assembly in m_hierarchy)
                {
                    MessageDispatcher.RegisterSharedAssembly(assembly);
                }

                UIManager.Instance.BusyMessage = "Loading plugins ...";
                PluginManager.Instance.LoadAllPlugins();

                DispatcherTask = new DispatcherTask(new MessageDispatcher(), MITM);
                DispatcherTask.Start(); // we have to start it now to dispatch the initialization msg

                BotManager.Instance.Initialize();

                var msg = new HostInitializationMessage();
                DispatcherTask.Dispatcher.Enqueue(msg, MITM);

                msg.Wait();

            }
            finally
            {
                UIManager.Instance.SetBusy(false);
            }

            Initialized = true;
        }
开发者ID:Guiedo,项目名称:BehaviorIsManaged,代码行数:99,代码来源:Host.cs


注:本文中的Config.RegisterAttributes方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。