本文整理汇总了C#中RawComment类的典型用法代码示例。如果您正苦于以下问题:C# RawComment类的具体用法?C# RawComment怎么用?C# RawComment使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
RawComment类属于命名空间,在下文中一共展示了RawComment类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: __CopyValue
private static RawComment.Internal* __CopyValue(RawComment.Internal native)
{
var ret = Marshal.AllocHGlobal(64);
CppSharp.Parser.AST.RawComment.Internal.cctor_2(ret, new global::System.IntPtr(&native));
return (RawComment.Internal*) ret;
}
示例2: RawComment
protected RawComment(RawComment.Internal* native, bool skipVTables = false)
{
if (native == null)
return;
__Instance = new global::System.IntPtr(native);
}
示例3: __CreateInstance
public static RawComment __CreateInstance(RawComment.Internal native)
{
return new RawComment(native);
}
示例4: __CreateInstance
public static RawComment __CreateInstance(RawComment.Internal native, bool skipVTables = false)
{
return new RawComment(native, skipVTables);
}
示例5: DocumentProperty
public void DocumentProperty(Property property)
{
var expansions = property.Namespace.PreprocessedEntities.OfType<MacroExpansion>();
var properties = expansions.Where(e => e.Text.Contains("Q_PROPERTY") || e.Text.Contains("QDOC_PROPERTY"));
string alternativeName = property.Name.Length == 1 ? property.Name :
"is" + StringHelpers.UppercaseFirst(property.Name);
foreach (var macroExpansion in properties)
{
var name = macroExpansion.Text.Split(' ')[1];
if (name == property.Name || name == alternativeName)
{
property.LineNumberStart = macroExpansion.LineNumberStart;
property.LineNumberEnd = macroExpansion.LineNumberEnd;
property.Name = name;
this.DocumentQtProperty(property);
return;
}
}
if (property.Field == null)
{
var comment = new RawComment();
var getter = property.GetMethod;
if (getter.Comment == null && getter.Namespace.OriginalName == property.Namespace.OriginalName)
{
this.DocumentFunction(getter);
}
if (getter.Comment != null)
{
comment.BriefText = getter.Comment.BriefText;
}
var setter = property.SetMethod;
if (setter != null)
{
if (setter.Comment == null && setter.Namespace.OriginalName == property.Namespace.OriginalName)
{
this.DocumentFunction(setter);
}
if (setter.Comment != null)
{
if (property.IsOverride)
{
comment.BriefText = ((Class) property.Namespace).GetBaseProperty(property).Comment.BriefText;
}
if (!string.IsNullOrEmpty(comment.BriefText))
{
comment.BriefText += Environment.NewLine;
}
comment.BriefText += setter.Comment.BriefText;
}
}
if (!string.IsNullOrEmpty(comment.BriefText))
{
property.Comment = comment;
}
}
else
{
property.LineNumberStart = property.Field.LineNumberStart;
property.LineNumberEnd = property.Field.LineNumberEnd;
this.DocumentVariable(property);
}
}
示例6: __CopyValue
private static void* __CopyValue(RawComment.__Internal native)
{
var ret = Marshal.AllocHGlobal(56);
global::CppSharp.Parser.AST.RawComment.__Internal.cctor_1(ret, new global::System.IntPtr(&native));
return ret.ToPointer();
}
示例7: RawComment
internal RawComment(RawComment.Internal native)
: this(&native)
{
}
示例8: GenerateInlineSummary
public void GenerateInlineSummary(RawComment comment)
{
if (comment == null) return;
if (String.IsNullOrWhiteSpace(comment.BriefText))
return;
PushBlock(BlockKind.InlineComment);
WriteLine("/// <summary> {0} </summary>", comment.BriefText);
PopBlock();
}
示例9: RawComment
private RawComment(RawComment.Internal native)
: this(__CopyValue(native))
{
__ownsNativeInstance = true;
}
示例10: RawComment
internal RawComment(RawComment.Internal native)
: this(__CopyValue(native))
{
}
示例11: VisitProperty
public override bool VisitProperty(Property property)
{
if (!base.VisitProperty(property) || property.TranslationUnit.IsSystemHeader)
{
return false;
}
if (!property.IsSynthetized && property.IsGenerated)
{
foreach (var @class in from m in new[] { property.GetMethod, property.SetMethod }
where m != null
let @class = m.OriginalNamespace as Class
where @class != null && @class.IsInterface
select @class)
{
RawComment comment = null;
if (property.GetMethod != null && functionsComments.ContainsKey(property.GetMethod.Mangled))
{
comment = new RawComment { BriefText = functionsComments[property.GetMethod.Mangled] };
}
if (comment == null && property.SetMethod != null && functionsComments.ContainsKey(property.SetMethod.Mangled))
{
comment = new RawComment { BriefText = functionsComments[property.SetMethod.Mangled] };
}
property.Comment = comment;
if (property.Comment != null)
{
return true;
}
}
this.documentation.DocumentProperty(property);
if (property.Comment != null)
{
if (property.GetMethod != null)
{
functionsComments[property.GetMethod.Mangled] = property.Comment.BriefText;
}
else
{
if (property.SetMethod != null)
{
functionsComments[property.SetMethod.Mangled] = property.Comment.BriefText;
}
}
}
return true;
}
return false;
}
示例12: DocumentProperty
public void DocumentProperty(Property property)
{
var expansions = property.Namespace.PreprocessedEntities.OfType<MacroExpansion>();
var properties = expansions.Where(e => e.Text.Contains("Q_PROPERTY") || e.Text.Contains("QDOC_PROPERTY"));
string alternativeName = property.Name.Length == 1 ? property.Name :
"is" + StringHelpers.UppercaseFirst(property.Name);
foreach (string name in from macroExpansion in properties
let name = macroExpansion.Text.Split(new[] { ' ' })[1]
where name == property.Name || name == alternativeName
select name)
{
property.Name = name;
this.DocumentQtProperty(property);
return;
}
if (property.Field == null)
{
Method getter = property.GetMethod;
if (getter.Comment == null)
{
this.DocumentFunction(getter);
}
var comment = new RawComment();
if (getter.Comment != null)
{
comment.BriefText = getter.Comment.BriefText;
}
Method setter = property.SetMethod;
if (setter != null)
{
if (setter.Comment == null)
{
this.DocumentFunction(setter);
}
if (setter.Comment != null)
{
if (!string.IsNullOrEmpty(comment.BriefText))
{
comment.BriefText += Environment.NewLine;
}
comment.BriefText += setter.Comment.BriefText;
}
}
if (!string.IsNullOrEmpty(comment.BriefText))
{
property.Comment = comment;
}
}
}
示例13: RawComment
private RawComment(RawComment.Internal native)
: this(__CopyValue(native))
{
__ownsNativeInstance = true;
NativeToManagedMap[__Instance] = this;
}
示例14: GenerateProperty
private static void GenerateProperty(DeclarationContext context, Method getter, Method setter = null)
{
Class type = (Class) context;
if (type.Properties.All(p => getter.Name != p.Name ||
p.ExplicitInterfaceImpl != getter.ExplicitInterfaceImpl))
{
Property property = new Property();
property.Name = GetPropertyName(getter.Name);
property.Namespace = type;
property.QualifiedType = getter.OriginalReturnType;
if (getter.IsOverride || (setter != null && setter.IsOverride))
{
Property baseVirtualProperty = type.GetRootBaseProperty(property);
if (baseVirtualProperty.SetMethod == null)
setter = null;
}
property.GetMethod = getter;
property.SetMethod = setter;
property.ExplicitInterfaceImpl = getter.ExplicitInterfaceImpl;
if (property.ExplicitInterfaceImpl == null && setter != null)
{
property.ExplicitInterfaceImpl = setter.ExplicitInterfaceImpl;
}
if (getter.Comment != null)
{
var comment = new RawComment();
comment.Kind = getter.Comment.Kind;
comment.BriefText = getter.Comment.BriefText;
comment.Text = getter.Comment.Text;
comment.FullComment = new FullComment();
comment.FullComment.Blocks.AddRange(getter.Comment.FullComment.Blocks);
if (setter != null && setter.Comment != null)
{
comment.BriefText += Environment.NewLine + setter.Comment.BriefText;
comment.Text += Environment.NewLine + setter.Comment.Text;
comment.FullComment.Blocks.AddRange(setter.Comment.FullComment.Blocks);
}
property.Comment = comment;
}
type.Properties.Add(property);
getter.IsGenerated = false;
if (setter != null)
setter.IsGenerated = false;
}
}
示例15: CombineComments
private static RawComment CombineComments(Declaration getter, Declaration setter)
{
var comment = new RawComment
{
Kind = getter.Comment.Kind,
BriefText = getter.Comment.BriefText,
Text = getter.Comment.Text
};
if (getter.Comment.FullComment != null)
{
comment.FullComment = new FullComment();
comment.FullComment.Blocks.AddRange(getter.Comment.FullComment.Blocks);
if (setter != null && setter.Comment != null)
{
comment.BriefText += Environment.NewLine + setter.Comment.BriefText;
comment.Text += Environment.NewLine + setter.Comment.Text;
comment.FullComment.Blocks.AddRange(setter.Comment.FullComment.Blocks);
}
}
return comment;
}