public ParamDefOptions(ParamDef pd) { Name = pd.Name; Sequence = pd.Sequence; Attributes = pd.Attributes; Constant = pd.Constant; MarshalType = pd.MarshalType; CustomAttributes.AddRange(pd.CustomAttributes); }
public ParamDef CopyTo(ParamDef pd) { pd.Name = Name ?? UTF8String.Empty; pd.Sequence = Sequence; pd.Attributes = Attributes; pd.Constant = Constant; pd.MarshalType = MarshalType; pd.CustomAttributes.Clear(); pd.CustomAttributes.AddRange(CustomAttributes); return pd; }
ParamDef UpdateRowId_NoLock(ParamDef pd) { var dt = method.DeclaringType; if (dt == null) { return(pd); } var module = dt.Module; if (module == null) { return(pd); } return(module.UpdateRowId(pd)); }
internal void CreateParamDef(Parameter param) { var paramDef = FindParamDef(param); if (paramDef != null) { return; } if (param.IsHiddenThisParameter) { hiddenThisParamDef = UpdateRowId(new ParamDefUser(UTF8String.Empty, ushort.MaxValue, 0)); return; } int seq = param.IsReturnTypeParameter ? 0 : param.MethodSigIndex + 1; paramDef = UpdateRowId(new ParamDefUser(UTF8String.Empty, (ushort)seq, 0)); method.ParamDefs.Add(paramDef); }
internal void CreateParamDef(Parameter param) { #if THREAD_SAFE theLock.EnterWriteLock(); try { #endif var paramDef = FindParamDef_NoLock(param); if (paramDef != null) { return; } if (param.IsHiddenThisParameter) { hiddenThisParamDef = UpdateRowId_NoLock(new ParamDefUser(UTF8String.Empty, ushort.MaxValue, 0)); return; } int seq = param.IsReturnTypeParameter ? 0 : param.MethodSigIndex + 1; paramDef = UpdateRowId_NoLock(new ParamDefUser(UTF8String.Empty, (ushort)seq, 0)); method.ParamDefs.Add(paramDef); #if THREAD_SAFE } finally { theLock.ExitWriteLock(); } #endif }
bool WriteRefIfByRef(ITextOutput output, TypeSig typeSig, ParamDef pd) { if (typeSig.RemovePinnedAndModifiers() is ByRefSig) { if (pd != null && (!pd.IsIn && pd.IsOut)) { output.Write("out", TextTokenType.Keyword); output.WriteSpace(); } else { output.Write("ref", TextTokenType.Keyword); output.WriteSpace(); } return true; } return false; }
/// <inheritdoc/> void IListListener <ParamDef> .OnRemove(int index, ParamDef value) { value.DeclaringMethod = null; }
/// <inheritdoc/> void IListListener <ParamDef> .OnLazyAdd(int index, ref ParamDef value) { OnLazyAdd2(index, ref value); }
public virtual DocumentTreeNodeFilterResult GetResult(MethodDef method, ParamDef param) => filter.GetResult(method, param);
public virtual FileTreeNodeFilterResult GetResult(MethodDef method, ParamDef param) { return this.filter.GetResult(method, param); }
public virtual DocumentTreeNodeFilterResult GetResult(MethodDef method, ParamDef param) => new DocumentTreeNodeFilterResult();
void Write(TypeSig type, ParamDef ownerParam, IList<TypeSig> typeGenArgs, IList<TypeSig> methGenArgs) { WriteRefIfByRef(type, ownerParam); var byRef = type.RemovePinnedAndModifiers() as ByRefSig; if (byRef != null) type = byRef.Next; Write(type, typeGenArgs, methGenArgs); }
void Add(ParamDef pd) { if (pd == null) return; Add(pd.DeclaringMethod); Add(pd.CustomAttributes); Add(pd.MarshalType); }
public void WriteType(ISyntaxHighlightOutput output, ITypeDefOrRef type, bool includeNamespace, ParamDef pd = null) { TypeToString(SyntaxHighlightOutputToTextOutput.Create(output), type, includeNamespace, pd); }
public virtual FileTreeNodeFilterResult GetResult(MethodDef method, ParamDef param) { return new FileTreeNodeFilterResult(); }
public virtual DocumentTreeNodeFilterResult GetResult(MethodDef method, ParamDef param) => new DocumentTreeNodeFilterResult(FilterType.Hide, false);
public virtual FileTreeNodeFilterResult GetResult(MethodDef method, ParamDef param) { return new FileTreeNodeFilterResult(FilterType.Hide, false); }
public virtual TreeViewNodeFilterResult GetFilterResult(MethodDef method, ParamDef param) { return new TreeViewNodeFilterResult(FilterResult.Hidden, false); }
public virtual TreeViewNodeFilterResult GetFilterResult(MethodDef method, ParamDef param) { return filter.GetFilterResult(method, param); }
public void WriteType(ITextColorWriter output, ITypeDefOrRef type, bool includeNamespace, ParamDef pd = null) => TypeToString(TextColorWriterToDecompilerOutput.Create(output), type, includeNamespace, pd);
public override DocumentTreeNodeFilterResult GetResult(MethodDef method, ParamDef param) { var visibleFlags = VisibleMembersFlags.ParamDef | VisibleMembersFlags.Attributes; bool isMatch = (flags & VisibleMembersFlags.ParamDef) != 0; if ((flags & visibleFlags) == 0) return new DocumentTreeNodeFilterResult(FilterType.Hide, isMatch); if (isMatch) return new DocumentTreeNodeFilterResult(FilterType.Visible, isMatch); // Make sure it's not hidden return new DocumentTreeNodeFilterResult(FilterType.CheckChildren, isMatch); }
public override TreeViewNodeFilterResult GetFilterResult(MethodDef method, ParamDef param) { bool isMatch = (flags & VisibleMembersFlags.ParamDef) != 0; if (!isMatch) return new TreeViewNodeFilterResult(FilterResult.Hidden, isMatch); return new TreeViewNodeFilterResult(FilterResult.Match, isMatch); }
bool WriteRefIfByRef(IDecompilerOutput output, TypeSig typeSig, ParamDef pd) { if (typeSig.RemovePinnedAndModifiers() is ByRefSig) { if (pd != null && (!pd.IsIn && pd.IsOut)) { output.Write("out", BoxedTextColor.Keyword); output.Write(" ", BoxedTextColor.Text); } else { output.Write("ref", BoxedTextColor.Keyword); output.Write(" ", BoxedTextColor.Text); } return true; } return false; }