本文整理汇总了C#中IList.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# IList.ToString方法的具体用法?C# IList.ToString怎么用?C# IList.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IList
的用法示例。
在下文中一共展示了IList.ToString方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DeleteEntities
/// <summary>
/// Elimina entidades (usuarios o grupos) a la regla con el id especificado
/// </summary>
/// <param name="rule"></param>
/// <param name="entities"></param>
public static IObservable<Rule> DeleteEntities(Rule rule, IList<IEntity> entities)
{
if (rule.Id == null) throw new InvalidDataException("The provided rule must have an Id");
if (entities == null || entities.IsEmpty())
return Observable.Defer(() => Observable.Return(rule));
return RestEndpointFactory
.Create<IRulesEndpoint>(SessionManager.Instance.CurrentLoggedUser)
.DeleteEntities(rule.Id, entities.IsEmpty()
? "0"
: entities.ToString(e => e.Id)).ToObservable()
.SubscribeOn(ThreadPoolScheduler.Instance)
.InterpretingErrors();
}
示例2: Get
// GET: api/ArtistsAPI/5
public string Get(int id)
{
_artistsData = new List<Artists>();
var myThreat = new Thread(new ThreadStart(GetAllArtistsData));
myThreat.Start();
return _artistsData.ToString();
}
示例3: AddMembers
/// <summary>
/// Agrega miembros al grupo con el Id especificado
/// </summary>
/// <param name="userGroupId"></param>
/// <param name="members"></param>
/// <param name="callback"></param>
public static IObservable<Unit> AddMembers(string userGroupId, IList<User> members)
{
return RestEndpointFactory
.Create<IUserGroupsEndpoint>(SessionManager.Instance.CurrentLoggedUser)
.AddMembers(userGroupId,
members.ToString((u) => u.Username))
.ToObservable()
.SubscribeOn(TaskPoolScheduler.Default)
.InterpretingErrors();
}
示例4: ConvertTo_ReturnsFirstValue_WhenSequenceNeedsToConvertedToSingleValue
public void ConvertTo_ReturnsFirstValue_WhenSequenceNeedsToConvertedToSingleValue(IList value, object expected)
{
// Arrange
var valueProviderResult = new ValueProviderResult(value, value.ToString(), CultureInfo.InvariantCulture);
// Act
var convertedValue = valueProviderResult.ConvertTo(expected.GetType());
// Assert
Assert.Equal(expected, convertedValue);
}
示例5: Deserialize
/// <summary>
/// Deserialize the JSON string into a proper object.
/// </summary>
/// <param name="content">HTTP body (e.g. string, JSON).</param>
/// <param name="type">Object type.</param>
/// <param name="headers"></param>
/// <returns>Object representation of the JSON string.</returns>
public object Deserialize(string content, Type type, IList<Parameter> headers=null)
{
if (type == typeof(Object)) // return an object
{
return content;
}
if (type == typeof(Stream))
{
var filePath = String.IsNullOrEmpty(Configuration.TempFolderPath)
? Path.GetTempPath()
: Configuration.TempFolderPath;
var fileName = filePath + Guid.NewGuid();
if (headers != null)
{
var regex = new Regex(@"Content-Disposition:.*filename=['""]?([^'""\s]+)['""]?$");
var match = regex.Match(headers.ToString());
if (match.Success)
fileName = filePath + match.Value.Replace("\"", "").Replace("'", "");
}
File.WriteAllText(fileName, content);
return new FileStream(fileName, FileMode.Open);
}
if (type.Name.StartsWith("System.Nullable`1[[System.DateTime")) // return a datetime object
{
return DateTime.Parse(content, null, System.Globalization.DateTimeStyles.RoundtripKind);
}
if (type == typeof(String) || type.Name.StartsWith("System.Nullable")) // return primitive type
{
return ConvertType(content, type);
}
// at this point, it must be a model (json)
try
{
return JsonConvert.DeserializeObject(content, type);
}
catch (Exception e)
{
throw new ApiException(500, e.Message);
}
}
示例6: discoverDevices
/**
* Discovers and reports all remote XBee devices that match the supplied
* identifiers.
*
* <p>This method blocks until the configured timeout in the device (NT)
* expires.</p>
*
* @param ids List which contains the identifiers of the devices to be
* discovered.
*
* @return A list of the discovered remote XBee devices with the given
* identifiers.
*
* @throws InterfaceNotOpenException if the device is not open.
* @throws XBeeException if there is an error discovering the devices.
*
* @see #discoverDevice(String)
*/
public List<RemoteXBeeDevice> discoverDevices(IList<string> ids)/*throws XBeeException */{
// Check if the connection is open.
if (!xbeeDevice.IsOpen)
throw new InterfaceNotOpenException();
logger.DebugFormat("{0}ND for all {1} devices.", xbeeDevice.ToString(), ids.ToString());
running = true;
discovering = true;
performNodeDiscovery(null, null);
List<RemoteXBeeDevice> foundDevices = new List<RemoteXBeeDevice>(0);
if (deviceList == null)
return foundDevices;
XBeeNetwork network = xbeeDevice.GetNetwork();
foreach (RemoteXBeeDevice d in deviceList)
{
string nID = d.NodeID;
if (nID == null)
continue;
foreach (string id in ids)
{
if (nID.Equals(id))
{
RemoteXBeeDevice rDevice = network.addRemoteDevice(d);
if (rDevice != null && !foundDevices.Contains(rDevice))
foundDevices.Add(rDevice);
}
}
}
return foundDevices;
}
示例7: AlertUserBadChars
private void AlertUserBadChars(IList<string> badCharsInName)
{
MessageBox.Show("The following characters are invalid for use in names: " + badCharsInName.ToString(),
"Invalid characters", MessageBoxButton.OK);
}
示例8: GetDmDPC
private static DmDPC GetDmDPC(IList<int> list,string type)
{
DmDPC dto = new DmDPC();
dto.Id = list.ToString("");
dto.Number = list.ToString(" ");
dto.DaXiao = list.GetDaXiao(4);
dto.DanShuang = list.GetDanShuang();
dto.ZiHe = list.GetZiHe();
dto.Lu012 = list.GetLu012();
dto.He = list.GetHe();
dto.HeWei = dto.He.GetWei();
dto.DaCnt = dto.DaXiao.Count("1");
dto.XiaoCnt = dto.DaXiao.Count("0");
dto.DanCnt = dto.DanShuang.Count("1");
dto.ShuangCnt = dto.DanShuang.Count("0");
dto.ZiCnt = dto.ZiHe.Count("1");
dto.HeCnt = dto.ZiHe.Count("0");
dto.Lu0Cnt = dto.Lu012.Count("0");
dto.Lu1Cnt = dto.Lu012.Count("1");
dto.Lu2Cnt = dto.Lu012.Count("2");
dto.Ji = list.GetJi();
dto.JiWei = dto.Ji.GetWei();
dto.KuaDu = list.GetKuaDu();
dto.AC = list.GetAC();
dto.DaXiaoBi = list.GetDaXiaoBi(4);
dto.ZiHeBi = list.GetZiHeBi();
dto.DanShuangBi = list.GetDanShuangBi();
dto.Lu012Bi = list.GetLu012Bi();
dto.NumberType = type.Contains("C") ? dto.Id.GetNumberType() : type;
return dto;
}
示例9: Send
/// <summary>
/// Send calls to recipients through default campaign.
/// Use the API to quickly send individual calls.
/// A verified Caller ID and sufficient credits are required to make a call.
/// </summary>
/// <param name="recipients">call recipients</param>
/// <param name="campaignId">specify a campaignId to send calls quickly on a previously created campaign</param>
/// <param name="fields">limit fields returned. Example fields=id,name</param>
/// <returns>list with created call objects</returns>
/// <exception cref="BadRequestException"> in case HTTP response code is 400 - Bad request, the request was formatted improperly.</exception>
/// <exception cref="UnauthorizedException"> in case HTTP response code is 401 - Unauthorized, API Key missing or invalid.</exception>
/// <exception cref="AccessForbiddenException"> in case HTTP response code is 403 - Forbidden, insufficient permissions.</exception>
/// <exception cref="ResourceNotFoundException"> in case HTTP response code is 404 - NOT FOUND, the resource requested does not exist.</exception>
/// <exception cref="InternalServerErrorException"> in case HTTP response code is 500 - Internal Server Error.</exception>
/// <exception cref="CallfireApiException"> in case HTTP response code is something different from codes listed above.</exception>
/// <exception cref="CallfireClientException"> in case error has occurred in client.</exception>
public IList<Call> Send(IList<CallRecipient> recipients, long? campaignId = null, string fields = null)
{
Validate.NotBlank(recipients.ToString(), "recipients cannot be blank");
var queryParams = new List<KeyValuePair<string, object>>(2);
ClientUtils.AddQueryParamIfSet("campaignId", campaignId, queryParams);
ClientUtils.AddQueryParamIfSet("fields", fields, queryParams);
return Client.Post<ListHolder<Call>>(CALLS_PATH, recipients, queryParams).Items;
}
示例10: ProcessChatCommandBofhwitsdie
private void ProcessChatCommandBofhwitsdie(IrcClient client, IIrcMessageSource source,
IList<IIrcMessageTarget> targets, string command, IList<string> parameters)
{
client.LocalUser.SendNotice(targets, "You've killed me!");
ConsoleUtilities.WriteError("Killed by '{0}'. ({1} {2})", source.Name, command, parameters.ToString());
Stop();
}
示例11: NpdlException
public NpdlException(IList errorMsgs) : base(errorMsgs.ToString())
{
this.errorMsgs = errorMsgs;
}
示例12: UploadLocations
public String UploadLocations(IList<JsonLocation> locations)
{
Console.WriteLine(locations.ToString());
foreach (JsonLocation location in locations)
{
Location modelLocation = prepareLocation(location);
insertLocation(modelLocation);
}
return ("Locations uploaded successfully.");
}
示例13: discoverDevices
/*throws XBeeException */
/**
* Discovers and reports all remote XBee devices that match the supplied
* identifiers.
*
* <p>This method blocks until the configured timeout expires. To configure
* the discovery timeout, use the method {@link #setDiscoveryTimeout(long)}.
* </p>
*
* <p>To configure the discovery options, use the
* {@link #setDiscoveryOptions(Set)} method.</p>
*
* @param ids List which contains the identifiers of the devices to be
* discovered.
*
* @return A list of the discovered remote XBee devices with the given
* identifiers.
*
* @throws ArgumentException if {@code ids.size() == 0}.
* @throws InterfaceNotOpenException if the device is not open.
* @throws ArgumentNullException if {@code ids == null}.
* @throws XBeeException if there is an error discovering the devices.
*
* @see #discoverDevice(String)
* @see RemoteXBeeDevice
*/
public List<RemoteXBeeDevice> discoverDevices(IList<string> ids)
{
if (ids == null)
throw new ArgumentNullException("List of device identifiers cannot be null.");
if (ids.Count == 0)
throw new ArgumentException("List of device identifiers cannot be empty.");
logger.DebugFormat("{0}Discovering all '{1}' devices.", localDevice.ToString(), ids.ToString());
return nodeDiscovery.discoverDevices(ids);
}