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


C# IConfig.GetLong方法代码示例

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


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

示例1: ExtensionInit

		public void ExtensionInit(IApplication application, int extensionID, IConfig config)
		{
			if (disposed)
				throw new ObjectDisposedException(GetType().Name);

			this.application = application;
			this.config = config;

			settings["appPort"].Value = config.GetString("Application COM Port", (string)settings["appPort"].Value);
			settings["logGarminProtocol"].Value = config.GetBoolean("Log Garmin Protocol", (bool)settings["logGarminProtocol"].Value);
			settings["gpsProductId"].Value = config.GetInt("GPS Product ID", (int)settings["gpsProductId"].Value);
            settings["gpsSoftwareVersion"].Value = config.GetInt("GPS Software Version", (int)settings["gpsSoftwareVersion"].Value);
			settings["gpsProductDescription"].Value = config.GetString("GPS Product Description", (string)settings["gpsProductDescription"].Value);
			settings["gpsUnitId"].Value = (long)config.GetLong("GPS Unit ID", (long)settings["gpsUnitId"].Value);
			settings["snrMin"].Value = config.GetInt("SNRdB Min", (int)settings["snrMin"].Value);
			settings["snrMax"].Value = config.GetInt("SNRdB Max", (int)settings["snrMax"].Value);

			logGarminProtocol = (bool)settings["logGarminProtocol"].Value;
		}
开发者ID:JeffreyZksun,项目名称:gpstranslator,代码行数:19,代码来源:GarminProtocolOutputExtension.cs

示例2: ReadItemFromConfig

        /// <summary>
        /// Read a library inventory item metadata from a loaded configuration
        /// </summary>
        /// <param name="source"></param>
        private void ReadItemFromConfig(IConfig config, string path)
        {
            InventoryItemBase item = new InventoryItemBase();
            item.Owner = libOwner;
            item.CreatorId = libOwner.ToString();
            item.ID = new UUID(config.GetString("inventoryID", m_LibraryRootFolder.ID.ToString()));
            item.AssetID = new UUID(config.GetString("assetID", item.ID.ToString()));
            item.Folder = new UUID(config.GetString("folderID", m_LibraryRootFolder.ID.ToString()));
            item.Name = config.GetString("name", String.Empty);
            item.Description = config.GetString("description", item.Name);
            item.InvType = config.GetInt("inventoryType", 0);
            item.AssetType = config.GetInt("assetType", item.InvType);
            item.CurrentPermissions = (uint)config.GetLong("currentPermissions", 0x7FFFFFFF);
            item.NextPermissions = (uint)config.GetLong("nextPermissions", 0x7FFFFFFF);
            item.EveryOnePermissions = (uint)config.GetLong("everyonePermissions", 0x7FFFFFFF);
            item.BasePermissions = (uint)config.GetLong("basePermissions", 0x7FFFFFFF);
            item.Flags = (uint)config.GetInt("flags", 0);

            if (libraryFolders.ContainsKey(item.Folder))
            {
                InventoryFolderImpl parentFolder = libraryFolders[item.Folder];
                try
                {
                    parentFolder.Items.Add(item.ID, item);
                }
                catch (Exception)
                {
                    m_log.WarnFormat("[LIBRARY INVENTORY] Item {1} [{0}] not added, duplicate item", item.ID, item.Name);
                }
            }
            else
            {
                m_log.WarnFormat(
                    "[LIBRARY INVENTORY]: Couldn't add item {0} ({1}) since parent folder with ID {2} does not exist!",
                    item.Name, item.ID, item.Folder);
            }
        }
开发者ID:NickyPerian,项目名称:Aurora,代码行数:41,代码来源:LibraryService.cs

示例3: ReadItemFromConfig

        /// <summary>
        /// Read a library inventory item metadata from a loaded configuration
        /// </summary>
        /// <param name="source"></param>
        private void ReadItemFromConfig(IConfig config, string path)
        {
            InventoryItemBase item = new InventoryItemBase();
            item.Owner = m_service.LibraryOwner;
            item.CreatorId = m_service.LibraryOwner.ToString();
            item.ID = new UUID (config.GetString ("inventoryID", UUID.Random().ToString()));
            item.AssetID = new UUID(config.GetString("assetID", item.ID.ToString()));
            item.Folder = new UUID (config.GetString ("folderID", UUID.Zero.ToString ()));
            item.Name = config.GetString("name", String.Empty);
            item.Description = config.GetString("description", item.Name);
            item.InvType = config.GetInt("inventoryType", 0);
            item.AssetType = config.GetInt("assetType", item.InvType);
            item.CurrentPermissions = (uint)config.GetLong("currentPermissions", 0x7FFFFFFF);
            item.NextPermissions = (uint)config.GetLong("nextPermissions", 0x7FFFFFFF);
            item.EveryOnePermissions = (uint)config.GetLong("everyonePermissions", 0x7FFFFFFF);
            item.BasePermissions = (uint)config.GetLong("basePermissions", 0x7FFFFFFF);
            item.Flags = (uint)config.GetInt("flags", 0);

            m_inventoryService.AddItem(item);
        }
开发者ID:nhede,项目名称:Aurora-Sim-Optional-Modules,代码行数:24,代码来源:DefaultInventoryXMLLoader.cs


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