本文整理汇总了C#中QualifiedName类的典型用法代码示例。如果您正苦于以下问题:C# QualifiedName类的具体用法?C# QualifiedName怎么用?C# QualifiedName使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
QualifiedName类属于命名空间,在下文中一共展示了QualifiedName类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetType
public INamedTypeSymbol GetType(QualifiedName name)
{
// std // TODO: table of types in PchpCor
if (name == NameUtils.SpecialNames.stdClass)
{
return _compilation.PhpCorLibrary.GetTypeByMetadataName(name.ClrName());
}
// TODO: reserved type names: self, parent, static
Debug.Assert(!name.IsReservedClassName);
// library types
foreach (AssemblySymbol ass in _compilation.ProbingAssemblies)
{
if (!ass.IsPchpCorLibrary)
{
var candidate = ass.GetTypeByMetadataName(name.ClrName());
if (candidate != null && !candidate.IsErrorType())
{
if (ass is PEAssemblySymbol && ((PEAssemblySymbol)ass).IsExtensionLibrary && candidate.IsStatic)
{
continue;
}
return candidate;
}
}
}
//
return Next.GetType(name);
}
示例2: AddUnknownFunctionCall
public static void AddUnknownFunctionCall(QualifiedName name)
{
var info = StaticInfo.Get;
if (info.UnknownCalls == null) info.UnknownCalls = new Dictionary<QualifiedName, int>();
CollectionUtils.IncrementValue(info.UnknownCalls, name, 1);
}
示例3: DataChangeMonitoredItem
/// <summary>
/// Constructs a new instance.
/// </summary>
public DataChangeMonitoredItem(
MonitoredNode source,
uint id,
uint attributeId,
NumericRange indexRange,
QualifiedName dataEncoding,
DiagnosticsMasks diagnosticsMasks,
TimestampsToReturn timestampsToReturn,
MonitoringMode monitoringMode,
uint clientHandle,
double samplingInterval,
bool alwaysReportUpdates)
{
m_source = source;
m_id = id;
m_attributeId = attributeId;
m_indexRange = indexRange;
m_dataEncoding = dataEncoding;
m_timestampsToReturn = timestampsToReturn;
m_diagnosticsMasks = diagnosticsMasks;
m_monitoringMode = monitoringMode;
m_clientHandle = clientHandle;
m_samplingInterval = samplingInterval;
m_nextSampleTime = DateTime.UtcNow.Ticks;
m_readyToPublish = false;
m_readyToTrigger = false;
m_alwaysReportUpdates = alwaysReportUpdates;
}
示例4: DirectFcnCall
public DirectFcnCall(Text.Span span,
QualifiedName qualifiedName, QualifiedName? fallbackQualifiedName, Text.Span qualifiedNameSpan,
List<ActualParam>/*!*/ parameters, List<TypeRef>/*!*/ genericParams)
: base(span, qualifiedNameSpan, parameters, genericParams)
{
this.qualifiedName = qualifiedName;
this.fallbackQualifiedName = fallbackQualifiedName;
}
示例5: DirectFcnCall
public DirectFcnCall(Position position,
QualifiedName qualifiedName, QualifiedName? fallbackQualifiedName, Position qualifiedNamePosition,
List<ActualParam>/*!*/ parameters, List<TypeRef>/*!*/ genericParams)
: base(position, qualifiedNamePosition, parameters, genericParams)
{
this.qualifiedName = qualifiedName;
this.fallbackQualifiedName = fallbackQualifiedName;
}
示例6: QualifiedNameTestMethod1
public void QualifiedNameTestMethod1()
{
string name = "Default Binary";
QualifiedName _qn = new QualifiedName("Default Binary");
Assert.IsNotNull(_qn);
//Assert.AreEqual<int>(_qn.NamespaceIndex, 0);
Assert.IsFalse(_qn.NamespaceIndexSpecified);
Assert.AreEqual<string>(_qn.Name, name);
}
示例7: Function
/// <summary>Creates functions or procedure</summary>
public Function(QualifiedName name, IList<ParameterDescription> inputs, IList<ParameterDescription> outputs, IList<ParameterDescription> inouts, ParameterDescription returning, AccessModifier visibility = AccessModifier.Private)
{
QualifiedName = name;
Profile = new ParametersProfile();
Profile.InputParameters = inputs ?? new List<ParameterDescription>();
Profile.OutputParameters = outputs ?? new List<ParameterDescription>();
Profile.InoutParameters = inouts ?? new List<ParameterDescription>();
Profile.ReturningParameter = returning;
Visibility = visibility;
}
示例8: CreateNamespaceImport
private NamespaceImportDeclaration CreateNamespaceImport() {
NameDeclaration dummyName = new NameDeclaration(Dummy.Name, SourceDummy.SourceLocation);
SimpleName microsoft = new SimpleName(this.Compilation.NameTable.GetNameFor("Microsoft"), SourceDummy.SourceLocation, false);
SimpleName smallBasic = new SimpleName(this.Compilation.NameTable.GetNameFor("SmallBasic"), SourceDummy.SourceLocation, false);
SimpleName library = new SimpleName(this.Compilation.NameTable.GetNameFor("Library"), SourceDummy.SourceLocation, false);
QualifiedName microsoftSmallBasic = new QualifiedName(microsoft, smallBasic, SourceDummy.SourceLocation);
QualifiedName microsoftSmallBasicLibrary = new QualifiedName(microsoftSmallBasic, library, SourceDummy.SourceLocation);
NamespaceReferenceExpression smallBasicLibrary = new NamespaceReferenceExpression(microsoftSmallBasicLibrary, SourceDummy.SourceLocation);
return new NamespaceImportDeclaration(dummyName, smallBasicLibrary, SourceDummy.SourceLocation);
}
示例9: GetUniqueName
private static QualifiedName GetUniqueName(CodeTypeMember member, QualifiedName parentName)
{
if (member is CodeTypeDeclaration)
{
return new QualifiedName(GetUniqueName((CodeTypeDeclaration)member), null);
}
else
{
return new QualifiedName(GetUniqueName(member), parentName);
}
}
示例10: ReflectedProviderFactoryDefinitionBase
protected ReflectedProviderFactoryDefinitionBase(MethodBase method,
QualifiedName qname,
Type outputType)
{
this.qname = qname;
this.outputType = outputType;
this.method = method;
this.parameters = new PropertyDefinitionCollection();
parameters.AddRange(this, qname.NamespaceName, method.GetParameters(), method.IsExtension());
}
示例11: Construct
/// <summary>
/// Creates a new instance of the node.
/// </summary>
public static MethodSource Construct(
IServerInternal server,
NodeSource parent,
NodeId referenceTypeId,
NodeId nodeId,
QualifiedName browseName,
uint numericId)
{
MethodSource instance = new MethodSource(server, parent);
instance.Initialize(referenceTypeId, nodeId, browseName, numericId, null);
return instance;
}
示例12: Construct
/// <summary>
/// Creates a new instance of the node.
/// </summary>
public static ObjectSource Construct(
IServerInternal server,
NodeSource parent,
NodeId referenceTypeId,
NodeId nodeId,
QualifiedName browseName,
uint numericId)
{
ObjectSource instance = new ObjectSource(server, parent);
instance.Initialize(referenceTypeId, nodeId, browseName, numericId, ObjectTypes.BaseObjectType);
return instance;
}
示例13: FixtureInit
public override void FixtureInit()
{
// Note element path.
noteElementPath = new XmlElementPath();
QualifiedName noteQualifiedName = new QualifiedName("note", "http://www.w3schools.com");
noteElementPath.Elements.Add(noteQualifiedName);
// Text element path.
textElementPath = new XmlElementPath();
textElementPath.Elements.Add(noteQualifiedName);
textElementPath.Elements.Add(new QualifiedName("text", "http://www.w3schools.com"));
}
示例14: EnumerareCodeMembers
private static void EnumerareCodeMembers(CodeTypeMember member, QualifiedName parentName, Dictionary<string, CodeTypeMember> members)
{
QualifiedName memberName = GetUniqueName(member, parentName);
members[memberName.ToString()] = member;
CodeTypeDeclaration decl = member as CodeTypeDeclaration;
if (decl != null)
{
foreach (CodeTypeMember subMember in decl.Members)
{
EnumerareCodeMembers(subMember, memberName, members);
}
}
}
示例15: CreateShouldLogCatchedExceptionAsError
public void CreateShouldLogCatchedExceptionAsError()
{
using (MockDomain domain = new MockDomain())
{
MockAssemblyRepository repository = new MockAssemblyRepository();
QualifiedName fakeName = new QualifiedName(
typeof(string).FullName.Replace("mscorlib", "NonExistingAssemblyName"),
typeof(string).Assembly.FullName.Replace("mscorlib", "NonExistingAssemblyName"));
IPluginCreator tested = PluginCreator.GetCreator(domain);
MockLog mocklog = new MockLog((ILogWriter)tested);
PluginDescriptor descriptor = MockPluginDescriptor.For(fakeName);
Exception ex = DoAssert.Throws<PluginException>(() => tested.Create(descriptor, repository, null));
Assert.IsTrue(mocklog.Any(x => x.Level == MockLog.Level.Error && x.Message.Contains(ex.Message)));
}
}