示例#1
0
        private void TryLookupUnkownLinkType()
        {
            if (_url.StartsWith(SiteSettings.Instance.FilePath))
            {
                _currentType = LinkProperty.LinkType.File;
                return;
            }

            // TODO: Make a better lookup
            var pageId = PageFactory.GetPageIdFromUrl(_url);

            if (pageId != Guid.Empty)
            {
                _currentType = LinkProperty.LinkType.Page;
                return;
            }
        }
        private void ParsePostedValues() {
            _url = Request.QueryString["url"];
            var typeString = Request.QueryString["type"];
            int type;

            _url = StripLocalDomain(_url);

            if (int.TryParse(typeString, out type)) {
                _currentType = (LinkProperty.LinkType)type;
            }
            else {
                _currentType = LinkProperty.LinkType.Unknown;
            }

            if (_currentType == LinkProperty.LinkType.Unknown) {
                TryLookupUnkownLinkType();
            }
        }
示例#3
0
        private void ParsePostedValues()
        {
            _url = Request.QueryString["url"];
            var typeString = Request.QueryString["type"];
            int type;

            _url = StripLocalDomain(_url);

            if (int.TryParse(typeString, out type))
            {
                _currentType = (LinkProperty.LinkType)type;
            }
            else
            {
                _currentType = LinkProperty.LinkType.Unknown;
            }

            if (_currentType == LinkProperty.LinkType.Unknown)
            {
                TryLookupUnkownLinkType();
            }
        }
示例#4
0
 private void CreateCallback(string url, LinkProperty.LinkType linkType)
 {
     PostbackResult.Text = string.Format("<script> top.executeCallback('{0}', '{1}'); top.closeModal(); </script>", url, (int)linkType);
 }
        private void TryLookupUnkownLinkType() {
            if (_url.StartsWith(SiteSettings.Instance.FilePath)) {
                _currentType = LinkProperty.LinkType.File;
                return;
            }

            // TODO: Make a better lookup
            var pageId = PageFactory.GetPageIdFromUrl(_url);
            if (pageId != Guid.Empty) {
                _currentType = LinkProperty.LinkType.Page;
                return;
            }
        }