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


C# Controls.AddToHistory方法代码示例

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


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

示例1: DisplayEdit

        /// <summary>
        /// Display edit
        /// </summary>
        /// <param name="_edit"></param>
        /// <param name="BrowsingHistory"></param>
        /// <param name="browser"></param>
        public static void DisplayEdit(Edit _edit, bool BrowsingHistory = false, Controls.SpecialBrowser browser = null, bool ChangeEdit = true)
        {
            Core.History("Processing.DisplayEdit()");
            try
            {
                if (browser == null)
                {
                    browser = main._CurrentBrowser;
                }
                    if (_edit != null)
                    {
                        if (_edit._Page != null)
                        {
                            if (BrowsingHistory != true && browser.History.Count == 0 || (browser.History[0].Edit is Edit) == false)
                            {
                                browser.AddToHistory(new Core.HistoryItem(_edit));
                            }
                        }

                        if (main._CurrentBrowser == browser && ChangeEdit == true)
                        {
                            browser.Edit = _edit;
                            Program.MainForm.Set_Current_User(_edit._User);
                            Program.MainForm.Set_Current_Page(_edit._Page);
                        }

                        if (_edit._Deleted)
                        {

                        }
                        else if (_edit.Prev == Core.NullEdit)
                        {
                            Requests.request_read.browser_html_data BrowserRequest = new Requests.request_read.browser_html_data();
                            BrowserRequest.address = Core.SitePath() + "index.php?title=" + System.Web.HttpUtility.UrlEncode(_edit._Page.Name) + "&id=" + _edit.Id;
                            BrowserRequest.browser = browser;
                            BrowserRequest.Start();
                        }
                        else
                        {
                            if (_edit.DiffCacheState == Edit.CacheState.Viewed || _edit.DiffCacheState == Edit.CacheState.Cached)
                            {
                                if (_edit.Diff != null)
                                {
                                    string DocumentText = "", DiffText = "";
                                    DiffText = _edit.Diff;

                                    DiffText = DiffText.Replace("href=\"/wiki/", "href=\"" + Config.Projects[Config.Project] + "wiki/");
                                    DiffText = DiffText.Replace("href='/wiki/", "href='" + Config.Projects[Config.Project] + "wiki/");
                                    DiffText = DiffText.Replace("href=\"/w/", "href=\"" + Config.Projects[Config.Project] + "w/");
                                    DiffText = DiffText.Replace("href='/w/", "href='" + Config.Projects[Config.Project] + "w/");

                                    DocumentText = huggle3.Properties.Resources.header;
                                    DocumentText += DiffText;
                                    DocumentText += huggle3.Properties.Resources.footer;

                                    browser.DocumentText = DocumentText;

                                }
                                _edit.DiffCacheState = Edit.CacheState.Viewed;
                            }
                        }
                        if (_edit.DiffCacheState == Edit.CacheState.Uncached)
                        {
                            _edit.DiffCacheState = Edit.CacheState.Caching;
                            Requests.request_read.diff Request = new Requests.request_read.diff();
                            Request._Edit = _edit;
                            Request.browsertab = browser;
                            Request.Start();
                        }
                        Program.MainForm.Refresh_Interface();
                    }
                }
            catch (Exception ex)
            {
                Core.ExceptionHandler( ex );
            }
        }
开发者ID:justinwillcott,项目名称:huggle,代码行数:83,代码来源:Processing.cs


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