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


C# IGenericData.ConnectToDatabase方法代码示例

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


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

示例1: Initialize

        public void Initialize(IGenericData GenericData, IConfigSource source, IRegistryCore simBase, string defaultConnectionString)
        {
            if (source.Configs["AuroraConnectors"].GetString("RegionInfoConnector", "LocalConnector") == "LocalConnector")
            {
                GD = GenericData;

                if (source.Configs[Name] != null)
                    defaultConnectionString = source.Configs[Name].GetString("ConnectionString", defaultConnectionString);

                GD.ConnectToDatabase (defaultConnectionString, "Generics", source.Configs["AuroraConnectors"].GetBoolean ("ValidateTables", true));
                GD.ConnectToDatabase (defaultConnectionString, "RegionInfo", source.Configs["AuroraConnectors"].GetBoolean ("ValidateTables", true));
                
                DataManager.DataManager.RegisterPlugin(Name, this);
            }
        }
开发者ID:HGExchange,项目名称:Aurora-Sim,代码行数:15,代码来源:LocalRegionInfoConnector.cs

示例2: Initialize

        public void Initialize(IGenericData GenericData, IConfigSource source, IRegistryCore simBase,
                               string defaultConnectionString)
        {
            if (source.Configs["AuroraConnectors"].GetString("UserInfoConnector", "LocalConnector") == "LocalConnector")
            {
                GD = GenericData;

                string connectionString = defaultConnectionString;
                if (source.Configs[Name] != null)
                {
                    connectionString = source.Configs[Name].GetString("ConnectionString", defaultConnectionString);

                    m_allowDuplicatePresences =
                        source.Configs[Name].GetBoolean("AllowDuplicatePresences",
                                                        m_allowDuplicatePresences);
                    m_checkLastSeen =
                        source.Configs[Name].GetBoolean("CheckLastSeen",
                                                        m_checkLastSeen);
                }
                GD.ConnectToDatabase(connectionString, "UserInfo",
                                     source.Configs["AuroraConnectors"].GetBoolean("ValidateTables", true));

                DataManager.DataManager.RegisterPlugin(this);
            }
        }
开发者ID:Gnu32,项目名称:Silverfin,代码行数:25,代码来源:LocalUserInfoConnector.cs

示例3: Initialize

        public void Initialize(IGenericData GenericData, IConfigSource source, IRegistryCore simBase,
                               string defaultConnectionString)
        {
            GD = GenericData;

            if (source.Configs[Name] != null)
                defaultConnectionString = source.Configs[Name].GetString("ConnectionString", defaultConnectionString);

            GD.ConnectToDatabase(defaultConnectionString, "Generics",
                                 source.Configs["AuroraConnectors"].GetBoolean("ValidateTables", true));

            DataManager.DataManager.RegisterPlugin(Name + "Local", this);

            m_maxOfflineMessages = source.Configs["AuroraConnectors"].GetInt("MaxOfflineMessages", m_maxOfflineMessages);
            m_maxGroupOfflineMessages = source.Configs["AuroraConnectors"].GetInt("MaxGroupOfflineMessages",
                                                                                  m_maxGroupOfflineMessages);
            m_saveGroupOfflineMessages = source.Configs["AuroraConnectors"].GetBoolean("SaveOfflineGroupChatMessages",
                                                                                       m_saveGroupOfflineMessages);
            if (source.Configs["AuroraConnectors"].GetString("OfflineMessagesConnector", "LocalConnector") ==
                "LocalConnector")
            {
                DataManager.DataManager.RegisterPlugin(this);
            }
            Init(simBase, Name);
        }
开发者ID:nathanmarck,项目名称:Aurora-Sim,代码行数:25,代码来源:LocalOfflineMessagesConnector.cs

示例4: Initialize

        public void Initialize(IGenericData GenericData, IConfigSource source, IRegistryCore simBase,
                               string defaultConnectionString)
        {
            GD = GenericData;

            if (source.Configs[Name] != null)
                defaultConnectionString = source.Configs[Name].GetString("ConnectionString", defaultConnectionString);

            GD.ConnectToDatabase(defaultConnectionString, "AbuseReports",
                                 source.Configs["AuroraConnectors"].GetBoolean("ValidateTables", true));

            DataManager.DataManager.RegisterPlugin(Name + "Local", this);
            if (source.Configs["AuroraConnectors"].GetString("AbuseReportsConnector", "LocalConnector") ==
                "LocalConnector")
            {
                WebPassword = Util.Md5Hash(source.Configs["Handlers"].GetString("WireduxHandlerPassword", String.Empty));

                //List<string> Results = GD.Query("Method", "abusereports", "passwords", "Password");
                //if (Results.Count == 0)
                //{
                //    string newPass = MainConsole.Instance.PasswdPrompt("Password to access Abuse Reports");
                //    GD.Insert("passwords", new object[] { "abusereports", Util.Md5Hash(Util.Md5Hash(newPass)) });
                //}
                DataManager.DataManager.RegisterPlugin(Name, this);
            }
        }
开发者ID:savino1976,项目名称:Aurora-Sim,代码行数:26,代码来源:LocalAbuseReportsConnector.cs

示例5: Initialize

        public void Initialize(IGenericData GenericData, IConfigSource source, IRegistryCore registry,
                               string defaultConnectionString)
        {
            m_gd = GenericData;
            m_registry = registry;

            IConfig config = source.Configs["Currency"];
            if (config == null || source.Configs["Currency"].GetString("Module", "") != "SimpleCurrency")
                return;

            if (source.Configs[Name] != null)
                defaultConnectionString = source.Configs[Name].GetString("ConnectionString", defaultConnectionString);

            if (GenericData != null)
                GenericData.ConnectToDatabase(defaultConnectionString, "SimpleCurrency", true);
            DataManager.RegisterPlugin(Name, this);

            m_config = new SimpleCurrencyConfig(config);

            Init(m_registry, Name, "", "/currency/", "CurrencyServerURI");

            if (!m_doRemoteCalls)
            {
                MainConsole.Instance.Commands.AddCommand("money add", "money add", "Adds money to a user's account.",
                                                         AddMoney);
                MainConsole.Instance.Commands.AddCommand("money set", "money set",
                                                         "Sets the amount of money a user has.",
                                                         SetMoney);
                MainConsole.Instance.Commands.AddCommand("money get", "money get",
                                                         "Gets the amount of money a user has.",
                                                         GetMoney);
            }
        }
开发者ID:velus,项目名称:Async-Sim-Testing,代码行数:33,代码来源:Simple.CurrencyConnector.cs

示例6: Initialize

        public void Initialize(IGenericData GenericData, IConfigSource source, string defaultConnectionString)
        {
            if (source.Configs["AuroraConnectors"].GetString("ProfileConnector", "LocalConnector") == "LocalConnector")
            {
                GD = GenericData;

                if (source.Configs[Name] != null)
                    defaultConnectionString = source.Configs[Name].GetString("ConnectionString", defaultConnectionString);

                GD.ConnectToDatabase(defaultConnectionString);

                DataManager.DataManager.RegisterPlugin(Name, this);
            }
            else
            {
                //Check to make sure that something else exists
                string m_ServerURI = source.Configs["AuroraData"].GetString("RemoteServerURI", "");
                if (m_ServerURI == "") //Blank, not set up
                {
                    OpenSim.Framework.Console.MainConsole.Instance.Output("[AuroraDataService]: Falling back on local connector for " + "ProfileConnector", "None");
                    GD = GenericData;

                    if (source.Configs[Name] != null)
                        defaultConnectionString = source.Configs[Name].GetString("ConnectionString", defaultConnectionString);

                    GD.ConnectToDatabase(defaultConnectionString);

                    DataManager.DataManager.RegisterPlugin(Name, this);
                }
            }
        }
开发者ID:WordfromtheWise,项目名称:Aurora,代码行数:31,代码来源:LocalProfileConnector.cs

示例7: Initialize

        public void Initialize(IGenericData GenericData, ISimulationBase simBase, string defaultConnectionString)
        {
            IConfigSource source = simBase.ConfigSource;
            if (source.Configs["AuroraConnectors"].GetString("AgentConnector", "LocalConnector") == "LocalConnector")
            {
                GD = GenericData;

                if (source.Configs[Name] != null)
                    defaultConnectionString = source.Configs[Name].GetString("ConnectionString", defaultConnectionString);

                GD.ConnectToDatabase(defaultConnectionString);

                DataManager.DataManager.RegisterPlugin(Name, this);
            }
            else
            {
                //Check to make sure that something else exists
                string m_ServerURI = simBase.ApplicationRegistry.RequestModuleInterface<IAutoConfigurationService>().FindValueOf("RemoteServerURI", "AuroraData");
                if (m_ServerURI == "") //Blank, not set up
                {
                    OpenSim.Framework.Console.MainConsole.Instance.Output("[AuroraDataService]: Falling back on local connector for " + "AgentConnector", "None");
                    GD = GenericData;

                    if (source.Configs[Name] != null)
                        defaultConnectionString = source.Configs[Name].GetString("ConnectionString", defaultConnectionString);

                    GD.ConnectToDatabase(defaultConnectionString);

                    DataManager.DataManager.RegisterPlugin(Name, this);
                }
            }
        }
开发者ID:KristenMynx,项目名称:Aurora-Sim,代码行数:32,代码来源:LocalAgentConnector.cs

示例8: Initialize

        public void Initialize(IGenericData GenericData, IConfigSource source, string defaultConnectionString)
        {
            if (source.Configs["AuroraConnectors"].GetString("AvatarArchiverConnector", "LocalConnector") == "LocalConnector")
            {
                GD = GenericData;

                if (source.Configs[Name] != null)
                    defaultConnectionString = source.Configs[Name].GetString("ConnectionString", defaultConnectionString);

                GD.ConnectToDatabase(defaultConnectionString);
                DataManager.DataManager.RegisterPlugin(Name, this);
            }
        }
开发者ID:WordfromtheWise,项目名称:Aurora,代码行数:13,代码来源:LocalAvatarArchiverConnector.cs

示例9: Initialize

        /// <summary>
        ///   Starts the database plugin, performs migrations if needed
        /// </summary>
        /// <param name = "GenericData">The Database Plugin</param>
        /// <param name = "source">Config if more parameters are needed</param>
        /// <param name="simBase"></param>
        /// <param name = "DefaultConnectionString">The connection string to use</param>
        public void Initialize(IGenericData GenericData, IConfigSource source, IRegistryCore simBase, string DefaultConnectionString)
        {
            if (source.Configs["AuroraConnectors"].GetString("SchedulerConnector", "LocalConnector") != "LocalConnector")
                return;

            if (source.Configs[Name] != null)
                DefaultConnectionString = source.Configs[Name].GetString("ConnectionString", DefaultConnectionString);
            GenericData.ConnectToDatabase(DefaultConnectionString, "Scheduler",
                                          source.Configs["AuroraConnectors"].GetBoolean("ValidateTables", true));

            m_Gd = GenericData;
            DataManager.DataManager.RegisterPlugin(this);
        }
开发者ID:nathanmarck,项目名称:Aurora-Sim,代码行数:20,代码来源:LocalSchedulerConnector.cs

示例10: Initialize

        public void Initialize(IGenericData genericData, IConfigSource source, IRegistryCore simBase, string defaultConnectionString)
        {
            if (source.Configs["AuroraConnectors"].GetString("AssetConnector", "LocalConnector") != "LocalConnector")
                return;
            m_Gd = genericData;

            m_Log.Warn("Asset Database is using " + ((IDataConnector)genericData).Identifier);

            if (source.Configs[Name] != null)
                defaultConnectionString = source.Configs[Name].GetString("ConnectionString", defaultConnectionString);

            genericData.ConnectToDatabase(defaultConnectionString, "Asset", source.Configs["AuroraConnectors"].GetBoolean("ValidateTables", true));
            DataManager.DataManager.RegisterPlugin(Name, this);
        }
开发者ID:NickyPerian,项目名称:Aurora-Sim,代码行数:14,代码来源:LocalAssetMainConnector.cs

示例11: Initialize

        /// <summary>
        ///     Starts the database plugin, performs migrations if needed
        /// </summary>
        /// <param name="genericData">The Database Plugin</param>
        /// <param name="source">Config if more parameters are needed</param>
        /// <param name="simBase"></param>
        /// <param name="defaultConnectionString">The connection string to use</param>
        public void Initialize(IGenericData genericData, IConfigSource source, IRegistryCore simBase,
                               string defaultConnectionString)
        {
            if (source.Configs["WhiteCoreConnectors"].GetString("SchedulerConnector", "LocalConnector") != "LocalConnector")
                return;

            if (source.Configs[Name] != null)
                defaultConnectionString = source.Configs[Name].GetString("ConnectionString", defaultConnectionString);
            if (genericData != null)
                genericData.ConnectToDatabase(defaultConnectionString, "Scheduler",
                                              source.Configs["WhiteCoreConnectors"].GetBoolean("ValidateTables", true));

            GD = genericData;
            Framework.Utilities.DataManager.RegisterPlugin(this);
        }
开发者ID:EnricoNirvana,项目名称:WhiteCore-Dev,代码行数:22,代码来源:LocalSchedulerConnector.cs

示例12: Initialize

        public void Initialize(IGenericData GenericData, ISimulationBase simBase, string defaultConnectionString)
        {
            IConfigSource source = simBase.ConfigSource;
            if (source.Configs["AuroraConnectors"].GetString("WebStatsDataConnector", "LocalConnector") == "LocalConnector")
            {
                GD = GenericData;

                if (source.Configs[Name] != null)
                    defaultConnectionString = source.Configs[Name].GetString("ConnectionString", defaultConnectionString);

                GD.ConnectToDatabase(defaultConnectionString);

                DataManager.DataManager.RegisterPlugin(Name, this);
            }
        }
开发者ID:KristenMynx,项目名称:Aurora-Sim,代码行数:15,代码来源:LocalWebStatsDataConnector.cs

示例13: Initialize

        public void Initialize(IGenericData GenericData, IConfigSource source, IRegistryCore registry, string DefaultConnectionString)
        {
            if (source.Configs["AuroraConnectors"].GetString("PresenceInfoConnector", "LocalConnector") == "LocalConnector")
            {
                GD = GenericData;

                if (source.Configs[Name] != null)
                {
                    DefaultConnectionString = source.Configs[Name].GetString("ConnectionString", DefaultConnectionString);
                    DatabaseToAuthTable = source.Configs[Name].GetString("DatabasePathToAuthTable", DatabaseToAuthTable);
                }
                GD.ConnectToDatabase(DefaultConnectionString, "PresenceInfo", true);
                DataManager.DataManager.RegisterPlugin(this);
            }
        }
开发者ID:satlanski2,项目名称:Aurora-Sim,代码行数:15,代码来源:LocalPresenceInfoConnector.cs

示例14: Initialize

        public override void Initialize(IGenericData GenericData, IConfigSource source, IRegistryCore simBase, string defaultConnectionString)
        {
            if (source.Configs["AuroraConnectors"].GetString("InventoryConnector", "LocalConnector") == "RobustConnector")
            {
                GD = GenericData;
                m_registry = simBase;

                string connectionString = defaultConnectionString;
                if (source.Configs[Name] != null)
                    connectionString = source.Configs[Name].GetString("ConnectionString", defaultConnectionString);

                GD.ConnectToDatabase(connectionString, "Inventory", source.Configs["AuroraConnectors"].GetBoolean("ValidateTables", true));

                DataManager.DataManager.RegisterPlugin(Name, this);
            }
        }
开发者ID:chazzmac,项目名称:Aurora-Sim,代码行数:16,代码来源:RobustInventoryConnector.cs

示例15: Initialize

        public void Initialize (IGenericData GenericData, IConfigSource source, IRegistryCore simBase, string defaultConnectionString)
        {
            if (source.Configs ["UniverseConnectors"].GetString ("FriendsConnector", "LocalConnector") != "LocalConnector")
                return;

            GD = GenericData;

            string connectionString = defaultConnectionString;
            if (source.Configs [Name] != null)
                connectionString = source.Configs [Name].GetString ("ConnectionString", defaultConnectionString);

            if (GD != null)
                GD.ConnectToDatabase (connectionString, "Friends", source.Configs ["UniverseConnectors"].GetBoolean ("ValidateTables", true));

            Framework.Utilities.DataManager.RegisterPlugin (this);
        }
开发者ID:Virtual-Universe,项目名称:Virtual-Universe,代码行数:16,代码来源:LocalFriendsConnector.cs


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