Ejemplo n.º 1
0
        private D2dAdaptableControl m_d2dHoverControl; // a child of hover form

        #region Expression related code

        // Allows getting circuit element by id
        public override bool TryGetMember(GetMemberBinder binder, out object result)
        {
            // It is possible to use any of the following to get access to all
            // the circuit elements.
            var mgr = m_documentRegistry.GetMostRecentDocument <ExpressionManager>();

            if (mgr != null)
            {
                foreach (var node in mgr.ExpressionNodes)
                {
                    if (binder.Name == node.GetId())
                    {
                        result = new DynamicDomNode(node);
                        return(true);
                    }
                }
            }
            return(base.TryGetMember(binder, out result));
        }
Ejemplo n.º 2
0
        private D2dAdaptableControl m_d2dHoverControl; // a child of hover form

        #region Expression related code

        // Allows getting circuit element by id
        public override bool TryGetMember(GetMemberBinder binder, out object result)
        {
            // It is possible to use any of the following to get access to all 
            // the circuit elements. 
            var mgr = m_documentRegistry.GetMostRecentDocument<ExpressionManager>();
            if (mgr != null)
            {
                foreach (var node in mgr.ExpressionNodes)
                {
                    if (binder.Name == node.GetId())
                    {
                        result = new DynamicDomNode(node);
                        return true;
                    }                    
                }
            }            
            return base.TryGetMember(binder, out result);         
        }