AttributeUtils Class

Definition

Contains tools for building and adding attributes to an existing Q# compilation.

public static class AttributeUtils
type AttributeUtils = class
Public Class AttributeUtils
Inheritance
AttributeUtils

Methods

AddToCallables(QsCompilation, QsDeclarationAttribute, Func<QsCallable,Boolean>)

Adds the given attribute to all callables in the given compilation that satisfy the given predicate

  • if the predicate is specified and not null.
AddToCallables(QsCompilation, QsDeclarationAttribute[])

Adds the given attribute(s) to all callables in the given compilation.

AddToCallables(QsCompilation, ValueTuple<QsDeclarationAttribute,Func<QsCallable,Boolean>>[])

Adds the given attribute(s) to all callables in the given compilation that satisfy the given predicate

  • if the predicate is specified and not null.
AddToCallables(QsNamespace, QsDeclarationAttribute, Func<QsCallable,Boolean>)

Adds the given attribute to all callables in the given namespace that satisfy the given predicate

  • if the predicate is specified and not null.
AddToCallables(QsNamespace, QsDeclarationAttribute[])

Adds the given attribute(s) to all callables in the given namespace.

AddToCallables(QsNamespace, ValueTuple<QsDeclarationAttribute,Func<QsCallable,Boolean>>[])

Adds the given attribute(s) to all callables in the given namespace that satisfy the given predicate

  • if the predicate is specified and not null.
BuildAttribute(QsQualifiedName, TypedExpression)

Returns a Q# attribute with the given name and argument that can be attached to a declaration. The attribute id is set to Null if the given name is null. The attribute argument is set to an invalid expression if the given argument is null.

StringArgument(String)

Builds a string literal with the given content that can be used as argument to a Q# attribute. The value of the string literal is set to the empty string if the given content is null.

StringArguments(String[])

Builds an attribute argument with the given string valued tuple items. If a given string is null, the value of the corresponding item is set to the empty string. If no items are given, a suitable argument of type unit is returned.

Applies to