コード例 #1
0
        public BeamHook(XmlReader r, int topLevelDepth)
        {
            M.Assert(r.Name == "beam-hook");

            Depth = r.Depth - topLevelDepth;

            int count = r.AttributeCount;

            for (int i = 0; i < count; i++)
            {
                r.MoveToAttribute(i);
                switch (r.Name)
                {
                case "event":
                {
                    EventID = r.Value.Trim();
                    break;
                }

                case "direction":
                {
                    switch (r.Value.Trim())
                    {
                    case "left":
                        BeamHookDirection = BeamHookDirection.left;
                        break;

                    case "right":
                        BeamHookDirection = BeamHookDirection.right;
                        break;
                    }
                    break;
                }

                default:
                    M.ThrowError("Unknown beam-hook attribute.");
                    break;
                }
            }

            r.MoveToElement();
            M.Assert(r.Name == "beam-hook");
        }
コード例 #2
0
 /// <summary>
 /// clone constructor
 /// </summary>
 /// <param name="eventID"></param>
 /// <param name="beamHookDirection"></param>
 /// <param name="depth"></param>
 public BeamHook(string eventID, BeamHookDirection beamHookDirection, int depth)
 {
     EventID           = eventID;
     BeamHookDirection = beamHookDirection;
     Depth             = depth;
 }