Пример #1
0
        public ProObject GetFlattend()
        {
            ProObject NewObject = new ProObject();

            foreach (var Item in myProperties)
            {
                NewObject.Add(Item.Key, Item.Value);
            }

            ProObject CurrentPrototype = myPrototype;

            while (CurrentPrototype != null)
            {
                foreach (var Item in CurrentPrototype)
                {
                    string CurrentKey = Item.Key;

                    if (!NewObject.Contains(CurrentKey))
                    {
                        NewObject.Add(CurrentKey, Item.Value);
                    }
                }

                CurrentPrototype = CurrentPrototype.Prototype;
            }

            return(NewObject);
        }
Пример #2
0
        public ProObject New(params object[] ThePrameters)
        {
            ProObject Obj;

            if (myPrototype != null)
            {
                Obj = new ProObject(myPrototype);
            }
            else
            {
                Obj = new ProObject();
            }

            myConstructorAction(Obj, ThePrameters);

            return(Obj);
        }
Пример #3
0
        public ProObject New()
        {
            ProObject Obj;

            if (myPrototype != null)
            {
                Obj = new ProObject(myPrototype);
            }
            else
            {
                Obj = new ProObject();
            }

            myConstructorAction(Obj, myEmptyArray);

            return(Obj);
        }
Пример #4
0
        public bool TryGetObjectMember(string BinderName, out object result)
        {
            if (myProperties.ContainsKey(BinderName))
            {
                result = myProperties[BinderName];

                return(true);
            }
            else if (myPrototype != null)
            {
                ProObject CurrentPrototype = myPrototype;

                while (CurrentPrototype != null)
                {
                    object TGMResult;

                    if (CurrentPrototype.TryGetObjectMember(BinderName, out TGMResult))
                    {
                        myProperties.Add(BinderName, TGMResult);

                        result = TGMResult;

                        return(true);
                    }

                    CurrentPrototype = CurrentPrototype.Prototype;
                }
            }

            if (IsPrototype(BinderName))
            {
                if (myPrototype != null)
                {
                    result = myPrototype;

                    return(true);
                }
            }

            result = null;

            return(false);
        }
Пример #5
0
        public bool TryGetProtoType(out ProObject TheProtoType)
        {
            TheProtoType = myPrototype;

            return(TheProtoType != null);
        }
Пример #6
0
 public ProObject(ProObject ThePrototype)
 {
     myPrototype = ThePrototype;
 }