Ejemplo n.º 1
0
        public virtual bool CanChangeType(T_Type to)
        {
            if (this.Name == to.Name)
            {
                return(true);
            }

            return(false);
        }
Ejemplo n.º 2
0
        //public bool NullAble { get; set; }
        public virtual T_Type ChangeType(T_Type to)
        {
            if (to.Name == this.Name)
            {
                return(this);
            }

            return(null);
        }
Ejemplo n.º 3
0
        public bool Equals(T_Type p)
        {
            // If parameter is null return false:
            if ((object)p == null)
            {
                return(false);
            }

            // Return true if the fields match:
            return(this.Name == p.Name);
        }
Ejemplo n.º 4
0
        //public T_Type Index(int index)

        internal T_ListType(T_Type valueType)
            : base()
        {
            this.Name = string.Format("List<{0}>", valueType.Name);
            var get = new T_Method()
            {
                Name = "Get", Type = ItemType
            };

            //get.Parameters.Add(new T_Parameter(){ Name});
            this.Methods.Add(get);
        }
Ejemplo n.º 5
0
        public T_InputType(T_Type valueType)
        {
            var type = "unknown";

            if (valueType != null)
            {
                type = valueType.Name;
            }

            this.Name = string.Format("Input<{0}>", type);

            this.Value = new T_Field()
            {
                Name = "Value", Type = valueType
            };
            this.Visible = new T_Field()
            {
                Name = "Visible", Type = T_Type.Boolean
            };
            this.Enabled = new T_Field()
            {
                Name = "Enabled", Type = T_Type.Boolean
            };
            this.Changed = new T_Field()
            {
                Name = "Changed", Type = new T_EventType("Changed")
            };
            this.Validation = new T_Field()
            {
                Name = "Validation", Type = new T_ValidateType()
            };

            this.Fields.Add(this.Visible);
            this.Fields.Add(this.Value);
            this.Fields.Add(this.Enabled);
            this.Fields.Add(this.Changed);
            this.Fields.Add(this.Validation);

            this.Methods.Add(new T_Method()
            {
                Name = "Value", Type = valueType
            });
            this.Methods.Add(new T_Method()
            {
                Name = "Visible", Type = T_Type.Boolean
            });
            this.Methods.Add(new T_Method()
            {
                Name = "Enabled", Type = T_Type.Boolean
            });
        }
Ejemplo n.º 6
0
        public override bool Equals(System.Object obj)
        {
            // If parameter is null return false.
            if (obj == null)
            {
                return(false);
            }

            // If parameter cannot be cast to Point return false.
            T_Type p = obj as T_Type;

            if ((System.Object)p == null)
            {
                return(false);
            }

            // Return true if the fields match:
            return(this.Name == p.Name);
        }
Ejemplo n.º 7
0
 public override bool CanChangeType(T_Type to)
 {
     return(base.CanChangeType(to));
 }
Ejemplo n.º 8
0
        public virtual T_Type RenderView(IndentStringBuilder builder, List <string> call_stack, IndentStringBuilder paras, AssignOperatorInfo?op, IndentStringBuilder opValue,
                                         PostfixPartType?postfixPartType, IndentStringBuilder func_paras, IndentStringBuilder index_para)
        {
            //if(call_stack == null)

            var member = call_stack[0];
            AssignOperatorInfo? op2      = null;
            IndentStringBuilder opValue2 = null;

            if (call_stack.Count == 1)
            {
                op2      = op;
                opValue2 = opValue;
            }

            T_Type nextType = null;

            if (!this.IsInstance)
            {
                foreach (var f in this.Static_Fields)
                {
                    if (f.Name == member)
                    {
                        this.RenderView(builder, f, op2, opValue2);
                        nextType = f.Type;
                        break;
                    }
                }
                if (nextType == null)
                {
                    foreach (var m in this.Static_Methods)
                    {
                        if (m.Name == member)
                        {
                            this.RenderView(builder, m, paras);
                            nextType = m.Type;
                            break;
                        }
                    }
                }
            }
            else
            {
                foreach (var f in this.Fields)
                {
                    if (f.Name == member)
                    {
                        this.RenderView(builder, f, op2, opValue2);
                        nextType = f.Type;
                        break;
                    }
                }
                if (nextType == null)
                {
                    foreach (var m in this.Methods)
                    {
                        if (m.Name == member)
                        {
                            this.RenderView(builder, m, paras);
                            nextType = m.Type;
                            break;
                        }
                    }
                }
            }
            if (call_stack.Count > 1)
            {
                //var call_stack2 = new List<string>();
                //call_stack2.AddRange(call_stack);
                //call_stack2.RemoveAt(0);
                return(nextType.RenderView(builder, call_stack.SubList(1), paras, op, opValue, postfixPartType, func_paras, index_para));
            }

            return(nextType);
        }
Ejemplo n.º 9
0
        public bool Equals(T_Type p)
        {
            // If parameter is null return false:
            if ((object)p == null)
            {
                return false;
            }

            // Return true if the fields match:
            return this.Name == p.Name;
        }
Ejemplo n.º 10
0
        //public bool NullAble { get; set; }
        public virtual T_Type ChangeType(T_Type to)
        {
            if (to.Name == this.Name)
                return this;

            return null;
        }
Ejemplo n.º 11
0
        public virtual bool CanChangeType(T_Type to)
        {
            if (this.Name == to.Name)
                return true;

            return false;
        }
Ejemplo n.º 12
0
 //public T_Type Index(int index)
 internal T_ListType(T_Type valueType)
     : base()
 {
     this.Name = string.Format("List<{0}>",valueType.Name);
     var get = new T_Method() { Name = "Get", Type = ItemType};
     //get.Parameters.Add(new T_Parameter(){ Name});
     this.Methods.Add(get);
 }
Ejemplo n.º 13
0
 public override bool CanChangeType(T_Type to)
 {
     return base.CanChangeType(to);
 }
Ejemplo n.º 14
0
        public T_InputType(T_Type valueType)
        {
            var type = "unknown";
            if (valueType != null)
                type = valueType.Name;

            this.Name = string.Format("Input<{0}>", type);

            this.Value = new T_Field() { Name = "Value", Type = valueType };
            this.Visible = new T_Field() { Name = "Visible", Type = T_Type.Boolean };
            this.Enabled = new T_Field() { Name = "Enabled", Type = T_Type.Boolean };
            this.Changed = new T_Field() { Name = "Changed", Type = new T_EventType("Changed") };
            this.Validation = new T_Field() {Name="Validation",Type = new T_ValidateType() };

            this.Fields.Add(this.Visible);
            this.Fields.Add(this.Value);
            this.Fields.Add(this.Enabled);
            this.Fields.Add(this.Changed);
            this.Fields.Add(this.Validation);

            this.Methods.Add(new T_Method() { Name = "Value", Type = valueType });
            this.Methods.Add(new T_Method() { Name = "Visible", Type = T_Type.Boolean });
            this.Methods.Add(new T_Method() { Name = "Enabled", Type = T_Type.Boolean });
        }