本文整理汇总了C#中Properties.AddHeaderLine方法的典型用法代码示例。如果您正苦于以下问题:C# Properties.AddHeaderLine方法的具体用法?C# Properties.AddHeaderLine怎么用?C# Properties.AddHeaderLine使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Properties
的用法示例。
在下文中一共展示了Properties.AddHeaderLine方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Initialized
protected override void Initialized(object state)
{
if (!Directory.Exists(RegionsFolder))
Directory.CreateDirectory(RegionsFolder);
rProperties = new Properties(RegionsFolder + Path.DirectorySeparatorChar + "regions.properties");
rProperties.Load();
rProperties.AddHeaderLine("Use 'rectify=false' to ignore world alterations from");
rProperties.AddHeaderLine("players who are blocked; Possibly saving bandwidth.");
rProperties.pushData();
rProperties.Save(false);
if (rProperties.RectifyChanges)
WorldAlter = HookResult.RECTIFY;
SelectorItem = rProperties.SelectionToolID;
#region set up mysql properties
string pluginFolder = Statics.PluginPath + Path.DirectorySeparatorChar + "mysql";
if (!Directory.Exists(pluginFolder))
{
Directory.CreateDirectory(pluginFolder);
}
mysql = new PropertiesFile(pluginFolder + Path.DirectorySeparatorChar + "mysql.properties");
mysql.Load();
var dummy1 = mysqlenabled;
var dummy2 = mysqlserver;
var dummy3 = mysqldatabase;
var dummy4 = mysqluser;
var dummy5 = mysqlpassword;
var dummy6 = imported;
mysql.Save(false);
#endregion
#region check if mysql table exists
if (mysqlenabled)
{
try
{
checkTable(connectionString, "terraria_regions");
}
catch (MySqlException e)
{
if (e.Number == 1042)
{
ProgramLog.Error.Log("[Regions] Could not connect to mysql server. Falling back to using regions files");
mysql.setValue("mysql-enabled", "False");
mysql.Save();
}
else
{
ProgramLog.Error.Log("[Regions] MYSQL ERROR CODE: " + e.Number);
ProgramLog.Error.Log(e.StackTrace);
}
}
}
#endregion
regionManager = new RegionManager(DataFolder);
selection = new Selection();
commands = new Commands();
commands.regionManager = regionManager;
commands.RegionsPlugin = this;
commands.selection = selection;
commands.Node_Create = Node.FromPath("region.create");
commands.Node_Here = Node.FromPath("region.here");
commands.Node_List = Node.FromPath("region.list");
commands.Node_Npcres = Node.FromPath("region.npcres");
commands.Node_Opres = Node.FromPath("region.opres");
commands.Node_Projectile = Node.FromPath("region.projectile");
commands.Node_ProtectAll = Node.FromPath("region.protectall");
commands.Node_Select = Node.FromPath("region.select");
commands.Node_User = Node.FromPath("region.user");
AddCommand("region")
.WithAccessLevel(AccessLevel.OP)
.WithHelpText("Usage: region [select, create, user, list, npcres, opres]")
.WithDescription("Region Management.")
.WithPermissionNode("regions")
.Calls(commands.Region);
AddCommand("regions")
.WithAccessLevel(AccessLevel.OP)
.WithHelpText("Usage: regions [select, create, user, list, npcres, opres]")
.WithDescription("Region Management.")
.WithPermissionNode("regions") //Need another method to split the commands up.
.Calls(commands.Region);
ChestBreak = AddAndCreateNode("region.chestbreak");
ChestOpen = AddAndCreateNode("region.chestopen");
DoorChange = AddAndCreateNode("region.doorchange");
LiquidFlow = AddAndCreateNode("region.liquidflow");
ProjectileUse = AddAndCreateNode("region.projectileuse");
SignEdit = AddAndCreateNode("region.signedit");
//.........这里部分代码省略.........
示例2: Initialized
protected override void Initialized(object state)
{
if (!Directory.Exists(RegionsFolder))
Directory.CreateDirectory(RegionsFolder);
rProperties = new Properties(RegionsFolder + Path.DirectorySeparatorChar + "regions.properties");
rProperties.Load();
rProperties.AddHeaderLine("Use 'rectify=false' to ignore world alterations from");
rProperties.AddHeaderLine("players who are blocked; Possibly saving bandwidth.");
rProperties.pushData();
rProperties.Save(false);
if (rProperties.RectifyChanges)
WorldAlter = HookResult.RECTIFY;
SelectorItem = rProperties.SelectionToolID;
regionManager = new RegionManager(DataFolder);
selection = new Selection();
commands = new Commands();
commands.regionManager = regionManager;
commands.RegionsPlugin = this;
commands.selection = selection;
commands.Node_Create = Node.FromPath("region.create");
commands.Node_Here = Node.FromPath("region.here");
commands.Node_List = Node.FromPath("region.list");
commands.Node_Npcres = Node.FromPath("region.npcres");
commands.Node_Opres = Node.FromPath("region.opres");
commands.Node_Projectile = Node.FromPath("region.projectile");
commands.Node_ProtectAll = Node.FromPath("region.protectall");
commands.Node_Select = Node.FromPath("region.select");
commands.Node_User = Node.FromPath("region.user");
AddCommand("region")
.WithAccessLevel(AccessLevel.OP)
.WithHelpText("Usage: region [select, create, user, list, npcres, opres]")
.WithDescription("Region Management.")
.WithPermissionNode("regions")
.Calls(commands.Region);
AddCommand("regions")
.WithAccessLevel(AccessLevel.OP)
.WithHelpText("Usage: regions [select, create, user, list, npcres, opres]")
.WithDescription("Region Management.")
.WithPermissionNode("regions") //Need another method to split the commands up.
.Calls(commands.Region);
ChestBreak = AddAndCreateNode("region.chestbreak");
ChestOpen = AddAndCreateNode("region.chestopen");
DoorChange = AddAndCreateNode("region.doorchange");
LiquidFlow = AddAndCreateNode("region.liquidflow");
ProjectileUse = AddAndCreateNode("region.projectileuse");
SignEdit = AddAndCreateNode("region.signedit");
TileBreak = AddAndCreateNode("region.tilebreak");
TilePlace = AddAndCreateNode("region.tileplace");
}
示例3: Initialized
protected override void Initialized(object state)
{
if (!Directory.Exists(RegionsFolder))
Directory.CreateDirectory(RegionsFolder);
rProperties = new Properties(RegionsFolder + Path.DirectorySeparatorChar + "regions.properties");
rProperties.Load();
rProperties.AddHeaderLine("Use 'rectify=false' to ignore world alterations from");
rProperties.AddHeaderLine("players who are blocked; Possibly saving bandwidth.");
rProperties.pushData();
rProperties.Save();
if (rProperties.RectifyChanges)
WorldAlter = HookResult.RECTIFY;
SelectorItem = rProperties.SelectionToolID;
regionManager = new RegionManager(DataFolder);
selection = new Selection();
commands = new Commands();
commands.regionManager = regionManager;
commands.RegionsPlugin = this;
commands.selection = selection;
AddCommand("region")
.WithAccessLevel(AccessLevel.OP)
.WithHelpText("Usage: region [select, create, user, list, npcres, opres]")
.WithDescription("Region Management.")
.WithPermissionNode("regions")
.Calls(commands.Region);
AddCommand("regions")
.WithAccessLevel(AccessLevel.OP)
.WithHelpText("Usage: regions [select, create, user, list, npcres, opres]")
.WithDescription("Region Management.")
.WithPermissionNode("regions") //Need another method to split the commands up.
.Calls(commands.Region);
Hook(HookPoints.PlayerWorldAlteration, OnPlayerWorldAlteration);
Hook(HookPoints.LiquidFlowReceived, OnLiquidFlowReceived);
Hook(HookPoints.ProjectileReceived, OnProjectileReceived);
Hook(HookPoints.PlayerEnteredGame, OnPlayerEnteredGame);
Hook(HookPoints.ServerStateChange, OnServerStateChange);
Hook(HookPoints.DoorStateChanged, OnDoorStateChange);
Hook(HookPoints.ChestBreakReceived, OnChestBreak);
Hook(HookPoints.SignTextSet, OnSignEdit);
UsingPermissions = isRunningPermissions();
if (UsingPermissions)
Log("Using Permissions.");
else
Log("No Permissions Found\nUsing Internal User System");
}