示例#1
0
        /// <summary>
        /// Get report settings from database or session (or generate default settings)
        /// </summary>
        JObject getJson(int id, string defaultTitle)
        {
            string  reportType = OriginalMethod.ToLower();
            dynamic json       = null;

            if ((PostParameters == null || PostParameters["json"] == null) && SessionData.Report != null)
            {
                json = SessionData.Report[reportType];
            }
            if (json == null || json.idReport != id || json.ReportType.ToString().ToLower() != reportType)
            {
                json = readReport(id, OriginalMethod, defaultTitle);
            }
            return(json);
        }
示例#2
0
        /// <summary>
        /// Set up any report
        /// </summary>
        /// <param name="json">The posted report parameters</param>
        void initialiseReport(JObject json)
        {
            string reportType = OriginalMethod.ToLower().Replace("save", "");

            Utils.Check(json.AsString("ReportType").ToLower() == reportType, "Invalid report type");
            dynamic r = SessionData.Report;

            if (r == null)
            {
                SessionData.Report = r = new JObject();
            }
            r[reportType] = json;
            _fields       = new List <DecimalField>();
            _series       = new List <ChartField>();
            _filters      = new List <Reports.Filter>();
        }
 public override MethodReference GetElementMethod()
 {
     return(OriginalMethod.GetElementMethod());
 }
示例#4
0
 static void MM_Init(object detour)
 {
     _original = detour.GenerateTrampolineEx <OriginalMethod>();
 }
示例#5
0
 public void CallOriginal(object _this, object[] _params)
 {
     Unhook();
     OriginalMethod.Invoke(_this, _params);
     ApplyHook();
 }
示例#6
0
 public OriginalMethodContainer(OriginalMethod contained) => origMethod = contained;