public void Save(string newFilename, MetaDataFlags mdFlags, IModuleWriterListener writerListener) { if (module.IsILOnly) { var writerOptions = new ModuleWriterOptions(module, writerListener); writerOptions.MetaDataOptions.Flags |= mdFlags; writerOptions.Logger = Logger.Instance; if (Logger.Instance.ForcePDBGeneration) { writerOptions.WritePdb = true; module.CreatePdbState(); } module.Write(newFilename, writerOptions); } else { var writerOptions = new NativeModuleWriterOptions(module, writerListener); writerOptions.MetaDataOptions.Flags |= mdFlags; writerOptions.Logger = Logger.Instance; writerOptions.KeepExtraPEData = true; writerOptions.KeepWin32Resources = true; if (Logger.Instance.ForcePDBGeneration) { writerOptions.WritePdb = true; module.CreatePdbState(); } module.NativeWrite(newFilename, writerOptions); } }
public void AddFlag(EntityUid uid, MetaDataFlags flags, MetaDataComponent?component = null) { if (!Resolve(uid, ref component)) { return; } component.Flags |= flags; }
public void Save(string newFilename, MetaDataFlags mdFlags, IModuleWriterListener writerListener) { if (module.IsILOnly) { var writerOptions = new ModuleWriterOptions(module, writerListener); writerOptions.MetaDataOptions.Flags |= mdFlags; writerOptions.Logger = Logger.Instance; module.Write(newFilename, writerOptions); } else { var writerOptions = new NativeModuleWriterOptions(module, writerListener); writerOptions.MetaDataOptions.Flags |= mdFlags; writerOptions.Logger = Logger.Instance; writerOptions.KeepExtraPEData = true; writerOptions.KeepWin32Resources = true; module.NativeWrite(newFilename, writerOptions); } }
public void save(Stream memStream, MetaDataFlags mdFlags, IModuleWriterListener writerListener) { if (module.IsILOnly) { var writerOptions = new ModuleWriterOptions(module, writerListener); writerOptions.MetaDataOptions.Flags |= mdFlags; writerOptions.Logger = Logger.Instance; module.Write(memStream, writerOptions); } else { var writerOptions = new NativeModuleWriterOptions(module, writerListener); writerOptions.MetaDataOptions.Flags |= mdFlags; writerOptions.Logger = Logger.Instance; writerOptions.KeepExtraPEData = true; writerOptions.KeepWin32Resources = true; module.NativeWrite(memStream, writerOptions); } }
/// <summary> /// Attempts to remove the specific flag from metadata. /// Other systems can choose not to allow the removal if it's still relevant. /// </summary> public void RemoveFlag(EntityUid uid, MetaDataFlags flags, MetaDataComponent?component = null) { if (!Resolve(uid, ref component) || (component.Flags & flags) == 0x0) { return; } var ev = new MetaFlagRemoveAttemptEvent(); EntityManager.EventBus.RaiseLocalEvent(component.Owner, ref ev); if (ev.Cancelled) { return; } component.Flags &= ~flags; }
void SetFlagValue(MetaDataFlags flag, bool value, string prop1, string prop2 = null) { bool origValue = (Flags & flag) != 0; if (origValue == value) { return; } if (value) { Flags |= flag; } else { Flags &= ~flag; } OnPropertyChanged(prop1); if (prop2 != null) { OnPropertyChanged(prop2); } }
bool GetFlagValue(MetaDataFlags flag) => (Flags & flag) != 0;
void SetFlagValue(MetaDataFlags flag, bool value, string prop1, string prop2 = null) { bool origValue = (Flags & flag) != 0; if (origValue == value) return; if (value) Flags |= flag; else Flags &= ~flag; OnPropertyChanged(prop1); if (prop2 != null) OnPropertyChanged(prop2); }
bool GetFlagValue(MetaDataFlags flag) { return (Flags & flag) != 0; }
bool GetFlagValue(MetaDataFlags flag) => (Flags & flag) != 0;