• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# Bookmark类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Bookmark的典型用法代码示例。如果您正苦于以下问题:C# Bookmark类的具体用法?C# Bookmark怎么用?C# Bookmark使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Bookmark类属于命名空间,在下文中一共展示了Bookmark类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: Run

        public static void Run()
        {
            // ExStart:AddChildBookmark
            // The path to the documents directory.
            string dataDir = RunExamples.GetDataDir_AsposePdfFacades_Bookmarks();
            // Create bookmarks
            Aspose.Pdf.Facades.Bookmarks bookmarks = new Aspose.Pdf.Facades.Bookmarks();
            Bookmark childBookmark1 = new Bookmark();
            childBookmark1.PageNumber = 1;
            childBookmark1.Title = "First Child";
            Bookmark childBookmark2 = new Bookmark();
            childBookmark2.PageNumber = 2;
            childBookmark2.Title = "Second Child";

            bookmarks.Add(childBookmark1);
            bookmarks.Add(childBookmark2);

            Bookmark bookmark = new Bookmark();
            bookmark.Action = "GoTo";
            bookmark.PageNumber = 1;
            bookmark.Title = "Parent";

            bookmark.ChildItems = bookmarks;

            // Create PdfBookmarkEditor class
            PdfBookmarkEditor bookmarkEditor = new PdfBookmarkEditor();
            // Bind PDF document
            bookmarkEditor.BindPdf(dataDir+ "AddChildBookmark.pdf");
            // Create bookmarks
            bookmarkEditor.CreateBookmarks(bookmark);
            // Save updated document
            bookmarkEditor.Save(dataDir+ "AddChildBookmark_out.pdf");
            // ExEnd:AddChildBookmark
        }
开发者ID:aspose-pdf,项目名称:Aspose.Pdf-for-.NET,代码行数:34,代码来源:AddChildBookmark.cs


示例2: Add

        public void Add(string title, string url, string description, string snapshotBase64String, IEnumerable<Tag> tags, Website website, string userId)
        {
            var bookmark = new Bookmark
            {
                Description = description,
                UserId = userId,
                Title = title,
                Url = url,
                SnapshotBase64String = snapshotBase64String

            };

            //check for existing website
            var existingWebsite = websiteService.GetWebsiteByName(website.Name, userId).FirstOrDefault();
            if (existingWebsite != null)
            {
                bookmark.WebSite = existingWebsite;
            }
            else
            {
                var websiteToAdd = new Website
                {
                    Name = website.Name,
                    FaviconBase64String = website.FaviconBase64String
                };

                bookmark.WebSite = website;
            }

            AddTags(bookmark, tags, userId);

            this.bookmarks.Add(bookmark);
            this.bookmarks.SaveChanges();
        }
开发者ID:HristoIgnev,项目名称:Bookmarks,代码行数:34,代码来源:BookmarksService.cs


示例3: Continue

        private void Continue(NativeActivityContext context, Bookmark bookmark, object obj)
        {
            var args = (object[])obj;
            var userID = (int)args[0];
            UserID.Set(context, userID);

            var result = 0;
            var id = ID.Get(context);
            var item = ProjectProcessService.GetById(id);
            ProjectProcessService.LoadReference(item, i => i.Owner);
            var appraisalResult = ProjectProcessService.GetAppraisalResult(item);
            var userCount = UserService.Count();

            if (appraisalResult.Item1 + appraisalResult.Item2 < userCount * 0.8)//投票人数未达到所有人的 80%
            {
                result = 0;
            }
            else
            {
                if (appraisalResult.Item1 > appraisalResult.Item2 * 2)//同意的人数大于不同意人数的两倍
                {
                    result = 1;
                    InboxService.Create(UserRoleEnum.全员, item.ID, RedirectType.项目流程查看, InboxService.APPRAISAL_FINISH_PROCESS_PROJECT, item.ID.ToString(), appraisalResult.Item1.ToString(), appraisalResult.Item2.ToString(), "通过", item.Owner.NickName);
                    InboxService.Create(UserRoleEnum.运营组成员, item.ID, RedirectType.项目流程处理, InboxService.DESIGN_PROCESS_PROJECT, item.ID.ToString(), item.Owner.NickName);
                }
                else
                {
                    result = -1;
                    InboxService.Create(UserRoleEnum.全员, item.ID, RedirectType.项目流程查看, InboxService.APPRAISAL_FINISH_PROCESS_PROJECT, item.ID.ToString(), appraisalResult.Item1.ToString(), appraisalResult.Item2.ToString(), "不通过", item.Owner.NickName);
                }
            }
            Rusult.Set(context, result);
        }
开发者ID:dozer47528,项目名称:Flying-Studio-OA-System,代码行数:33,代码来源:Appraisal.cs


示例4: OnCancelTimer

 protected override void OnCancelTimer(Bookmark bookmark)
 {
     lock (this.ThisLock)
     {
         this.RegisteredTimers.RemoveTimer(bookmark);
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:7,代码来源:DurableTimerExtension.cs


示例5: ExprNodeAssignment

 // Constructor
 public ExprNodeAssignment(Bookmark bookmark, ExprNode lhs, ExprNode rhs, Token op)
     : base(bookmark)
 {
     Lhs = lhs;
     Rhs = rhs;
     Op = op;
 }
开发者ID:blyry,项目名称:MiniME,代码行数:8,代码来源:ExprNodeAssignment.cs


示例6: AddBookmark

    public static void AddBookmark(string username, string title, string url, string[] tags, string notes)
    {
        //Console.WriteLine("{0} {1} {2} {3} {4}", username, title, url, string.Join(", ", tags), notes);

        BookmarksEntities context = new BookmarksEntities();

        Bookmark newBookmark = new Bookmark();
        newBookmark.User = CreateOrLoadUser(context, username);
        newBookmark.Title = title;
        newBookmark.URL = url;
        newBookmark.Notes = notes;

        foreach (var tagName in tags)
        {
            Tag tag = CreateOrLoadTag(context, tagName);
            newBookmark.Tags.Add(tag);
        }

        //dopulnitelnite tagotve------------------------
        //string[] titleTags = Regex.Split(title, @"\W+");
        string[] titleTags = Regex.Split(title, @"[,'!\. ;?-]+");
        foreach (var titleTagName in titleTags)
        {
            Tag titleTag = CreateOrLoadTag(context, titleTagName);
            newBookmark.Tags.Add(titleTag);
        }
        //dopulnitelnite tagotve-----------------------

        context.Bookmarks.Add(newBookmark);
        context.SaveChanges();
    }
开发者ID:Jarolim,项目名称:AllMyHomeworkForTelerikAcademy,代码行数:31,代码来源:BookmarksDAL.cs


示例7: BookmarkWorkItem

 // This ctor is only used by subclasses which make their own determination about no persist or not
 protected BookmarkWorkItem(BookmarkCallbackWrapper callbackWrapper, Bookmark bookmark, object value)
     : base(callbackWrapper.ActivityInstance)
 {
     this.callbackWrapper = callbackWrapper;
     this.bookmark = bookmark;
     this.state = value;
 }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:8,代码来源:BookmarkWorkItem.cs


示例8: Main

        public static void Main()
        {
            // The path to the documents directory.
            string dataDir = Path.GetFullPath("../../../Data/");
            //create bookmarks
            Bookmarks bookmarks = new Bookmarks();
            Bookmark childBookmark1 = new Bookmark();
            childBookmark1.PageNumber = 1;
            childBookmark1.Title = "First Child";
            Bookmark childBookmark2 = new Bookmark();
            childBookmark2.PageNumber = 2;
            childBookmark2.Title = "Second Child";

            bookmarks.Add(childBookmark1);
            bookmarks.Add(childBookmark2);

            Bookmark bookmark = new Bookmark();
            bookmark.Action = "GoTo";
            bookmark.PageNumber = 1;
            bookmark.Title = "Parent";

            bookmark.ChildItems = bookmarks;

            //create PdfBookmarkEditor class
            PdfBookmarkEditor bookmarkEditor = new PdfBookmarkEditor();
            //bind PDF document
            bookmarkEditor.BindPdf(dataDir+ "input.pdf");
            //create bookmarks
            bookmarkEditor.CreateBookmarks(bookmark);
            //save updated document
            bookmarkEditor.Save(dataDir+ "output.pdf");
        }
开发者ID:Ravivishnubhotla,项目名称:Aspose_Pdf_NET,代码行数:32,代码来源:Program.cs


示例9: OnBookmarkCallback

        private void OnBookmarkCallback(NativeActivityContext context, Bookmark bookmark)
        {
            var log = context.Resolve<ILoggerFactory>() != null
                    ? context.Resolve<ILoggerFactory>().Create(typeof(SubProcess))
                    : null;
            var parser = context.Resolve<IScriptParser>();
            var extension = context.GetExtension<DataFieldExtension>();

            //完成规则解析
            if (this.Result != null
                && parser != null
                && this.FinishRule != null
                && this.FinishRule.Count > 0)
            {
                foreach (var i in this.FinishRule)
                    if (parser.EvaluateRule(i.Value, extension))
                    {
                        this.Result.Set(context, i.Key);
                        if (log != null)
                            log.InfoFormat("SubProcess节点完成规则“{0}”测试通过,将进入节点“{1}”", i.Value, i.Key);
                        break;
                    }
            }
            //所有逻辑完成才可删除,若上述逻辑失败则将此书签用于错误恢复
            context.RemoveBookmark(bookmark);
        }
开发者ID:jatinbhole,项目名称:NTFE-BPM,代码行数:26,代码来源:SubProcess.cs


示例10: AppendBookmarkedText

        /// <summary>
        /// Copies content of the bookmark and adds it to the end of the specified node.
        /// The destination node can be in a different document.
        /// </summary>
        /// <param name="importer">Maintains the import context </param>
        /// <param name="srcBookmark">The input bookmark</param>
        /// <param name="dstNode">Must be a node that can contain paragraphs (such as a Story).</param>
        private static void AppendBookmarkedText(NodeImporter importer, Bookmark srcBookmark, CompositeNode dstNode)
        {
            // This is the paragraph that contains the beginning of the bookmark.
            Paragraph startPara = (Paragraph)srcBookmark.BookmarkStart.ParentNode;

            // This is the paragraph that contains the end of the bookmark.
            Paragraph endPara = (Paragraph)srcBookmark.BookmarkEnd.ParentNode;

            if ((startPara == null) || (endPara == null))
                throw new InvalidOperationException("Parent of the bookmark start or end is not a paragraph, cannot handle this scenario yet.");

            // Limit ourselves to a reasonably simple scenario.
            if (startPara.ParentNode != endPara.ParentNode)
                throw new InvalidOperationException("Start and end paragraphs have different parents, cannot handle this scenario yet.");

            // We want to copy all paragraphs from the start paragraph up to (and including) the end paragraph,
            // therefore the node at which we stop is one after the end paragraph.
            Node endNode = endPara.NextSibling;

            // This is the loop to go through all paragraph-level nodes in the bookmark.
            for (Node curNode = startPara; curNode != endNode; curNode = curNode.NextSibling)
            {
                // This creates a copy of the current node and imports it (makes it valid) in the context
                // of the destination document. Importing means adjusting styles and list identifiers correctly.
                Node newNode = importer.ImportNode(curNode, true);

                // Now we simply append the new node to the destination.
                dstNode.AppendChild(newNode);
            }
        }
开发者ID:robv8r,项目名称:Aspose_Words_NET,代码行数:37,代码来源:CopyBookmarkedText.cs


示例11: AddBookmarks

        public static void AddBookmarks(string username, string title, string url, string[] tags, string notes)
        {
            var dbCon = new BookmarksEntities();

            using (dbCon)
            {
                var bookmark = new Bookmark();
                bookmark.Notes = notes;
                bookmark.URL = url;
                bookmark.Title = title;

                bookmark.User = CreateOrLoadUser(dbCon, username);

                foreach (var tagName in tags)
                {
                    var tag = CreateOrLoadTag(dbCon, tagName);

                    bookmark.Tags.Add(tag);
                }

                var titleTags = Regex.Split(title, @"[ ,-\.;!?]+");

                foreach (var titleTag in titleTags)
                {
                    var tag = CreateOrLoadTag(dbCon, titleTag);

                    bookmark.Tags.Add(tag);
                }

                dbCon.Bookmarks.Add(bookmark);
                dbCon.SaveChanges();
            }
        }
开发者ID:aleks-todorov,项目名称:HomeWorks,代码行数:33,代码来源:BookmarksDAL.cs


示例12: MatchProgram

        private bool MatchProgram(Bookmark bookmark, FuzzyMatcher matcher)
        {
            if ((bookmark.Score = matcher.Evaluate(bookmark.Name).Score) > 0) return true;
            if ((bookmark.Score = matcher.Evaluate(bookmark.PinyinName).Score) > 0) return true;
            if ((bookmark.Score = matcher.Evaluate(bookmark.Url).Score / 10) > 0) return true;

            return false;
        }
开发者ID:Jackie-Innover,项目名称:Wox,代码行数:8,代码来源:Main.cs


示例13: Continue

        void Continue(NativeActivityContext context, Bookmark bookmark, object obj)
        {
            var eventArgs = obj as WorkflowNotificationEventArgs;
            if (eventArgs.NotificationType != WorkflowNotificationObserver.CONTENTCHANGEDNOTIFICATIONTYPE)
                return;

            InstanceManager.ReleaseWait(notificationId.Get(context));
        }
开发者ID:maxpavlov,项目名称:FlexNet,代码行数:8,代码来源:WaitForContentChanged.cs


示例14: CreateBookmark

 public static Bookmark CreateBookmark(int bookmarkId, int userId, int ordinal)
 {
     Bookmark bookmark = new Bookmark();
     bookmark.BookmarkId = bookmarkId;
     bookmark.UserId = userId;
     bookmark.Ordinal = ordinal;
     return bookmark;
 }
开发者ID:mbrit,项目名称:AmxMobile.Phone7.SixBookmarks-1.2,代码行数:8,代码来源:BookmarksClient.cs


示例15: AddDeclaration

 // Add another variable declaration
 public void AddDeclaration(Bookmark bookmark, string Name, ast.Expression InitialValue)
 {
     var v = new Variable();
     v.Bookmark = bookmark;
     v.Name = Name;
     v.InitialValue = InitialValue;
     Variables.Add(v);
 }
开发者ID:blyry,项目名称:MiniME,代码行数:9,代码来源:StatementVariableDeclaration.cs


示例16: AddSubProcess

 /// <summary>
 /// 添加子流程启动信息
 /// </summary>
 /// <param name="context"></param>
 /// <param name="referredBookmark"></param>
 /// <param name="activityName"></param>
 /// <param name="flowNodeIndex"></param>
 public void AddSubProcess(NativeActivityContext context, Bookmark referredBookmark, string activityName, int flowNodeIndex)
 {
     this._instances.Add(new SubProcessActivityInstance(context.WorkflowInstanceId
         , flowNodeIndex
         , context.ActivityInstanceId
         , activityName
         , referredBookmark.Name));
 }
开发者ID:jatinbhole,项目名称:NTFE-BPM,代码行数:15,代码来源:SubProcessExtension.cs


示例17: GetArticle

 /// <summary>
 /// Gets a specific article from a bookmark based on its href.
 /// </summary>
 /// <param name="bookmark">The bookmark that has the article to be returned.</param>
 /// <returns>The full article as a string. This is useful for immediately saving it.</returns>
 public async Task<Article> GetArticle(Bookmark bookmark)
 {
     var request = new RestRequest(bookmark.ArticleHref.Replace("/api/rest/v1", ""));
     var content = await ReadabilityClient.MakeRequestAsync(request).ConfigureAwait(false);
     var js = new StringReader(content);
     var jr = new JsonTextReader(js);
     var serializer = new JsonSerializer();
     return serializer.Deserialize<Article>(jr);
 }
开发者ID:now-readable,项目名称:readability-api,代码行数:14,代码来源:ArticleEndpoint.cs


示例18: Initialize

        private void Initialize()
        {
            // Create new map with a base map
            Map myMap = new Map(Basemap.CreateImageryWithLabels());

            // Set the map view, map property to the base map
            MyMapView.Map = myMap;

            // Create a set of predefined bookmarks; each one follows the pattern of:
            // ~ Initialize a viewpoint pointing to a latitude longitude
            // ~ Create a new bookmark
            // ~ Give the bookmark a name
            // ~ Assign the viewpoint
            // ~ Add the bookmark to bookmark collection of the map
            // ~ Add the bookmark to the UI combo box for the user to choose from 

            // Bookmark-1
            Viewpoint myViewpoint1 = new Viewpoint(27.3805833, 33.6321389, 6000);
            Bookmark myBookmark1 = new Bookmark();
            myBookmark1.Name = "Mysterious Desert Pattern";
            myBookmark1.Viewpoint = myViewpoint1;
            MyMapView.Map.Bookmarks.Add(myBookmark1);
            bookmarkChooser.Items.Add(myBookmark1);

            // Bookmark-2
            Viewpoint myViewpoint2 = new Viewpoint(37.401573, -116.867808, 6000);
            Bookmark myBookmark2 = new Bookmark();
            myBookmark2.Name = "Strange Symbol";
            myBookmark2.Viewpoint = myViewpoint2;
            MyMapView.Map.Bookmarks.Add(myBookmark2);
            bookmarkChooser.Items.Add(myBookmark2);

            // Bookmark-3
            Viewpoint myViewpoint3 = new Viewpoint(-33.867886, -63.985, 40000);
            Bookmark myBookmark3 = new Bookmark();
            myBookmark3.Name = "Guitar-Shaped Forest";
            myBookmark3.Viewpoint = myViewpoint3;
            MyMapView.Map.Bookmarks.Add(myBookmark3);
            bookmarkChooser.Items.Add(myBookmark3);

            // Bookmark-4
            Viewpoint myViewpoint4 = new Viewpoint(44.525049, -110.83819, 6000);
            Bookmark myBookmark4 = new Bookmark();
            myBookmark4.Name = "Grand Prismatic Spring";
            myBookmark4.Viewpoint = myViewpoint4;
            MyMapView.Map.Bookmarks.Add(myBookmark4);
            bookmarkChooser.Items.Add(myBookmark4);

            // Set the initial combo box selection to the lat bookmark added
            bookmarkChooser.SelectedItem = MyMapView.Map.Bookmarks.Last();

            // Zoom to the last bookmark
            myMap.InitialViewpoint = myMap.Bookmarks.Last().Viewpoint;

            // Hide the controls for adding an additional bookmark
            BorderAddBookmark.Visibility = Visibility.Collapsed;
        }
开发者ID:Esri,项目名称:arcgis-runtime-samples-dotnet,代码行数:57,代码来源:ManageBookmarks.xaml.cs


示例19: Initialize

 internal void Initialize(FolderWatcherExtension extension, Bookmark bookmark, string folder, string pattern, bool subfolders, string subscriberDisplayName)
 {
     if (this.IsInitialized)
     {
         throw new InvalidOperationException(String.Format(
             Properties.Resources.SubscriptionHandleAlreadyInitialized, subscriberDisplayName));
     }
     this.Id = extension.Subscribe(bookmark, folder, pattern, subfolders);
 }
开发者ID:miguelhasse,项目名称:Workflow-Activities,代码行数:9,代码来源:FileChangeSubscriptionHandle.cs


示例20: ResumeBookmark

 /// <summary>
 /// Used to resume bookmark outside workflow.
 /// </summary>
 /// <param name="bookmark">The value of Bookmark to be resumed</param>
 public void ResumeBookmark(Bookmark bookmark)
 {
     // This method is necessary due to CSDMain 223257.
     IAsyncResult asyncResult = this.instance.BeginResumeBookmark(bookmark, null, Fx.ThunkCallback(new AsyncCallback(StateMachineExtension.OnResumeBookmarkCompleted)), this.instance);
     if (asyncResult.CompletedSynchronously)
     {
         this.instance.EndResumeBookmark(asyncResult);
     }
 }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:13,代码来源:StateMachineExtension.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Bool类代码示例发布时间:2022-05-24
下一篇:
C# Booking类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap