Beispiel #1
0
        override public ActionEvent Parse(ActionParser parser)
        {
            base.Parse(parser);

            ReferenceParameter obj = _list.Set[0] as ReferenceParameter;

            if (obj.Set[0] is EnmrType)
            {
                EnmrType enmr = obj.Set[0] as EnmrType;

                switch (enmr.Key)
                {
                case "Lyr":
                    return(new HideLayerEvent(this));

                case "Chnl":
                    return(new HideChannelEvent(this, enmr.Value));

                default:
                    Console.WriteLine("Can't hide " + enmr.Key);
                    break;
                }
            }
            else if (obj.Set[0] is NameType)
            {
                NameType name = obj.Set[0] as NameType;

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

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

                default:
                    Console.WriteLine("Can't hide " + name.ClassID2);
                    break;
                }
            }
            else if (obj.Set[0] is PropertyType)
            {
                PropertyType property = obj.Set[0] as PropertyType;
                switch (property.ClassID2)
                {
                case "Lyr":
                    return(new HideLayerEvent(this, property));

                default:
                    Console.WriteLine("Can't hide " + property.Key);
                    break;
                }
            }
            else
            {
                Console.WriteLine("HideEvent: " + obj.Set[0]);
            }
            return(this);
        }
Beispiel #2
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);
                }
            }
        }
Beispiel #3
0
        override public ActionEvent Parse(ActionParser parser)
        {
            base.Parse(parser);

            if (_obj != null)
            {
                if (_obj.Set[0] is EnmrType)
                {
                    EnmrType enmr = _obj.Set[0] as EnmrType;
                    switch (enmr.Key)
                    {
                    case "Lyr":
                        return(new TransformLayerEvent(this));

                    default:
                        Console.WriteLine("Transform-2: unknown key " + enmr.Key);
                        break;
                    }
                }
                else if (_obj.Set[0] is PropertyType)
                {
                    PropertyType property = _obj.Set[0] as PropertyType;
                    switch (property.Key)
                    {
                    case "fsel":
                        return(new TransformSelectionEvent(this));

                    default:
                        Console.WriteLine("Transform-4: unknown key " +
                                          property.Key);
                        break;
                    }
                }
                else
                {
                    Console.WriteLine("Transform-3: " + _obj.Set[0]);
                }
            }
            else
            {
                Console.WriteLine("Transform-1");
            }

            return(this);
        }
Beispiel #4
0
        override public ActionEvent Parse(ActionParser parser)
        {
            ActionEvent myEvent = base.Parse(parser);

            if (_obj != null)
            {
                if (_obj.Set[0] is PropertyType)
                {
                    PropertyType property = _obj.Set[0] as PropertyType;

                    switch (property.ClassID2)
                    {
                    case "Clr":
                        switch (property.Key)
                        {
                        case "BckC":
                            return(new SetBackgroundColorEvent(this));

                        case "ClrT":
                            return(new SetColorTableEvent(this));

                        case "FrgC":
                            return(new SetForegroundColorEvent(this));

                        default:
                            Console.WriteLine("SetEvent.Clr.Prpr: " + property.Key);
                            break;
                        }
                        break;

                    case "Chnl":
                        if (property.Key == "fsel")
                        {
                            return(new SelectionEvent(this).Parse(parser));
                        }
                        break;

                    case "Lyr":
                        return(new SetLayerPropertyEvent(this));

                    case "Prpr":
                        switch (property.Key)
                        {
                        case "FlIn":
                            return(new SetFileInfoEvent(this));

                        case "Grdn":
                            return(new SetGradientEvent(this));

                        case "Lefx":
                            return(new SetLayerEffectsEvent(this));

                        case "QucM":
                            return(new SetQuickMaskEvent(this));

                        default:
                            Console.WriteLine("SetEvent.Prpr: " + property.Key);
                            break;
                        }
                        break;

                    case "HstS":
                        return(new SetHistoryStateEvent(this));

                        break;

                    default:
                        Console.WriteLine("SetEvent.Parse: " + property.ClassID2);
                        break;
                    }
                }
                else if (_obj.Set[0] is EnmrType)
                {
                    EnmrType enmr = _obj.Set[0] as EnmrType;
                    switch (enmr.Key)
                    {
                    case "AdjL":
                        return(new SetAdjustmentLayerEvent(this));

                    case "Brsh":
                        return(new SetBrushEvent(this));

                    case "Chnl":
                        return(new SetChannelPropertyEvent(this));

                    case "contentLayer":
                        return(new SetContentLayerEvent(this));

                    case "Lyr":
                        return(new SetLayerPropertyEvent(this));

                    case "TxLr":
                        return(new SetTextLayerPropertyEvent(this));

                    default:
                        Console.WriteLine("SetEvent.Parse-1: unknown key " +
                                          enmr.Key);
                        break;
                    }
                }
                else if (_obj.Set[0] is IndexType)
                {
                    IndexType index = _obj.Set[0] as IndexType;
                    switch (index.Key)
                    {
                    case "Chnl":
                        return(new SetChannelToSelectionEvent(this, index.Index));

                    default:
                        Console.WriteLine("SetEvent.Parse-2: unknown key " +
                                          index.Key);
                        break;
                    }
                }
                else if (_obj.Set[0] is NameType)
                {
                    NameType name = _obj.Set[0] as NameType;
                    switch (name.ClassID2)
                    {
                    case "Chnl":
                        return(new SetChannelByNameToSelectionEvent(this, name.Key));

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

                    default:
                        Console.WriteLine("SetEvent.Parse-3: unknown class " +
                                          name.ClassID2);
                        break;
                    }
                }
                else
                {
                    Console.WriteLine("SetEvent.Parse: {0} unknown type",
                                      _obj.Set[0]);
                }
            }

            return(this);
        }
Beispiel #5
0
        override public ActionEvent Parse(ActionParser parser)
        {
            ActionEvent myEvent = base.Parse(parser);

            if (_obj != null)
            {
                if (_obj.Set[0] is EnmrType)
                {
                    EnmrType type = _obj.Set[0] as EnmrType;

                    switch (type.Key)
                    {
                    case "Chnl":
                        return(new DuplicateChannelEvent(this, type.Value));

                    case "Dcmn":
                        return(new DuplicateDocumentEvent(this, type.Value));

                    case "Lyr":
                        return(new DuplicateLayerEvent(this));

                    default:
                        Console.WriteLine("DuplicateEvent: {0} unknown", type.Key);
                        break;
                    }
                }
                else if (_obj.Set[0] is NameType)
                {
                    NameType type = _obj.Set[0] as NameType;

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

                    case "Lyr":
                        return(new DuplicateLayerByNameEvent(this, type.Key));

                    default:
                        Console.WriteLine("DuplicateEvent-1: {0} unknown",
                                          type.ClassID2);
                        break;
                    }
                }
                else if (_obj.Set[0] is PropertyType)
                {
                    PropertyType type = _obj.Set[0] as PropertyType;

                    switch (type.ClassID2)
                    {
                    case "Lyr":
                        return(new DuplicateLayerByNameEvent(this, type.Key));

                        break;

                    case "Chnl":
                        if (type.Key == "fsel")
                        {
                            return(new DuplicateSelectionEvent(this));
                        }
                        else
                        {
                            Console.WriteLine("Duplicate Channel!");
                        }
                        break;

                    default:
                        Console.WriteLine("DuplicateEvent: {0} unknown", type.Key);
                        break;
                    }
                }
                else
                {
                    Console.WriteLine("DuplicateEvent-2: {0} unknown", _obj.Set[0]);
                }
            }
            return(this);
        }
Beispiel #6
0
        override public ActionEvent Parse(ActionParser parser)
        {
            ActionEvent myEvent = base.Parse(parser);

            if (_obj != null)
            {
                if (_obj.Set[0] is EnmrType)
                {
                    EnmrType type = _obj.Set[0] as EnmrType;
                    switch (type.Key)
                    {
                    case "Chnl":
                        return(new DeleteChannelEvent(this));

                    case "Gd":
                        return(new DeleteGuideEvent(this, type.Value));

                    case "Lyr":
                        return(new DeleteLayerEvent(this));

                    default:
                        Console.WriteLine("DeleteEvent-1: {0} unknown", type.Key);
                        break;
                    }
                }
                else if (_obj.Set[0] is NameType)
                {
                    NameType type = _obj.Set[0] as NameType;
                    switch (type.ClassID2)
                    {
                    case "Chnl":
                        return(new DeleteChannelByNameEvent(this, type.Key));

                    case "Lyr":
                        return(new DeleteLayerEvent(this));

                    default:
                        Console.WriteLine("DeleteEvent-2: {0} unknown",
                                          type.ClassID2);
                        break;
                    }
                }
                else if (_obj.Set[0] is PropertyType)
                {
                    PropertyType type = _obj.Set[0] as PropertyType;
                    switch (type.ClassID2)
                    {
                    case "Lyr":
                        return(new DeleteLayerByNameEvent(this, type.Key));

                    default:
                        Console.WriteLine("DeleteEvent-3: {0} unknown",
                                          type.ClassID2);
                        break;
                    }
                }
                else if (_obj.Set[0] is IndexType)
                {
                    IndexType type = _obj.Set[0] as IndexType;
                    switch (type.Key)
                    {
                    case "Chnl":
                        return(new DeleteChannelByIndexEvent(this, type.Index));

                    default:
                        Console.WriteLine("DeleteEvent-4: {0} unknown", type.Key);
                        break;
                    }
                }
                else
                {
                    Console.WriteLine("DeleteEvent: " + _obj.Set[0]);
                }
            }
            return(myEvent);
        }
Beispiel #7
0
        override public ActionEvent Parse(ActionParser parser)
        {
            ActionEvent myEvent = base.Parse(parser);

            if (_type != null)
            {
                if (_type is ReferenceParameter)
                {
                    ReferenceParameter type = _type as ReferenceParameter;

                    if (type.Set[0] is EnmrType)
                    {
                        EnmrType enmr = type.Set[0] as EnmrType;

                        switch (enmr.Key)
                        {
                        case "Lyr":
                            return(new MoveLayerEvent(this, enmr.Value));

                        default:
                            Console.WriteLine("MoveEvent, unknown key: " + enmr.Key);
                            break;
                        }
                    }
                    else if (type.Set[0] is IndexType)
                    {
                        IndexType index = type.Set[0] as IndexType;
                        switch (index.Key)
                        {
                        case "Lyr":
                            return(new MoveLayerByIndexEvent(this, index.Index));

                        default:
                            Console.WriteLine("MoveEvent, unknown key: " +
                                              index.Key);
                            break;
                        }
                    }
                }
                else if (_type is ObjcParameter)
                {
                    ObjcParameter type = _type as ObjcParameter;

                    if (type.ClassID2 == "Ofst")
                    {
                        return(new MoveOffsetEvent(this, type));
                    }
                    else
                    {
                        Console.WriteLine("MoveEvent-1: " + type.ClassID2);
                    }
                }
                else
                {
                    Console.WriteLine("MoveEvent-2");
                }
            }
            else
            {
                Console.WriteLine("MoveEvent-3");
            }
            return(myEvent);
        }
Beispiel #8
0
        override public ActionEvent Parse(ActionParser parser)
        {
            if (_parameter is ObjcParameter)
            {
                ObjcParameter objc     = _parameter as ObjcParameter;
                string        classID2 = objc.ClassID2;

                switch (classID2)
                {
                case "Elps":
                    return(new SelectEllipseEvent(this, objc));

                case "Plgn":
                    return(new SelectPolygonEvent(this, objc));

                case "Pnt":
                    return(new SelectPointEvent(this, objc));

                case "Rctn":
                    return(new SelectRectangleEvent(this, objc));

                case "Sngc":
                    return(new SelectSingleRowEvent(this, objc));

                case "Sngr":
                    return(new SelectSingleRowEvent(this, objc));

                default:
                    Console.WriteLine("SelectionEvent Implement " + classID2);
                    break;
                }
            }
            else if (_parameter is EnumParameter)
            {
                string type = (_parameter as EnumParameter).Value;

                switch (type)
                {
                case "Al":
                    return(new SelectAllEvent(this));

                case "None":
                    return(new SelectNoneEvent(this));

                case "Prvs":
                    return(new SelectPreviousEvent(this));

                default:
                    Console.WriteLine("SelectionEvent-1: " + type);
                    break;
                }
            }
            else if (_parameter is ReferenceParameter)
            {
                ReferenceParameter enmr = _parameter as ReferenceParameter;

                if (enmr.Set[0] is EnmrType)
                {
                    EnmrType type = enmr.Set[0] as EnmrType;
                    switch (type.Key)
                    {
                    case "Chnl":
                        return(new SelectionFromChannelEvent(this, type.Value));

                    case "Pxel":
                        return(new SelectPixelEvent(this, type.Value));

                    default:
                        Console.WriteLine("SelectionEvent-3: " + type.Key);
                        break;
                    }
                }
                else if (enmr.Set[0] is IndexType)
                {
                    IndexType index = enmr.Set[0] as IndexType;
                    switch (index.Key)
                    {
                    case "Chnl":
                        return(new SelectionByIndexEvent(this, index.Index));

                    default:
                        Console.WriteLine("SelectionEvent-5: " + index.Key);
                        break;
                    }
                }
                else if (enmr.Set[0] is NameType)
                {
                    NameType name = enmr.Set[0] as NameType;
                    switch (name.ClassID2)
                    {
                    case "Chnl":
                        return(new SelectionFromChannelEvent(this, name.Key));

                    default:
                        Console.WriteLine("SelectionEvent-6: " + name.ClassID2);
                        break;
                    }
                }
                else
                {
                    Console.WriteLine("SelectionEvent-4: " + enmr.Set[0]);
                }
            }
            else
            {
                Console.WriteLine("SelectionEvent-2: " + _parameter);
            }
            return(this);
        }
Beispiel #9
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);
        }
        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);
            }
            }
        }