internal virtual void Reload(RM.API rm, ref double maxValue) { MeasureSkin = rm.GetSkin(); MeasureName = rm.GetMeasureName(); _xpath = rm.ReadString("XPath", null); RM.API.Log(RM.API.LogType.Debug, GetLogString("XPath=[{0}]", _xpath)); }
internal override void Reload(Rainmeter.API api, ref double maxValue) { base.Reload(api, ref maxValue); Name = api.GetMeasureName(); Skin = api.GetSkin(); Path = api.ReadString("Path", ""); Server = api.ReadString("Server", ""); Format = api.ReadString("Format", ""); }
internal virtual void Initialize(Rainmeter.API api) { Name = api.GetMeasureName(); Skin = api.GetSkin(); }
internal override void Reload(Rainmeter.API api, ref double maxValue) { base.Reload(api, ref maxValue); Name = api.GetMeasureName(); Skin = api.GetSkin(); ValueA = api.ReadInt("ValueA", 0); ValueB = api.ReadInt("ValueB", 0); ValueC = api.ReadInt("ValueC", 0); }
internal void Reload(Rainmeter.API api, ref double maxValue) { // Pointers / name this.Name = api.GetMeasureName(); this.Skin = api.GetSkin(); // Measure does the data refresh string reQuery = api.ReadString("ReQuery", string.Empty); if (reQuery.Equals("1") || reQuery.Equals("true", StringComparison.InvariantCultureIgnoreCase)) { this.ReQuery = true; } // Metric Type string type = api.ReadString("MetricType", string.Empty); switch (type.ToLowerInvariant()) { case "memory": case "mem": this.Type = MetricType.TopMemory; break; default: this.Type = MetricType.TopCPU; break; } // If provides data if (this.ReQuery) { this.QueryString = "SELECT * FROM Win32_PerfRawData_PerfProc_Process"; // Apply globally ignored processes to query string globalIgnoredProcesses = api.ReadString("GlobalIgnoredProcesses", string.Empty); if (!string.IsNullOrEmpty(globalIgnoredProcesses)) { bool firstTime = true; foreach (string procName in globalIgnoredProcesses.Split(new char[] { '|' })) { if (firstTime) { this.QueryString += " WHERE"; firstTime = false; } else { this.QueryString += " AND"; } this.QueryString += " NOT Name LIKE '" + procName.Replace("*", "%").Replace("'", "''") + "'"; } } // Create lists only if data provider this._cpuList = new List<Performance>(); this._memList = new List<Performance>(); } // Find the measure in this skin with ReQuery=1 foreach (KeyValuePair<IntPtr, Measure> current in Plugin.Measures) { Measure value = current.Value; if (value.Skin.Equals(this.Skin) && value.ReQuery) { this.DataProvider = current.Key; this.HasData = true; break; } } // Set ignored processes for this measure this.SpecificIgnoredProcesses = api.ReadString("SpecificIgnoredProcesses", string.Empty); // Set format for this measure this.Format = api.ReadString("Format", string.Empty); // Set range or specific process number to display string procNum = api.ReadString("ProcNums", string.Empty); if (!string.IsNullOrEmpty(procNum)) { string[] procNums = procNum.Split(new char[] { '-' }); if (procNums.Length == 1) { int num = Convert.ToInt32(procNums[0]); this.StartProcNum = num; this.EndProcNum = num; } else if (procNums.Length == 2) { this.StartProcNum = Convert.ToInt32(procNums[0]); this.EndProcNum = Convert.ToInt32(procNums[1]); } } }