本文整理汇总了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;
}
示例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;
}
示例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());
}
}
}
}
示例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);
}
示例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);
}
示例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();
}
示例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");
}
示例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));
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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(); }
示例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
//.........这里部分代码省略.........
示例15: SetValue
private void SetValue(string key, Boolean value)
{
SetValue(key, value.ToString());
}