Example #1
0
        public static void RedirectTo(
            System.Web.HttpResponse InResponse,
            IPageProperties InToPage, RedirectParms InParms)
        {
            bool   bArgs  = false;
            string subDir = InToPage.GetPageDirPath( );

            // Build the full path name needed to redirect to this page relative to the
            // current page ( the from page )
            System.Text.StringBuilder url = new System.Text.StringBuilder(256);
            if (subDir != null)
            {
                url.Append(subDir + "/");
            }
            url.Append(InToPage.GetPageFileName( ));

            // add the querystring parms.
            if (InParms.IsNotEmpty)
            {
                if (bArgs == false)
                {
                    url.Append("?" + InParms.QueryString);
                }
                else
                {
                    url.Append("&" + InParms.QueryString);
                }
                bArgs = true;
            }

            // redirect to the page.
            InResponse.Redirect(url.ToString());
        }
Example #2
0
        public Page(IFlags flags, IPageProperties properties, IElementFactory elementFactory) : base(flags)
        {
            this.flags          = flags;
            this.properties     = properties;
            this.elementFactory = elementFactory;
            this.frame          = (IFrame)Global.FrameProvider.CreateFrame(FrameType.Frame, GenerateFrameName("GHD_DocumentPage"));
            this.frame.SetWidth(this.properties.Width);
            this.frame.SetHeight(this.properties.Height);

            var texture = this.frame.CreateTexture();

            texture.SetAllPoints(this.frame);
            texture.SetTexture(0.1, 0.1, 0.1);

            this.AppendChild(elementFactory.CreateLine(flags));
            this.FirstChild.Object.Region.SetPoint(FramePoint.TOPLEFT, this.frame, FramePoint.TOPLEFT, this.properties.EdgeLeft, -this.properties.EdgeTop);
        }
Example #3
0
        // calc the sub directory needed when redirecting from this page to another page.
        public static string CalcRedirectDirPath(
            IPageProperties InPageProperties, string InToPageDirPath)
        {
            string DirPath;
            string FromPageDirPath = InPageProperties.GetPageDirPath( );

            if ((FromPageDirPath == null) && (InToPageDirPath == null))
            {
                DirPath = null;
            }
            else if (FromPageDirPath == null)
            {
                DirPath = InToPageDirPath;
            }

            // to page in the appl root. add ".." to the relative page for each directory
            // in the from page dirpath. ( have to unwind 1 or more directory levels )
            else if (InToPageDirPath == null)
            {
                StringBuilder sb = new StringBuilder();
                int           Cx = Text.Stringer.Talley(FromPageDirPath, new char[] { '/', '\\' });
                ++Cx;
                for (int Ix = 0; Ix < Cx; ++Ix)
                {
                    if (sb.Length > 0)
                    {
                        sb.Append("/");
                    }
                    sb.Append("..");
                }
                DirPath = sb.ToString();
            }

            else if (FromPageDirPath.ToLower() == InToPageDirPath.ToLower())
            {
                DirPath = null;
            }
            else
            {
                DirPath = "../" + InToPageDirPath;
            }
            return(DirPath);
        }
 public static string GetPageTitle(IPageProperties that) => that.Value <string>("pageTitle");
Example #5
0
 public ElementFactory(ITextScoper textScoper, IElementFrameFactory elementFrameFactory, IPageProperties pageProperties)
 {
     this.textScoper          = textScoper;
     this.elementFrameFactory = elementFrameFactory;
     this.pageProperties      = pageProperties;
 }