本文整理汇总了C++中CBookmarkFolder::InsertBookmark方法的典型用法代码示例。如果您正苦于以下问题:C++ CBookmarkFolder::InsertBookmark方法的具体用法?C++ CBookmarkFolder::InsertBookmark怎么用?C++ CBookmarkFolder::InsertBookmark使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CBookmarkFolder
的用法示例。
在下文中一共展示了CBookmarkFolder::InsertBookmark方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: BookmarkItemAdded
void CIPBookmarkObserver::BookmarkItemAdded(void *pData,bool bFolder)
{
IPBookmarkAddedNotification_t *pipban = reinterpret_cast<IPBookmarkAddedNotification_t *>(pData);
/* TODO: Find the parent with the specified GUID. */
//pipban->guidParent
CBookmarkFolder *pParentBookmarkFolder = m_pAllBookmarks;
m_pipbns->SetIPBroadcast(false);
char *pSerializedData = reinterpret_cast<char *>(pData) + sizeof(IPBookmarkAddedNotification_t);
try
{
if(bFolder)
{
CBookmarkFolder BookmarkFolder = CBookmarkFolder::Unserialize(pSerializedData);
pParentBookmarkFolder->InsertBookmarkFolder(BookmarkFolder,pipban->uPosition);
}
else
{
CBookmark Bookmark(pSerializedData);
pParentBookmarkFolder->InsertBookmark(Bookmark,pipban->uPosition);
}
}
catch(int)
{
/* The actual content of the error here
is unimportant. May be needed in the
future if an error message will be shown
to the user. */
}
m_pipbns->SetIPBroadcast(true);
}
示例2: Bookmark
TEST(BookmarkTest,UpdateNotifications)
{
CBookmarkFolder BookmarkFolderParent = CBookmarkFolder::Create(L"Test");
CTestBookmarkItemNotifier *ptbn = new CTestBookmarkItemNotifier();
CBookmarkItemNotifier::GetInstance().AddObserver(ptbn);
CBookmark Bookmark(L"Test name",L"Test location",L"Test description");
BookmarkFolderParent.InsertBookmark(Bookmark);
Bookmark.SetName(L"New test folder name");
}