當前位置: 首頁>>代碼示例>>C#>>正文


C# Agent.GetContextId方法代碼示例

本文整理匯總了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);
                }
            }
        }
開發者ID:KeyleXiao,項目名稱:behaviac,代碼行數:34,代碼來源:Properties.cs

示例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);
        }
開發者ID:KeyleXiao,項目名稱:behaviac,代碼行數:34,代碼來源:Properties.cs


注:本文中的Agent.GetContextId方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。