public override void CheckSemantics(Scope scope, Report report) { id.CheckSemantics(scope, report); if (!id.returnType.isOK)//Chequear que el nombre no sea una palabra reservada { returnType = scope.FindType("error"); return; } if (scope.ShortFindFunction(id.name) != null || scope.ShortFindVariable(id.name) != null)//Chequear que no exista ya una variable o funcion con ese nombre { report.Add(id.Line, id.CharPositionInLine, string.Format("Identifier {0} already in use.", id.name)); returnType = scope.FindType("error"); return; } returnType = scope.FindType("void"); }
public override void CheckSemantics(Scope scope, Report report) { FunctionInfo func = scope.FindFunction(name); if (func == null) { report.Add(Line, CharPositionInLine, string.Format("Function {0} isn't defined", name)); returnType = scope.FindType("error"); return; } if (Params.Check(func, scope, report)) { returnType = func.returnType; function = func; return; } returnType = scope.FindType("error"); }
public override void CheckSemantics(Scope scope, Report report) { condition.CheckSemantics(scope, report); if (!condition.returnType.isInt) { report.Add(condition.Line, condition.CharPositionInLine, string.Format("If's Condition's return type must be int not {0}.", condition.returnType.name)); returnType = scope.FindType("error"); return; } thenBlock.CheckSemantics(scope, report); if (thenBlock.returnType.isError) { returnType = scope.FindType("error"); } returnType = thenBlock.returnType; }
public void Run(ref Report report, List <Dictionary <string, string> > list) { var registryPath = @"Software\Microsoft\Windows\CurrentVersion\Internet Settings"; var keyHKCU = Registry.CurrentUser; var key = keyHKCU.OpenSubKey(registryPath); var enabled = key.GetValue("ProxyEnable").ToString(); if (enabled == "1") { list.Add(new Dictionary <string, string> { { "token", "IEProxy" }, { "server", key.GetValue("ProxyServer").ToString() } }); report.Add(list); } }
public void Run(ref Report report, List <Dictionary <string, string> > list) { list.Add(new Dictionary <string, string> { { "raw", Main.name + " Version " + Main.version } }); var ci = CultureInfo.InstalledUICulture; list.Add(new Dictionary <string, string> { { "raw", "Running from " + Assembly.GetExecutingAssembly().Location.Substring(0, 3) + " as " + WindowsIdentity.GetCurrent().Name + " on " + DateTime.Now } }); list.Add(new Dictionary <string, string> { { "raw", "Windows Version " + WmiQuery("Version") + " Language " + ci.EnglishName } }); var totalMemory = (int)Math.Round(double.Parse(WmiQuery("TotalVisibleMemorySize"))); totalMemory = totalMemory / 1000000; var freeMemory = double.Parse(WmiQuery("FreePhysicalMemory")); freeMemory = freeMemory / 1000000; list.Add(new Dictionary <string, string> { { "raw", totalMemory.ToString("N0") + "GB RAM installed; " + freeMemory.ToString("N1") + "GB RAM available" } }); report.Add(list); }
public void Run(ref Report report, List <Dictionary <string, string> > list) { foreach (var file in files) { var exists = File.Exists(file); list.Add(new Dictionary <string, string> { { "token", "Sig" }, { "file", file }, { "signed", exists ? !Authenticode.IsSigned(file, true) ? "[b]is not signed[/b]" : "is signed" : "[b]does not exist[/b]" } }); } report.Add(list); }
public void Run(ref Report report, List <Dictionary <string, string> > list) { var hosts = File.ReadAllLines(@"C:\Windows\System32\drivers\etc\hosts"); foreach (var line in hosts) { if (line != "" && line.Substring(0, 1) != "#") { list.Add(new Dictionary <string, string> { { "token", "Host" }, { "contents", line } }); } } if (list.Count > 0) { report.Add(list); } }
public override void CheckSemantics(Scope scope, Report report) { base.CheckSemantics(scope, report); elseBlock.CheckSemantics(scope, report); if (returnType.isError || elseBlock.returnType.isError) { returnType = scope.FindType("error"); return; } if (!thenBlock.returnType.Alike(elseBlock.returnType)) { report.Add(thenBlock.Line, thenBlock.CharPositionInLine, string.Format("then else can't respectively return types {0} and {1}", thenBlock.returnType.name, elseBlock.returnType.name)); returnType = scope.FindType("error"); return; } returnType = thenBlock.returnType; }
public void Run(ref Report report, List <Dictionary <string, string> > list) { foreach (var registryKey in ConsolidateKeys()) { var splitKeys = registryKey.Split('\\'); var lastKey = splitKeys[splitKeys.Length - 1]; foreach (RegistryResult result in RegistryWrapper.RegistryWrapper.QuerySubKey(RegistryHive.LocalMachine, registryKey)) { list = IterateOverValues(list, result.key, lastKey, "HKLM", result.view == RegistryView.Registry64); } foreach (RegistryResult result in RegistryWrapper.RegistryWrapper.QuerySubKey(RegistryHive.CurrentUser, registryKey)) { list = IterateOverValues(list, result.key, lastKey, "HKCU", result.view == RegistryView.Registry64); } } report.Add(list); }
public override void CheckSemantics(Scope scope, Report report) { LeftOperand.CheckSemantics(scope, report); RightOperand.CheckSemantics(scope, report); //No tener errores en los operandos if (LeftOperand.returnType.isError || RightOperand.returnType.isError) { returnType = scope.FindType("error"); return; } //Verificar que sean del mismo tipo if (!LeftOperand.returnType.Alike(RightOperand.returnType)) { report.Add(LeftOperand.Line, LeftOperand.CharPositionInLine, string.Format("Can't apply operator {0} between types {1} and {2}", Text, LeftOperand.returnType.name, RightOperand.returnType.name)); returnType = scope.FindType("error"); return; } returnType = LeftOperand.returnType; }
public List <string> GeneratePrimitiveReport() { var result = new List <string>(); foreach (var section in this.Suggestions) { if (!Report.ContainsKey(section.Key)) { Report.Add(section.Key, new Dictionary <string, string>()); } foreach (var item in this.Suggestions[section.Key].Where(x => x.Performed)) { if (!Report[section.Key].ContainsKey(item.BaseType)) { Report[section.Key].Add(item.BaseType, this.GenerateExplanation(item)); } else { Report[section.Key][item.BaseType] = this.GenerateExplanation(item); } } } foreach (var section in Report) { result.Add(string.Empty); result.Add("MAJOR SECTION: " + section.Key); result.Add(string.Empty); foreach (var basetypes in section.Value) { result.Add($"{basetypes.Key}: {basetypes.Value}"); } result.Add(string.Empty); } return(result); //string.Join(System.Environment.NewLine, result); }
public void Run(ref Report report, List <Dictionary <string, string> > list) { var processes = Process.GetProcesses(); var sortedProcesses = processes.OrderBy(process => process.Id).ToList(); foreach (var process in sortedProcesses) { if (process.Id == 0) { continue; } string path; try { path = process.MainModule.FileName; } catch (Win32Exception) { path = process.ProcessName; } catch (InvalidOperationException) { continue; } list.Add(new Dictionary <string, string> { { "token", "Proc" }, { "pid", "(" + process.Id + ")" }, { "path", path } }); } report.Add(list); }
public void Run(ref Report report, List <Dictionary <string, string> > list) { foreach (RegistryResult result in RegistryWrapper.RegistryWrapper.QuerySubKey(RegistryHive.LocalMachine, ToolbarKey)) { foreach (var toolbarClsid in result.key.GetValueNames()) { string companyName = Clsid.GetName(toolbarClsid, result.view); string filePath = Clsid.GetFile(toolbarClsid, result.view); list.Add(new Dictionary <string, string>() { { "Token", "O3" }, { "regview", result.view.toEntryString() }, { "company", companyName ?? "()" }, { "clsid", toolbarClsid }, { "path", filePath ?? "<File not found>" } }); } } report.Add(list); }
public void Run(ref Report report, List <Dictionary <string, string> > list) { foreach (var result in RegistryWrapper.RegistryWrapper.QuerySubKey(RegistryHive.LocalMachine, registryPath)) { foreach (var subKeyName in result.key.GetSubKeyNames()) { using (var subKey = result.key.OpenSubKey(subKeyName)) { if (subKey.GetValue("Debugger") != null) { list.Add(new Dictionary <string, string> { { "token", "IFEO" }, { "subkey_name", @"HKLM\..\IFEO\" + subKeyName + ": [Debugger]" }, { "debugger_value", (string)subKey.GetValue("Debugger") } }); } } } } report.Add(list); }
public void CheckSemantics(Scope scope, Report report, RecordDecNode node) { Create(); if (fields.Count != node.paramsNode.ChildCount) {//La cantidad de parametros a inicializar tiene que ser igual que la cantidad de parametros declarados en el record report.Add(node.id.Line, node.id.CharPositionInLine, string.Format("Can't create record {0}, have {1} parameters, got {2}", node.id.name, node.paramsNode.ChildCount, fields.Count)); returnType = scope.FindType("error"); return; } for (int i = 0; i < fields.Count; i++) { fields[i].CheckSemantics(scope, report, node.paramsNode.parameters[i]); if (fields[i].returnType != null && fields[i].returnType.isError) { returnType = scope.FindType("error"); return; } } returnType = scope.FindType("void"); }
public void Run(ref Report report, List <Dictionary <string, string> > list) { if (!Directory.Exists(path)) { return; } foreach (var directory in Directory.GetDirectories(path)) { if (!Directory.Exists(directory + @"\Extensions")) { continue; } foreach (var extension in Directory.GetDirectories(directory + @"\Extensions")) { var name = Path.GetFileName(extension.TrimEnd(Path.DirectorySeparatorChar)); var friendly = GetFriendlyName(extension); var version = GetVersion(extension); if (friendly == null || friendly.StartsWith("__")) { continue; } list.Add(new Dictionary <string, string> { { "token", "Chrome" }, { "friendly", friendly }, { "version", "(" + version + ")" + " -" }, { "name", name } }); } } report.Add(list); }
public void Run(ref Report report, List <Dictionary <string, string> > list) { if (!Directory.Exists(path)) { return; } foreach (var profile in Directory.GetDirectories(path + @"\Profiles")) { if (!File.Exists(profile + @"\extensions.json")) { continue; } var manifest = DecodeManifest(profile); var addons = manifest.GetValue("addons"); foreach (JObject addon in addons) { var locale = (JObject)addon.GetValue("defaultLocale"); var id = (string)addon.GetValue("id"); var version = (string)addon.GetValue("version"); var name = (string)locale.GetValue("name"); list.Add(new Dictionary <string, string> { { "token", "FF" }, { "id", id + " -" }, { "name", name }, { "version", "(" + version + ")" } }); } } report.Add(list); }
public override void OnNavigatedTo(INavigationParameters parameters) { bool edit; if (parameters.TryGetValue("user", out Models.User user)) { User = parameters.GetValue <Models.User>("user"); Title = $"Bienvenido {User.Name}"; } else if (parameters.TryGetValue("report", out Report reports))//GetValue<bool>("reportCreated")) { ReportTitle = reports.Title; Report.Add(reports); } else if (parameters.TryGetValue("edit", out edit)) { User.Name = parameters.GetValue <string>("name"); User.Email = parameters.GetValue <string>("email"); User.PhoneNumber = parameters.GetValue <string>("phone"); User.WebSite = parameters.GetValue <string>("webSite"); User.Description = parameters.GetValue <string>("description"); User.Address = parameters.GetValue <string>("address"); } }
public void Run(ref Report report, List <Dictionary <string, string> > list) { var registryKey = @"Software\Microsoft\Windows NT\CurrentVersion\Winlogon"; var splitKeys = registryKey.Split('\\'); var lastKey = splitKeys[splitKeys.Length - 1]; using (var key = Registry.LocalMachine.OpenSubKey(registryKey)) { var shell = (string)key.GetValue("Shell"); var userinit = (string)key.GetValue("Userinit"); if (shell != null) { list.Add( new Dictionary <string, string> { { "token", "Shell" }, { "key", @"HKLM\..\Winlogon: [Shell]" }, { "value", shell } } ); } if (userinit != null) { list.Add( new Dictionary <string, string> { { "token", "Shell" }, { "key", @"HKLM\..\Winlogon: [Userinit]" }, { "value", userinit } } ); } } using (var key = Registry.CurrentUser.OpenSubKey(registryKey)) { var shell = (string)key.GetValue("Shell"); var userinit = (string)key.GetValue("Userinit"); if (shell != null) { list.Add( new Dictionary <string, string> { { "token", "Shl" }, { "key", @"HKCU\..\Winlogon: [Shell]" }, { "value", shell } } ); } if (userinit != null) { list.Add( new Dictionary <string, string> { { "token", "Shl" }, { "key", @"HKCU\..\Winlogon: [Userinit]" }, { "value", userinit } } ); } } report.Add(list); }
private Report CreateReport(string fileName) { string ext = Path.GetExtension(fileName); ext = ext.ToLower(); var r = new Report(); r.Title = "Oxyplot example report"; var main = new ReportSection(); r.AddHeader(1, "Example report from OxyPlot"); // r.AddHeader(2, "Content"); // r.AddTableOfContents(main); r.Add(main); main.AddHeader(2, "Introduction"); main.AddParagraph("The content in this file was generated by OxyPlot."); main.AddParagraph("See http://oxyplot.codeplex.com for more information."); var dir = Path.GetDirectoryName(fileName); var name = Path.GetFileNameWithoutExtension(fileName); string fileNameWithoutExtension = Path.Combine(dir, name); main.AddHeader(2, "Plot"); main.AddParagraph("This plot was rendered to a file and included in the report as a plot."); main.AddPlot(this.Model, "Plot", 800, 500); main.AddHeader(2, "Drawing"); main.AddParagraph("Not yet implemented."); /* switch (ext) * { * case ".html": * { * main.AddHeader(2, "Plot (svg)"); * main.AddParagraph("This plot was rendered to a .svg file and included in the report."); * main.AddPlot(Model, "SVG plot", 800, 500); * * //main.AddHeader(2, "Drawing (vector)"); * //main.AddParagraph("This plot was rendered to SVG and included in the report as a drawing."); * //var svg = Model.ToSvg(800, 500); * //main.AddDrawing(svg, "SVG plot as a drawing."); * break; * } * case ".pdf": * case ".tex": * { * main.AddHeader(2, "Plot (vector)"); * main.AddParagraph("This plot was rendered to a .pdf file and included in the report."); * main.AddPlot(Model, "PDF plot", 800, 500); * //var pdfPlotFileName = fileNameWithoutExtension + "_plot.pdf"; * //PdfExporter.Export(Model, pdfPlotFileName, 800, 500); * //main.AddParagraph("This plot was rendered to PDF and embedded in the report."); * //main.AddImage(pdfPlotFileName, "PDF plot"); * break; * } * case ".docx": * { * main.AddHeader(2, "Plot"); * main.AddParagraph("This plot was rendered to a .png file and included in the report."); * main.AddPlot(Model, "Plot", 800, 500); * } * break; * }*/ main.AddHeader(2, "Image"); main.AddParagraph("The plot is rendered to a .png file and included in the report as an image. Zoom in to see the difference."); string pngPlotFileName = fileNameWithoutExtension + "_Plot2.png"; PngExporter.Export(this.Model, pngPlotFileName, 800, 500, OxyColors.Automatic); main.AddImage(pngPlotFileName, "Plot as image"); main.AddHeader(2, "Data"); int i = 1; foreach (OxyPlot.Series.DataPointSeries s in this.Model.Series) { main.AddHeader(3, "Data series " + (i++)); var pt = main.AddPropertyTable("Properties of the " + s.GetType().Name, new[] { s }); pt.Fields[0].Width = 50; pt.Fields[1].Width = 100; var fields = new List <ItemsTableField> { new ItemsTableField("X", "X") { Width = 60, StringFormat = "0.00" }, new ItemsTableField("Y", "Y") { Width = 60, StringFormat = "0.00" } }; main.Add(new ItemsTable { Caption = "Data", Fields = fields, Items = s.Points }); } // main.AddHeader(3, "Equations"); // main.AddEquation(@"E = m \cdot c^2"); // main.AddEquation(@"\oint \vec{B} \cdot d\vec{S} = 0"); return(r); }
private static void DailyDistribution(bool HourDistribution = false, bool FinalDistributionButHourly = false) { DailyPool Pool = DailyPool.GetYesterdayPool(PoolsHelper.GetBuiltInProfitPoolId(Pools.AdPackRevenueReturn)); String RaportMessage = String.Empty; Int32 ActiveAdPacks = 0; Money TotalDistributed = Money.Zero; Money PerUnit = Money.Zero; Money InThePool = Pool.SumAmount; using (var bridge = ParserPool.Acquire(Database.Client)) { DistributionSQLHelper DistributionHelper = new DistributionSQLHelper(bridge.Instance); DistributionHelper.SetStartingDistributionPriority(); ActiveAdPacks = DistributionHelper.GetSumOfActiveAdPacks(); try { if (AppSettings.RevShare.AdPack.GroupPolicy == GroupPolicy.Classic) { //Classic //Nothing to change } if (AppSettings.RevShare.AdPack.GroupPolicy == GroupPolicy.CustomGroups || AppSettings.RevShare.AdPack.GroupPolicy == GroupPolicy.AutomaticAndCustomGroups) { //CustomGrups if (AppSettings.RevShare.AdPack.CustomReturnOption == CustomReturnOption.Accelerate) { DistributionHelper.UpdatePrioritiesCustomGroups(); } } if (AppSettings.RevShare.AdPack.GroupPolicy == GroupPolicy.AutomaticGroups || AppSettings.RevShare.AdPack.GroupPolicy == GroupPolicy.AutomaticAndCustomGroups) { //AutomaticGroups DistributionHelper.UpdatePrioritiesAutomaticGroups(); } Decimal priorities = DistributionHelper.GetSumOfPriorities(); if (ActiveAdPacks == 0) { throw new MsgException("No active AdPacks with active members. " + GetNoDistributionMessage(HourDistribution)); } //Make the distribution var adPackTypes = AdPackTypeManager.GetAllTypes(); foreach (var adPackType in adPackTypes) { var returnedPercentage = 0.0m; if (AppSettings.RevShare.AdPack.DistributionPolicy == DistributionPolicy.Fixed) { PerUnit = GetMoneyPerUnit(GetMoneyPerUnitFixed(adPackType), HourDistribution, FinalDistributionButHourly, adPackType); returnedPercentage = adPackType.FixedDistributionValuePercent; } else if (AppSettings.RevShare.AdPack.DistributionPolicy == DistributionPolicy.Pools) { PerUnit = GetMoneyPerUnit(GetMoneyPerUnitPools(InThePool, priorities), HourDistribution, FinalDistributionButHourly, adPackType); returnedPercentage = PerUnit.ToDecimal() / adPackType.Price.ToDecimal(); } RaportMessage += "<b>" + adPackType.Name + "</b> for priority 1.00 (no acceleration): <b>" + PerUnit.ToClearString() + "</b>. <br/>"; if (PerUnit > Money.Zero) { TotalDistributed += DistributionHelper.DistributeUsingPriority(PerUnit, adPackType.Id); } RevShareManager.AddAdPackTypePercentageHistory(adPackType.Id, returnedPercentage); } if (TitanFeatures.isAri) { AriRevShareDistribution.CreditAriRevShareDistribution(); } } catch (MsgException ex) { RaportMessage += ex.Message; } catch (Exception ex) { ErrorLogger.Log(ex); } Pool.SumAmount -= TotalDistributed; if (HourDistribution == false) { if (AppSettings.RevShare.AdPack.DistributionPolicy == DistributionPolicy.Pools) { RaportMessage += "Money moved to the next day pool: " + Pool.SumAmount.ToClearString() + ". "; } Pool.MoveMoneyForTomorrow(); } Pool.Save(); Report.Add(ActiveAdPacks, InThePool, TotalDistributed, RaportMessage); CustomGroupManager.TrySetGroupsAsExpired(); } }
public override void OnReport(Report report) { base.OnReport(report); report.Add("ifconfig", (LocateExecutable("ifconfig") != "") ? SystemShell.Shell0(LocateExecutable("ifconfig")) : "'ifconfig' " + LanguageManager.GetText("NotFound")); }
static ReportFactory() { Report.Add("Zaposleni 1", () => new ZaposleniSaoOsig1()); Report.Add("Zaposleni 2", () => new ZaposleniSaoOsig2()); Report.Add("Zaposleni 3", () => new ZaposleniSaoOsig3()); }
protected void AddReport(string reportId, System.DateTime?inputDate, string inputUser, string note, string proVerId, System.Collections.Generic.List <ReportDetail> details) { Report report = Report.Create(reportId, inputDate, inputUser, note, proVerId); report.Add(report, details); }
public void Add(DiffItem diffItem) { Report.Add(diffItem); }
public override void StartRound(ICollection <Card> cards, Card trumpCard, int myTotalPoints, int opponentTotalPoints) { Report.Add("Trump for current game is: " + trumpCard.ToString()); base.StartRound(cards, trumpCard, myTotalPoints, opponentTotalPoints); }
public override void EndRound() { Report.Add(" ------ END ROUND ------"); base.EndRound(); }
public override void OnReport(Report report) { base.OnReport(report); report.Add("ifconfig", (LocateExecutable("ifconfig") != "") ? SystemShell.Shell0(LocateExecutable("ifconfig")) : "'ifconfig' " + Messages.NotFound); }