Esempio n. 1
0
        public override void Parse(ActionParser parser)
        {
            int number = parser.ReadInt32();

            for (int i = 0; i < number; i++)
            {
                ReferenceType referenceType = null;

                string type = parser.ReadFourByteString();

                switch (type)
                {
                case "Clss":
                    referenceType = new ClassType();
                    break;

                case "Enmr":
                    referenceType = new EnmrType();
                    break;

                case "indx":
                    referenceType = new IndexType();
                    break;

                case "name":
                    referenceType = new NameType();
                    break;

                case "prop":
                    referenceType = new PropertyType();
                    break;

                case "rele":
                    referenceType = new ReleType();
                    break;

                default:
                    Console.WriteLine("ReferenceParameter: type {0} unknown!",
                                      type);
                    break;
                }

                if (referenceType != null)
                {
                    referenceType.Parse(parser);
                    Set.Add(referenceType);
                }
            }
        }
Esempio n. 2
0
        override public ActionEvent Parse(ActionParser parser)
        {
            ActionEvent myEvent = base.Parse(parser);

            if (_obj != null)
            {
                ReferenceType parameter = _obj.Set[0];

                if (parameter is NameType)
                {
                    NameType name = parameter as NameType;

                    switch (name.ClassID2)
                    {
                    case "Chnl":
                        return(new SelectChannelByNameEvent(this, name.Key));

                    case "Lyr":
                        return(new SelectLayerByNameEvent(this, name.Key));

                    case "SnpS":
                        return(new SelectSnapshotEvent(this, name.Key));

                    default:
                        Console.WriteLine("SelectEvent: " + name.ClassID2);
                        break;
                    }
                }
                else if (parameter is PropertyType)
                {
                    PropertyType property = parameter as PropertyType;
                    switch (property.Key)
                    {
                    case "Bckg":
                        return(new SelectLayerByNameEvent(this, "Background"));

                    case "CrnH":
                        return(new SelectCurrentHistoryStateEvent(this));

                    default:
                        Console.WriteLine("Property: " + property.Key);
                        break;
                    }
                }
                else if (parameter is EnmrType)
                {
                    EnmrType enmr = parameter as EnmrType;
                    switch (enmr.Key)
                    {
                    case "Chnl":
                        return(new SelectChannelEvent(this, enmr.Value));

                    case "HstS":
                        return(new SelectHistoryStateEvent(this, enmr.Value));

                    case "Lyr":
                        return(new SelectLayerEvent(this, enmr.Value));

                    case "Mn":
                        return(new SelectMenuItemEvent(this, enmr.Value));

                    default:
                        Console.WriteLine("SelectEvent.Enmr: " + enmr.Key);
                        break;
                    }
                }
                else if (parameter is ReleType)
                {
                    ReleType rele = parameter as ReleType;
                    switch (rele.ClassID2)
                    {
                    case "Dcmn":
                        return(new SelectDocumentEvent(this, rele.Offset));

                    case "HstS":
                        return(new SelectHistoryStateEvent(this, rele.Offset));

                    default:
                        Console.WriteLine("rele.ClassID2: " + rele.ClassID2);
                        break;
                    }
                }
                else if (parameter is IndexType)
                {
                    IndexType index = parameter as IndexType;
                    switch (index.Key)
                    {
                    case "Brsh":
                        return(new SelectBrushByIndexEvent(this, index.Index));

                    case "Chnl":
                        return(new SelectChannelByIndexEvent(this, index.Index));

                    default:
                        Console.WriteLine("SelectEvent index.Key: " + index.Key);
                        break;
                    }
                }
                else if (parameter is ClassType)
                {
                    ClassType type = parameter as ClassType;
                    return(new SelectBrushEvent(this, type.ClassID2));
                }
                else
                {
                    Console.WriteLine("SelectEvent-1: " + parameter);
                }
            }

            return(myEvent);
        }
Esempio n. 3
0
        public override void Parse(ActionParser parser)
        {
            int number = parser.ReadInt32();

              for (int i = 0; i < number; i++)
            {
              ReferenceType referenceType = null;

              string type = parser.ReadFourByteString();

              switch (type)
            {
            case "Clss":
              referenceType = new ClassType();
              break;
            case "Enmr":
              referenceType = new EnmrType();
              break;
            case "indx":
              referenceType = new IndexType();
              break;
            case "name":
              referenceType = new NameType();
              break;
            case "prop":
              referenceType = new PropertyType();
              break;
            case "rele":
              referenceType = new ReleType();
              break;
            default:
              Console.WriteLine("ReferenceParameter: type {0} unknown!",
                type);
              break;
            }

              if (referenceType != null)
            {
              referenceType.Parse(parser);
              _set.Add(referenceType);
            }
            }
        }