當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。