本文整理汇总了C#中Settings.Set方法的典型用法代码示例。如果您正苦于以下问题:C# Settings.Set方法的具体用法?C# Settings.Set怎么用?C# Settings.Set使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Settings
的用法示例。
在下文中一共展示了Settings.Set方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ReadWrite
public void ReadWrite()
{
Settings settings = new Settings();
settings.DEBUG = true;
string[] testArray = new string[] {"foo", "bar"};
settings.Set("foo", testArray);
string[] newArray = settings.GetArray<string>("foo");
Assert.IsTrue(testArray.SequenceEqual(newArray));
int[] testArrayInt = new int[] { 3,5,333,456,3457};
settings.Set("fooInt", testArrayInt);
int[] newArrayInt = settings.GetArray<int>("fooInt");
Assert.IsTrue(testArray.SequenceEqual(newArray));
bool[] testArrayBool = new bool[] { true, false};
settings.Set("fooBool", testArrayBool);
bool[] newArrayBool = settings.GetArray<bool>("fooBool");
Assert.IsTrue(testArray.SequenceEqual(newArray));
String inputString = "randomStringWith§$%&/()=Charakters";
settings.Set("inputString", inputString);
Assert.AreEqual(inputString, settings.Get<string>("inputString"));
int inputInt = new Random().Next();
settings.Set("inputInt", inputInt);
Assert.AreEqual(inputInt, settings.Get<int>("inputInt"));
bool inputBool = true;
settings.Set("inputBool", inputBool);
Assert.AreEqual(inputBool, settings.Get<bool>("inputBool"));
}
示例2: InitSettings
private void InitSettings()
{
settings = new Settings();
settings.Set<bool>("_SAVEONCHANGE_SHOW_MAIN", true);
settings.Set<bool>("_SAVEONCHANGE_SHOW_REFERENCES", true);
settings.Set<bool>("_SAVEONCHANGE_USE_ATMOSPHERE", false);
settings.Set<bool>("_SAVEONCHANGE_SHOW_ALL_STAGES", false);
settings.Set<bool>("_SAVEONCHANGE_COMPACT", false);
settings.Set("*SPACER_TWEAKS", "");
settings.Set("*headingStyle_TWEAKABLES", "TWEAKABLES");
settings.Set<bool>("Tweak: Sim Timing", true);
settings.Set<bool>("Tweak: Atmospheric Pressure", false);
settings.Set<bool>("Tweak: Sim Velocity", false);
settings.Set<bool>("Tweak: Vectored Thrust", false);
settings.Set<bool>("Tweak: Dump Tree", false);
settings.Set<bool>("Tweak: Log Simulation", false);
}
示例3: InitSettings
private void InitSettings()
{
settings = new Settings();
settings.Set<bool>("_TOGGLE_FLIGHT_ENGINEER", true);
settings.Set("_SAVEONCHANGE_NOCHANGEUPDATE_WINDOW_POSITION", settings.ConvertToString(windowPosition));
settings.Set("_SAVEONCHANGE_SHOW_ORBITAL", false);
settings.Set("_SAVEONCHANGE_SHOW_SURFACE", false);
settings.Set("_SAVEONCHANGE_SHOW_VESSEL", false);
settings.Set("_SAVEONCHANGE_SHOW_RENDEZVOUS", false);
settings.Set("*SPACER_TWEAKS", "");
settings.Set("*headingStyle_TWEAKABLES", "TWEAKABLES");
settings.Set<bool>("Tweak: Sim Timing", true);
settings.Set<bool>("Tweak: Vectored Thrust", false);
settings.Set<bool>("Tweak: Dump Tree", false);
settings.Set<bool>("Tweak: Log Simulation", false);
settings.Set("*SPACER_ORBITAL", "");
settings.Set("*headingStyle_ORBITAL", "ORBITAL DISPLAY");
settings.Set<bool>("Orbital: Show Grouped Ap/Pe Readouts", false);
settings.Set<bool>("Orbital: Apoapsis Height", true);
settings.Set<bool>("Orbital: Time to Apoapsis", true);
settings.Set<bool>("Orbital: Periapsis Height", true);
settings.Set<bool>("Orbital: Time to Periapsis", true);
settings.Set<bool>("Orbital: Inclination", true);
settings.Set<bool>("Orbital: Eccentricity", true);
settings.Set<bool>("Orbital: Period", true);
settings.Set<bool>("Orbital: Longitude of AN", true);
settings.Set<bool>("Orbital: Longitude of Pe", true);
settings.Set<bool>("Orbital: Semi-major Axis", true);
settings.Set<bool>("Orbital: Semi-minor Axis", true);
settings.Set("*SPACER_SURFACE", "");
settings.Set("*headingStyle_SURFACE", "SURFACE DISPLAY");
settings.Set<bool>("Surface: Altitude (Sea Level)", true);
settings.Set<bool>("Surface: Altitude (Terrain)", true);
#if TERRAINTEST
settings.Set<bool>("Surface: terrainAltitude", true);
settings.Set<bool>("Surface: pqsAltitude", true);
settings.Set<bool>("Surface: diff", true);
settings.Set<bool>("Surface: maxDiff", true);
settings.Set<bool>("Surface: heightFromTerrain", true);
settings.Set<bool>("Surface: heightDiff", true);
settings.Set<bool>("Surface: heightMaxDiff", true);
#endif
settings.Set<bool>("Surface: Vertical Speed", true);
settings.Set<bool>("Surface: Horizontal Speed", true);
settings.Set<bool>("Surface: Longitude", true);
settings.Set<bool>("Surface: Latitude", true);
settings.Set<bool>("Surface: Biome", true);
settings.Set<bool>("Surface: Slope", true);
settings.Set<bool>("Surface: Impact Time", true);
settings.Set<bool>("Surface: Impact Longitude", true);
settings.Set<bool>("Surface: Impact Latitude", true);
settings.Set<bool>("Surface: Impact Altitude", true);
settings.Set<bool>("Surface: Impact Biome", true);
settings.Set<bool>("Surface: G-Force", true);
settings.Set<bool>("Surface: Terminal Velocity", true);
settings.Set<bool>("Surface: Atmospheric Efficiency", true);
settings.Set<bool>("Surface: Atmospheric Drag", true);
settings.Set<bool>("Surface: Atmospheric Pressure", true);
settings.Set<bool>("Surface: Atmospheric Density", true);
settings.Set("*SPACER_VESSEL", "");
settings.Set("*headingStyle_VESSEL", "VESSEL DISPLAY");
settings.Set<bool>("Vessel: Show All DeltaV Stages", true);
settings.Set<bool>("Vessel: DeltaV (Stage)", true);
settings.Set<bool>("Vessel: DeltaV (Total)", true);
settings.Set<bool>("Vessel: Specific Impulse", true);
settings.Set<bool>("Vessel: Mass", true);
settings.Set<bool>("Vessel: Thrust (Maximum)", true);
settings.Set<bool>("Vessel: Thrust (Throttle)", true);
settings.Set<bool>("Vessel: Thrust to Weight (Throttle)", true);
settings.Set<bool>("Vessel: Thrust to Weight (Current)", true);
settings.Set<bool>("Vessel: Thrust to Weight (Surface)", true);
settings.Set("*SPACER_RENDEZVOUS_CELESTIAL", "");
settings.Set("*headingStyle_RENDEZVOUS_CELESTIAL", "RENDEZVOUS DISPLAY - CELESTIAL BODY");
settings.Set<bool>("Rendezvous: Celestial Body - Current Phase Angle", true);
settings.Set<bool>("Rendezvous: Celestial Body - Intercept Angle", true);
settings.Set<bool>("Rendezvous: Celestial Body - Ejection Angle", true);
settings.Set<bool>("Rendezvous: Celestial Body - Angle to Prograde/Retrograde", true);
settings.Set<bool>("Rendezvous: Celestial Body - Relative Inclination", true);
settings.Set<bool>("Rendezvous: Celestial Body - Ascending Node", true);
settings.Set<bool>("Rendezvous: Celestial Body - Descending Node", true);
settings.Set<bool>("Rendezvous: Celestial Body - Time to Ascending Node", true);
settings.Set<bool>("Rendezvous: Celestial Body - Time to Ascending Node", true);
settings.Set<bool>("Rendezvous: Celestial Body - Altitude", true);
settings.Set<bool>("Rendezvous: Celestial Body - Distance", true);
settings.Set<bool>("Rendezvous: Celestial Body - Orbital Period", true);
settings.Set("*SPACER_RENDEZVOUS_VESSEL", "");
settings.Set("*headingStyle_RENDEZVOUS_VESSEL", "RENDEZVOUS DISPLAY - VESSEL");
settings.Set<bool>("Rendezvous: Vessel - Phase Angle", true);
settings.Set<bool>("Rendezvous: Vessel - Intercept Angle", true);
settings.Set<bool>("Rendezvous: Vessel - Intercept Distance", true);
settings.Set<bool>("Rendezvous: Vessel - Rel. Inclination", true);
settings.Set<bool>("Rendezvous: Vessel - Rel. Latitude", false);
settings.Set<bool>("Rendezvous: Vessel - Ascending Node", true);
settings.Set<bool>("Rendezvous: Vessel - Descending Node", true);
//.........这里部分代码省略.........