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


C# IList.ToString方法代码示例

本文整理汇总了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();
 }
开发者ID:diegoRodriguezAguila,项目名称:SGAM.Elfec.Admin,代码行数:18,代码来源:RulesManager.cs

示例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();
        }
开发者ID:JabsBCN,项目名称:MyRepository,代码行数:11,代码来源:ArtistsAPIController.cs

示例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();
 }
开发者ID:diegoRodriguezAguila,项目名称:SGAM.Elfec.Admin,代码行数:16,代码来源:UserGroupManager.cs

示例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);
        }
开发者ID:huangw-t,项目名称:aspnetwebstack,代码行数:11,代码来源:ValueProviderResultTest.cs

示例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);
            }
        }
开发者ID:VirtoCommerce,项目名称:vc-internal,代码行数:53,代码来源:ApiClient.cs

示例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;
		}
开发者ID:LordVeovis,项目名称:xbee-csharp-library,代码行数:54,代码来源:NodeDiscovery.cs

示例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);
 }
开发者ID:hmehart,项目名称:Notepad,代码行数:5,代码来源:RenameItem.xaml.cs

示例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;
        }
开发者ID:tomdeng,项目名称:gaopincai,代码行数:32,代码来源:ImportDmDPC.cs

示例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;
 }
开发者ID:CallFire,项目名称:callfire-api-client-csharp,代码行数:24,代码来源:CallsApi.cs

示例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();
 }
开发者ID:amauragis,项目名称:BofhDotNet,代码行数:7,代码来源:BofhBot.cs

示例11: NpdlException

		public NpdlException(IList errorMsgs) : base(errorMsgs.ToString())
		{
			this.errorMsgs = errorMsgs;
		}
开发者ID:qwinner,项目名称:NetBPM,代码行数:4,代码来源:NpdlException.cs

示例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.");
 }
开发者ID:dataware,项目名称:geostore,代码行数:10,代码来源:GeoStoreService.svc.cs

示例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);
        }
开发者ID:LordVeovis,项目名称:xbee-csharp-library,代码行数:37,代码来源:XBeeNetwork.cs


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