Here are the examples of the csharp api class string.Format(System.IFormatProvider, string, params object[]) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
200 Examples
3
1. Example
View licensepublic string ToStringFull() { return string.Format("Room: '{0}' {1},{2} {4}/{3} players.\ncustomProps: {5}", this.nameField, this.visibleField ? "visible" : "hidden", this.openField ? "open" : "closed", this.maxPlayersField, this.PlayerCount, this.customPropertiesField.ToStringFull()); }
2
2. Example
View licenseprivate void UpdateDebugText() { if ( debugText ) { debugText.text = string.Format( "Linear: {0}\nAngle: {1}\n", linearMapping.value, outAngle ); } }
1
3. Example
View licensepublic new string ToStringFull() { return string.Format("Room: '{0}' {1},{2} {4}/{3} players.\ncustomProps: {5}", this.nameField, this.visibleField ? "visible" : "hidden", this.openField ? "open" : "closed", this.maxPlayersField, this.PlayerCount, this.CustomProperties.ToStringFull()); }
0
4. Example
View licensepublic override string Format(string viewName, string controllerName, string areaName, string theme) { return string.Format(CultureInfo.InvariantCulture, virtualPathFormatString, viewName, controllerName, areaName, theme); }
0
5. Example
View licensestatic ApplicationException AppExcept (string message, params object [] args) { return new ApplicationException (String.Format ( CultureInfo.InvariantCulture, message, args)); }
0
6. Example
View licensestatic uint GetGid (string group) { var info = new UnixGroupInfo (group); var gid = info.GroupId; if (gid > UInt32.MaxValue || gid <= 0) throw new ArgumentOutOfRangeException ("group", String.Format ("Gid for {0} ({1}) not in range for sgid", group, gid)); return (uint)gid; }
0
7. Example
View licenseprivate MongoAuthenticationException CreateException(IConnection connection, Exception ex) { var message = string.Format("Unable to authenticate username '{0}' on database '{1}'.", _credential.Username, _credential.Source); return new MongoAuthenticationException(connection.ConnectionId, message, ex); }
0
8. Example
View licenseprivate static string FormatMessage(ConnectionId connectionId, long cursorId) { return string.Format( "Cursor {0} not found on server {1} using connection {2}.", cursorId, EndPointHelper.ToString(connectionId.ServerId.EndPoint), connectionId.ServerValue); }
0
9. Example
View licensepublic static TimeSpan IsInfiniteOrGreaterThanZero(TimeSpan value, string paramName) { if (value == Timeout.InfiniteTimeSpan || value > TimeSpan.Zero) { return value; } var message = string.Format("Value is not infinite or greater than zero: {0}.", TimeSpanParser.ToString(value)); throw new ArgumentOutOfRangeException(paramName, message); }
0
10. Example
View licensepublic override string ToString() { return string.Format("{0}.DefaultIfEmpty()", _source.ToString()); }
0
11. Example
View licensepublic override string ToString() { return string.Format("{0}.Zip({1})", _source.ToString(), _other.ToString()); }
0
12. Example
View licensepublic override string ToString() { return string.Format("{0}.Sample({1})", _source.ToString(), _count.ToString()); }
0
13. Example
View licensepublic override string ToString() { return string.Format("{0}.Where({1})", _source.ToString(), _predicate.ToString()); }
0
14. Example
View licensestatic StackObject* Format_97(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack,/n ..... /n //View Source file for more details /n }
0
15. Example
View licensepublic static MethodInfo GetMethodInfo<T, TResult>(Expression<Func<T, TResult>> lambda) { Ensure.IsNotNull(lambda, nameof(lambda)); switch (lambda.Body.NodeType) { case ExpressionType.Call: return ((MethodCallExpression)lambda.Body).Method; } throw new MongoInternalException(string.Format("Unable to extract method info from {0}", lambda.Body.ToString())); }
0
16. Example
View licensepublic static void ValidValueE<T>(T value, string format, params object[] args) where T : class { if(null == value) throw new UnityException(string.Format(null, format, args)); }
0
17. Example
View licensepublic override RenderedFieldDefinition<TField> Render(IBsonSerializer<TDocument> documentSerializer, IBsonSerializerRegistry serializerRegistry) { var lambda = (LambdaExpression)PartialEvaluator.Evaluate(_expression); var bindingContext = new PipelineBindingContext(serializerRegistry); var parameterExpression = new DocumentExpression(documentSerializer); bindingContext.AddExpressionMapping(lambda.Parameters[0], parameterExpression); var bound = bindingContext.Bind(lambda.Body); bound = FieldExpressionFlattener.FlattenFields(bound); IFieldExpression field; if (!Linq.ExpressionHelper.TryGetExpression(bound, out field)) { var message = string.Format("Unable to determine the serialization information for {0}.", _expression); throw new InvalidOperationException(message); } var underlyingSerializer = field.Serializer; var fieldSerializer = underlyingSerializer as IBsonSerializer<TField>; var valueSerializer = (IBsonSerializer<TField>)FieldValueSerializerHelper.GetSerializerForValueType(underlyingSerializer, serializerRegistry, typeof(TField)); return new RenderedFieldDefinition<TField>(field.FieldName, fieldSerializer, valueSerializer, underlyingSerializer); }
0
18. Example
View licensepublic override string ToString() { return string.Format("{{ ClusterId : {0}, EndPoint : \"{1}\" }}", _clusterId, _endPoint); }
0
19. Example
View licensepublic override string ToString() { return string.Format("{0}.Union({1})", _source.ToString(), _other.ToString()); }
0
20. Example
View licensepublic override string ToString() { return string.Format("{0}.Take({1})", _source.ToString(), _count.ToString()); }
0
21. Example
View licensepublic override string ToString() { return string.Format("{0}({1})", _accumulatorType.ToString(), _argument == null ? "" : _argument.ToString()); }
0
22. Example
View licensepublic static TimeSpan IsInfiniteOrGreaterThanOrEqualToZero(TimeSpan value, string paramName) { if (value < TimeSpan.Zero && value != Timeout.InfiniteTimeSpan) { var message = string.Format("Value is not infinite or greater than or equal to zero: {0}.", TimeSpanParser.ToString(value)); throw new ArgumentOutOfRangeException(paramName, message); } return value; }
0
23. Example
View licenseprivate CursorBatch<TDocument> ProcessReply(ConnectionId connectionId, ReplyMessage<TDocument> reply) { if (reply.CursorNotFound) { throw new MongoCursorNotFoundException(connectionId, _cursorId, _query); } if (reply.QueryFailure) { var failureDocument = reply.QueryFailureDocument; var errorMessage = string.Format("GetMore QueryFailure: {0}.", failureDocument); throw ExceptionMapper.Map(connectionId, failureDocument) ?? new MongoQueryException(connectionId, errorMessage, _query, failureDocument); } return new CursorBatch<TDocument>(reply.CursorId, reply.Documents); }
0
24. Example
View licensepublic override string ToString() { return string.Format("{0}.GroupBy({1})", _source.ToString(), _keySelector.ToString()); }
0
25. Example
View licensepublic static void AssertE(bool bCondition, string format, params object[] args) { if (!bCondition) throw new UnityException(string.Format(null, format, args)); }
0
26. Example
View licensepublic override string ToString() { return string.Format("{0}.Intersect({1})", _source.ToString(), _other.ToString()); }
0
27. Example
View licensepublic static TimeSpan? IsNullOrInfiniteOrGreaterThanOrEqualToZero(TimeSpan? value, string paramName) { if (value.HasValue && value.Value < TimeSpan.Zero && value.Value != Timeout.InfiniteTimeSpan) { var message = string.Format("Value is not null or infinite or greater than or equal to zero: {0}.", TimeSpanParser.ToString(value.Value)); throw new ArgumentOutOfRangeException(paramName, message); } return value; }
0
28. Example
View licensepublic static string Label(ClusterId clusterId) { return string.Format("cluster[{0}]", clusterId.Value.ToString()); }
0
29. Example
View licensepublic override string ToString() { return string.Format("{0}.Concat({1})", _source.ToString(), _other.ToString()); }
0
30. Example
View licensepublic override string ToString() { return string.Format("{0}.GroupBy({1})", _source.ToString(), _selector.ToString()); }
0
31. Example
View licensepublic override string ToString() { if (_serverValue == null) { return string.Format("{{ ServerId : {0}, LocalValue : {1} }}", _serverId, _localValue); } else { return string.Format("{{ ServerId : {0}, LocalValue : {1}, ServerValue : \"{2}\" }}", _serverId, _localValue, _serverValue); } }
0
32. Example
View licenseprotected override Expression BindNonMethodCall(Expression node) { if (node.NodeType == ExpressionType.Constant && node.Type.GetTypeInfo().IsGenericType && node.Type.GetGenericTypeDefinition() == typeof(IMongoQueryable<>)) { var queryable = (IMongoQueryable)((ConstantExpression)node).Value; var provider = (IMongoQueryProvider)queryable.Provider; return new PipelineExpression( new CollectionExpression(provider.CollectionNamespace, provider.CollectionDocumentSerializer), new DocumentExpression(provider.CollectionDocumentSerializer)); } var message = string.Format("The expression tree is not supported: {0}", node.ToString()); throw new NotSupportedException(message); }
0
33. Example
View licensepublic override string ToString() { return string.Format("{0}.SelectMany({1})", _source.ToString(), _resultSelector.ToString()); }
0
34. Example
View licensepublic override string ToString() { return string.Format("{0}.Except({1})", _source.ToString(), _other.ToString()); }
0
35. Example
View licensepublic override string ToString() { return string.Format("ReadPreferenceServerSelector{{ ReadPreference = {0} }}", _readPreference); }
0
36. Example
View licenseprivate static string FormatMessage(ClusterDescription clusterDescription) { return string.Format( "This version of the driver is not compatible with one or more of the servers to which it is connected: {0}.", clusterDescription); }
0
37. Example
View licensepublic override RenderedFieldDefinition Render(IBsonSerializer<TDocument> documentSerializer, IBsonSerializerRegistry serializerRegistry) { var bindingContext = new PipelineBindingContext(serializerRegistry); var lambda = ExpressionHelper.GetLambda(PartialEvaluator.Evaluate(_expression)); var parameterExpression = new DocumentExpression(documentSerializer); bindingContext.AddExpressionMapping(lambda.Parameters[0], parameterExpression); var bound = bindingContext.Bind(lambda.Body); bound = FieldExpressionFlattener.FlattenFields(bound); IFieldExpression field; if (!ExpressionHelper.TryGetExpression(bound, out field)) { var message = string.Format("Unable to determine the serialization information for {0}.", _expression); throw new InvalidOperationException(message); } return new RenderedFieldDefinition(field.FieldName, field.Serializer); }
0
38. Example
View licensepublic override string ToString() { return string.Format("{0}@{1}", _identity.Username, _identity.Source); }
0
39. Example
View licensepublic override string ToString() { return string.Format("{0}.Select({1})", _source.ToString(), _selector.ToString()); }
0
40. Example
View licensepublic override string ToString() { return string.Format("{0}.Skip({1})", _source.ToString(), _count.ToString()); }
0
41. Example
View licensepublic override string ToString() { return string.Format("{0}.Distinct()", _source.ToString()); }
0
42. Example
View licensestatic StackObject* Format_99(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj) { ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain; StackObject* ptr_of_this_method; StackObject* __ret = ILIntepreter.Minus(__esp, 3); ptr_of_this_method = ILIntepreter.Minus(__esp, 1); System.Object[] args = (System.Object[])typeof(System.Object[]).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack)); __intp.Free(ptr_of_this_method); ptr_of_this_method = ILIntepreter.Minus(__esp, 2); System.String format = (System.String)typeof(System.String).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack)); __intp.Free(ptr_of_this_method); ptr_of_this_method = ILIntepreter.Minus(__esp, 3); System.IFormatProvider provider = (System.IFormatProvider)typeof(System.IFormatProvider).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack)); __intp.Free(ptr_of_this_method); var result_of_this_method = System.String.Format(provider, format, args); return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method); }
0
43. Example
View licenseinternal static MongoWaitQueueFullException ForConnectionPool(EndPoint endPoint) { var message = string.Format( "The wait queue for acquiring a connection to server {0} is full.", EndPointHelper.ToString(endPoint)); return new MongoWaitQueueFullException(message); }
0
44. Example
View licensepublic ISaslStep Initialize(IConnection connection, ConnectionDescription description) { Ensure.IsNotNull(connection, nameof(connection)); Ensure.IsNotNull(description, nameof(description)); var dataString = string.Format("\0{0}\0{1}", _credential.Username, _credential.GetInsecurePassword()); var bytes = Utf8Encodings.Strict.GetBytes(dataString); return new CompletedStep(bytes); }
0
45. Example
View licensepublic static MethodInfo GetMethodInfo<TResult>(Expression<Func<TResult>> lambda) { Ensure.IsNotNull(lambda, nameof(lambda)); switch (lambda.Body.NodeType) { case ExpressionType.Call: return ((MethodCallExpression)lambda.Body).Method; } throw new MongoInternalException(string.Format("Unable to extract method info from {0}", lambda.Body.ToString())); }
0
46. Example
View licensestatic StackObject* Format_98(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack,/n ..... /n //View Source file for more details /n }
0
47. Example
View licensepublic static TimeSpan IsGreaterThanOrEqualToZero(TimeSpan value, string paramName) { if (value < TimeSpan.Zero) { var message = string.Format("Value is not greater than or equal to zero: {0}.", TimeSpanParser.ToString(value)); throw new ArgumentOutOfRangeException(paramName, message); } return value; }
0
48. Example
View licensepublic static BsonType ReadBsonType(this BsonStream stream) { if (stream == null) { throw new ArgumentNullException("stream"); } var b = stream.ReadByte(); if (b == -1) { throw new EndOfStreamException(); } if (!__validBsonTypes[b]) { var message = string.Format("Detected unknown BSON type \"\\x{0:x2}\". Are you using the latest driver version?", b); throw new FormatException(message); } return (BsonType)b; }
0
49. Example
View licenseprivate void EnsureMemberMapIsForThisClass(BsonMemberMap memberMap) { if (memberMap.ClassMap != this) { var message = string.Format( "The memberMap argument must be for class {0}, but was for class {1}.", _classType.Name, memberMap.ClassMap.ClassType.Name); throw new ArgumentOutOfRangeException("memberMap", message); } }
0
50. Example
View licenseprivate static string ConvertVerbosityToString(ExplainVerbosity verbosity) { switch (verbosity) { case ExplainVerbosity.AllPlansExecution: return "allPlansExecution"; case ExplainVerbosity.ExecutionStats: return "executionStats"; case ExplainVerbosity.QueryPlanner: return "queryPlanner"; default: var message = string.Format("Unsupported explain verbosity: {0}.", verbosity.ToString()); throw new InvalidOperationException(message); } }