本文整理汇总了C#中System.Boolean类的典型用法代码示例。如果您正苦于以下问题:C# Boolean类的具体用法?C# Boolean怎么用?C# Boolean使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Boolean类属于System命名空间,在下文中一共展示了Boolean类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Platform
public Platform(int x, int y, Type type, Texture2D texture, Boolean bottomCollision)
: base(x, y, texture)
{
this.bottomCollision = bottomCollision;
this.type = type;
}
示例2: GetRestUrl
/// <summary>Gets REST url.</summary>
/// <param name="urlKey">Url key.</param>
/// <param name="addClientId">Denotes whether client identifier should be composed into final url.</param>
/// <param name="pagination">Pagination object.</param>
/// <param name="additionalUrlParams">Additional parameters.</param>
/// <returns>Final REST url.</returns>
public String GetRestUrl(String urlKey, Boolean addClientId, Pagination pagination, Dictionary<String, String> additionalUrlParams)
{
String url;
if (!addClientId)
{
url = "/v2.01" + urlKey;
}
else
{
url = "/v2.01/" + _root.Config.ClientId + urlKey;
}
bool paramsAdded = false;
if (pagination != null)
{
url += "?page=" + pagination.Page + "&per_page=" + pagination.ItemsPerPage;
paramsAdded = true;
}
if (additionalUrlParams != null)
{
foreach (string key in additionalUrlParams.Keys)
{
url += paramsAdded ? Constants.URI_QUERY_PARAMS_SEPARATOR : Constants.URI_QUERY_SEPARATOR;
url += key + "=" + Uri.EscapeDataString(additionalUrlParams[key]);
paramsAdded = true;
}
}
return url;
}
示例3: ConvertToFontWeight
FontWeight ConvertToFontWeight(Boolean bold)
{
if (bold) {
return FontWeights.Bold;
}
return FontWeights.Normal;
}
示例4: Config
public Config()
{
//check if there is any config file, if not create a new one with some defaults...
if (File.Exists(AppPath + "\\dufftv.ini"))
{
//declare new source ini file
source = new IniConfigSource(AppPath + "\\dufftv.ini");
//turn on autosaving, no need to save manually
source.AutoSave = true;
// Creates two Boolean aliases.
source.Alias.AddAlias("On", true);
source.Alias.AddAlias("Off", false);
_Version = source.Configs["defaults"].GetString("Version");
_AutoUpdate = source.Configs["defaults"].GetBoolean("AutoUpdate", false);
_ConnectionCheckURI = source.Configs["defaults"].GetString("ConnectionCheckURI", "http://www.google.se");
_LastUpdate = _Version = source.Configs["defaults"].GetString("LastUpdate");
_IconSize = source.Configs["defaults"].GetInt("IconSize");
_XMLTVSourceURI = source.Configs["xmltv"].GetString("SourceURI");
_Country = source.Configs["xmltv"].GetString("Country");
_ChannelList = source.Configs["xmltv"].Get("ChannelList").Split('|');
_CreatedNewFile = false;
}
else
{
CreateNewConfigFile();
}
}
示例5: CaptionDef
public CaptionDef(Point Position, String Text, Color ForeColor, Boolean Visible)
{
this.Position = Position;
this.Text = Text;
this.ForeColor = ForeColor;
this.Visible = Visible;
}
示例6: Update
public void Update(PlayerButton input, Facing facing, Boolean paused)
{
m_inputbuffer.Add(input, facing);
if (paused == false)
{
foreach (BufferCount count in m_commandcount.Values) count.Tick();
}
foreach (Command command in Commands)
{
if (command.IsValid == false) continue;
if (CommandChecker.Check(command, m_inputbuffer) == true)
{
Int32 time = command.BufferTime;
if (paused == true) ++time;
m_commandcount[command.Name].Set(time);
}
}
m_activecommands.Clear();
foreach (var data in m_commandcount) if (data.Value.IsActive == true) m_activecommands.Add(data.Key);
}
示例7: fromFile
public Boolean fromFile(String path)
{
FileStream fs = new FileStream(path, FileMode.Open);
BinaryReader reader = new BinaryReader(fs);
try
{
String h = reader.ReadString();
float v = BitConverter.ToSingle(reader.ReadBytes(sizeof(float)), 0);
drawFloorModel = reader.ReadBoolean();
showAlwaysFloorMap = reader.ReadBoolean();
lockMapSize = reader.ReadBoolean();
mapXsize = reader.ReadInt32();
mapYsize = reader.ReadInt32();
//edgeXのxはmapX-1
//yはmapYsize
return true;
}
catch (EndOfStreamException eex)
{
//握りつぶす
return false;
}
finally
{
reader.Close();
}
}
示例8: TicTacToeTransaction
public TicTacToeTransaction(String[,] board, int x, int y, Boolean playerXTurn)
{
this.board = board;
this.x = x;
this.y = y;
this.playerXTurn = playerXTurn;
}
示例9: RunFlashDevelopWithErrorHandling
/// <summary>
/// Run FlashDevelop and catch any unhandled exceptions.
/// </summary>
static void RunFlashDevelopWithErrorHandling(String[] arguments, Boolean isFirst)
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
MainForm.IsFirst = isFirst;
MainForm.Arguments = arguments;
MainForm mainForm = new MainForm();
SingleInstanceApp.NewInstanceMessage += delegate(Object sender, Object message)
{
MainForm.Arguments = message as String[];
mainForm.ProcessParameters(message as String[]);
};
try
{
SingleInstanceApp.Initialize();
Application.Run(mainForm);
}
catch (Exception ex)
{
MessageBox.Show("There was an unexpected problem while running FlashDevelop: " + ex.Message, "Error");
}
finally
{
SingleInstanceApp.Close();
}
}
示例10: PersistFile
internal void PersistFile(Web web, ProvisioningTemplateCreationInformation creationInfo, PnPMonitoredScope scope, string folderPath, string fileName, Boolean decodeFileName = false)
{
if (creationInfo.FileConnector != null)
{
SharePointConnector connector = new SharePointConnector(web.Context, web.Url, "dummy");
Uri u = new Uri(web.Url);
if (folderPath.IndexOf(u.PathAndQuery, StringComparison.InvariantCultureIgnoreCase) > -1)
{
folderPath = folderPath.Replace(u.PathAndQuery, "");
}
using (Stream s = connector.GetFileStream(fileName, folderPath))
{
if (s != null)
{
creationInfo.FileConnector.SaveFileStream(decodeFileName ? HttpUtility.UrlDecode(fileName) : fileName, s);
}
}
}
else
{
WriteWarning("No connector present to persist homepage.", ProvisioningMessageType.Error);
scope.LogError("No connector present to persist homepage");
}
}
示例11: Map
/// <summary>
/// Initializes the map with values from parameter.
/// </summary>
/// <param name="folderName">Deprecated</param>
/// <param name="id"></param>
/// <param name="title"></param>
/// <param name="description"></param>
/// <param name="fieldSize"></param>
/// <param name="hitbox"></param>
/// <param name="carStartSpeed"></param>
/// <param name="carStartDirection"></param>
/// <param name="published"></param>
/// <param name="carStartPositions"></param>
/// <param name="roundFinishedPositions"></param>
/// <param name="forbiddenPositions"></param>
public Map(
String folderName, String id, String title, String description,
int fieldSize, int hitbox, int carStartSpeed,
String carStartDirection, Boolean published, BindingList<Node> carStartPositions,
BindingList<Node> roundFinishedPositions, BindingList<Node> forbiddenPositions,
Image image
)
{
this.FolderName = folderName;
this.Id = id;
this.Title = title;
this.Description = description;
this.FieldSize = fieldSize;
this.Hitbox = hitbox;
this.CarStartSpeed = carStartSpeed;
this.CarStartDirection = carStartDirection;
this.Published = published;
this.CarStartPositions = carStartPositions;
this.RoundFinishedPositions = roundFinishedPositions;
this.ForbiddenPositions = forbiddenPositions;
this.Image = image;
}
示例12: initSimulation
public static void initSimulation(Airport.Airport airport, Boolean enableMultiThreading)
{
Simulation.airport = airport;
Simulation.multiThreadingEnabled = enableMultiThreading;
Console.ForegroundColor = ConsoleColor.White;
}
示例13: parse
public override void parse(BinaryReader br, ChunkMap chkMap, Boolean dbg, int endPosition)
{
if (dbg) Console.Out.WriteLine("|---| " + ChunkHeader.W3D_CHUNK_TEXTURE);
HeaderID = (int)ChunkHeader.W3D_CHUNK_TEXTURE;
HeaderName = ChunkHeader.W3D_CHUNK_TEXTURE.ToString();
}
示例14: Bullet
//public:
public Bullet(Double x_, Double y_, Int32 width_, Int32 height_, Int32 damage_, BulletKind kind_)
{
PosX = x_;
PosY = y_;
Width = width_;
Height = height_;
switch (kind_)
{
case BulletKind.Laser:
{
_type = BulletType.Laser;
break;
}
case BulletKind.Exploded:
{
_type = BulletType.Exploded;
break;
}
case BulletKind.Rocket:
{
_type = BulletType.Rocket;
break;
}
}
Damage = damage_+_type._bonusdamage;
_active = true;
_vx = 1; _vy = 0;
_speed = _type.speed;
}
示例15: Begin_Click
private void Begin_Click(object sender, EventArgs e)
{
Begin.Text = "开始...";
Begin.Enabled = false;
start = true;
List<Task> listTask = new List<Task>();
TaskFactory tskf = new TaskFactory();
var controls = groupBox.Controls;
foreach (var control in controls)
{
if (control.GetType() != typeof(Label))
{
continue;
}
var label = control as Label;
listTask.Add(tskf.StartNew(new Action(() =>
{
while (start)
{
Thread.Sleep(200);
var text = GeNum(label);
UpdateLabl(label, text);
//Console.WriteLine("label:[{0}],value:[{1}]", label.Name, text);
}
})));
}
tskf.ContinueWhenAll(listTask.ToArray(), (rest) => { ShowMessage(); });
//MessageBox.Show("主线程结束了。。。", "结果");
Thread.Sleep(1000);
End.Enabled = true;
}