コード例 #1
0
        public static string GetTrace(GlobalValues globals)
        {
            StringBuilder sb  = new StringBuilder();
            int           sum = 0;

            sb.Append(SHOW_HIDE_SCRIPT);
            foreach (TraceStateUtils.TraceLevels level in Enum.GetValues(typeof(TraceStateUtils.TraceLevels)))
            {
                sb.Append(String.Format("<a href=\"{1}\">{0}</a> | ",
                                        Enum.GetName(typeof(TraceStateUtils.TraceLevels), level),
                                        globals.Page.Request.FilePath +
                                        globals.GetQueryString(new String[] { "TraceLevels=" + level })));
                sum += (int)level;
            }
            sb.Append(String.Format("<a href=\"{1}\">{0}</a> <br /> ",
                                    "ALL",
                                    globals.Page.Request.FilePath +
                                    globals.GetQueryString(new String[] { "TraceLevels=" + sum.ToString() })));

            sb.Append(PrintGridVisibleColumns(globals.Page));

            if ((globals.TraceLevels & TraceStateUtils.TraceLevels.qs)
                == TraceStateUtils.TraceLevels.qs)
            {
                sb.Append(PrintQuerystring().ToString());
            }

            if ((globals.TraceLevels & TraceStateUtils.TraceLevels.globals)
                == TraceStateUtils.TraceLevels.globals)
            {
                sb.Append(PrintGlobalValues(globals).ToString());
            }

            if ((globals.TraceLevels & TraceStateUtils.TraceLevels.session)
                == TraceStateUtils.TraceLevels.session)
            {
                sb.Append(PrintSession().ToString());
            }

            if ((globals.TraceLevels & TraceStateUtils.TraceLevels.sql)
                == TraceStateUtils.TraceLevels.sql)
            {
                sb.Append("<br />" + globals.TraceSql);
            }

            if ((globals.TraceLevels & TraceStateUtils.TraceLevels.graph)
                == TraceStateUtils.TraceLevels.graph)
            {
                sb.Append(PrintGraphProps(globals.Page));
            }

            if ((globals.TraceLevels & TraceStateUtils.TraceLevels.sort)
                == TraceStateUtils.TraceLevels.sort)
            {
                sb.Append(PrintSortProps(globals.Page));
            }

            return(sb.ToString());
        }
コード例 #2
0
        public static void associateCompareSelectedToOrgLevel(GlobalValues user, GlobalValues app)
        {
            //CompareSelected Overrides are propagated to the User Values so that Dialogues (ChooseSelected) can pick up overrides

            if (app.OrgLevel.Key == OrgLevelKeys.District &&
                app.CompareTo.Key == CompareToKeys.SelSchools)
            {
                user.CompareTo.Value = app.CompareTo.Value = app.CompareTo.Range[CompareToKeys.SelDistricts];
            }

            if (app.OrgLevel.Key == OrgLevelKeys.School &&
                app.CompareTo.Key == CompareToKeys.SelDistricts)
            {
                user.CompareTo.Value = app.CompareTo.Value = app.CompareTo.Range[CompareToKeys.SelSchools];
            }
        }
コード例 #3
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            WI.GlobalValues GV = ((PageBaseWI)Page).GlobalValues;

            System.Reflection.PropertyInfo propertyInfo = GV.GetType().
                                                          GetProperty(this.ParamName,
                                                                      System.Reflection.BindingFlags.GetProperty
                                                                      | System.Reflection.BindingFlags.Public
                                                                      | System.Reflection.BindingFlags.Instance
                                                                      | System.Reflection.BindingFlags.IgnoreCase);

            ((PageBaseWI)Page).SetNavigationLinkSelectedStatus(propertyInfo, this);

            if (Selected)
            {
                Visible = false;
            }

            Style.Add("white-space", "nowrap");
        }
コード例 #4
0
        private static StringBuilder PrintGlobalValues(GlobalValues globals)
        {
            System.Web.HttpRequest Request  = System.Web.HttpContext.Current.Request;
            StringBuilder          Response = new StringBuilder();

            Response.Append("<br />GLOBALVALUES:<br />");
            Response.Append(@"<a href=""javascript:ReverseDisplay('traceGlobals')"">Click to show/hide.</a>");
            Response.Append(@"<div id=""traceGlobals"" style=""display:none;"">");

            PropertyInfo[] propertyInfos;
            propertyInfos = typeof(GlobalValues).GetProperties();

            String msg;

            Array.Sort(propertyInfos,
                       delegate(PropertyInfo propertyInfo1, PropertyInfo propertyInfo2)
                       { return(propertyInfo1.Name.CompareTo(propertyInfo2.Name)); });

            for (int n = 0; n < propertyInfos.Length; n++)
            {
                msg = String.Empty;
                if (n != 0)
                {//extra line break between letters of the alphabet
                    try
                    {
                        if (propertyInfos[n - 1].Name.ToCharArray()[0]
                            != propertyInfos[n].Name.ToCharArray()[0])
                        {
                            msg = "<br />";
                        }
                    }
                    catch (NullReferenceException x) { msg = msg + x.Message; }
                }

                Response.Append(msg + "<br />" + propertyInfos[n].Name + " | ");

                try
                {
                    Response.Append(((ParameterValues)propertyInfos[n].GetValue(globals, null)).Value);
                }
                catch
                {
                    try
                    {
                        Response.Append(((int)propertyInfos[n].GetValue(globals, null)).ToString());
                    }
                    catch {
                        try
                        {
                            Response.Append(((string)propertyInfos[n].GetValue(globals, null)).ToString());
                        }
                        catch
                        {
                            Response.Append(propertyInfos[n].ToString());
                        }
                    }
                }
            }
            Response.Append(@"</div>");

            return(Response);
        }