本文整理汇总了C#中Agent.GetContextId方法的典型用法代码示例。如果您正苦于以下问题:C# Agent.GetContextId方法的具体用法?C# Agent.GetContextId怎么用?C# Agent.GetContextId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Agent
的用法示例。
在下文中一共展示了Agent.GetContextId方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetValue
public object GetValue(Agent parent, Agent parHolder)
{
if (parent == null || m_bIsConst)
{
return this.GetDefaultValue();
}
else
{
if (this.m_memberBase != null)
{
#if !BEHAVIAC_RELEASE
ParentType pt = this.m_memberBase.GetParentType();
if (pt == ParentType.PT_INSTANCE)
{
Agent pInstance = Agent.GetInstance(this.GetInstanceNameString(), parHolder.GetContextId());
Debug.Check(Object.ReferenceEquals(pInstance, parHolder));
}
#endif//
if (this.m_pt == ParentType.PT_INSTANCE)
{
Agent pInstance = Agent.GetInstance(this.GetInstanceNameString(), parHolder.GetContextId());
parHolder = pInstance;
}
object pVariable = this.m_memberBase.Get(parHolder);
return pVariable;
}
else
{
return parHolder.GetVariable(this.m_varaibleName);
}
}
}
示例2: SetValue
public void SetValue(Agent parent, object v)
{
Debug.Check(!Object.ReferenceEquals(parent, null));
Debug.Check(!m_bIsConst);
string staticClassName = null;
if (this.m_memberBase != null)
{
#if !BEHAVIAC_RELEASE
ParentType pt = this.m_memberBase.GetParentType();
if (pt == ParentType.PT_INSTANCE)
{
Agent pInstance = Agent.GetInstance(this.GetInstanceNameString(), parent.GetContextId());
Debug.Check(Object.ReferenceEquals(pInstance, parent));
}
#endif//
if (this.m_pt == ParentType.PT_INSTANCE)
{
Agent pInstance = Agent.GetInstance(this.GetInstanceNameString(), parent.GetContextId());
parent = pInstance;
}
//don't update member as v is indeed the member itsef!
//this.m_memberBase.Set(parent, v);
if (this.m_memberBase.ISSTATIC())
{
staticClassName = this.m_memberBase.GetClassNameString();
}
}
parent.SetVariableRegistry(this.m_memberBase, this.m_varaibleName, v, staticClassName, this.m_variableId);
}