Here are the examples of the csharp api class System.Convert.ToBoolean(object) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
200 Examples
0
1. Example
Project: TraceLab
Source File: Converters.cs
Source File: Converters.cs
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { return System.Convert.ToBoolean(value) ? Visibility.Visible : (parameter != null && ((string)parameter) == "Hidden" ? Visibility.Hidden : Visibility.Collapsed); }
0
2. Example
Project: GameCloud.Orleans
Source File: _Custom.cs
Source File: _Custom.cs
static Boolean va_arg( object[] ap, Boolean sysType ) { return Convert.ToBoolean( ap[vaNEXT++] ); }
0
3. Example
Project: GameCloud.Orleans
Source File: _Custom.cs
Source File: _Custom.cs
static Boolean va_arg( object[] ap, Boolean sysType ) { return Convert.ToBoolean( ap[vaNEXT++] ); }
0
4. Example
Project: CsharpSQLite
Source File: SQLiteDataReader.cs
Source File: SQLiteDataReader.cs
public override bool GetBoolean(int i) { return Convert.ToBoolean(((object[])rows[current_row])[i]); }
0
5. Example
Project: CsharpSQLite
Source File: _Custom.cs
Source File: _Custom.cs
static Boolean va_arg(object[] ap, Boolean sysType) { return Convert.ToBoolean(ap[vaNEXT++]); }
0
6. Example
Project: TidyTabs-VisualStudio
Source File: Extensions.cs
Source File: Extensions.cs
private static bool IsWindowPinned(this IVsWindowFrame frame) { object result; frame.GetProperty((int)__VSFPROPID5.VSFPROPID_IsPinned, out result); return Convert.ToBoolean(result); }
0
7. Example
Project: Extend
Source File: Object.ToBoolean.cs
Source File: Object.ToBoolean.cs
[PublicAPI] [Pure] public static Boolean ToBoolean( [CanBeNull] this Object obj ) => Convert.ToBoolean( obj );
0
8. Example
Project: Dopamine
Source File: LoveConverter.cs
Source File: LoveConverter.cs
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { bool isLoved = System.Convert.ToBoolean(value); return isLoved ? Visibility.Visible : Visibility.Collapsed; }
0
9. Example
Project: Dopamine
Source File: LoveConverter.cs
Source File: LoveConverter.cs
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { bool isLoved = System.Convert.ToBoolean(value); return isLoved ? Visibility.Collapsed : Visibility.Visible; }
0
10. Example
Project: Dnn.Platform
Source File: Null.cs
Source File: Null.cs
public static bool SetNullBoolean(object objValue) { return objValue != DBNull.Value ? Convert.ToBoolean(objValue) : NullBoolean; }
0
11. Example
Project: Dnn.Platform
Source File: jQuery.cs
Source File: jQuery.cs
private static bool GetSettingAsBoolean(string key, bool defaultValue) { bool retValue = defaultValue; try { object setting = HttpContext.Current.Items[key]; if (setting != null) { retValue = Convert.ToBoolean(setting); } } catch (Exception ex) { Exceptions.LogException(ex); } return retValue; }
0
12. Example
Project: Dnn.Platform
Source File: FileInfo.cs
Source File: FileInfo.cs
public void Fill(IDataReader dr) { ContentType = Null.SetNullString(dr["ContentT/n ..... /n //View Source file for more details /n }
0
13. Example
Project: Dnn.Platform
Source File: SettingsEditorControl.cs
Source File: SettingsEditorControl.cs
protected override bool GetRowVisibility(object obj) { var info = (SettingInfo) obj; bool _IsVisible = true; if ((Visibility != null) && (Visibility[info.Name] != null)) { _IsVisible = Convert.ToBoolean(Visibility[info.Name]); } return _IsVisible; }
0
14. Example
Project: api
Source File: Decimal_BigInteger.cs
Source File: Decimal_BigInteger.cs
bool IConvertible.ToBoolean (IFormatProvider provider) { return Convert.ToBoolean (this); }
0
15. Example
Project: digitsquare
Source File: _Custom.cs
Source File: _Custom.cs
static Boolean va_arg( object[] ap, Boolean sysType ) { return Convert.ToBoolean( ap[vaNEXT++] ); }
0
16. Example
Project: BehaviorIsManaged
Source File: BoolToStatus.cs
Source File: BoolToStatus.cs
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { return System.Convert.ToBoolean(value) ? "Running" : "Stopped"; }
0
17. Example
Project: BehaviorIsManaged
Source File: IsEquipedBoolConverter.cs
Source File: IsEquipedBoolConverter.cs
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { if (!( value is bool )) return null; return System.Convert.ToBoolean(value) ? "Equipped" : "In inventory"; }
0
18. Example
Project: InnovatorAdmin
Source File: ExprQuery.cs
Source File: ExprQuery.cs
internal override object GetValue(XPathReader reader) { object ret = this.opnd1.GetValue(reader); if (Convert.ToBoolean(ret) == false) { ret = this.opnd2.GetValue(reader); } #if DEBUG1 Console.WriteLine("OrExpr: {0}", ret); #endif return ret; }
0
19. Example
Project: InnovatorAdmin
Source File: ExprQuery.cs
Source File: ExprQuery.cs
internal override object GetValue(XPathReader reader) { object ret = this.opnd1.GetValue(reader); if (Convert.ToBoolean(ret) == true) { ret = this.opnd2.GetValue(reader); } return ret; }
0
20. Example
Project: NCache
Source File: ConfigConverter.cs
Source File: ConfigConverter.cs
private static PerfCounters GetPerfCounters(Hashtable settings) { PerfCounters perCounters = new PerfCounters(); perCounters.Enabled = Convert.ToBoolean(settings["perf-counters"]); return perCounters; }
0
21. Example
Project: vsSolutionBuildEvent
Source File: VersionFrm.cs
Source File: VersionFrm.cs
private void save(StepFields s) { foreach(DataGridViewRow row in dgvFields.Rows) { s.items[row.Index].disabled = !Convert.ToBoolean(row.Cells[dgvFieldsEnabled.Name].Value); s.items[row.Index].newname = (string)row.Cells[dgvFieldsNameNew.Name].Value; } }
0
22. Example
Project: nemiro.oauth.dll
Source File: UniValue.cs
Source File: UniValue.cs
[EditorBrowsable(EditorBrowsableState.Never)] public bool ToBoolean(IFormatProvider provider) { if (!this.HasValue) { return false; } return Convert.ToBoolean(this.Data); }
0
23. Example
Project: YAMP
Source File: EvaluationVisitor.cs
Source File: EvaluationVisitor.cs
public override void Visit(TernaryExpression expression) { // Evaluates the left expression and saves the value expression.LeftExpression.Accept(this); bool left = Convert.ToBoolean(Result); if (left) { expression.MiddleExpression.Accept(this); } else { expression.RightExpression.Accept(this); } }
0
24. Example
Project: fluentcassandra
Source File: BigDecimal.cs
Source File: BigDecimal.cs
bool IConvertible.ToBoolean(IFormatProvider provider) { return Convert.ToBoolean(this); }
0
25. Example
Project: FinalesFunkeln
Source File: YamlFile.cs
Source File: YamlFile.cs
public bool GetBoolean(string key) { return Convert.ToBoolean(this[key]); }
0
26. Example
Project: SyncUtil
Source File: GUIUtil.cs
Source File: GUIUtil.cs
static object FieldFuncBool(object v, ref string unparsedStr, params GUILayoutOption[] options) { return GUILayout.Toggle(Convert.ToBoolean(v), "", options); }
0
27. Example
Project: openPDC
Source File: ConfigurationTypeScreen.xaml.cs
Source File: ConfigurationTypeScreen.xaml.cs
private void UpdateDatabaseRadioButtonContent() { if (m_state != null && Convert.ToBoolean(m_state["existing"])) m_databaseRadioButton.Content = "Database"; else m_databaseRadioButton.Content = "Database (suggested)"; }
0
28. Example
Project: openPDC
Source File: OracleDatabaseSetupScreen.xaml.cs
Source File: OracleDatabaseSetupScreen.xaml.cs
private void AdminUserNameTextBox_TextChanged(object sender, TextChangedEventArgs e) { string adminUserName = m_adminUserNameTextBox.Text; bool existing = Convert.ToBoolean(m_state["existing"]); bool migrate = existing && Convert.ToBoolean(m_state["updateConfiguration"]); m_oracleSetup.AdminUserName = adminUserName; if (existing && !migrate) m_oracleSetup.SchemaUserName = adminUserName; }
0
29. Example
Project: openPDC
Source File: OracleDatabaseSetupScreen.xaml.cs
Source File: OracleDatabaseSetupScreen.xaml.cs
private void AdminPasswordTextBox_PasswordChanged(object sender, RoutedEventArgs e) { string adminPassword = m_adminPasswordTextBox.Password; bool existing = Convert.ToBoolean(m_state["existing"]); bool migrate = existing && Convert.ToBoolean(m_state["updateConfiguration"]); m_oracleSetup.AdminPassword = adminPassword; if (existing && !migrate) m_oracleSetup.SchemaPassword = adminPassword; }
0
30. Example
Project: openPDC
Source File: PostgresDatabaseSetupScreen.xaml.cs
Source File: PostgresDatabaseSetupScreen.xaml.cs
private void AdminUserNameTextBox_TextChanged(object sender, TextChangedEventArgs e) { if ((object)m_state != null) { string adminUserName = m_adminUserNameTextBox.Text; bool existing = Convert.ToBoolean(m_state["existing"]); bool migrate = existing && Convert.ToBoolean(m_state["updateConfiguration"]); m_postgresSetup.AdminUserName = adminUserName; if (existing && !migrate) m_postgresSetup.RoleName = adminUserName; } }
0
31. Example
Project: openPDC
Source File: PostgresDatabaseSetupScreen.xaml.cs
Source File: PostgresDatabaseSetupScreen.xaml.cs
private void AdminPasswordTextBox_PasswordChanged(object sender, RoutedEventArgs e) { bool existing = Convert.ToBoolean(m_state["existing"]); bool migrate = existing && Convert.ToBoolean(m_state["updateConfiguration"]); m_postgresSetup.AdminPassword = m_adminPasswordTextBox.SecurePassword; if (existing && !migrate) m_postgresSetup.RolePassword = m_adminPasswordTextBox.SecurePassword; }
0
32. Example
Project: openHistorian
Source File: ConfigurationTypeScreen.xaml.cs
Source File: ConfigurationTypeScreen.xaml.cs
private void UpdateDatabaseRadioButtonContent() { if (m_state != null && Convert.ToBoolean(m_state["existing"])) m_databaseRadioButton.Content = "Database"; else m_databaseRadioButton.Content = "Database (suggested)"; }
0
33. Example
Project: openHistorian
Source File: OracleDatabaseSetupScreen.xaml.cs
Source File: OracleDatabaseSetupScreen.xaml.cs
private void AdminUserNameTextBox_TextChanged(object sender, TextChangedEventArgs e) { string adminUserName = m_adminUserNameTextBox.Text; bool existing = Convert.ToBoolean(m_state["existing"]); bool migrate = existing && Convert.ToBoolean(m_state["updateConfiguration"]); m_oracleSetup.AdminUserName = adminUserName; if (existing && !migrate) m_oracleSetup.SchemaUserName = adminUserName; }
0
34. Example
Project: openHistorian
Source File: OracleDatabaseSetupScreen.xaml.cs
Source File: OracleDatabaseSetupScreen.xaml.cs
private void AdminPasswordTextBox_PasswordChanged(object sender, RoutedEventArgs e) { string adminPassword = m_adminPasswordTextBox.Password; bool existing = Convert.ToBoolean(m_state["existing"]); bool migrate = existing && Convert.ToBoolean(m_state["updateConfiguration"]); m_oracleSetup.AdminPassword = adminPassword; if (existing && !migrate) m_oracleSetup.SchemaPassword = adminPassword; }
0
35. Example
Project: openHistorian
Source File: PostgresDatabaseSetupScreen.xaml.cs
Source File: PostgresDatabaseSetupScreen.xaml.cs
private void AdminUserNameTextBox_TextChanged(object sender, TextChangedEventArgs e) { if ((object)m_state != null) { string adminUserName = m_adminUserNameTextBox.Text; bool existing = Convert.ToBoolean(m_state["existing"]); bool migrate = existing && Convert.ToBoolean(m_state["updateConfiguration"]); m_postgresSetup.AdminUserName = adminUserName; if (existing && !migrate) m_postgresSetup.RoleName = adminUserName; } }
0
36. Example
Project: openHistorian
Source File: PostgresDatabaseSetupScreen.xaml.cs
Source File: PostgresDatabaseSetupScreen.xaml.cs
private void AdminPasswordTextBox_PasswordChanged(object sender, RoutedEventArgs e) { bool existing = Convert.ToBoolean(m_state["existing"]); bool migrate = existing && Convert.ToBoolean(m_state["updateConfiguration"]); m_postgresSetup.AdminPassword = m_adminPasswordTextBox.SecurePassword; if (existing && !migrate) m_postgresSetup.RolePassword = m_adminPasswordTextBox.SecurePassword; }
0
37. Example
Project: byteflood
Source File: NullableToNonNullableConverter.cs
Source File: NullableToNonNullableConverter.cs
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { try { return System.Convert.ToBoolean(value); } catch { return false; } }
0
38. Example
Project: byteflood
Source File: PieceViewConverter.cs
Source File: PieceViewConverter.cs
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { if (System.Convert.ToBoolean(value)) { return Brushes.Red; } else { return Brushes.Black; } }
0
39. Example
Project: BetterEntityFramework
Source File: QueryableDataReader.cs
Source File: QueryableDataReader.cs
public override bool GetBoolean(int ordinal) { return Convert.ToBoolean(this[ordinal]); }
0
40. Example
Project: RestDb
Source File: Common.cs
Source File: Common.cs
public static bool IsTrue(bool? val) { if (val == null) return false; return Convert.ToBoolean(val); }
0
41. Example
Project: KOS
Source File: Opcode.cs
Source File: Opcode.cs
public override void Execute(ICpu cpu) { // This may look like it's just pointlessly converting from a // ScalarBoolean to a primitive boolean and then back into a // ScalarBoolean, and in the case where the operand was already // a ScalarBoolean that would be true. But the purpose of this opcode // is to also change integers and floats into booleans. Thus the call to // Convert.ToBoolean(): object value = cpu.PopValueArgument(); bool result = Convert.ToBoolean(value); cpu.PushArgumentStack(Structure.FromPrimitive(result)); }
0
42. Example
Project: storage-server
Source File: Common.cs
Source File: Common.cs
public static bool IsTrue(bool? val) { if (val == null) return false; return Convert.ToBoolean(val); }
0
43. Example
Project: PureJSB
Source File: JSB_System_Convert.cs
Source File: JSB_System_Convert.cs
static bool Convert_ToBoolean__Object(JSVCall vc, int argc) { int len = argc; if (len == 1) { System.Object arg0 = (System.Object)JSMgr.datax.getWhatever((int)JSApi.GetType.Arg); JSApi.setBooleanS((int)JSApi.SetType.Rval, (System.Boolean)(System.Convert.ToBoolean(arg0))); } return true; }
0
44. Example
Project: FileHelpers
Source File: ConvertHelpers.cs
Source File: ConvertHelpers.cs
public override string FieldToString(object from) { bool b = Convert.ToBoolean(from); if (b) { if (mTrueString == null) return "True"; else return mTrueString; } else if (mFalseString == null) return "False"; else return mFalseString; }
0
45. Example
Project: MatterControl
Source File: _Custom.cs
Source File: _Custom.cs
private static Boolean va_arg(object[] ap, Boolean sysType) { return Convert.ToBoolean(ap[vaNEXT++]); }
0
46. Example
Project: candor-common
Source File: DataRecordExtensions.cs
Source File: DataRecordExtensions.cs
public static bool GetBoolean(object fieldValue, bool defaultValue) { if (fieldValue == DBNull.Value || fieldValue == null) return defaultValue; else return Convert.ToBoolean(fieldValue); }
0
47. Example
Project: graphql-dotnetcore
Source File: GraphQLBoolean.cs
Source File: GraphQLBoolean.cs
protected override GraphQLValue GetAst(object value, ISchemaRepository schemaRepository) { if (value is int) value = Convert.ToBoolean(value); if (!(value is bool)) return null; var stringValue = (bool)value ? "true" : "false"; return new GraphQLScalarValue(ASTNodeKind.BooleanValue) { Value = stringValue }; }
0
48. Example
Project: UWPConversionMappings
Source File: BooleanToVisibilityConverter.cs
Source File: BooleanToVisibilityConverter.cs
public object Convert(object value, Type targetType, object parameter, string language) { var boolValue = System.Convert.ToBoolean(value); if(parameter != null) { boolValue = !boolValue; } return boolValue ? Visibility.Visible : Visibility.Collapsed; }
0
49. Example
Project: MultiversePlatform
Source File: RepositoryInstaller.cs
Source File: RepositoryInstaller.cs
bool IsTypeEnabled( string type ) { return Convert.ToBoolean( FilterFlags & m_TypeToFilterFlagMap[ type ] ); }
0
50. Example
Project: neolua
Source File: LuaGlobalPortable.cs
Source File: LuaGlobalPortable.cs
private static bool IsTrue(object value) { if (value == null) return false; else if (value is bool) return (bool)value; else try { return Convert.ToBoolean(value); } catch { return true; } }