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


C# Boolean.ToString方法代码示例

本文整理汇总了C#中System.Boolean.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# Boolean.ToString方法的具体用法?C# Boolean.ToString怎么用?C# Boolean.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Boolean的用法示例。


在下文中一共展示了Boolean.ToString方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: getObject

        public static List<RData> getObject(RProjectDetails details, List<String> objectNames, Boolean encodeDataFramePrimitiveAsVector, RClient client, String uri)
        {
            StringBuilder data = new StringBuilder();

            //create the input String
            data.Append(Constants.FORMAT_JSON);
            data.Append("&project=" + HttpUtility.UrlEncode(details.id));
            if (!(objectNames == null))
            {
                if (objectNames.Count > 0)
                {
                    data.Append("&name=");
                    foreach (var s in objectNames)
                    {
                        data.Append(HttpUtility.UrlEncode(s) + ",");
                    }
                    data.Remove(data.Length - 1, 1);
                }
            }
            data.Append("&encodeDataFramePrimitiveAsVector=" + encodeDataFramePrimitiveAsVector.ToString());

            //call the server
            JSONResponse jresponse = HTTPUtilities.callRESTGet(uri, data.ToString(), ref client);

            List<RData> returnValue = new List<RData>();
            returnValue = JSONUtilities.parseRObjects(jresponse.JSONMarkup);

            return returnValue;
        }
开发者ID:myers-github,项目名称:dotnet-client-library,代码行数:29,代码来源:RProjectWorkspaceImpl.cs

示例2: ReadPrefs

        private void ReadPrefs()
        {
            //read existing prefs from config file
            _Version = _prefs.Version;
            _AutoUpdate = _prefs.AutoUpdate;
            _XMLTVSourceURI = _prefs.XMLTVSourceURI;
            _Country = _prefs.Country;
            _LastUpdate = _prefs.LastUpdate;
            _ChannelList = _prefs.ChannelListNames;
            _Countries = _prefs.Countries;

            //assign prefs to UI
            lblVersion.Text = _Version;
            lblLastUpdate.Text = _LastUpdate;

            cmbAutoUpdate.Items.Add(_AutoUpdate.ToString());

            cmbCountry.DataSource = _Countries;
            cmbCountry.DisplayMember = "CountryName";
            cmbCountry.ValueMember = "SourceURI";
            cmbCountry.SelectedIndex = 0;

            cmbSource.DataSource = _Countries;
            cmbSource.DisplayMember = "SourceURI";
            cmbSource.ValueMember = "SourceURI";
            cmbSource.SelectedIndex = 0;

            lstChannelList.DataSource = _ChannelList;
        }
开发者ID:BackupTheBerlios,项目名称:dufftv-svn,代码行数:29,代码来源:Prefs.cs

示例3: SendGCM

        public static void SendGCM(String planeId, Boolean state)
        {
            String currentDateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
            SqlParameter planeIdParam = new SqlParameter() { ParameterName = "@PlaneId", SqlDbType = SqlDbType.NVarChar, Value = planeId };
            String floorId = Convert.ToString(SqlHelper.ExecuteScalar(CommandType.Text, "SELECT [FKFloor] FROM [dbo].[Charge] WHERE [FKPlaneId][email protected]", new SqlParameter[] { planeIdParam }));
            if (!String.IsNullOrEmpty(floorId))
            {
                SqlParameter floorIdParam = new SqlParameter() { ParameterName = "@FloorId", SqlDbType = SqlDbType.NVarChar, Value = floorId };
                SqlParameter stateParam = new SqlParameter() { ParameterName = "@FloorState", SqlDbType = SqlDbType.Bit, Value = state };
                SqlParameter dateTimeParam = new SqlParameter() { ParameterName = "@StateChangedDate", SqlDbType = SqlDbType.NVarChar, Value = currentDateTime };
                SqlHelper.ExecuteScalar(CommandType.Text, "UPDATE [dbo].[Floor] SET [FloorState][email protected], [StateChangedDate] = @StateChangedDate WHERE [FloorId] = @FloorId", new SqlParameter[] { stateParam, dateTimeParam, floorIdParam });

                DataSet accountResult = SqlHelper.ExecuteDataSet(CommandType.Text, "SELECT [FKAccount] FROM [dbo].[Register] WHERE [FKFloor][email protected]", new SqlParameter[] { floorIdParam });
                int accountRows = accountResult.Tables[0].Rows.Count;
                for (int i = 0; i < accountRows; i++)
                {
                    String account = accountResult.Tables[0].Rows[i].ItemArray[0].ToString();
                    SqlParameter accountParam = new SqlParameter() { ParameterName = "@Account", SqlDbType = SqlDbType.NVarChar, Value = account };
                    DataSet phoneIdResult = SqlHelper.ExecuteDataSet(CommandType.Text, "SELECT [PhoneRegistId] FROM [dbo].[MemberMultiValue] WHERE [FKAccount][email protected]", new SqlParameter[] { accountParam });
                    int idRows = phoneIdResult.Tables[0].Rows.Count;
                    for (int j = 0; j < idRows; j++)
                    {
                        Debug.WriteLine(phoneIdResult.Tables[0].Rows[j].ItemArray[0].ToString());
                        AndroidGcmNotificationer gcmSender = new AndroidGcmNotificationer();
                        gcmSender.SendNotification(account, phoneIdResult.Tables[0].Rows[j].ItemArray[0].ToString(), state.ToString());
                    }
                }
            }
        }
开发者ID:WindAzure,项目名称:AutoCopter,代码行数:29,代码来源:Commands.cs

示例4: autosaveProjects

        public static void autosaveProjects(Boolean save, RClient client, String uri)
        {
            StringBuilder data = new StringBuilder();

            //create the input String
            data.Append(Constants.FORMAT_JSON);
            data.Append("&enable=" + save.ToString().ToLower());
            //call the server
            JSONResponse jresponse = HTTPUtilities.callRESTPost(uri, data.ToString(), ref client);
        }
开发者ID:myers-github,项目名称:dotnet-client-library,代码行数:10,代码来源:RUserProjectImpl.cs

示例5: GetUserAccounts

		// Accounts - NEW
		public string GetUserAccounts(int page = 1, int limit = 25, Boolean all_accounts = false)
		{
			var sb = new StringBuilder();

			sb.Append("?page=" + page);

			if (limit > 1000) limit = 1000;
			sb.Append("&limit=" + limit);

			sb.Append("&all_accounts=" + all_accounts.ToString());

			return JsonRequest(URL_BASE + "accounts" + sb.ToString(), GET);
		}
开发者ID:destenson,项目名称:Coinbase.NET,代码行数:14,代码来源:Connector.cs

示例6: save

        public void save(string PC, string Android, Boolean clean, Boolean syncPlaylists, string iTunesLib)
        {
            System.IO.StreamWriter cfg = new System.IO.StreamWriter(cfg_filename);

            string[] lines = new string[5];
            lines[0] = "PC=" + PC;
            lines[1] = "Android=" + Android;
            lines[2] = "Clean_Sync=" + clean.ToString();
            lines[3] = "Sync_Playlists=" + syncPlaylists.ToString();
            lines[4] = "iTunesXML=" + iTunesLib;

            foreach (string element in lines) cfg.WriteLine(element);

            cfg.Close();
        }
开发者ID:atai92,项目名称:iTunes-Android-Sync,代码行数:15,代码来源:config.cs

示例7: GetGallery

 /// <summary>
 /// 
 /// </summary>
 /// <param name="section">hot | top | user     - defaults to hot</param>
 /// <param name="sort">viral | top | time | rising (only available with user section)      - defaults to viral</param>
 /// <param name="Viral">true | false     - Show or hide viral images from the 'user' section. Defaults to true</param>
 /// <param name="Page">integer - the data paging number</param>
 /// <param name="OAuth">OAuth Token - For user authentication</param>
 /// <returns></returns>
 public JsonObject GetGallery(String section,String sort, Boolean Viral, Int32 Page, String OAuth =null )
 {
     HttpClient client = GetHttpClient(OAuth);
     
     string URI = BaseURL;
     URI += "gallery/" + section + "/" + sort + "/" + Page + ".json";
     if (section == "user")
     {
             URI += "showViral=" + Viral.ToString();
     }              
     var jsonStr = client.GetStringAsync(URI).Result;
     JsonObject json = new JsonObject();
     JsonObject.TryParse(jsonStr, out json);
     return json;
    // throw new Exception("Method not implemented yet");
 }
开发者ID:ninijay,项目名称:Wingur,代码行数:25,代码来源:BLImgurAPI.cs

示例8: Init

    public void Init(HttpApplication application)
    {
        EventLog.WriteEntry(sSource, "HTTP Module registration", EventLogEntryType.Information);

        EventLog.WriteEntry(sSource, "Loading configuration from file:" + AssemblyDirectory + "\\EUMInjection.dll");
        EventLog.WriteEntry(sSource, "HTTP Post Request", EventLogEntryType.Information);
        Configuration appConfig = ConfigurationManager.OpenExeConfiguration(AssemblyDirectory+ "\\EUMInjection.dll");

        reference = Convert.ToBoolean(appConfig.AppSettings.Settings["Reference"].Value);
        uri = Convert.ToString(appConfig.AppSettings.Settings["AdrumURI"].Value);

        EventLog.WriteEntry(sSource, "Reference:" + reference.ToString());
        EventLog.WriteEntry(sSource, "URI:" + uri);

        application.PostRequestHandlerExecute += (new EventHandler(Application_PostRequest));
    }
开发者ID:soickm,项目名称:AppDynamics-EUMInjection,代码行数:16,代码来源:EUMInjectionModule.cs

示例9: ProcessTransaction

        protected PayfirmaTransactionResponse ProcessTransaction(String type, PayfirmaCredentials credentials, Double amount, String transactionId, Boolean isTest)
        {
            PayfirmaTransactionResponse payfirmaResponse = new PayfirmaTransactionResponse();
            var webClient = new WebClient();

            NameValueCollection requestData = new NameValueCollection();
            requestData.Add("key", credentials.APIKey);
            requestData.Add("merchant_id", credentials.MerchantID);
            requestData.Add("amount", amount.ToString());
            requestData.Add("test_mode", isTest.ToString().ToLower());
            requestData.Add("do_not_store", "true");

            if (type.ToLower() != "refund" && type.ToLower() != "capture")
            {
                payfirmaResponse.Error = "Payfirma Invalid Transaction Type : " + type;
                return payfirmaResponse;
            }

            if (String.IsNullOrEmpty(transactionId))
            {
                payfirmaResponse.Error = "Payfirma Invalid Transaction ID";
                return payfirmaResponse;
            }

            String url = this.GetPayfirmaURL() + "/" + type.ToLower() + "/" + transactionId;

            try
            {
                var webResponseByte = webClient.UploadValues(url, "POST", requestData);
                var webResponse = Encoding.ASCII.GetString(webResponseByte);

                if (!String.IsNullOrEmpty(webResponse))
                {
                    payfirmaResponse = this.HandleTransacitonResponse(webResponse);
                }
                else
                {
                    payfirmaResponse.Error = "Payfirma unknown error";
                }
            }
            catch (Exception e)
            {
                payfirmaResponse.Error = "Payfirma Error: " + e.Message;
            }

            return payfirmaResponse;
        }
开发者ID:bentolila,项目名称:payfirma-ecommerce-c-sharp,代码行数:47,代码来源:PayfirmaBase.cs

示例10: CreateMetadataRequest

        public RestRequest CreateMetadataRequest(String path, String root, String hash, Boolean list, Boolean include_deleted)
        {
            var request = new RestRequest(Method.GET);
            request.Resource = "{version}/metadata/{root}{path}";
            request.AddParameter("version", _version, ParameterType.UrlSegment);
            request.AddParameter("path", path, ParameterType.UrlSegment);
            request.AddParameter("root", root, ParameterType.UrlSegment);

            if (list)
            {
                request.AddParameter("hash", hash);
                request.AddParameter("list", list.ToString().ToLower());
                request.AddParameter("include_deleted", include_deleted.ToString().ToLower());
            }

            return request;
        }
开发者ID:fischerth,项目名称:DropNet,代码行数:17,代码来源:RequestHelper.cs

示例11: GetBool

 public Boolean GetBool(XmlNode parentNode, String id, Boolean default_val)
 {
     XmlNode nd = FindChildElement(parentNode, id);
     Boolean result;
     if (nd == null)
     {
         AddParameter(parentNode, id, default_val.ToString());
         return default_val;
     }
     try
     {
         result = Boolean.Parse(nd.InnerText);
     }
     catch (Exception)
     {
         LogParamErr(parentNode, id, "True or False");
         result = default_val;
     }
     return result;
 }
开发者ID:kakaka2013,项目名称:UVDLPSlicerController,代码行数:20,代码来源:XmlHelper.cs

示例12: listScripts

        public static List<RRepositoryScript> listScripts(String filename, String directory, Boolean archived, Boolean sharedUsers, Boolean published, Boolean external, String categoryFilter, RClient client, String uri)
        {
            StringBuilder data = new StringBuilder();

            //create the input String
            data.Append(Constants.FORMAT_JSON);
            data.Append("&filename=" + HttpUtility.UrlEncode(filename));
            data.Append("&directory=" + HttpUtility.UrlEncode(directory));
            data.Append("&archived=" + archived.ToString());
            data.Append("&shared=" + sharedUsers.ToString());
            data.Append("&published=" + published.ToString());
            data.Append("&external=" + external.ToString());
            data.Append("&categoryFilter=" + HttpUtility.UrlEncode(categoryFilter));

            JSONResponse jresponse = HTTPUtilities.callRESTGet(uri, data.ToString(), ref client);

            List<RRepositoryScript> returnValue = new List<RRepositoryScript>();

            if (!(jresponse.JSONMarkup["repository"] == null))
            {
                JObject jrepo = jresponse.JSONMarkup["repository"].Value<JObject>();
                if (!(jrepo["scripts"] == null))
                {
                    JArray jvalues = jrepo["scripts"].Value<JArray>();
                    foreach (var j in jvalues)
                    {
                        if (j.Type != JTokenType.Null)
                        {
                            returnValue.Add(new RRepositoryScript(new JSONResponse(j.Value<JObject>(), true, "", 0), client));
                        }
                    }
                }
            }

            return returnValue;
        }
开发者ID:myers-github,项目名称:dotnet-client-library,代码行数:36,代码来源:RUserRepositoryScriptImpl.cs

示例13: ToSqlString

		// Simple Types
		//
		/// <summary>Converts the value from <c>Boolean</c> to an equivalent <c>SqlString</c> value.</summary>
		public static SqlString ToSqlString(Boolean         p) { return p.ToString();                                                                     }
开发者ID:titolarz,项目名称:bltoolkit,代码行数:4,代码来源:Convert.generated.cs

示例14: DispatchPropertyUpdate

        /** When the socket reader receives a property update from runtime, it decodes object ID
         * property ID and the new value of the property. It then calls this method of
         * the target object, to update the new value in property cache. After updating the cache,
         * this method then fires appropriate event in skype.events to notify the UI of what has happened.
         * DispatchPropertyUpdate is executed in the socket reader thread.
         */
        internal override void DispatchPropertyUpdate(uint propId, object value, bool hasValue)
        {
            switch (propId)
            {
            case 972: /* Conversation.P_IDENTITY */
                cache[0] = hasValue; // if no value - invalidate cache
                if (hasValue)
                {
                    cache_identity = (String)value;
                    if (skypeRef.logging) skypeRef.Log("Conversation.P_IDENTITY = " + cache_identity.ToString());
                }
                else if (skypeRef.logging) skypeRef.Log("Conversation.P_IDENTITY - update without value");
                skypeRef.events.FireOnConversationIdentity(this, cache_identity);
                break;

            case 902: /* Conversation.P_TYPE */
                cache[1] = hasValue; // if no value - invalidate cache
                if (hasValue)
                {
                    cache_type = (SktConversation.TYPE)value;
                    if (skypeRef.logging) skypeRef.Log("Conversation.P_TYPE = " + cache_type.ToString());
                }
                else if (skypeRef.logging) skypeRef.Log("Conversation.P_TYPE - update without value");
                skypeRef.events.FireOnConversationType(this, cache_type);
                break;

            case 918: /* Conversation.P_LIVE_HOST */
                cache[2] = hasValue; // if no value - invalidate cache
                if (hasValue)
                {
                    cache_live_host = (String)value;
                    if (skypeRef.logging) skypeRef.Log("Conversation.P_LIVE_HOST = " + cache_live_host.ToString());
                }
                else if (skypeRef.logging) skypeRef.Log("Conversation.P_LIVE_HOST - update without value");
                skypeRef.events.FireOnConversationLiveHost(this, cache_live_host);
                break;

            case 974: /* Conversation.P_LIVE_START_TIMESTAMP */
                cache[3] = hasValue; // if no value - invalidate cache
                if (hasValue)
                {
                    cache_live_start_timestamp = (uint)value;
                    if (skypeRef.logging) skypeRef.Log("Conversation.P_LIVE_START_TIMESTAMP = " + cache_live_start_timestamp.ToString());
                }
                else if (skypeRef.logging) skypeRef.Log("Conversation.P_LIVE_START_TIMESTAMP - update without value");
                skypeRef.events.FireOnConversationLiveStartTimestamp(this, skypeRef.UnixTimestampToDateTime(cache_live_start_timestamp));
                break;

            case 996: /* Conversation.P_LIVE_IS_MUTED */
                cache[4] = hasValue; // if no value - invalidate cache
                if (hasValue)
                {
                    cache_live_is_muted = (Boolean)value;
                    if (skypeRef.logging) skypeRef.Log("Conversation.P_LIVE_IS_MUTED = " + cache_live_is_muted.ToString());
                }
                else if (skypeRef.logging) skypeRef.Log("Conversation.P_LIVE_IS_MUTED - update without value");
                skypeRef.events.FireOnConversationLiveIsMuted(this, cache_live_is_muted);
                break;

            case 920: /* Conversation.P_ALERT_STRING */
                cache[5] = hasValue; // if no value - invalidate cache
                if (hasValue)
                {
                    cache_alert_string = (String)value;
                    if (skypeRef.logging) skypeRef.Log("Conversation.P_ALERT_STRING = " + cache_alert_string.ToString());
                }
                else if (skypeRef.logging) skypeRef.Log("Conversation.P_ALERT_STRING - update without value");
                skypeRef.events.FireOnConversationAlertString(this, cache_alert_string);
                break;

            case 921: /* Conversation.P_IS_BOOKMARKED */
                cache[6] = hasValue; // if no value - invalidate cache
                if (hasValue)
                {
                    cache_is_bookmarked = (Boolean)value;
                    if (skypeRef.logging) skypeRef.Log("Conversation.P_IS_BOOKMARKED = " + cache_is_bookmarked.ToString());
                }
                else if (skypeRef.logging) skypeRef.Log("Conversation.P_IS_BOOKMARKED - update without value");
                skypeRef.events.FireOnConversationIsBookmarked(this, cache_is_bookmarked);
                break;

            case 925: /* Conversation.P_GIVEN_DISPLAYNAME */
                cache[7] = hasValue; // if no value - invalidate cache
                if (hasValue)
                {
                    cache_given_displayname = (String)value;
                    if (skypeRef.logging) skypeRef.Log("Conversation.P_GIVEN_DISPLAYNAME = " + cache_given_displayname.ToString());
                }
                else if (skypeRef.logging) skypeRef.Log("Conversation.P_GIVEN_DISPLAYNAME - update without value");
                skypeRef.events.FireOnConversationGivenDisplayname(this, cache_given_displayname);
                break;

            case 924: /* Conversation.P_DISPLAYNAME */
                cache[8] = hasValue; // if no value - invalidate cache
//.........这里部分代码省略.........
开发者ID:nosilence,项目名称:jira-skype-app,代码行数:101,代码来源:skt_skypekit_2010.cs

示例15: SetValue

 private void SetValue(string key, Boolean value)
 {
     SetValue(key, value.ToString());
 }
开发者ID:djmurray,项目名称:NzbDrone,代码行数:4,代码来源:ConfigProvider.cs


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