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


C# System.Boolean类代码示例

本文整理汇总了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;
        }
开发者ID:Cur10s1ty,项目名称:project2,代码行数:7,代码来源:Platform.cs

示例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;
        }
开发者ID:ioliver85,项目名称:mangopay2-net-sdk,代码行数:39,代码来源:UrlTool.cs

示例3: ConvertToFontWeight

 FontWeight ConvertToFontWeight(Boolean bold)
 {
     if (bold) {
         return FontWeights.Bold;
     }
     return FontWeights.Normal;
 }
开发者ID:2594636985,项目名称:SharpDevelop,代码行数:7,代码来源:BooleanToFontWeightConverter.cs

示例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();
            }
        }
开发者ID:BackupTheBerlios,项目名称:dufftv,代码行数:31,代码来源:Config.cs

示例5: CaptionDef

 public CaptionDef(Point Position, String Text, Color ForeColor, Boolean Visible)
 {
     this.Position = Position;
     this.Text = Text;
     this.ForeColor = ForeColor;
     this.Visible = Visible;
 }
开发者ID:StewartScottRogers,项目名称:RealtimeControlsSolution,代码行数:7,代码来源:CaptionDef.cs

示例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);
		}
开发者ID:lodossDev,项目名称:xnamugen,代码行数:25,代码来源:CommandManager.cs

示例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();
            }
        }
开发者ID:kistvan,项目名称:geditor,代码行数:30,代码来源:EditorConfig.cs

示例8: TicTacToeTransaction

 public TicTacToeTransaction(String[,] board, int x, int y, Boolean playerXTurn)
 {
     this.board = board;
     this.x = x;
     this.y = y;
     this.playerXTurn = playerXTurn;
 }
开发者ID:physic,项目名称:18xx,代码行数:7,代码来源:TicTacToeTransaction.cs

示例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();
     }
 }
开发者ID:zpLin,项目名称:flashdevelop,代码行数:29,代码来源:Program.cs

示例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");
            }
        }
开发者ID:rgueldenpfennig,项目名称:PnP-Sites-Core,代码行数:26,代码来源:ObjectContentHandlerBase.cs

示例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;
        }
开发者ID:AMartinNo1,项目名称:AWE-Projekt-Autorennen,代码行数:41,代码来源:Map.cs

示例12: initSimulation

        public static void initSimulation(Airport.Airport airport, Boolean enableMultiThreading)
        {
            Simulation.airport = airport;
            Simulation.multiThreadingEnabled = enableMultiThreading;

            Console.ForegroundColor = ConsoleColor.White;
        }
开发者ID:quintstoffers,项目名称:Introductieproject,代码行数:7,代码来源:Simulation.cs

示例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();
        }
开发者ID:RavenB,项目名称:Earth-and-Beyond-server,代码行数:7,代码来源:TextureChunk.cs

示例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;
        }
开发者ID:porcellus,项目名称:UniScrollShooter,代码行数:31,代码来源:Bullet.cs

示例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;
 }
开发者ID:s455016457,项目名称:study,代码行数:31,代码来源:Form1.cs


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