本文整理汇总了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;
}
示例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);
}
}
示例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);
}