Esempio n. 1
0
        public void RefreshName(IYZDbProvider provider, IDbConnection cn)
        {
            AttachmentInfo attachment = AttachmentManager.TryGetAttachmentInfo(provider, cn, this.FileID);

            if (attachment != null)
            {
                this.FileName = attachment.Name;
            }
            else
            {
                this.FileName = "";
            }

            switch (this.LinkType)
            {
            case ReferenceType.SpriteToSprite:
            case ReferenceType.ProcessToSprite:
                SpriteIdentity identity = BPAManager.TryGetSpriteIdentity(provider, cn, this.FileID, this.SpriteID);
                this.SpriteName = identity != null ? identity.Name : "";
                break;

            default:
                this.SpriteName = "";
                break;
            }
        }
Esempio n. 2
0
 public static void Insert(IYZDbProvider provider, IDbConnection cn, SpriteIdentity spriteIdentity)
 {
     try
     {
         provider.Insert(cn, spriteIdentity);
     }
     catch (Exception e)
     {
         throw new BPMException(BPMExceptionType.DBInsertDataErr, "BPASpriteIdentity", e.Message);
     }
 }
Esempio n. 3
0
        public Reference TryGetItem(SpriteIdentity identity)
        {
            foreach (Reference @ref in this)
            {
                if (@ref.FileID == identity.FileID &&
                    @ref.SpriteID == identity.SpriteID)
                {
                    return(@ref);
                }
            }

            return(null);
        }
Esempio n. 4
0
        public static SpriteIdentity TryGetSpriteIdentity(IYZDbProvider provider, IDbConnection cn, string fileid, string spriteid)
        {
            SpriteIdentity spriteIdentity = null;

            try
            {
                using (YZReader reader = new YZReader(provider.GetSpriteIdentity(cn, fileid, spriteid)))
                {
                    if (reader.Read())
                    {
                        spriteIdentity = new SpriteIdentity(reader);
                    }
                }
            }
            catch (Exception e)
            {
                throw new BPMException(BPMExceptionType.DBLoadDataErr, "BPASpriteIdentity", e.Message);
            }

            return(spriteIdentity);
        }
Esempio n. 5
0
        public bool Contains(SpriteIdentity identity)
        {
            Reference @ref = this.TryGetItem(identity);

            return(@ref == null ? false:true);
        }