本文整理汇总了C#中ICollection.PrintNull方法的典型用法代码示例。如果您正苦于以下问题:C# ICollection.PrintNull方法的具体用法?C# ICollection.PrintNull怎么用?C# ICollection.PrintNull使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ICollection
的用法示例。
在下文中一共展示了ICollection.PrintNull方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: UnPublishSnippet
public bool UnPublishSnippet(long snippetID, ICollection<int> channelIDs)
{
// 1) check input validity:
if ((snippetID <= 0) || channelIDs.IsNullOrEmpty())
{
SetLastError(log, ErrorCodes.WRONG_INPUT, string.Format("Input error: snippetID={0}; channelIDs={1}", snippetID, channelIDs.PrintNull()));
return false;
}
// 2) remove the channels ID as a property of the snippet:
foreach (int channelID in channelIDs)
{
if (!DeleteSnippetProperty(new SnippetProperty(DefaultProperty.Channel, channelID + "", snippetID, false)))
return false;
}
return true;
}
示例2: PublishSnippet
public bool PublishSnippet(long snippetID, ICollection<int> channelIDs)
{
if ((snippetID <= 0) || channelIDs.IsNullOrEmpty())
{
SetLastError(log, ErrorCodes.WRONG_INPUT, string.Format("Input error: snippetID={0}; channelIDs={1}", snippetID, channelIDs.PrintNull()));
return false;
}
//send the request and parse the response:
string content = Utilities.MergeIntoCommaSeparatedString(channelIDs, true);
string contentToSend = string.Format("snippetID={0}&channelsIDs={1}", snippetID, content);
S2CResObj<object> resp = SendReqObj(PUBLISH_SNIPPET_URL, contentToSend, true);
//build the result:
return ParseBoolResponse(resp);
}