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


C# ICollection.Print方法代码示例

本文整理汇总了C#中ICollection.Print方法的典型用法代码示例。如果您正苦于以下问题:C# ICollection.Print方法的具体用法?C# ICollection.Print怎么用?C# ICollection.Print使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ICollection的用法示例。


在下文中一共展示了ICollection.Print方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: AddSnippetProperties

        public bool AddSnippetProperties(long snippetID, ICollection<SnippetProperty> properties)
        {
            if ((snippetID <= 0) || properties.IsNullOrEmpty())
            {
                SetLastError(log, ErrorCodes.WRONG_INPUT, 
                    string.Format("Input error: snippetID={0}, properties={1}", snippetID, properties.Print<SnippetProperty>()));
                return false;
            }

            //check input properties and clean them if not valid:
            List<SnippetProperty> cleanProperties = SnippetProperty.CleanPropertyList(properties, snippetID);

            //fastly return if no properties are to be added:
            if (cleanProperties.IsNullOrEmpty())
                return true;

            //send the request and parse the response:
            S2CSerializer ser = new S2CSerializer(m_serialFormat, snippetID);
            string contentToSend = "content=" + HttpUtility.UrlEncode(ser.SerializeBaseEntityList<SnippetProperty>(cleanProperties.ToArray(), null));
            S2CResObj<object> resp = SendReqObj(ADD_PROPERTIES_URL, contentToSend, true);

            //build the result:
            return ParseBoolResponse(resp);
        }
开发者ID:modulexcite,项目名称:snip2codeNET,代码行数:24,代码来源:SnippetsWS.cs

示例2: DeleteSnippetTags

        public bool DeleteSnippetTags(long snippetID, ICollection<string> tagsToDelete)
        {
            if ((snippetID <= 0) || tagsToDelete.IsNullOrEmpty())
            {
                SetLastError(log, ErrorCodes.WRONG_INPUT, 
                    string.Format("Input error: snippetID={0}, tags={1}", snippetID, tagsToDelete.Print<string>()));
                return false;
            }

            //send the request and parse the response:
            S2CSerializer ser = new S2CSerializer(m_serialFormat, snippetID);
            string contentToSend = "content=" + HttpUtility.UrlEncode(ser.SerializeListObj<string>(tagsToDelete.ToArray()));
            S2CResObj<object> resp = SendReqObj(DELETE_TAGS_URL, contentToSend, true);

            //build the result:
            return ParseBoolResponse(resp);
        }
开发者ID:modulexcite,项目名称:snip2codeNET,代码行数:17,代码来源:SnippetsWS.cs

示例3: FindChannelsItems

        public IList<Snippet> FindChannelsItems(int start, int count, ICollection<int> channelsIDs, out int totNum,
                ItemSortField field = ItemSortField.Relevance, SortDirection direction = SortDirection.Descent,
                bool findAllChannels = false)
        {
            //check for erroneous input:
            totNum = 0;
            if ((count <= 0) || (start < 0) || (channelsIDs.IsNullOrEmpty() && !findAllChannels))
            {
                SetLastError(log, ErrorCodes.WRONG_INPUT, string.Format("Input error: userID={0}, count={1}, start={2}, channelsIDs={3}",
                    CurrentUserID, count, start, channelsIDs.Print()));
                return new List<Snippet>();
            }

            //exec the SP:
            string search = string.Format("{0}={1}", DefaultProperty.Channel,
                (findAllChannels ? "*" : Utilities.MergeIntoCommaSeparatedString(channelsIDs, true)));
            Dictionary<string, string[]> misSpellings = null;
            int totNumWithNonDefOp = 0;
            SortedDictionary<string, int> tagsOccurrences = null; 
            return GetSnippetsForSearch(search, out misSpellings, out totNum, out totNumWithNonDefOp, out tagsOccurrences,
                        count, start, false, 0, field, direction);
        }
开发者ID:modulexcite,项目名称:snip2codeNET,代码行数:22,代码来源:SnippetsWS.cs


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