本文整理汇总了C#中Composite.GetType方法的典型用法代码示例。如果您正苦于以下问题:C# Composite.GetType方法的具体用法?C# Composite.GetType怎么用?C# Composite.GetType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Composite
的用法示例。
在下文中一共展示了Composite.GetType方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AnalyzeComposite
public void AnalyzeComposite(Composite comp, TreeNode parent)
{
var par = AddNode(comp.Guid.ToString(),
string.IsNullOrEmpty(comp.DebugName)
? comp.GetType().Name
: comp.DebugName + " | " + comp.GetType().Name,
parent != null ? parent : root);
if (comp is GroupComposite)
{
foreach (var children in (comp as GroupComposite).Children)
{
AnalyzeComposite(children, par);
}
}
}
示例2: GetMessage
//[DebuggerStepThrough]
////[DebuggerHidden]
private static string GetMessage(Composite composite, MethodInfo method, IEnumerable<ConstraintViolation> violations)
{
string message = string.Format("{0}.{1} caused parameter constraint violations", composite.GetType().Name, method.Name);
foreach (ConstraintViolation violation in violations)
{
string violationMessage = string.Format("Parameter: '{0}' Value: '{1}' Constraint: '{2}'", violation.Name, violation.Value ?? "{null}", violation.Constraint.GetConstraintName());
message += Environment.NewLine + violationMessage;
}
return message;
}
示例3: StoreMethodName
private static void StoreMethodName(Composite comp)
{
var cSharpCode = comp as ICSharpCode;
if (cSharpCode != null)
{
CsharpCodeDict["Code" + Util.Rng.Next(int.MaxValue).ToString(CultureInfo.InvariantCulture)] = cSharpCode;
cSharpCode.CompileError = "";
}
// check for DynamicExpression proprerties
List<IDynamicProperty> dynProps = (from prop in comp.GetType().GetProperties()
where typeof (IDynamicProperty).IsAssignableFrom(prop.PropertyType)
select (IDynamicProperty) prop.GetValue(comp, null)).ToList();
foreach (IDynamicProperty dynProp in dynProps)
{
CsharpCodeDict["Code" + Util.Rng.Next(int.MaxValue).ToString(CultureInfo.InvariantCulture)] = dynProp;
dynProp.CompileError = "";
}
var groupComposite = comp as GroupComposite;
if (groupComposite != null)
{
foreach (Composite child in groupComposite.Children)
StoreMethodName(child);
}
}
示例4: printComposite
private void printComposite(Composite comp, int cnt)
{
string name;
if (comp is IPBComposite)
name = ((IPBComposite) comp).Title;
else
name = comp.GetType().ToString();
var pbComposite = comp as IPBComposite;
if (pbComposite != null)
Logging.Write("{0}{1} IsDone:{2} LastStatus:{3}", new string(' ', cnt*4), name,
(pbComposite).IsDone, comp.LastStatus);
var groupComposite = comp as GroupComposite;
if (groupComposite != null)
{
foreach (Composite child in (groupComposite).Children)
{
printComposite(child, cnt + 1);
}
}
}
示例5: printComposite
void printComposite(Composite comp, int cnt)
{
string name;
if (comp is IPBComposite)
name = ((IPBComposite)comp).Title;
else
name = comp.GetType().ToString();
if (typeof(IPBComposite).IsAssignableFrom(comp.GetType()))
Logging.Write("{0}{1} IsDone:{2} LastStatus:{3}", new string(' ', cnt * 4), ((IPBComposite)comp).Title, ((IPBComposite)comp).IsDone, comp.LastStatus);
if (comp is GroupComposite)
{
foreach (Composite child in ((GroupComposite)comp).Children)
{
printComposite(child, cnt + 1);
}
}
}