Exemple #1
0
 protected void CheckLinks(MHObjectRef sourceRef, int eventType, MHUnion un)
 {
     for (int i = 0; i < (int)m_LinkTable.Count; i++)
     {
         m_LinkTable[i].MatchEvent(sourceRef, eventType, un, this);
     }
 }
Exemple #2
0
 // Return the value, looking up any indirect ref.
 public void GetValue(MHOctetString str, MHEngine engine)
 {
     if (m_fIsDirect)
     {
         str.Copy(m_Direct);
     }
     else
     {
         MHUnion result = new MHUnion();
         MHRoot  pBase  = engine.FindObject(m_Indirect);
         pBase.GetVariableValue(result, engine);
         // From my reading of the MHEG documents implicit conversion is only
         // performed when assigning variables.  Nevertheless the Channel 4
         // Teletext assumes that implicit conversion takes place here as well.
         if (result.Type == MHUnion.U_Int)
         {
             // Implicit conversion of string to integer.
             MHOctetString s = new MHOctetString("" + result.Int);
             str.Copy(s);
         }
         else
         {
             result.CheckType(MHUnion.U_String);
             str.Copy(result.String);
         }
     }
 }
Exemple #3
0
 // Return the value, looking up any indirect ref.
 public int GetValue(MHEngine engine)
 {
     if (m_fIsDirect)
     {
         return(m_nDirect);
     }
     else
     {
         MHUnion result = new MHUnion();
         MHRoot  pBase  = engine.FindObject(m_Indirect);
         pBase.GetVariableValue(result, engine);
         // From my reading of the MHEG documents implicit conversion is only
         // performed when assigning variables.  Nevertheless the Channel 4
         // Teletext assumes that implicit conversion takes place here as well.
         if (result.Type == MHUnion.U_String)
         {
             // Implicit conversion of string to integer.
             return(Convert.ToInt32(result.String.ToString()));
         }
         else
         {
             result.CheckType(MHUnion.U_Int);
             return(result.Int);
         }
     }
 }
Exemple #4
0
        public void EventTriggered(MHRoot pSource, int ev, MHUnion evData)
        {
            Logging.Log(Logging.MHLogLinks, "Event - " + MHLink.EventTypeToString(ev) + " from " + pSource.ObjectIdentifier.Printable());

            switch (ev)
            {
            case MHRoot.EventFirstItemPresented:
            case MHRoot.EventHeadItems:
            case MHRoot.EventHighlightOff:
            case MHRoot.EventHighlightOn:
            case MHRoot.EventIsAvailable:
            case MHRoot.EventIsDeleted:
            case MHRoot.EventIsDeselected:
            case MHRoot.EventIsRunning:
            case MHRoot.EventIsSelected:
            case MHRoot.EventIsStopped:
            case MHRoot.EventItemDeselected:
            case MHRoot.EventItemSelected:
            case MHRoot.EventLastItemPresented:
            case MHRoot.EventTailItems:
            case MHRoot.EventTestEvent:
            case MHRoot.EventTokenMovedFrom:
            case MHRoot.EventTokenMovedTo:
                // Synchronous events.  Fire any links that are waiting.
                // The UK MHEG describes this as the preferred interpretation.  We are checking the link
                // at the time we generate the event rather than queuing the synchronous events until
                // this elementary action is complete.  That matters if we are processing an elementary action
                // which will activate or deactivate links.
                CheckLinks(pSource.ObjectIdentifier, ev, evData);
                break;

            case MHRoot.EventAnchorFired:
            case MHRoot.EventAsyncStopped:
            case MHRoot.EventContentAvailable:
            case MHRoot.EventCounterTrigger:
            case MHRoot.EventCursorEnter:
            case MHRoot.EventCursorLeave:
            case MHRoot.EventEngineEvent:
            case MHRoot.EventEntryFieldFull:
            case MHRoot.EventInteractionCompleted:
            case MHRoot.EventStreamEvent:
            case MHRoot.EventStreamPlaying:
            case MHRoot.EventStreamStopped:
            case MHRoot.EventTimerFired:
            case MHRoot.EventUserInput:
            case MHRoot.EventFocusMoved:         // UK MHEG.  Generated by HyperText class
            case MHRoot.EventSliderValueChanged: // UK MHEG.  Generated by Slider class
            {
                // Asynchronous events.  Add to the event queue.
                MHAsynchEvent pEvent = new MHAsynchEvent();
                pEvent.EventSource = pSource;
                pEvent.EventType   = ev;
                pEvent.EventData   = evData;
                m_EventQueue.Add(pEvent);
            } break;
            }
        }
Exemple #5
0
 // Return the value, looking up any indirect ref.
 public void GetValue(MHContentRef reference, MHEngine engine)
 {
     if (m_fIsDirect)
     {
         reference.Copy(m_Direct);
     }
     else
     {
         MHUnion result = new MHUnion();
         MHRoot  pBase  = engine.FindObject(m_Indirect);
         pBase.GetVariableValue(result, engine);
         result.CheckType(MHUnion.U_ContentRef);
         reference.Copy(result.ContentRef);
     }
 }
Exemple #6
0
 // Return the value, looking up any indirect ref.
 public bool GetValue(MHEngine engine)
 {
     if (m_fIsDirect)
     {
         return(m_fDirect);
     }
     else
     {
         MHUnion result = new MHUnion();
         MHRoot  pBase  = engine.FindObject(m_Indirect);
         pBase.GetVariableValue(result, engine);
         result.CheckType(MHUnion.U_Bool);
         return(result.Bool);
     }
 }
Exemple #7
0
 public virtual void SetVariableValue(MHUnion value)
 {
     InvalidAction("SetVariableValue");
 }
Exemple #8
0
 public virtual void GetVariableValue(MHUnion value, MHEngine engine)
 {
     InvalidAction("GetVariableValue");
 }
Exemple #9
0
 // Actions on variables.
 public virtual void TestVariable(int nOp, MHUnion parm, MHEngine engine)
 {
     InvalidAction("TestVariable");
 }