Exemple #1
0
        public void Load(RSFileReader R)
        {
            byte tag;

            while ((tag = R.ReadByte()) != 0)
            {
                switch (tag)
                {
                case 10:
                    Name = R.ReadString();
                    break;

                case 20:
                    if (Parameters == null)
                    {
                        Parameters = new List <GVDeclarationDataEntry>();
                    }
                    GVDeclarationDataEntry de = new GVDeclarationDataEntry();
                    de.Load(R);
                    break;

                case 30:
                    OutNaming = new GVDeclarationFlowOut();
                    OutNaming.Load(R);
                    break;
                }
            }
        }
Exemple #2
0
 public override void PaintContent(GVGraphViewContext context, RectangleF rect, Pen penBorder)
 {
     context.Graphics.DrawRectangle(penBorder, rect.X, rect.Y, rect.Width, rect.Height);
     if (Action != null)
     {
         context.Graphics.DrawString(Action.Name, GVGraphics.ActionTitleFont, Brushes.Black, rect.X + 4, rect.Y + 4);
         for (int i = 0; i < Action.ParametersCount; i++)
         {
             GVDeclarationDataEntry ap = Action.GetParameter(i);
             context.Graphics.DrawLine(Pens.LightGray, rect.X + 4, rect.Y + p_titleheight + i * p_rowheight,
                                       rect.X + p_titlewidth - 4, rect.Y + p_titleheight + i * p_rowheight);
             context.Graphics.DrawString(ap.Name, GVGraphics.ActionPropertyFont, Brushes.Black, rect.X + 8, rect.Y + p_titleheight + i * p_rowheight + 4);
             context.Graphics.DrawString(ap.Value, GVGraphics.ActionPropertyFont, Brushes.DarkGreen, rect.X + p_row1width + 4, rect.Y + p_titleheight + i * p_rowheight + 4);
         }
         context.Graphics.DrawLine(Pens.LightGray, rect.X + 4, rect.Y + p_titleheight + Action.ParametersCount * p_rowheight,
                                   rect.X + p_titlewidth - 4, rect.Y + p_titleheight + Action.ParametersCount * p_rowheight);
         context.Graphics.DrawLine(Pens.LightGray, rect.X + 4, rect.Y + p_titleheight, rect.X + 4,
                                   rect.Y + p_titleheight + Action.ParametersCount * p_rowheight);
         context.Graphics.DrawLine(Pens.LightGray, rect.X + p_row1width, rect.Y + p_titleheight,
                                   rect.X + p_row1width, rect.Y + p_titleheight + Action.ParametersCount * p_rowheight);
         context.Graphics.DrawLine(Pens.LightGray, rect.X + p_titlewidth - 4, rect.Y + p_titleheight,
                                   rect.X + p_titlewidth - 4, rect.Y + p_titleheight + Action.ParametersCount * p_rowheight);
     }
     else
     {
         context.Graphics.DrawString("<action>", GVGraphics.ActionTitleFont, Brushes.Black, rect.X + 4, rect.Y + 4);
     }
     //base.PaintContent(context, rect, penBorder);
 }
        public GVDeclarationDataEntry CreateCopy()
        {
            GVDeclarationDataEntry ap = new GVDeclarationDataEntry();

            ap.DataType  = this.DataType;
            ap.Name      = this.Name;
            ap.Value     = this.Value;
            ap.Direction = this.Direction;
            return(ap);
        }
Exemple #4
0
        public override SizeF GetBoundsSize(GVGraphViewContext context)
        {
            if (Action == null)
            {
                return(context.Graphics.MeasureString("<action>", SystemFonts.MenuFont));
            }
            else
            {
                float r1 = 16, r2 = 16;
                float rh        = 0;
                SizeF cellSize  = SizeF.Empty;
                SizeF titleSize = context.Graphics.MeasureString(Action.Name, GVGraphics.ActionTitleFont);
                int   count     = Action.ParametersCount;
                for (int a = 0; a < count; a++)
                {
                    GVDeclarationDataEntry ap = Action.GetParameter(a);
                    cellSize = context.Graphics.MeasureString(ap.Name, GVGraphics.ActionPropertyFont);
                    r1       = Math.Max(r1, cellSize.Width + 12);
                    rh       = Math.Max(rh, cellSize.Height);
                    cellSize = context.Graphics.MeasureString(ap.Value, GVGraphics.ActionPropertyFont);
                    r2       = Math.Max(r2, cellSize.Width + 12);
                    rh       = Math.Max(rh, cellSize.Height);
                }

                if (r1 + r2 > titleSize.Width + 8)
                {
                    p_titlewidth = r1 + r2;
                }
                else
                {
                    p_titlewidth = titleSize.Width + 8;
                    float d = (p_titlewidth - r1 - r2) / 2;
                    r1 += d;
                    r2 += d;
                }
                p_titleheight = titleSize.Height + 12;
                p_row1width   = r1;
                p_row2width   = r2;
                p_rowheight   = rh + 8;

                return(new SizeF(p_titlewidth, p_titleheight + p_rowheight * count + 4));
            }
        }