internal static void CreateMasterStatusReport(DATA_TYPE fileType, List <DateOpenClosedStatDto> openclosed, List <PatchCountOfComplianceDto> issues, List <PatchData> patches) { string fileName = GetDataTypeFileName(fileType, "MasterReport"); if (!Directory.Exists(m_dataDirectory)) { Directory.CreateDirectory(m_dataDirectory); } ReportWriter writer = new ReportWriter(fileName); if (fileType == DATA_TYPE.CSV) { //WriteCSVFixedInPercent(data, writer); //writer.StartFile(); } if (fileType == DATA_TYPE.XLS) { //WriteCSVFixedInPercent(data, writer); //Process.Start(Environment.CurrentDirectory.ToString() + "\\bin\\convertFPercR.cmd", fileName); } if (fileType == DATA_TYPE.HTML) { WriteHTMLMasterReport(openclosed, issues, patches, writer); Process.Start(fileName); } LoaderHelper.LoaderKill(); }
public void PreLoadResource(ref List <ActorPreloadTab> list, LoaderHelper loadHelper) { if ((this.SpawnType == ESpawnObjectType.Actor) && (this.TheActorMeta.ConfigId > 0)) { loadHelper.AddPreloadActor(ref list, ref this.TheActorMeta, 1f, 0); } }
internal static void CreateLatestReport(DATA_TYPE fileType, List <PatchData> data) { string fileName = GetDataTypeFileName(fileType, "LatestSecurity"); if (!Directory.Exists(m_dataDirectory)) { Directory.CreateDirectory(m_dataDirectory); } var writer = new ReportWriter(fileName); if (fileType == DATA_TYPE.CSV) { WriteCSVLastestReport(data, writer); writer.StartFile(); } if (fileType == DATA_TYPE.XLS) { WriteCSVLastestReport(data, writer); Process.Start(Environment.CurrentDirectory.ToString() + "\\bin\\convertLR.cmd", fileName); } if (fileType == DATA_TYPE.HTML) { WriteHTMLLatestReport(data, writer); Process.Start(fileName); } LoaderHelper.LoaderKill(); }
private static string Uninstall(Arguments arguments) { if (string.IsNullOrEmpty(arguments.AssemblyName)) { return($"Assembly is empty"); } if (string.IsNullOrEmpty(arguments.ConnectionString)) { return("Connection string blank"); } var connCheck = CheckConnectionString(arguments.ConnectionString); if (connCheck != "") { return(connCheck); } var clrHelper = new LoaderHelper(arguments.ConnectionString); clrHelper.UninstallClrAssembly(arguments.AssemblyName); return("Uninstall Completed!!"); }
public static void CreateVulnReport(DATA_TYPE fileType, List <PatchCountOfComplianceDto> data) { string fileName = GetDataTypeFileName(fileType, "VulnReport"); if (!Directory.Exists(m_dataDirectory)) { Directory.CreateDirectory(m_dataDirectory); } ReportWriter writer = new ReportWriter(fileName); if (fileType == DATA_TYPE.CSV) { WriteCSVVulnReport(data, writer); writer.StartFile(); } if (fileType == DATA_TYPE.XLS) { WriteCSVVulnReport(data, writer); Process.Start(Environment.CurrentDirectory.ToString() + "\\bin\\convertVR.cmd", fileName); } if (fileType == DATA_TYPE.HTML) { WriteHTMLVulnReport(data, writer); Process.Start(fileName); } LoaderHelper.LoaderKill(); }
internal static void CreateComplianceStatusReport(DATA_TYPE fileType, List <ComputerOpenClosedStatDto> data) { string fileName = GetDataTypeFileName(fileType, "ComplianceStatusReport"); if (!Directory.Exists(m_dataDirectory)) { Directory.CreateDirectory(m_dataDirectory); } ReportWriter writer = new ReportWriter(fileName); if (fileType == DATA_TYPE.CSV) { WriteCSVFixedInPercent(data, writer); writer.StartFile(); } if (fileType == DATA_TYPE.XLS) { WriteCSVFixedInPercent(data, writer); Process.Start(Environment.CurrentDirectory.ToString() + "\\bin\\convertFPercR.cmd", fileName); } if (fileType == DATA_TYPE.HTML) { WriteHTMLFixedInPercent(data, writer); Process.Start(fileName); } LoaderHelper.LoaderKill(); }
public DomType Load(GomBinaryReader reader) { DomAssociation result = new DomAssociation(); LoaderHelper.ParseShared(reader, result); return(result); }
public void PreLoadResource(ref ActorPreloadTab loadInfo, LoaderHelper loadHelper) { if (this.SpawnType == ESpawnObjectType.Tailsman) { CharmLib dataByKey = GameDataMgr.charmLib.GetDataByKey((long)this.ConfigId); if (dataByKey != null) { for (int i = 0; i < 10; i++) { if (dataByKey.astCharmId[i].iParam == 0) { break; } int iParam = dataByKey.astCharmId[i].iParam; ShenFuInfo info = GameDataMgr.shenfuBin.GetDataByKey((long)iParam); if (info != null) { AssetLoadBase item = new AssetLoadBase { assetPath = StringHelper.UTF8BytesToString(ref info.szShenFuResPath) }; loadInfo.mesPrefabs.Add(item); loadHelper.AnalyseSkillCombine(ref loadInfo, info.iBufId); } } } } }
/// <summary> /// create process with desire filepath /// and inject dll to the remote process /// </summary> /// <param name="FilePath">desire filepath</param> private bool CreateProcessWithDll(string FilePath) { if (!LoaderHelper.CreateProcessWithDll(FilePath, "KrkrExtract.Core.dll")) { NotifyError("Failed to create process...\nCode :" + Marshal.GetLastWin32Error()); return(false); } return(true); }
public void PreLoadResource(ref List <ActorPreloadTab> list, LoaderHelper loadHelper) { foreach (SpawnerWrapper wrapper in this.SpawnerList) { if (wrapper != null) { wrapper.PreLoadResource(ref list, loadHelper); } } }
public void PreLoadResource(ref List <ActorPreloadTab> list, LoaderHelper loadHelper) { SpawnerWrapper[] spawnerList = this.SpawnerList; for (int i = 0; i < spawnerList.Length; i++) { SpawnerWrapper spawnerWrapper = spawnerList[i]; if (spawnerWrapper != null) { spawnerWrapper.PreLoadResource(ref list, loadHelper); } } }
public void PreLoadResource(ref List <ActorPreloadTab> list, LoaderHelper loadHelper) { if (this.TheActorsMeta.Length > 0) { for (int i = 0; i < this.TheActorsMeta.Length; i++) { ActorMeta actorMeta = this.TheActorsMeta[i]; if (actorMeta.ConfigId > 0) { loadHelper.AddPreloadActor(ref list, ref actorMeta, 1f, 0); } } } }
private static string Install(Arguments arguments) { if (string.IsNullOrEmpty(arguments.Path) && string.IsNullOrEmpty(arguments.Directory)) { return("Missing path or directory"); } if (!string.IsNullOrEmpty(arguments.Path) && !string.IsNullOrEmpty(arguments.Directory)) { return("Only Path or Directory can be used at a time"); } if (!string.IsNullOrEmpty(arguments.Path) && !File.Exists(arguments.Path)) { return($"{arguments.Path} does not exists"); } if (!string.IsNullOrEmpty(arguments.Directory) && !Directory.Exists(arguments.Directory)) { return($"{arguments.Directory} does not exists"); } if (string.IsNullOrEmpty(arguments.ConnectionString)) { return("Connection string blank"); } var connCheck = CheckConnectionString(arguments.ConnectionString); if (connCheck != "") { return(connCheck); } var clrHelper = new LoaderHelper(arguments.ConnectionString); if (arguments.Path != "") { clrHelper.InstallClrAssembly(arguments.Path, permissionSetType.SAFE); } else { clrHelper.InstallClrAssemblyDirectory(arguments.Directory, permissionSetType.SAFE); } return("Install Completed!!"); }
private static string View(Arguments arguments) { if (string.IsNullOrEmpty(arguments.Path)) { return("Missing path"); } if (!string.IsNullOrEmpty(arguments.Path) && !File.Exists(arguments.Path)) { return($"{arguments.Path} does not exists"); } var clrHelper = new LoaderHelper(); clrHelper.ViewClrAssemblyFunctions(arguments.Path); return(""); }
public void PreLoadResource(ref ActorPreloadTab loadInfo, Dictionary <string, bool> ageCheckerSet, LoaderHelper loadHelper) { if (this.TimingActionsInter != null) { int num = this.TimingActionsInter.Length; for (int i = 0; i < num; i++) { if (!string.IsNullOrEmpty(this.TimingActionsInter[i].ActionName) && !ageCheckerSet.ContainsKey(this.TimingActionsInter[i].ActionName)) { AssetLoadBase assetLoadBase = default(AssetLoadBase); assetLoadBase.assetPath = this.TimingActionsInter[i].ActionName; loadInfo.ageActions.Add(assetLoadBase); ageCheckerSet.Add(this.TimingActionsInter[i].ActionName, true); } } } if (this.TriggerType == EGlobalTriggerAct.TriggerBuff) { loadHelper.AnalyseSkillCombine(ref loadInfo, this.EnterUniqueId); loadHelper.AnalyseSkillCombine(ref loadInfo, this.LeaveUniqueId); loadHelper.AnalyseSkillCombine(ref loadInfo, this.UpdateUniqueId); } }
private IEnumerator AnalyseAgeRecursiveAssets(LoaderHelper loadHelper) { GameLoader.< AnalyseAgeRecursiveAssets > c__Iterator13 <AnalyseAgeRecursiveAssets> c__Iterator = new GameLoader.< AnalyseAgeRecursiveAssets > c__Iterator13();
private void Load() { string dllPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Logic.dll"); var assembly = LoaderHelper.Load(dllPath); Type[] types = assembly.GetTypes(); // 加载封包处理器 var localHandlers = new Dictionary <int, Tuple <IHandler, Type> >(); foreach (var type in types) { object[] attrs = type.GetCustomAttributes(typeof(HandlerAttribute), false); if (attrs.Length == 0) { continue; } var handler = (IHandler)Activator.CreateInstance(type); int opcode = ((HandlerAttribute)attrs[0]).Opcode; Type messageType = ((HandlerAttribute)attrs[0]).Type; if (opcode == 0 || messageType == null) { throw new Exception(string.Format("not set opcode or type, handler name: {0}", type.Name)); } if (localHandlers.ContainsKey(opcode)) { throw new Exception(string.Format( "same handler opcode, opcode: {0}, name: {1}", opcode, type.Name)); } localHandlers[opcode] = new Tuple <IHandler, Type>(handler, messageType); } // 加载事件处理器 var localEvents = new Dictionary <EventType, SortedDictionary <int, IEvent> >(); foreach (var type in types) { object[] attrs = type.GetCustomAttributes(typeof(EventAttribute), false); if (attrs.Length == 0) { continue; } var evt = (IEvent)Activator.CreateInstance(type); EventType eventType = ((EventAttribute)attrs[0]).Type; int eventOrder = ((EventAttribute)attrs[0]).Order; if (eventOrder == 0 || eventType == EventType.DefaultEvent) { throw new Exception(string.Format("not set order or type, event name: {0}", type.Name)); } if (!localEvents.ContainsKey(eventType)) { localEvents[eventType] = new SortedDictionary <int, IEvent>(); } if (localEvents[eventType].ContainsKey(eventOrder)) { throw new Exception(string.Format( "same event number, type: {0}, number: {1}, name: {2}", eventType, eventOrder, type.Name)); } localEvents[eventType][eventOrder] = evt; } // this.handlers = localHandlers; this.events = localEvents; }
private void ShowLoader(bool isShow) { LoaderHelper.OnRequestLoader(MainGrid, ref _loader, isShow); }
public void PreLoadResource(TriggerActionWrapper triggerActionWrapper, ref ActorPreloadTab loadInfo, LoaderHelper loadHelper) { if (triggerActionWrapper == null) { return; } ShenFuSystem.PreLoadShenfuResource(triggerActionWrapper.UpdateUniqueId, ref loadInfo, loadHelper); }
public void LoadFile(string path, string templateBaseUrl) { if (path == null) { return; } var Request = HttpContext.Current.Request; var Response = HttpContext.Current.Response; //var cacheData = (string)ContextHelper.GetFromCache(path); bool isCss = path.EndsWith(".css"); bool isJs = path.EndsWith(".js"); if (isCss) { Response.ContentType = "text/css"; } else if (isJs) { Response.ContentType = "application/x-javascript"; } string data = ""; data = LoaderHelper.ReadUrl(path, AppSettings.EnableWebRequestCaching, AppSettings.WebRequestCacheDurationInSeconds); //if (AppSettings.MinifyOutput) //{ // if (isCss) // { // var cssCompressor = new CssCompressor(); // data = cssCompressor.Compress(data); // } // else if (isJs) // { // var jsCompressor = new JavaScriptCompressor(); // data = jsCompressor.Compress(data); // } //} var segments = URIHelper.GetUriSegments(path).ToList(); segments.RemoveAt(segments.Count - 1); data = ParserHelper.ParseData(data, BasePage.GetDefaultTemplateVars(templateBaseUrl)); if (isCss) { string fileBaseUrl = "/" + string.Join("/", segments) + "/"; /*data = data.Replace("url('", "url('" + fileBaseUrl); * data = data.Replace("url(\"", "url(\"" + fileBaseUrl); * data = data.Replace("url(", "url(" + fileBaseUrl); * data = data.Replace("url(" + fileBaseUrl + "'", "url('"); * data = data.Replace("url('" + fileBaseUrl + "", "url('");*/ data = Regex.Replace(data, "url[(][\'|\"]{0,1}(?!.*http)", "${0}" + fileBaseUrl); } //ContextHelper.SaveToCache(Request.Url.AbsoluteUri, data, DateTime.Now.AddSeconds(AppSettings.WebRequestCacheDurationInSeconds)); BaseService.WriteRaw(data, Response); }
private void OnRequestLoader(bool isShow) { LoaderHelper.OnRequestLoader(MainGrid, ref _loader, isShow); IsEnabled = !isShow; }
protected void SlidesList_OnItemDataBound(object sender, ListViewItemEventArgs e) { if (e.Item.ItemType == ListViewItemType.DataItem) { HyperLink FlashAltLink = (HyperLink)e.Item.FindControl("Link"); HyperLink Link = (HyperLink)e.Item.FindControl("Link"); Image Image = (Image)e.Item.FindControl("Image"); Panel ImageSliderPanel = (Panel)e.Item.FindControl("ImageSliderPanel"); Panel ContentSliderPanel = (Panel)e.Item.FindControl("ContentSliderPanel"); Panel NonFlashPanel = (Panel)e.Item.FindControl("NonFlashPanel"); HtmlControl Slide = (HtmlControl)e.Item.FindControl("Slide"); Slide Item = (Slide)e.Item.DataItem; if ((this.gallery.PathToRenderControl != null && this.gallery.PathToRenderControl != "")) { ImageSliderPanel.Visible = false; ContentSliderPanel.Visible = true; Literal ItemRenderedLayout = new Literal(); ItemRenderedLayout.Text = LoaderHelper.RenderControl(this.gallery.PathToRenderControl, Item.MediaDetail); ContentSliderPanel.Controls.Add(ItemRenderedLayout); } else { ImageSliderPanel.Visible = true; ContentSliderPanel.Visible = false; if (Item.PathToFile.Trim() != "") { Link.NavigateUrl = FlashAltLink.NavigateUrl = Item.Link; } this.BasePage.AddToJSPreload(Item.PathToFile); if (!Item.PathToFile.Contains(".swf")) { Image.ImageUrl = Item.PathToFile; Image.Attributes["data-alt-image"] = URIHelper.ConvertToAbsUrl(Item.PathToAlternativeFile); Image.AlternateText = Item.Title; NonFlashPanel.CssClass = NonFlashPanel.CssClass + " InteriorBanner"; if (!string.IsNullOrEmpty(Item.BgColor)) { NonFlashPanel.Style["background-color"] = Item.BgColor; } } else { NonFlashPanel.Visible = false; } Link.ToolTip = Item.Title; if (Link.NavigateUrl != "") { Link.CssClass += " popup"; } } } }
public static int Main(string[] args) { int error = -1; if (ArgumentHelper.IsHelpNeeded(args)) { ArgumentHelper.ShowHelp(); } else { Keyboard.AbortKey = Keys.Pause; var silentMode = ArgumentHelper.IsSilent(args); var dialogResult = DialogResult.None; string pathToReport = Directory.GetCurrentDirectory() + @"\..\..\Source\Run\Bin\Debug\Report\"; if (!Directory.Exists(pathToReport)) { Directory.CreateDirectory(pathToReport); } string report = pathToReport + "LatestReport.rxlog"; TestReport.Setup(ReportLevel.Debug, report, true); try { string configFile = Directory.GetCurrentDirectory() + @"\..\..\Source\Run\Bin\Debug\ConfigData\Configuration.xml"; configuratorDialog = new ConfiguratorDialog(configFile); if (!silentMode) { dialogResult = configuratorDialog.ShowDialog(); } if (dialogResult == DialogResult.Cancel) { MessageBox.Show(@"Operation was canceled by user."); } else if (dialogResult == DialogResult.OK || silentMode) { LoaderHelper.InitializeAssemblyProvider(); ReportHelper.ReportPath = @"C:\Report\Output\"; EH.PCPS.TestAutomation.Common.Tools.Logging.Log4Net.Log4NetLog.XmlInitialize(); /*----------------*/ /* Test Area */ /*----------------*/ //EH.PCPS.TestAutomation.Testlibrary.TestCases.DeviceFunction.CoDIA.Parameterization.TC_ConnectToRemoteHost_HMI.Run(); //EH.PCPS.TestAutomation.Testlibrary.TestCases.HostApplication.TC_OpenHostApplication.Run(@"C:\Program Files (x86)\Endress+Hauser\FieldCare\Frame\FMPFrame.exe"); EH.PCPS.TestAutomation.Testlibrary.TestCases.HostApplication.FDT.TC_FdtPrint.Run(@"C:\Report\Output\Test", 30000); } else { throw new Exception("Impossible error"); } } catch (ImageNotFoundException e) { Report.Error(e.ToString()); Report.LogData(ReportLevel.Error, "Image not found", e.Feature); Report.LogData(ReportLevel.Error, "Searched image", e.Image); error = -1; } catch (RanorexException e) { Report.Error(e.ToString()); Report.Screenshot(); error = -1; } catch (ThreadAbortException e) { Report.Warn("AbortKey has been pressed: " + e); Thread.ResetAbort(); error = -1; } catch (Exception e) { Report.Error("Unexpected exception occurred: " + e); error = -1; } Report.End(); return(error); } return(0); }
/// <summary> /// 载入头像资源 /// </summary> /// <param name="lable">载入标志</param> /// <returns></returns> private async Task <List <Sprite> > LoadSpriteAsync(AssetLabelReference lable) { var result = await LoaderHelper.LoadAssertsAsync <Sprite>(lable); return(result.OrderBy(x => x.name).ToList()); }
public void PreLoadResource(TriggerActionWrapper triggerActionWrapper, ref ActorPreloadTab loadInfo, LoaderHelper loadHelper) { if (triggerActionWrapper != null) { ShenFuInfo dataByKey = GameDataMgr.shenfuBin.GetDataByKey((long)triggerActionWrapper.UpdateUniqueId); if (dataByKey != null) { AssetLoadBase item = new AssetLoadBase { assetPath = StringHelper.UTF8BytesToString(ref dataByKey.szShenFuResPath) }; loadInfo.mesPrefabs.Add(item); loadHelper.AnalyseSkillCombine(ref loadInfo, dataByKey.iBufId); } } }
public static void PreLoadShenfuResource(int shenfuId, ref ActorPreloadTab loadInfo, LoaderHelper loadHelper) { ShenFuInfo dataByKey = GameDataMgr.shenfuBin.GetDataByKey((long)shenfuId); if (dataByKey == null) { return; } AssetLoadBase assetLoadBase = new AssetLoadBase { assetPath = StringHelper.UTF8BytesToString(ref dataByKey.szShenFuResPath) }; loadInfo.mesPrefabs.Add(assetLoadBase); loadHelper.AnalyseSkillCombine(ref loadInfo, dataByKey.iBufId); }