Ejemplo n.º 1
0
 /// <summary>
 /// 将给定的Cld_Graphic和当前的sheet关联起来
 /// </summary>
 /// <param name="to_add"></param>
 public virtual void Add(Cld_Graphic to_add)
 {
     this.Cld_Constant_List.Add(to_add);
     to_add.Prj_Sheet_ID      = this.ID;
     to_add.Prj_Document_ID   = this.Prj_Document_ID;
     to_add.Prj_Controller_ID = this.Prj_Controller_ID;
 }
Ejemplo n.º 2
0
        /// <summary>
        /// 返回 此Sheet下面的一个新的Cld_Graphic对象
        /// </summary>
        /// <returns></returns>
        public virtual Cld_Graphic New_Cld_Graphic()
        {
            Cld_Graphic result = new Cld_Graphic();

            result.Prj_Controller_ID = this.Prj_Controller_ID;
            result.Prj_Document_ID   = this.Prj_Document_ID;
            result.Prj_Sheet_ID      = this.ID;
            return(result);
        }
Ejemplo n.º 3
0
 /// <summary>
 /// 根据ID获得Cld_FCBlock
 /// </summary>
 /// <param name="condition">ID type:int</param>
 /// <returns></returns>
 public Cld_Graphic GetCld_Graphic_By_ID(int condition)
 {
     using (ITransaction transaction = session.BeginTransaction()){
         try{
             Cld_Graphic result = this.session.Get <Cld_Graphic>(condition);
             transaction.Commit();
             return(result);
         }catch (Exception e) {
             transaction.Rollback();
             throw e;
         }
     }
 }
Ejemplo n.º 4
0
 public virtual bool Compare(Cld_Graphic g) {
     if (this.ID != g.ID) {
         throw new Exception("id should be equal");
     }
     if (this.Type != g.Type || this.Layer != g.Layer
         || this.Data != g.Data || this.Prj_Controller_ID != g.Prj_Controller_ID
         || this.Prj_Document_ID != g.Prj_Document_ID || this.Prj_Sheet_ID != g.Prj_Sheet_ID
         )
     {
         return false;
     }
     else {
         return true;
     }
 }
Ejemplo n.º 5
0
 public virtual bool Compare(Cld_Graphic g)
 {
     if (this.ID != g.ID)
     {
         throw new Exception("id should be equal");
     }
     if (this.Type != g.Type || this.Layer != g.Layer ||
         this.Data != g.Data || this.Prj_Controller_ID != g.Prj_Controller_ID ||
         this.Prj_Document_ID != g.Prj_Document_ID || this.Prj_Sheet_ID != g.Prj_Sheet_ID
         )
     {
         return(false);
     }
     else
     {
         return(true);
     }
 }
Ejemplo n.º 6
0
        private static void GenerateText(Cld_Graphic graphic, ArrayList symbols)
        {
            string staticAttributeString;
            if (graphic.Data.Contains("$$"))
            {
                staticAttributeString = graphic.Data.Substring(graphic.Data.IndexOf("$$") + 2);
            }
            else
            {
                staticAttributeString = graphic.Data;
            }

            string[] staticAttributes = staticAttributeString.Split(new string[] { "||" }, StringSplitOptions.None);

            LogicText text = new LogicText();
            text.Text = staticAttributes[0];
            if (staticAttributes[0].StartsWith("&"))
            {
                DynTagDef tagDef = new DynTagDef(staticAttributes[0].Substring(1), 1);
                text.Dynamics.Add(tagDef);
            }
            string[] location = staticAttributes[2].Split('_');
            text.Location = new PointF(Convert.ToSingle(location[0]), Convert.ToSingle(location[1]));
            text.Angle = Convert.ToInt32(staticAttributes[3]);
            FontStyle style = FontStyle.Regular;
            if (staticAttributes.Length > 7)
            {
                if (staticAttributes[7] == "1")
                    style = FontStyle.Bold;
                if (staticAttributes[8] == "1")
                    style |= FontStyle.Italic;
                if (staticAttributes[9] == "1")
                    style |= FontStyle.Underline;
            }
            text.Font = new Font(staticAttributes[4], Convert.ToSingle(staticAttributes[5]), style);

            string[] color = staticAttributes[6].Split('_');
            text.ForeColor = Color.FromArgb(Convert.ToInt32(color[0]), Convert.ToInt32(color[1]), Convert.ToInt32(color[2]));


            //if (staticAttributes[1] == "左上")
            //{
            //    text.Alignment = Align.TopLeft;
            //}
            //else if (staticAttributes[1] == "中上")
            //{
            //    text.Alignment = Align.TopCenter;
            //}
            //else if (staticAttributes[1] == "右上")
            //{
            //    text.Alignment = Align.TopRight;
            //}
            //else if (staticAttributes[1] == "左中")
            //{
            //    text.Alignment = Align.MiddleLeft;
            //}
            //else if (staticAttributes[1] == "居中")
            //{
            //    text.Alignment = Align.MiddleCenter;
            //}
            //else if (staticAttributes[1] == "右中")
            //{
            //    text.Alignment = Align.MiddleRight;
            //}
            //else if (staticAttributes[1] == "左下")
            //{
            //    text.Alignment = Align.BottomLeft;
            //}
            //else if (staticAttributes[1] == "中下")
            //{
            //    text.Alignment = Align.BottomCenter;
            //}
            //else if (staticAttributes[1] == "右下")
            //{
            //    text.Alignment = Align.BottomRight;
            //}
            //else
            //{
            //    throw new Exception("对齐方式不确定!");
            //}

            symbols.Add(text);
        }
Ejemplo n.º 7
0
 /// <summary>
 /// 将给定的Cld_Graphic和当前的sheet关联起来
 /// </summary>
 /// <param name="to_add"></param>
 public virtual void Add(Cld_Graphic to_add)
 {
     this.Cld_Constant_List.Add(to_add);
     to_add.Prj_Sheet_ID = this.ID;
     to_add.Prj_Document_ID = this.Prj_Document_ID;
     to_add.Prj_Controller_ID = this.Prj_Controller_ID;
 }
Ejemplo n.º 8
0
 /// <summary>
 /// 返回 此Sheet下面的一个新的Cld_Graphic对象
 /// </summary>
 /// <returns></returns>
 public virtual Cld_Graphic New_Cld_Graphic()
 {
     Cld_Graphic result = new Cld_Graphic();
     result.Prj_Controller_ID = this.Prj_Controller_ID;
     result.Prj_Document_ID = this.Prj_Document_ID;
     result.Prj_Sheet_ID = this.ID;
     return result;
 }
Ejemplo n.º 9
0
 /// <summary>
 /// 返回 此Sheet下面的一个新的Cld_Graphic对象
 /// </summary>
 /// <returns></returns>
 public virtual Cld_Graphic New_Cld_Graphic()
 {
     Cld_Graphic result = new Cld_Graphic();
     result.Prj_Controller_ID = this.Prj_Controller_ID;
     result.Prj_Controller = this.Prj_Controller;
     result.Prj_Document_ID = this.Prj_Document_ID;
     result.Prj_Document = this.Prj_Document;
     result.Prj_Sheet_ID = this.ID;
     result.Prj_Sheet = this;
     this.Cld_Graphic_List.Add(result);
     return result;
 }