public override int GetHashCode() { int hash = 1; if (Id != 0) { hash ^= Id.GetHashCode(); } if (Type != 0) { hash ^= Type.GetHashCode(); } if (SharedDataDir.Length != 0) { hash ^= SharedDataDir.GetHashCode(); } if (GameName.Length != 0) { hash ^= GameName.GetHashCode(); } if (TargetName.Length != 0) { hash ^= TargetName.GetHashCode(); } if (TargetTimestamp != 0UL) { hash ^= TargetTimestamp.GetHashCode(); } if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } return(hash); }
public override void Write() { _worldPacket.WriteUInt8((byte)SlashCmd); _worldPacket.WriteUInt32((uint)_Language); _worldPacket.WritePackedGuid(SenderGUID); _worldPacket.WritePackedGuid(SenderGuildGUID); _worldPacket.WritePackedGuid(SenderAccountGUID); _worldPacket.WritePackedGuid(TargetGUID); _worldPacket.WriteUInt32(TargetVirtualAddress); _worldPacket.WriteUInt32(SenderVirtualAddress); _worldPacket.WritePackedGuid(PartyGUID); _worldPacket.WriteUInt32(AchievementID); _worldPacket.WriteFloat(DisplayTime); _worldPacket.WriteBits(SenderName.GetByteCount(), 11); _worldPacket.WriteBits(TargetName.GetByteCount(), 11); _worldPacket.WriteBits(Prefix.GetByteCount(), 5); _worldPacket.WriteBits(Channel.GetByteCount(), 7); _worldPacket.WriteBits(ChatText.GetByteCount(), 12); _worldPacket.WriteBits((byte)_ChatFlags, 14); _worldPacket.WriteBit(HideChatLog); _worldPacket.WriteBit(FakeSenderName); _worldPacket.WriteBit(Unused_801.HasValue); _worldPacket.FlushBits(); _worldPacket.WriteString(SenderName); _worldPacket.WriteString(TargetName); _worldPacket.WriteString(Prefix); _worldPacket.WriteString(Channel); _worldPacket.WriteString(ChatText); if (Unused_801.HasValue) { _worldPacket.WriteUInt32(Unused_801.Value); } }
public void HandleMessage(Message message, RouterSocket serverSocket, PublisherSocket ioPub) { TargetName targetName = message.Content as TargetName; Message replyMessage = new Message(MessageType.CommInfoReply, CreateCommInfoReply(targetName), message.Header); _logger.LogInformation("Sending comm_info_reply"); serverSocket.SendMessage(replyMessage); }
public NameViewModel( TargetName config, TargetInfoModel model) { this.config = config ?? Settings.Instance.TargetName; this.model = model ?? TargetInfoModel.Instance; this.Initialize(); }
private CommInfoReplyContent CreateCommInfoReply(TargetName name) { CommInfoReplyContent CommInfoReply = new CommInfoReplyContent(new System.Collections.Generic.Dictionary <string, TargetName> { }) { }; return(CommInfoReply); }
/// <summary> /// Serves as a hash function for a particular type. /// </summary> /// <returns> /// A hash code for the current <see cref="T:System.Object" />. /// </returns> /// <filterpriority>2</filterpriority> public override int GetHashCode() { unchecked { int hashCode = (Name != null ? Name.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (TargetName != null ? TargetName.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (int)Type; hashCode = (hashCode * 397) ^ (Implicit ? 1 : 0); return(hashCode); } }
private void Update() { if (EnemyTargetManager.Instance.target != null) { TargetName textSpawner = text.GetComponent <TargetName>(); textSpawner.Display(EnemyTargetManager.Instance.target.name); position.Set(EnemyTargetManager.Instance.target.transform.position.x, EnemyTargetManager.Instance.target.transform.position.y + 1.2f, EnemyTargetManager.Instance.target.transform.position.z); text.position = position; } }
public override int GetHashCode() { unchecked // Overflow is fine { int hash = 17; hash = hash * 23 + (IgnoreCase ? IgnoreCase.GetHashCode() : 0); hash = hash * 23 + (Field != null ? Field.GetHashCode() : 0); hash = hash * 23 + (TargetName != null ? TargetName.GetHashCode() : 0); hash = hash * 23 + (TargetType != null ? TargetType.GetHashCode() : 0); return(hash); } }
public NameViewModel( TargetName config, TargetInfoModel model) { this.config = config ?? Settings.Instance.TargetName; this.model = model ?? TargetInfoModel.Instance; this.RaisePropertyChanged(nameof(Config)); this.RaisePropertyChanged(nameof(Model)); this.Initialize(); }
public void Rename(string search, string replace) { TargetName = TargetName.Replace(search, replace); if (Action == InstallType.Update) { SourceName = SourceName.Replace(search, replace); RenameInDictionary(search, replace, true, true); } else { SearchReplaceRegExDictionary.Add(search, replace); } }
public override int GetHashCode() { unchecked // Overflow is fine { int hash = 17; hash = hash * 23 + (Field != null ? Field.GetHashCode() : 0); hash = hash * 23 + (IgnoreCase.HasValue ? IgnoreCase.Value.GetHashCode() : 0); hash = hash * 23 + (NameSeparator != null ? NameSeparator.GetHashCode() : 0); hash = hash * 23 + (TargetName != null ? TargetName.GetHashCode() : 0); hash = hash * 23 + (TargetType != null ? TargetType.GetHashCode() : 0); hash = hash * 23 + (UseQualifiedName.HasValue ? UseQualifiedName.Value.GetHashCode() : 0); return(hash); } }
public override int GetHashCode() { int hash = 1; if (TargetName.Length != 0) { hash ^= TargetName.GetHashCode(); } hash ^= watchVariables_.GetHashCode(); if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } return(hash); }
public bool Equals(MLTProject pProject) { return( pProject != null && SourceExists.Equals(pProject.SourceExists) && SourceIsValid.Equals(pProject.SourceIsValid) && TargetExists.Equals(pProject.TargetExists) && TargetIsValid.Equals(pProject.TargetIsValid) && TargetName.Equals(pProject.TargetName) && TargetPath.Equals(pProject.TargetPath) && FullPath.Equals(pProject.FullPath) && Job.Equals(pProject.Job) && Name.Equals(pProject.Name) && SourcePath.Equals(pProject.SourcePath)); }
public override bool Execute() { if (string.IsNullOrEmpty(LinkName)) { throw new InvalidOperationException("LinkName was not set"); } if (string.IsNullOrEmpty(TargetName)) { throw new InvalidOperationException("TargetName was not set"); } var exists = SymlinkTargetType == SymlinkTargetType.Directory ? Directory.Exists(LinkName) : File.Exists(LinkName); if (exists) { // if this is already a symlink, check if it points to the same target and if not then delete it var isSymlink = (File.GetAttributes(LinkName) & FileAttributes.ReparsePoint) == FileAttributes.ReparsePoint; if (isSymlink) { var querySymlinkTask = new QuerySymlink { LinkName = LinkName, TargetName = TargetName, TargetType = TargetType, BuildEngine = BuildEngine }; if (!querySymlinkTask.Execute()) { return(false); } Log.LogMessage(MessageImportance.Low, $"{SymlinkTargetType} '{LinkName}' is a symlink which points to '{querySymlinkTask.TargetName}'"); if (string.Equals(querySymlinkTask.TargetName, TargetName.TrimEnd('\\'), StringComparison.InvariantCultureIgnoreCase)) { // the symlink's target matches our target return(true); } Log.LogMessage(MessageImportance.Normal, $"Deleting symlink '{LinkName}' because it points to a different target '{querySymlinkTask.TargetName}'"); } else { Log.LogMessage(MessageImportance.Normal, $"{SymlinkTargetType} '{LinkName}' needs to be deleted before converting it to a symlink"); } // if this is reached then delete is needed DeleteDirectoryOrFile(); } var createSymlinkTask = new CreateSymlink { LinkName = LinkName, TargetName = TargetName, TargetType = TargetType, BuildEngine = BuildEngine }; return(createSymlinkTask.Execute()); }
/// <summary> /// Writes information about the targets in an assembly to a file /// </summary> /// <param name="ProjectFile">The project file for the targets being built</param> /// <param name="Assembly">The rules assembly for this target</param> /// <param name="OutputFile">Output file to write to</param> /// <param name="Arguments"></param> public static void WriteTargetInfo(FileReference ProjectFile, RulesAssembly Assembly, FileReference OutputFile, CommandLineArguments Arguments) { // Construct all the targets in this assembly List <string> TargetNames = new List <string>(); Assembly.GetAllTargetNames(TargetNames, false); // Write the output file DirectoryReference.CreateDirectory(OutputFile.Directory); using (JsonWriter Writer = new JsonWriter(OutputFile)) { Writer.WriteObjectStart(); Writer.WriteArrayStart("Targets"); foreach (string TargetName in TargetNames) { // skip target rules that are platform extension or platform group specializations string[] TargetPathSplit = TargetName.Split(new char[] { '_' }, StringSplitOptions.RemoveEmptyEntries); if (TargetPathSplit.Length > 1 && (UnrealTargetPlatform.IsValidName(TargetPathSplit.Last()) || UnrealPlatformGroup.IsValidName(TargetPathSplit.Last()))) { continue; } // Construct the rules object TargetRules TargetRules; try { string Architecture = UEBuildPlatform.GetBuildPlatform(BuildHostPlatform.Current.Platform).GetDefaultArchitecture(ProjectFile); TargetRules = Assembly.CreateTargetRules(TargetName, BuildHostPlatform.Current.Platform, UnrealTargetConfiguration.Development, Architecture, ProjectFile, Arguments); } catch (Exception Ex) { Log.TraceWarning("Unable to construct target rules for {0}", TargetName); Log.TraceVerbose(ExceptionUtils.FormatException(Ex)); continue; } // Write the target info Writer.WriteObjectStart(); Writer.WriteValue("Name", TargetName); Writer.WriteValue("Path", Assembly.GetTargetFileName(TargetName).ToString()); Writer.WriteValue("Type", TargetRules.Type.ToString()); Writer.WriteObjectEnd(); } Writer.WriteArrayEnd(); Writer.WriteObjectEnd(); } }
public IEnumerable <string> GetFilePaths(TargetName targetName) { var paths = new List <string>(); foreach (var kvp in targetName) { if (kvp.Value.Runtime != null) { foreach (var depInfo in kvp.Value.Runtime) { if (!depInfo.Key.StartsWith("Jacobi.Vst.")) // nuget package troubles { if (depInfo.Value.AssemblyVersion != null || depInfo.Value.FileVersion != null) { paths.Add(Path.Combine(_nugetPath, kvp.Key, depInfo.Key)); } if (!depInfo.Key.StartsWith("lib")) { paths.Add(Path.Combine(_binPath, depInfo.Key)); } } } } else { var platform = ToString(ProcessorArchitecture); // TODO: detect if the assemblies are at 'lib' or 'processor architecture' level // TODO: tfm from params (netcoreapp3.1) var path = Path.Combine(_nugetPath, kvp.Key, "lib", "netcoreapp3.1", platform); paths.AddRange(Directory.EnumerateFiles(path, "*.dll")); var rt = kvp.Value.RuntimeTargets?.Keys.FirstOrDefault(rt => rt.Contains(platform)); if (rt != null) { paths.Add(Path.Combine(_nugetPath, kvp.Key, rt)); } } } paths.AddRange(InteropDependencies .Select(dep => Path.Combine(_nugetPath, dep))); return(paths.Select(p => p.Replace("/", "\\")).Distinct()); }
public override int GetHashCode() { int hash = 1; if (HasTargetName) { hash ^= TargetName.GetHashCode(); } if (HasUri) { hash ^= Uri.GetHashCode(); } if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } return(hash); }
public override bool Execute() { if (string.IsNullOrEmpty(LinkName)) { throw new InvalidOperationException("LinkName was not set"); } if (string.IsNullOrEmpty(TargetName)) { throw new InvalidOperationException("TargetName was not set"); } var linkParentDirectory = Path.GetDirectoryName(LinkName.TrimEnd('\\')); try { if (linkParentDirectory != null && !Directory.Exists(linkParentDirectory)) { Directory.CreateDirectory(linkParentDirectory); } } catch (Exception ex) { Log.LogError($"Error creating symbolic link for {LinkName} <<====>> {TargetName}. Could not create parent directory {linkParentDirectory}: {ex.Message}"); return(false); } var result = NativeMethods.CreateSymbolicLink(LinkName.TrimEnd('\\'), TargetName.TrimEnd('\\'), _targetType); if (!result) { const uint requiredPrivilegeError = 0x80070522; if ((uint)Marshal.GetHRForLastWin32Error() == requiredPrivilegeError) { Log.LogError($"Error creating symbolic link for {LinkName} <<====>> {TargetName}. Try running the build from an elevated process."); return(false); } var exception = Win32Utils.GetExceptionForLastError(); Log.LogError($"Error creating symbolic link for {LinkName} <<====>> {TargetName}: {exception.Message}"); return(false); } Log.LogMessage(MessageImportance.High, $"Symbolic link created for {LinkName} <<====>> {TargetName}"); return(true); }
public IEnumerable <string> GetFilePaths(TargetName targetName) { var paths = new List <string>(); foreach (var kvp in targetName) { if (kvp.Value.Runtime != null) { foreach (var depInfo in kvp.Value.Runtime) { if (!depInfo.Key.StartsWith("Jacobi.Vst.")) // nuget package troubles { if (depInfo.Value.AssemblyVersion != null || depInfo.Value.FileVersion != null) { paths.Add(Path.Combine(_nugetPath, kvp.Key, depInfo.Key)); } if (!depInfo.Key.StartsWith("lib")) { paths.Add(Path.Combine(_binPath, depInfo.Key)); } } } } else { var platform = ToString(ProcessorArchitecture); var dependencies = FindDependencyFiles(kvp.Key, platform); paths.AddRange(dependencies); var rt = kvp.Value.RuntimeTargets?.Keys.FirstOrDefault(rt => rt.Contains(platform)); if (rt != null) { paths.Add(Path.Combine(_nugetPath, kvp.Key, rt)); } } } paths.AddRange(InteropDependencies .Select(dep => Path.Combine(_nugetPath, dep))); return(paths.Select(p => p.Replace("/", "\\")).Distinct()); }
private List <IBasicModule> AddTargetModules() { List <IBasicModule> modules = new List <IBasicModule>(); targetName = new TargetName("Target Name"); closest = new ClosestApproach("Closest Approach"); closestVel = new RelVelocityAtClosest("Rel Vel At Appr"); distance = new DistanceToTarget("Dist To Target"); relInc = new RelInclination("Rel Inclination"); relVel = new RelVelocity("Rel Velocity"); angToPro = new AngleToPrograde("Ang To Pro"); phaseAngle = new PhaseAngle("Phase Angle"); targetName.IsVisible = BasicSettings.Instance.showTargetName; targetName.AlwaysShow = BasicSettings.Instance.showTargetNameAlways; closest.IsVisible = BasicSettings.Instance.showClosestApproach; closest.AlwaysShow = BasicSettings.Instance.showClosestApproachAlways; closestVel.IsVisible = BasicSettings.Instance.showClosestApproachVelocity; closestVel.AlwaysShow = BasicSettings.Instance.showClosestApproachVelocityAlways; distance.IsVisible = BasicSettings.Instance.showDistance; distance.AlwaysShow = BasicSettings.Instance.showDistanceAlways; relInc.IsVisible = BasicSettings.Instance.showRelInclination; relInc.AlwaysShow = BasicSettings.Instance.showRelInclinationAlways; relVel.IsVisible = BasicSettings.Instance.showRelVelocity; relVel.AlwaysShow = BasicSettings.Instance.showRelVelocityAlways; angToPro.IsVisible = BasicSettings.Instance.showAngleToPrograde; angToPro.AlwaysShow = BasicSettings.Instance.showAngleToProgradeAlways; phaseAngle.IsVisible = BasicSettings.Instance.showPhaseAngle; phaseAngle.AlwaysShow = BasicSettings.Instance.showPhaseAngleAlways; modules.Add(relVel); modules.Add(relInc); modules.Add(angToPro); modules.Add(phaseAngle); modules.Add(closestVel); modules.Add(closest); modules.Add(distance); modules.Add(targetName); return(modules); }
public override int GetHashCode() { int hashcode = 0; if (InstanceId != null) { hashcode ^= InstanceId.GetHashCode(); } if (TargetName != null) { hashcode ^= TargetName.GetHashCode(); } if (DatabaseId != null) { hashcode ^= DatabaseId.GetHashCode(); } return(hashcode); }
public override string ToString() { try { StringBuilder output = new StringBuilder(); output.AppendLine($"HAL build info: {Info?.ToString()}"); output.AppendLine($" Target: {TargetName?.ToString()}"); output.AppendLine($" Platform: {PlatformName?.ToString()}"); output.AppendLine($" Type: {PlatformInfo}"); output.AppendLine(); return(output.ToString()); } catch { // OK to fail. Most likely because of a formatting issue. } return("ReleaseInfo is not valid!"); }
public override void Run(bool runChildren) { var pages = this.GetAncestorRawler().Where(n => n is Page); if (pages.Count() > 0) { var html = Html.Convert(this); if (string.IsNullOrEmpty(html)) { html = GetText(); } var targetName = TargetName.Convert(this); if (string.IsNullOrEmpty(targetName) == false) { if (pages.Where(n => n.Name == targetName).Any()) { pages.Where(n => n.Name == targetName).First().SetText(html); } else { ReportManage.ErrReport(this, "TargetName「" + targetName + "」が見つかりません"); } } else { pages.First().SetText(html); } SetText(html); } else { ReportManage.ErrUpperNotFound <Page>(this); } base.Run(runChildren); }
void ReleaseDesignerOutlets() { if (BottomConstraint != null) { BottomConstraint.Dispose(); BottomConstraint = null; } if (ChatEditMessage != null) { ChatEditMessage.Dispose(); ChatEditMessage = null; } if (ChatEditMessageContainer != null) { ChatEditMessageContainer.Dispose(); ChatEditMessageContainer = null; } if (ChatMessageWindow != null) { ChatMessageWindow.Dispose(); ChatMessageWindow = null; } if (ChatOneBack != null) { ChatOneBack.Dispose(); ChatOneBack = null; } if (ChatOneLeftConstraint != null) { ChatOneLeftConstraint.Dispose(); ChatOneLeftConstraint = null; } if (ChatOneRightConstraint != null) { ChatOneRightConstraint.Dispose(); ChatOneRightConstraint = null; } if (ChatSendMessage != null) { ChatSendMessage.Dispose(); ChatSendMessage = null; } if (ChatTargetImage != null) { ChatTargetImage.Dispose(); ChatTargetImage = null; } if (ChatViewProfile != null) { ChatViewProfile.Dispose(); ChatViewProfile = null; } if (MatchDate != null) { MatchDate.Dispose(); MatchDate = null; } if (MenuBlock != null) { MenuBlock.Dispose(); MenuBlock = null; } if (MenuContainer != null) { MenuContainer.Dispose(); MenuContainer = null; } if (MenuFriend != null) { MenuFriend.Dispose(); MenuFriend = null; } if (MenuIcon != null) { MenuIcon.Dispose(); MenuIcon = null; } if (MenuLayer != null) { MenuLayer.Dispose(); MenuLayer = null; } if (MenuLocationUpdates != null) { MenuLocationUpdates.Dispose(); MenuLocationUpdates = null; } if (MenuReport != null) { MenuReport.Dispose(); MenuReport = null; } if (MenuUnmatch != null) { MenuUnmatch.Dispose(); MenuUnmatch = null; } if (NoMessages != null) { NoMessages.Dispose(); NoMessages = null; } if (RoundBottom != null) { RoundBottom.Dispose(); RoundBottom = null; } if (Snackbar != null) { Snackbar.Dispose(); Snackbar = null; } if (SnackBottomConstraint != null) { SnackBottomConstraint.Dispose(); SnackBottomConstraint = null; } if (SnackTopConstraint != null) { SnackTopConstraint.Dispose(); SnackTopConstraint = null; } if (TargetName != null) { TargetName.Dispose(); TargetName = null; } if (UnmatchDate != null) { UnmatchDate.Dispose(); UnmatchDate = null; } }
public override ExitCode Execute() { string[] Arguments = this.Params; ProjectName = ParseParamValue("project", ProjectName); Targets = ParseParamValue("target", Targets); Platforms = ParseParamValue("platform", Platforms); Configurations = ParseParamValue("configuration", Configurations); Clean = ParseParam("clean") || Clean; if (string.IsNullOrEmpty(Targets)) { throw new AutomationException("No target specified with -target. Use -help to see all options"); } bool NoTools = ParseParam("notools"); IEnumerable <string> TargetList = Targets.Split(new char[] { '+' }, StringSplitOptions.RemoveEmptyEntries); IEnumerable <UnrealTargetConfiguration> ConfigurationList = null; IEnumerable <UnrealTargetPlatform> PlatformList = null; try { ConfigurationList = Configurations.Split(new char[] { '+' }, StringSplitOptions.RemoveEmptyEntries) .Select(C => (UnrealTargetConfiguration)Enum.Parse(typeof(UnrealTargetConfiguration), C, true)).ToArray(); } catch (Exception Ex) { LogError("Failed to parse configuration string. {0}", Ex.Message); return(ExitCode.Error_Arguments); } try { PlatformList = Platforms.Split(new char[] { '+' }, StringSplitOptions.RemoveEmptyEntries) .Select(C => { UnrealTargetPlatform Platform; if (!UnrealTargetPlatform.TryParse(C, out Platform)) { throw new AutomationException("No such platform {0}", C); } return(Platform); }).ToArray(); } catch (Exception Ex) { LogError("Failed to parse configuration string. {0}", Ex.Message); return(ExitCode.Error_Arguments); } FileReference ProjectFile = null; if (!string.IsNullOrEmpty(ProjectName)) { ProjectFile = ProjectUtils.FindProjectFileFromName(ProjectName); if (ProjectFile == null) { throw new AutomationException("Unable to find uproject file for {0}", ProjectName); } string SourceDirectoryName = Path.Combine(ProjectFile.Directory.FullName, "Source"); if (Directory.Exists(SourceDirectoryName)) { IEnumerable <string> TargetScripts = Directory.EnumerateFiles(SourceDirectoryName, "*.Target.cs"); foreach (string TargetName in TargetList) { string TargetScript = TargetScripts.Where(S => S.IndexOf(TargetName, StringComparison.OrdinalIgnoreCase) >= 0).FirstOrDefault(); if (TargetScript == null && ( TargetName.Equals("Client", StringComparison.OrdinalIgnoreCase) || TargetName.Equals("Game", StringComparison.OrdinalIgnoreCase) ) ) { // if there's no ProjectGame.Target.cs or ProjectClient.Target.cs then // fallback to Project.Target.cs TargetScript = TargetScripts.Where(S => S.IndexOf(ProjectName + ".", StringComparison.OrdinalIgnoreCase) >= 0).FirstOrDefault(); } if (TargetScript == null) { throw new AutomationException("No Target.cs file for target {0} in project {1}", TargetName, ProjectName); } string FullName = Path.GetFileName(TargetScript); TargetNames[TargetName] = Regex.Replace(FullName, ".Target.cs", "", RegexOptions.IgnoreCase); } } } else { Log.TraceWarning("No project specified, will build vanilla UE4 binaries"); } // Handle content-only projects or when no project was specified if (TargetNames.Keys.Count == 0) { foreach (string TargetName in TargetList) { TargetNames[TargetName] = string.Format("UE4{0}", TargetName); } } UE4Build Build = new UE4Build(this); UE4Build.BuildAgenda Agenda = new UE4Build.BuildAgenda(); string EditorTarget = TargetList.Where(T => T.EndsWith("Editor", StringComparison.OrdinalIgnoreCase)).FirstOrDefault(); IEnumerable <string> OtherTargets = TargetList.Where(T => T != EditorTarget); UnrealTargetPlatform CurrentPlatform = HostPlatform.Current.HostEditorPlatform; if (!NoTools) { Agenda.AddTarget("UnrealHeaderTool", CurrentPlatform, UnrealTargetConfiguration.Development, ProjectFile); } if (string.IsNullOrEmpty(EditorTarget) == false) { string TargetName = TargetNames[EditorTarget]; Agenda.AddTarget(TargetName, CurrentPlatform, UnrealTargetConfiguration.Development, ProjectFile); if (!NoTools) { Agenda.AddTarget("UnrealPak", CurrentPlatform, UnrealTargetConfiguration.Development, ProjectFile); Agenda.AddTarget("ShaderCompileWorker", CurrentPlatform, UnrealTargetConfiguration.Development); Agenda.AddTarget("UnrealLightmass", CurrentPlatform, UnrealTargetConfiguration.Development); Agenda.AddTarget("CrashReportClient", CurrentPlatform, UnrealTargetConfiguration.Shipping); Agenda.AddTarget("CrashReportClientEditor", CurrentPlatform, UnrealTargetConfiguration.Shipping); } } foreach (string Target in OtherTargets) { string TargetName = TargetNames[Target]; bool IsServer = Target.EndsWith("Server", StringComparison.OrdinalIgnoreCase); IEnumerable <UnrealTargetPlatform> PlatformsToBuild = IsServer ? new UnrealTargetPlatform[] { CurrentPlatform } : PlatformList; foreach (UnrealTargetPlatform Platform in PlatformsToBuild) { foreach (UnrealTargetConfiguration Config in ConfigurationList) { Agenda.AddTarget(TargetName, Platform, Config); } } } // Set clean and log foreach (var Target in Agenda.Targets) { if (Clean) { Target.Clean = Clean; } Log.TraceInformation("Will {0}build {1}", Clean ? "clean and " : "", Target); } Build.Build(Agenda, InUpdateVersionFiles: false); return(ExitCode.Success); }
public override void OnActionExecuting(ActionExecutingContext filterContext) { logService = new LogService(); bool isChange = false; LogViewModel logModel = new LogViewModel(); var user = (UserViewModel)HttpContext.Current.Session["user"]; int?userId = null; if (user != null) { userId = user.Id; } ILogService logger = new LogService(); CourseService courseService = new CourseService(); CategoryService categoryService = new CategoryService(); LearningOutcomeService learningOutcomeService = new LearningOutcomeService(); LevelService levelService = new LevelService(); int?targetId = null; int?importId = null; QuestionViewModel oldQuestionModel = new QuestionViewModel(); QuestionViewModel newQuestionModel = new QuestionViewModel(); IQuestionService questionService = new QuestionService(); int[] ids; if (IdParamName != null && filterContext.ActionParameters.ContainsKey(IdParamName)) { targetId = filterContext.ActionParameters[IdParamName] as Int32?; } else if (ObjectParamName != null && filterContext.ActionParameters.ContainsKey(ObjectParamName)) { newQuestionModel = filterContext.ActionParameters[ObjectParamName] as QuestionViewModel; targetId = newQuestionModel.GetType().GetProperty(IdParamName).GetValue(newQuestionModel, null) as Int32?; if (Action.Equals(Enum.GetName(typeof(LogEnum), LogEnum.Update)) && TargetName.ToLower().Equals("question")) { oldQuestionModel = questionService.GetQuestionById(newQuestionModel.Id); } } #region update Log if (Action.Equals(Enum.GetName(typeof(LogEnum), LogEnum.Update)) && TargetName.ToLower().Equals("question")) { QuestionViewModel questionViewModel = new QuestionViewModel(); oldQuestionModel.QuestionContent = WebUtility.HtmlDecode(oldQuestionModel.QuestionContent); if (oldQuestionModel.CategoryId != 0) { oldQuestionModel.Category = categoryService.GetCategoryById(oldQuestionModel.CategoryId).Name; } oldQuestionModel.Category = oldQuestionModel.CategoryId != 0 ? oldQuestionModel.Category : "[None of Category]"; oldQuestionModel.LevelName = oldQuestionModel.LevelId != 0 ? oldQuestionModel.LevelName : "[None of Level]"; oldQuestionModel.LearningOutcomeName = oldQuestionModel.LearningOutcomeId != 0 ? oldQuestionModel.LearningOutcomeName : "[None of LOC]"; for (int i = 0; i < oldQuestionModel.Options.Count; i++) { oldQuestionModel.Options[i].OptionContent = WebUtility.HtmlDecode(oldQuestionModel.Options[i].OptionContent); } logModel.OldValue = JsonConvert.SerializeObject(oldQuestionModel); if (newQuestionModel.QuestionContent != "") { newQuestionModel.QuestionCode = oldQuestionModel.QuestionCode != null?oldQuestionModel.QuestionCode.ToString() : ""; newQuestionModel.CourseId = oldQuestionModel.CourseId; //newQuestionModel.CategoryId = oldQuestionModel.CategoryId; if (newQuestionModel.CategoryId != 0) { newQuestionModel.Category = categoryService.GetCategoryById(newQuestionModel.CategoryId).Name; } newQuestionModel.Category = newQuestionModel.CategoryId != 0 ? newQuestionModel.Category : "[None of Category]"; if (newQuestionModel.LevelId != 0) { newQuestionModel.LevelName = levelService.GetLevelById(newQuestionModel.LevelId).Name; } newQuestionModel.LevelName = newQuestionModel.LevelId != 0 ? newQuestionModel.LevelName : "[None of Level]"; if (newQuestionModel.LearningOutcomeId != 0) { newQuestionModel.LearningOutcomeName = learningOutcomeService.GetLearingOutcomeById(newQuestionModel.LearningOutcomeId).Name; } newQuestionModel.LearningOutcomeName = newQuestionModel.LearningOutcomeId != 0 ? newQuestionModel.LearningOutcomeName : "[None of LOC]"; //newQuestionModel.Image = oldQuestionModel.Image; newQuestionModel.CourseName = oldQuestionModel.CourseName; //newQuestionModel.LearningOutcomeName = oldQuestionModel.LearningOutcomeName; //newQuestionModel.LevelName = oldQuestionModel.LevelName; newQuestionModel.QuestionContent = WebUtility.HtmlDecode(newQuestionModel.QuestionContent); for (int i = 0; i < newQuestionModel.Options.Count; i++) { newQuestionModel.Options[i].OptionContent = WebUtility.HtmlDecode(newQuestionModel.Options[i].OptionContent); } logModel.NewValue = JsonConvert.SerializeObject(newQuestionModel); } logModel.OldValue = JsonConvert.SerializeObject(oldQuestionModel); logModel.NewValue = JsonConvert.SerializeObject(newQuestionModel); logModel.UserId = userId; logModel.TargetId = targetId; logModel.Action = Action; logModel.TargetName = TargetName; logModel.LogDate = DateTime.Now; logModel.Message = Message; logModel.Controller = filterContext.ActionDescriptor.ControllerDescriptor.ControllerName; logModel.Method = filterContext.ActionDescriptor.ActionName; logModel.Fullname = Fullname; logModel.UserCode = UserCode; logger.Log(logModel); isChange = true; } if (Action.Equals(Enum.GetName(typeof(LogEnum), LogEnum.Update)) && TargetName.ToLower().Equals("rule")) { } #endregion #region move Question Log else if (Action.Equals(Enum.GetName(typeof(LogEnum), LogEnum.Move)) && TargetName.ToLower().Equals("question")) { int categoryId = 0; int learningOutComeId = 0; int levelId = 0; CourseViewModel courseView = new CourseViewModel(); LearningOutcomeViewModel learningOutcomeViewModel = new LearningOutcomeViewModel(); LevelViewModel levelViewModel = new LevelViewModel(); CategoryViewModel categoryView = new CategoryViewModel(); if (filterContext.ActionParameters.ContainsKey(IdParamName)) { ids = filterContext.ActionParameters[IdParamName] as int[]; categoryId = filterContext.ActionParameters[CateParamName] != null ? (int)filterContext.ActionParameters[CateParamName] : 0; learningOutComeId = filterContext.ActionParameters[LocParamName] != null ? (int)filterContext.ActionParameters[LocParamName] : 0; levelId = (int)filterContext.ActionParameters[LevelParamName]; if (ids != null) { foreach (var item in ids) { if (item != 0) { targetId = item; oldQuestionModel = questionService.GetQuestionById((int)targetId); if (oldQuestionModel.CategoryId != 0) { oldQuestionModel.Category = categoryService.GetCategoryById(oldQuestionModel.CategoryId).Name; } oldQuestionModel.Category = oldQuestionModel.CategoryId != 0 ? oldQuestionModel.Category : "[None of Category]"; oldQuestionModel.LevelName = oldQuestionModel.LevelId != 0 ? oldQuestionModel.LevelName : "[None of Level]"; oldQuestionModel.LearningOutcomeName = oldQuestionModel.LearningOutcomeId != 0 ? oldQuestionModel.LearningOutcomeName : "[None of LOC]"; newQuestionModel.LearningOutcomeId = learningOutComeId; newQuestionModel.LevelId = levelId; if (categoryId != 0) { newQuestionModel.Category = categoryService.GetCategoryById(categoryId).Name; } newQuestionModel.Category = categoryId != 0 ? newQuestionModel.Category : "[None of Category]"; //newQuestionModel.CourseId = oldQuestionModel.CourseId; courseView = courseService.GetCourseById(oldQuestionModel.CourseId); newQuestionModel.CourseName = courseView.Name; if (learningOutComeId != 0) { learningOutcomeViewModel = learningOutcomeService.GetLearingOutcomeById(learningOutComeId); } newQuestionModel.LearningOutcomeName = learningOutComeId != 0 ? learningOutcomeViewModel.Name : "[None of LOC]"; if (levelId != 0) { levelViewModel = levelService.GetLevelById(levelId); } newQuestionModel.LevelName = levelId != 0 ? levelViewModel.Name : "[None of level]"; //newQues.CourseName = oldValue.CourseName; //newQues.LearningOutcomeName = oldValue.LearningOutcomeName; //newQues.LevelName = oldValue.LevelName; newQuestionModel.QuestionContent = oldQuestionModel.QuestionContent; newQuestionModel.Id = oldQuestionModel.Id; newQuestionModel.QuestionCode = oldQuestionModel.QuestionCode; newQuestionModel.Options = oldQuestionModel.Options; #region log to db logModel.OldValue = JsonConvert.SerializeObject(oldQuestionModel); logModel.NewValue = JsonConvert.SerializeObject(newQuestionModel); logModel.UserId = userId; logModel.TargetId = targetId; logModel.Action = Action; logModel.TargetName = TargetName; logModel.LogDate = DateTime.Now; logModel.Message = Message; logModel.Controller = filterContext.ActionDescriptor.ControllerDescriptor.ControllerName; logModel.Method = filterContext.ActionDescriptor.ActionName; logger.Log(logModel); logModel = new LogViewModel(); isChange = true; #endregion } } } } } #endregion else if (isChange == false) { logModel.OldValue = OldValue; logModel.NewValue = NewValue; if (newQuestionModel != null && !String.IsNullOrWhiteSpace(NewValue)) { for (int i = 0; i < newQuestionModel.Options.Count; i++) { newQuestionModel.Options[i].OptionContent = WebUtility.HtmlDecode(newQuestionModel.Options[i].OptionContent); } logModel.NewValue = JsonConvert.SerializeObject(newQuestionModel); } if (Action.Equals(Enum.GetName(typeof(LogEnum), LogEnum.Cancel))) { logModel.Status = (int)StatusEnum.Canceled; } if (Action.Equals(Enum.GetName(typeof(LogEnum), LogEnum.Save))) { logModel.Status = (int)StatusEnum.Done; } else { logModel.Status = (int)StatusEnum.Checked; } logModel.OldValue = JsonConvert.SerializeObject(oldQuestionModel); logModel.NewValue = JsonConvert.SerializeObject(newQuestionModel); logModel.UserId = userId; logModel.TargetId = targetId; logModel.Action = Action; logModel.TargetName = TargetName; logModel.LogDate = DateTime.Now; logModel.Message = Message; logModel.Controller = filterContext.ActionDescriptor.ControllerDescriptor.ControllerName; logModel.Method = filterContext.ActionDescriptor.ActionName; logModel.Fullname = Fullname; logModel.UserCode = UserCode; logger.Log(logModel); } #region comment /*if (!Action.ToLower().Equals("move")) * { * logModel.UserId = userId; * logModel.TargetId = targetId; * logModel.Action = Action; * logModel.TargetName = TargetName; * logModel.LogDate = DateTime.Now; * logModel.Message = Message; * logModel.Controller = filterContext.ActionDescriptor.ControllerDescriptor.ControllerName; * logModel.Method = filterContext.ActionDescriptor.ActionName; * * } * else * { * logModel.UserId = userId; * logModel.TargetId = targetId; * logModel.Action = Action; * logModel.TargetName = TargetName; * logModel.LogDate = DateTime.Now; * logModel.Message = Message; * logModel.Controller = filterContext.ActionDescriptor.ControllerDescriptor.ControllerName; * logModel.Method = filterContext.ActionDescriptor.ActionName; * logModel.Fullname = Fullname; * logModel.UserCode = UserCode; * }*/ //else //{ // logModel.OldValue = JsonConvert.SerializeObject(oldQuestionModel); // logModel.NewValue = JsonConvert.SerializeObject(newQuestionModel); // logModel.UserId = userId; // logModel.TargetId = targetId; // logModel.Action = Action; // logModel.TargetName = TargetName; // logModel.LogDate = DateTime.Now; // logModel.Message = Message; // logModel.Controller = filterContext.ActionDescriptor.ControllerDescriptor.ControllerName; // logModel.Method = filterContext.ActionDescriptor.ActionName; // logModel.Fullname = Fullname; // logModel.UserCode = UserCode; // logger.Log(logModel); //} #endregion }
void Apply() { relationship = new Schemas.Relationship(Model); string neo4jType; string relationshipName; switch (SourceType) { case PropertyType.None: throw new NotSupportedException(string.Format("Source Property Type {0} is currently not supported", SourceType)); case PropertyType.Lookup: switch (TargetType) { case PropertyType.None: relationshipName = string.Concat(SourceName.ToUpper(), "_HAS_", TargetName.ToUpper()); neo4jType = string.Concat("HAS_", TargetName.ToUpper()); relationship.InProperty = TargetName; relationship.InPropertyType = PropertyType.Lookup.ToString(); break; case PropertyType.Lookup: relationshipName = string.Concat(SourceName.ToUpper(), "_IS_", TargetName.ToUpper()); neo4jType = string.Concat("IS_", TargetName.ToUpper()); relationship.InProperty = TargetName; relationship.InPropertyType = PropertyType.Lookup.ToString(); relationship.OutProperty = SourceName; relationship.OutPropertyType = PropertyType.Lookup.ToString(); break; case PropertyType.Collection: relationshipName = string.Concat(SourceName.ToUpper(), "_VALID_FOR_", TargetName.ToUpper()); neo4jType = string.Concat("VALID_FOR_", TargetName.ToUpper()); relationship.InProperty = TargetName; relationship.InPropertyType = PropertyType.Lookup.ToString(); relationship.OutProperty = SourceName.ToPlural(); relationship.OutPropertyType = PropertyType.Collection.ToString(); break; default: throw new NotSupportedException(string.Format("Target Property Type value {0} is currently not supported", TargetType)); } break; case PropertyType.Collection: switch (TargetType) { case PropertyType.None: relationshipName = string.Concat(SourceName.ToUpper(), "_CONTAINS_", TargetName.ToUpper()); neo4jType = string.Concat("CONTAINS_", TargetName.ToUpper()); relationship.InProperty = TargetName.ToPlural(); relationship.InPropertyType = PropertyType.Collection.ToString(); break; case PropertyType.Lookup: relationshipName = string.Concat(SourceName.ToUpper(), "_CONTAINS_", TargetName.ToUpper()); neo4jType = string.Concat("CONTAINS_", TargetName.ToUpper()); relationship.InProperty = TargetName.ToPlural(); relationship.InPropertyType = PropertyType.Collection.ToString(); relationship.OutProperty = SourceName; relationship.OutPropertyType = PropertyType.Lookup.ToString(); break; case PropertyType.Collection: relationshipName = string.Concat(SourceName.ToUpper(), "_CONTAINS_", TargetName.ToUpper()); neo4jType = string.Concat("CONTAINS_", TargetName.ToUpper()); relationship.InProperty = TargetName.ToPlural(); relationship.InPropertyType = PropertyType.Collection.ToString(); relationship.OutProperty = SourceName.ToPlural(); relationship.OutPropertyType = PropertyType.Collection.ToString(); break; default: throw new NotSupportedException(string.Format("Target Property Type value {0} is currently not supported", TargetType)); } break; default: throw new NotSupportedException(string.Format("Source Property Type {0} is currently not supported", SourceType)); } lblCardinality.Text = GetRelationshipCardinality(); if (cbAutoLabel.Checked == false) { return; } txtRelationshipName.Text = relationshipName; txtNeo4jName.Text = neo4jType; }
/// <summary> /// Returns a string representation of this <see cref="PrivateMessageBase"/> instance. /// </summary> /// <returns>A string representation of this Channel instance.</returns> public override string ToString() { return(TargetName.ToString()); }
public override int GetHashCode() { return(TargetName.GetHashCodeOrdSenseCase()); }
private void InitializeAttackVectors() { string URL; URL = ctlConnection1.UseSsl == true ? "https://" : "http://"; URL += ctlConnection1.TargetUrl; string Method = ctlConnection1.ConnectMethod; if (Method.Equals("")) { return; } SafelyChangeCursor(Cursors.WaitCursor); // Generate StringDict string TargetName, TargetField; bool InjectAsString; TargetName = String.Empty; TargetField = String.Empty; NameValueCollection Others = new NameValueCollection(); NameValueCollection Cookies = new NameValueCollection(); Others = FormParameters.FormParameters(ref TargetName, ref TargetField, out InjectAsString); Cookies = FormParameters.Cookies; if (TargetName.Equals(String.Empty)) { UserStatus("No Injection Point Found"); SafelyChangeCursor(Cursors.Default); return; } UserStatus("Beginning Preliminary Scan"); try { SafelyChangeEnableOfControl(butInitializeInjection, false); AttackVectorFactory avf; InjectionOptions opts; if (optBlindInjection.Checked == true) { opts = new BlindInjectionOptions(); ((BlindInjectionOptions)opts).Tolerance = _AbsintheState.FilterTolerance; ((BlindInjectionOptions)opts).Delimiter = _AbsintheState.FilterDelimiter; } else { opts = new ErrorInjectionOptions(); ((ErrorInjectionOptions)opts).VerifyVersion = chkVerifyVersion.Checked; } opts.TerminateQuery = _AbsintheState.TerminateQuery; opts.Cookies = Cookies; opts.WebProxies = _AppSettings.ProxyQueue(); opts.InjectAsString = InjectAsString; opts.UserAgent = _AbsintheState.UserAgent; opts.AuthCredentials = ctlUserAuth1.NetworkCredential; opts.AppendedQuery = _AbsintheState.AppendedText; avf = new AttackVectorFactory(URL, TargetName, TargetField, Others, Method, opts); avf.UserStatus += new UserEvents.UserStatusEventHandler(UserStatus); int PluginNumber = Array.IndexOf(_PluginEntries, _AbsintheState.LoadedPluginName); IPlugin pt = null; if (optBlindInjection.Checked) { foreach (IPlugin bp in _AbsintheState.PluginList) { if (bp.GetType().GetInterface("IBlindPlugin") != null) { if (bp.PluginDisplayTargetName == _AbsintheState.LoadedPluginName) { pt = (IPlugin)bp; break; } } } _AbsintheState.TargetAttackVector = avf.BuildBlindSqlAttackVector(_AbsintheState.FilterTolerance, (IBlindPlugin)pt); UserStatus("Finished initial scan"); } else if (optErrorBasedInjection.Checked) { if (PluginNumber <= 0) { pt = AutoDetectPlugin(avf); } else { foreach (IPlugin ep in _AbsintheState.PluginList) { if (ep.PluginDisplayTargetName == _AbsintheState.LoadedPluginName) { pt = (IPlugin)ep; break; } } } if (pt != null) { try { _AbsintheState.TargetAttackVector = avf.BuildSqlErrorAttackVector((IErrorPlugin)pt); UserStatus("Finished initial scan"); } catch (UnsupportedSQLErrorVersionException sqlex) { ErrorReportingDelegate ts = new ErrorReportingDelegate(ThreadUnsafeDisplayErrorReportDialog); this.Invoke(ts, new object[] { sqlex.VersionErrorPageHtml, sqlex.HavingErrorPageHtml }); } } } } catch (Exception e) { System.Diagnostics.Debug.WriteLine(e.ToString()); UserStatus(e.Message); } finally { SafelyChangeEnableOfControl(butInitializeInjection, true); SafelyChangeCursor(Cursors.Default); } }