本文整理匯總了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);
}