Example #1
0
//		public void MakeInternal(ClassEntry e)
//		{
//			isInternal = true;
//			classEntry = e;
//		}
//
//		public void MakeReference(ClassEntry e)
//		{
//			isFromReference = true;
//			classEntry = e;
//		}

        /// <summary>
        /// Creates a Custom ChildDataType.
        /// </summary>
        /// <param name="name"></param>
        /// <param name="nameSpace"></param>
        /// <param name="isTableCoded"></param>
        /// <param name="defaultTableName"></param>
        public EnumType(string name, string nameSpace)
        {
            this.name                 = name;
            this.nameSpace            = nameSpace;
            this.parentEnumEntry      = null;
            this.parentReferenceEntry = null;
        }
Example #2
0
//		public void MakeInternal(ClassEntry c)
//		{
//			isInternal = true;
//			classEntry = c;
//		}
//
//		public void MakeReference(ClassEntry c)
//		{
//			isFromReference = true;
//			classEntry = c;
//		}

        /// <summary>
        /// Creates a Custom ChildDataType.
        /// </summary>
        /// <param name="name"></param>
        /// <param name="nameSpace"></param>
        /// <param name="isTableCoded"></param>
        /// <param name="defaultTableName"></param>
        public ReferenceType(string name, string nameSpace)
        {
            this.name                 = name;
            this.nameSpace            = nameSpace;
            this.parentClassEntry     = null;
            this.parentReferenceEntry = null;
        }
        public void Remove(ReferenceEntry value)
        {
            int index = IndexOf(value);

            if (index == -1)
            {
                throw(new Exception("ReferenceEntry not found in collection."));
            }
            RemoveAt(index);
        }
 public int IndexOf(ReferenceEntry value)
 {
     for (int x = 0; x < itemCount; x++)
     {
         if (ReferenceEntryArray[x].Equals(value))
         {
             return(x);
         }
     }
     return(-1);
 }
 public void Insert(int index, ReferenceEntry value)
 {
     itemCount++;
     if (itemCount > ReferenceEntryArray.Length)
     {
         for (int x = index + 1; x == itemCount - 2; x++)
         {
             ReferenceEntryArray[x] = ReferenceEntryArray[x - 1];
         }
     }
     ReferenceEntryArray[index] = value;
 }
 public int Add(ReferenceEntry value)
 {
     itemCount++;
     if (itemCount > ReferenceEntryArray.GetUpperBound(0) + 1)
     {
         ReferenceEntry[] tempReferenceEntryArray = new ReferenceEntry[itemCount * 2];
         for (int x = 0; x <= ReferenceEntryArray.GetUpperBound(0); x++)
         {
             tempReferenceEntryArray[x] = ReferenceEntryArray[x];
         }
         ReferenceEntryArray = tempReferenceEntryArray;
     }
     ReferenceEntryArray[itemCount - 1] = value;
     return(itemCount - 1);
 }
Example #7
0
        public void AddReference(string fileName)
        {
            ReferenceEntry r = new ReferenceEntry(fileName);

            references.Add(r);

            DataModel m = new DataModel();

            m.Load(fileName);

            foreach (ModelFolder folder in m.Folders)
            {
                foreach (object i in folder.Items)
                {
                    if (i is ModelClass)
                    {
                        DataTypeManager.AddDataType(new ReferenceType((ModelClass)i, r));
                    }
                }
            }
        }
Example #8
0
 /// <summary>
 /// Instantiates a ChildDataType. Be sure to set the reference entry if it is loaded from a reference.
 /// </summary>
 /// <param name="e"></param>
 /// <param name="e"></param>
 public EnumType(ModelEnum e, ReferenceEntry r)
 {
     parentEnumEntry      = e;
     parentReferenceEntry = r;
 }
Example #9
0
 /// <summary>
 /// Instantiates a ChildDataType. Be sure to set the reference entry if it is loaded from a reference.
 /// </summary>
 /// <param name="c"></param>
 /// <param name="c"></param>
 public ReferenceType(ModelClass c, ReferenceEntry r)
 {
     parentClassEntry     = c;
     parentReferenceEntry = r;
 }
Example #10
0
 public int CompareTo(ReferenceEntry x)
 {
     return(name.CompareTo(x.Name));
 }
 public bool Contains(ReferenceEntry value)
 {
     return(IndexOf(value) != -1);
 }