public ParameterDefinition BuildParameterDefinition(string name, int sequence, ParamAttributes attrs, Param psig, GenericContext context) { ParameterDefinition ret = new ParameterDefinition(name, sequence, attrs, null); TypeReference paramType = null; if (psig.ByRef) { paramType = new ReferenceType(GetTypeRefFromSig(psig.Type, context)); } else if (psig.TypedByRef) { paramType = SearchCoreType(Constants.TypedReference); } else { paramType = GetTypeRefFromSig(psig.Type, context); } if (psig.CustomMods.Length > 0) { paramType = GetModifierType(psig.CustomMods, paramType); } ret.ParameterType = paramType; return(ret); }
public MDParamInfo(string name, uint token, uint seq, ParamAttributes flags) { this.Name = name; this.Token = token; this.Sequence = seq; this.Flags = flags; }
/// <summary> /// Set or clear flags in <see cref="attributes"/> /// </summary> /// <param name="set"><c>true</c> if flags should be set, <c>false</c> if flags should /// be cleared</param> /// <param name="flags">Flags to set or clear</param> void ModifyAttributes(bool set, ParamAttributes flags) { #if THREAD_SAFE int origVal, newVal; do { origVal = attributes; if (set) { newVal = origVal | (int)flags; } else { newVal = origVal & ~(int)flags; } } while (Interlocked.CompareExchange(ref attributes, newVal, origVal) != origVal); #else if (set) { attributes |= (int)flags; } else { attributes &= ~(int)flags; } #endif }
public MDParamInfo(string name, uint token, uint seq, ParamAttributes flags) { Name = name; Token = token; Sequence = seq; Flags = flags; }
public ParameterDefinition(string name, int seq, ParamAttributes attrs, TypeReference paramType) { m_name = name; m_sequence = seq; m_attributes = attrs; m_paramType = paramType; }
public ParamDefOptions(ParamDef pd) { Name = pd.Name; Sequence = pd.Sequence; Attributes = pd.Attributes; Constant = pd.Constant; MarshalType = pd.MarshalType; CustomAttributes.AddRange(pd.CustomAttributes); }
public ParameterImpl(AssemblyLoader loader, MetadataRow row, int index) : base(loader, TableId.Param, index) { _flags = ((ParamAttributes)row[Schema.Param.Flags].Value); Index = ((int)row[Schema.Param.Sequence].Value); Name = row[Schema.Param.Name].String; Value = Loader.Const[MetadataToken]; }
public ParamDefOptions(ParamDef pd) { this.Name = pd.Name; this.Sequence = pd.Sequence; this.Attributes = pd.Attributes; this.Constant = pd.Constant; this.MarshalType = pd.MarshalType; this.CustomAttributes.AddRange(pd.CustomAttributes); }
public ParamRow CreateParamRow(ParamAttributes _flags, ushort _sequence, uint _name) { ParamRow row = new ParamRow(); row.Flags = _flags; row.Sequence = _sequence; row.Name = _name; return(row); }
void SetFlagValue(ParamAttributes flag, bool value) { if (value) { Attributes |= flag; } else { Attributes &= ~flag; } }
public static void MakeAccessible(this ParamDef parameter, AccessMode mode) { if (parameter.IsAccessible(mode)) { return; } ParamAttributes attributes = parameter.Attributes; if (mode.HasFlag(AccessMode.Read)) { attributes &= ~ParamAttributes.Out; } if (mode.HasFlag(AccessMode.Write)) { attributes &= ~ParamAttributes.In; } parameter.Attributes = attributes; }
private void PrintHelpMsg() { string processName = Process.GetCurrentProcess().ProcessName + ".exe"; ColorWriteLine(HelpColor, "Usage of " + processName + ":"); string usageLine = string.Format(" {0} [{1}] (parameter list)", processName, string.Join("|", OptionDescriptions.Keys)); ColorWriteLine(HelpColor, usageLine); ColorWriteLine(HelpColor, " ** parameter format: /PARAMNAME:PARAMVALUE"); ColorWriteLine(HelpColor, " ** for bool type, /PARAMNAME /PARAMNAME:1 /PARAMNAME:true are all 'true'"); Console.WriteLine(); // if option is correct, only print attr associate with this option if (!string.IsNullOrEmpty(SelectedOptionName) && ParamAttributes.ContainsKey(SelectedOptionName)) { ColorWriteLine(HelpColor, "Parameter usage of selected option name '{0}' :", SelectedOptionName); ColorWriteLine(HelpColor, " Option: {0} ({1})", SelectedOptionName, OptionDescriptions[SelectedOptionName]); foreach (var attr in ParamAttributes[SelectedOptionName].Values) { ColorWriteLine(HelpColor, GetArgumentParameterUsage(attr)); } return; // no further help msg } foreach (var optionDesc in OptionDescriptions) { ColorWriteLine(HelpColor, " Option: {0} ({1})", optionDesc.Key, optionDesc.Value); if (ParamAttributes.ContainsKey(optionDesc.Key)) { foreach (var attr in ParamAttributes[optionDesc.Key].Values) { ColorWriteLine(HelpColor, GetArgumentParameterUsage(attr)); } } Console.WriteLine(); } }
public extern static ReactElement Param(ParamAttributes properties, params ReactElementOrText[] children);
public unsafe static bool GetParamSeqAndAttrs(IMetaDataImport mdi, uint token, out uint seq, out ParamAttributes attrs) { seq = uint.MaxValue; attrs = 0; if (mdi == null) return false; uint ulSequence, dwAttr; int hr = mdi.GetParamProps(token, IntPtr.Zero, new IntPtr(&ulSequence), IntPtr.Zero, 0, IntPtr.Zero, new IntPtr(&dwAttr), IntPtr.Zero, IntPtr.Zero, IntPtr.Zero); if (hr != 0) return false; seq = ulSequence; attrs = (ParamAttributes)dwAttr; return true; }
private void Add(ParamAttributes a) { }
bool GetFlagValue(ParamAttributes flag) { return (Attributes & flag) != 0; }
void SetFlagValue(ParamAttributes flag, bool value) { if (value) Attributes |= flag; else Attributes &= ~flag; }
/// <summary> /// Constructor /// </summary> /// <param name="name">Name</param> /// <param name="sequence">Sequence</param> /// <param name="flags">Flags</param> public ParamDefUser(UTF8String name, ushort sequence, ParamAttributes flags) { this.name = name; this.sequence = sequence; this.flags = flags; }
private void LoadData(CLIFile pFile) { Flags = (ParamAttributes)pFile.ReadUInt16(); Sequence = pFile.ReadUInt16(); Name = pFile.ReadStringHeap(pFile.ReadHeapIndex(HeapOffsetSizes.Strings32Bit)); }
bool GetFlagValue(ParamAttributes flag) { return((Attributes & flag) != 0); }
bool GetFlagValue(ParamAttributes flag) => (Attributes & flag) != 0;
/// <summary> /// Constructor /// </summary> /// <param name="name">Name</param> /// <param name="sequence">Sequence</param> /// <param name="flags">Flags</param> public ParamDefUser(UTF8String name, ushort sequence, ParamAttributes flags) { this.name = name; this.sequence = sequence; this.attributes = (int)flags; }
public ParamRow CreateParamRow(ParamAttributes _flags, ushort _sequence, uint _name) { ParamRow row = new ParamRow (); row.Flags = _flags; row.Sequence = _sequence; row.Name = _name; return row; }
void Add(ParamAttributes a) { }
/// <summary> /// Set or clear flags in <see cref="attributes"/> /// </summary> /// <param name="set"><c>true</c> if flags should be set, <c>false</c> if flags should /// be cleared</param> /// <param name="flags">Flags to set or clear</param> void ModifyAttributes(bool set, ParamAttributes flags) { #if THREAD_SAFE int origVal, newVal; do { origVal = attributes; if (set) newVal = origVal | (int)flags; else newVal = origVal & ~(int)flags; } while (Interlocked.CompareExchange(ref attributes, newVal, origVal) != origVal); #else if (set) attributes |= (int)flags; else attributes &= ~(int)flags; #endif }