Example #1
0
        public object Clone()
        {
            GenericArgumentType genericArgType = new GenericArgumentType();

            genericArgType.ID = ID != null ? (string)ID.Clone() : null;
            genericArgType.GenericArgsCompactTypes = GenericArgsCompactTypes != null ? (CompactClass[])GenericArgsCompactTypes.Clone() : null;
            return(genericArgType);
        }
Example #2
0
            private static Hashtable GetArgumentType(GenericArgumentType gat)
            {
                Hashtable concreteArgTypes = new Hashtable(gat.GenericArgsCompactTypeList.Count);
                Hashtable concreteArgType  = null;

                if (gat.GenericArgsCompactTypeList != null)
                {
                    foreach (CompactClass cls in gat.GenericArgsCompactTypeList)
                    {
                        concreteArgType = new Hashtable();
                        concreteArgType.Add("id", cls.ID);
                        concreteArgType.Add("name", cls.Name);
                        concreteArgType.Add("assembly", cls.Assembly);
                        concreteArgType.Add("portable", cls.Portable);
                        concreteArgType.Add("type", cls.Type);
                        concreteArgType.Add("generic-id", cls.GenericId);
                        concreteArgType.Add("is-generic", cls.IsGeneric);
                        concreteArgType.Add("num-of-args", cls.NumberOfArgs);
                        #region [changes]
                        Hashtable argTypes = null;
                        if (cls.IsGeneric && cls.GenericArgumentTypeList != null)
                        {
                            argTypes = new Hashtable();
                            foreach (GenericArgumentType gat2 in cls.GenericArgumentTypeList)
                            {
                                argTypes.Add(gat2.ID, GetArgumentType(gat2));
                            }
                            concreteArgType.Add("arg-types", argTypes);
                        }
                        #endregion

                        Hashtable nonCompactFields = null;
                        if (cls.NonCompactFieldsTable.Count > 0)
                        {
                            nonCompactFields = new System.Collections.Hashtable();

                            foreach (Attrib attrib in cls.NonCompactFields)
                            {
                                nonCompactFields.Add(attrib.ID, attrib);
                            }

                            concreteArgType.Add("non-compact-fields", nonCompactFields);
                        }

                        concreteArgTypes.Add(cls.ID, concreteArgType);
                    }
                }
                return(concreteArgTypes);
            }