Esempio n. 1
0
 public static SchemaOpr Instance()
 {
     if (null == m_opr)
     {
         m_opr = new SchemaOpr();
     }
     return(m_opr);
 }
Esempio n. 2
0
 public SchemaEntityOpr(Entity ent)
 {
     if (null != ent && ent.Schema.GUID == SchemaOpr.Instance().schema.GUID)
     {
         m_sch    = ent.Schema;
         m_entity = ent;
     }
 }
Esempio n. 3
0
 public SchemaEntityOpr(Element ele)
 {
     if (false == GetEntityFrom(ele))
     {
         m_sch    = SchemaOpr.Instance().schema;
         m_entity = new Entity(m_sch);
     }
 }
Esempio n. 4
0
        /// <summary>
        /// 创建基于该表结构的ent
        /// </summary>
        /// <returns></returns>
        static public Entity CreateEntity()
        {
            if (SchemaOpr.Instance().IsValid())
            {
                Entity ent = new Entity(SchemaOpr.Instance().schema);
                return(ent);
            }

            //
            return(null);
        }
Esempio n. 5
0
        /// <summary>
        /// 从element获取扩展存储
        /// </summary>
        /// <param name="ele"></param>
        /// <returns></returns>
        public bool GetEntityFrom(Element ele)
        {
            Entity ent = ele.GetEntity(SchemaOpr.Instance().schema);

            if (ent.IsValid())
            {
                m_sch    = ent.Schema;
                m_entity = ent;
                return(true);
            }

            //
            return(false);
        }