Exemplo n.º 1
0
        public DesignTableClass AddTable(bool show)
        {
            DesignTableClass tb = new DesignTableClass(ctrl, "test", show);

            Tables.Add(tb);
            return(tb);
        }
Exemplo n.º 2
0
        /*
         * public DrawLine(int i)
         * {
         *          Graphics g;
         *
         *          g = pbDesign.CreateGraphics();
         *
         *          Pen myPen = new Pen(Color.Red);
         *          myPen.Width = 4;
         *          myPen.StartCap = System.Drawing.Drawing2D.LineCap.Round;
         *          myPen.EndCap = System.Drawing.Drawing2D.LineCap.ArrowAnchor;
         *          g.DrawLine(myPen, ob_s.Location.X, ob_s.Location.Y,ob_e.Location.X, ob_e.Location.Y);
         * }
         */
        private void hotSpot1_Click(object sender, EventArgs e)
        {
            ActionClass.Instance().Clear();


            int offsetx = this.Left;
            int offsety = this.Top;

            Point absoff = new Point();

            absoff.X = 0;
            absoff.Y = 32;  // Location plus Fenstertitelrand


            DesignTableClass tc = new DesignTableClass(pbDesign, "test");

            ActTable = tc;
        }
Exemplo n.º 3
0
        private void ShowAllObjects()
        {
            foreach (var ob in ObjectList)
            {
                foreach (var ln in ob.LineList)
                {
                    DesignTableClass ob_s = (DesignTableClass)ln.StartObject;
                    DesignTableClass ob_e = (DesignTableClass)ln.EndObject;
                    Graphics         g;

                    g = pbDesign.CreateGraphics();

                    Pen myPen = new Pen(Color.Red);
                    myPen.Width    = 4;
                    myPen.StartCap = System.Drawing.Drawing2D.LineCap.Round;
                    myPen.EndCap   = System.Drawing.Drawing2D.LineCap.ArrowAnchor;
                    g.DrawLine(myPen, ob_s.Location.X, ob_s.Location.Y, ob_e.Location.X, ob_e.Location.Y);
                }
            }
        }
Exemplo n.º 4
0
        private void CreateDesignObjects()
        {
            ObjectList.Clear();

            // string[] ln = File.ReadAllLines(fn);

            DesignTableClass tc;
            int x = 20;
            int y = 20;

            //foreach (string s in ln)
            int n = 0;

            //object ob1=null;
            //object ob2=null;
            foreach (ItemDataClass s in selDBObjects.CheckedItemDatas)
            {
                if (s.Object.GetType() == typeof(TableClass))
                {
                    //  string n = s.Substring(s.IndexOf("'")+1, s.LastIndexOf("'") - s.IndexOf("'") -1);
                    n++;
                    tc = new DesignTableClass(pbDesign, s.Object.ToString(), true, x, y);

                    tc.TableNotify.Notify.OnRaiseInfoHandler += Notify_OnRaiseInfoHandler;
                    x += 160;
                    //y += 0;
                    if (x > 1000)
                    {
                        x  = 20;
                        y += 180;
                    }
                    var tob = (TableClass)s.Object;
                    foreach (var att in tob.Fields.Values)
                    {
                        tc.AddAttribute(att.Name);
                    }
                    //if(n == 1) ob1 = tc;
                    //if(n == 2) ob2 = tc;

                    ObjectList.Add(tc);
                }

                /*
                 * else if (s.ToUpper().StartsWith("VIEW"))
                 * {
                 *
                 * }
                 * else if (s.ToUpper().StartsWith("FIELD"))
                 * {
                 *
                 * }
                 */
            }

            foreach (ItemDataClass s in selDBObjects.CheckedItemDatas)
            {
                if (s.Object.GetType() == typeof(TableClass))
                {
                    TableClass tb1 = (TableClass)s.Object;
                    foreach (var fld in tb1.Fields)
                    {
                        if (fld.Key.EndsWith("_ID"))
                        {
                            DesignTableClass ob1 = (DesignTableClass)FindObject(tb1.Name);
                            DesignTableClass ob2 = (DesignTableClass)FindObject(fld.Key.Remove(fld.Key.Length - 3));
                            if ((ob1 != null) && (ob2 != null))
                            {
                                ReferenzClass rc = new ReferenzClass();
                                rc.Name        = fld.Key;
                                rc.StartObject = ob1;
                                rc.EndObject   = ob2;
                                ob1.LineList.Add(rc);
                            }
                        }
                    }
                }
            }
        }