Beispiel #1
0
        /// <summary>
        /// Adds an IRapEntry to entry collection based on Type.
        /// </summary>
        /// <param name="entry">Entry to be added.</param>
        /// <param name="reader">Reader for reading binarized rap entry.</param>
        public void AddEntry(IRapEntry entry, RapBinaryReader reader)
        {
            if (entry is RapClass)
            {
                Classes.Add(reader.ReadBinarizedRapEntry <RapClass>());
            }

            if (entry is RapExtern)
            {
                Externs.Add(reader.ReadBinarizedRapEntry <RapExtern>());
            }

            if (entry is RapDelete)
            {
                Deletes.Add(reader.ReadBinarizedRapEntry <RapDelete>());
            }

            if (entry is RapValue)
            {
                Values.Add(reader.ReadBinarizedRapEntry <RapValue>());
            }

            if (entry is RapArray)
            {
                Arrays.Add(reader.ReadBinarizedRapEntry <RapArray>());
            }
        }
Beispiel #2
0
        public override void VisitAssociativeArray(AssociativeArray value)
        {
            if (Arrays == null)
            {
                Arrays = new HashSet <AssociativeArray>();
            }

            Arrays.Add(value);
            hasArray = true;
        }
        public DefaultNHibernatePatternsHolder(IDomainInspector domainInspector, IExplicitDeclarationsHolder explicitDeclarations)
        {
            Poids.Add(new PoIdPattern());
            Sets.Add(new SetCollectionPattern());
            Bags.Add(new BagCollectionPattern());
            Lists.Add(new ListCollectionPattern(domainInspector));
            Arrays.Add(new ArrayCollectionPattern());
            Components.Add(new ComponentPattern(domainInspector));
            Dictionaries.Add(new DictionaryCollectionPattern());

            PoidStrategies.Add(new HighLowPoidPattern());
            PoidStrategies.Add(new GuidOptimizedPoidPattern());

            PersistentPropertiesExclusions.Add(new ReadOnlyPropertyPattern());
            ManyToOneRelations.Add(new OneToOneUnidirectionalToManyToOnePattern(domainInspector, explicitDeclarations));
            ManyToOneRelations.Add(new PolymorphicManyToOnePattern(domainInspector));
            OneToManyRelations.Add(new PolymorphicOneToManyPattern(domainInspector));
            HeterogeneousAssociations.Add(new HeterogeneousAssociationOnPolymorphicPattern(domainInspector));
        }
Beispiel #4
0
        public DefaultNHibernatePatternsHolder(IDomainInspector domainInspector, IExplicitDeclarationsHolder explicitDeclarations)
        {
            if (domainInspector == null)
            {
                throw new ArgumentNullException("domainInspector");
            }
            Poids.Add(new PoIdPattern());
            Sets.Add(new SetCollectionPattern());
            Bags.Add(new BagCollectionPattern());
            Lists.Add(new ListCollectionPattern(domainInspector));
            Arrays.Add(new ArrayCollectionPattern());
            Components.Add(new ComponentPattern(domainInspector));
            Dictionaries.Add(new DictionaryCollectionPattern());

            PoidStrategies.Add(new HighLowPoidPattern());
            PoidStrategies.Add(new GuidOptimizedPoidPattern());

            PersistentPropertiesExclusions.Add(new ReadOnlyPropertyPattern());
            ManyToOneRelations.Add(new OneToOneUnidirectionalToManyToOnePattern(explicitDeclarations));
        }
        // Number Handling
        static void intHandling()                                              // This handles big datasets and just has a few things to parse data from it
        {
            double current_data;
            string to_exit = "";
            bool   done    = true;

            double[] data = new double[0];

            Console.WriteLine("Type anything other than a number to exit");
            Console.Write("Input: ");

            to_exit = Console.ReadLine();
            done    = double.TryParse(to_exit, out current_data);               // First use of the better basics libary. This one has all the try parse in it and is self contained

            while (done)                                                        // Will loop thru until a blank line is found
            {
                data = Arrays.Add(current_data, data);                          // Arrays.add is also a better basics thing. Instead of using a list you can use array and it will make a new array size of + 1
                Console.Write("Input: ");
                to_exit = Console.ReadLine();
                done    = double.TryParse(to_exit, out current_data);
            }

            intHandleMenu(data);
        }
Beispiel #6
0
 public void AddArray(Array array)
 {
     Arrays.Add(array);
 }
 public Turns Next(Phases child)
 {
     childs = Arrays.Add(childs, child);
     return(this);
 }
 public Games Next(Turns child)
 {
     childs = Arrays.Add(childs, child);
     return(this);
 }
 public Phases Next(Steps child)
 {
     childs = Arrays.Add(childs, child);
     return(this);
 }
Beispiel #10
0
        private string ProcessArray(string currentline)
        {
            currentline = currentline.Substring(6);
            currentline = currentline.Trim();
            ArrayList al     = new ArrayList();
            int       state  = 0;
            string    tmp    = "";
            bool      fin    = false;
            bool      foundu = false;

            foreach (char c in currentline.ToCharArray())
            {
                switch (state)
                {
                case 0:
                    if (c == '[')
                    {
                        state = 1;
                    }
                    else
                    {
                        return("Array Decleration Error");
                    }
                    break;

                case 1:
                    if (c == '\\')
                    {
                        state = 2;
                    }
                    else if (c == '.')
                    {
                        state = 3;
                    }
                    else if (c == ']')
                    {
                        if (tmp.Length > 1)
                        {
                            return("Error Array Item Contain More Than One Character");
                        }
                        else if (tmp.Length == 0)
                        {
                        }
                        else
                        {
                            al.Add(tmp);
                        }
                        state = 5;
                    }
                    else if (c == ',')
                    {
                        if (tmp.Length > 1)
                        {
                            return("Error Array Item Contain More Than One Character");
                        }
                        else if (tmp.Length == 0)
                        {
                        }
                        else
                        {
                            al.Add(tmp);
                        }
                        tmp = "";
                    }
                    else if (c == ' ' || c == '\t')
                    {
                    }
                    else if (c == '+')
                    {
                        if (tmp == "U")
                        {
                            state = 7;
                            tmp   = "";
                        }
                    }
                    else
                    {
                        tmp += c;
                    }
                    break;

                case 2:
                    if (c == '\\' || c == '.' || c == ']')
                    {
                        tmp += c;
                    }
                    else if (c == ',')
                    {
                        tmp += c;
                    }
                    else if (c == ' ' || c == '\t')
                    {
                        tmp += c;
                    }
                    else
                    {
                        return("Invalid Escape Character - " + c);
                    }
                    state = 1;
                    break;

                case 3:
                    if (c == '.')
                    {
                        state = 4;
                    }
                    else if (c == ',')
                    {
                        if (tmp.Length > 1)
                        {
                            return("Error Array Item Contain More Than One Character");
                        }
                        else if (tmp.Length == 0)
                        {
                        }
                        else
                        {
                            al.Add(tmp);
                        }
                        tmp = "";
                    }
                    else
                    {
                        tmp += c;
                    }
                    break;

                case 4:
                    char start = tmp[tmp.Length - 1];
                    char end   = c;
                    tmp = "";
                    for (int j = (int)start; j <= (int)end; j++)
                    {
                        al.Add(((char)j).ToString());
                    }
                    state = 1;
                    break;

                case 5:
                    if (c == ' ' || c == '\t')
                    {
                        //do nothing
                    }
                    else if (c == '>')
                    {
                        state = 6;
                        tmp   = "";
                    }
                    else
                    {
                        return("Error Array Name");
                    }
                    break;

                case 6:
                    if (c == ' ' || c == '\t')
                    {
                        if (tmp.Length > 0)
                        {
                            return("Error Array Name");
                        }
                    }
                    else if (c == '}')
                    {
                        fin = true;
                    }
                    else if (fin == false)
                    {
                        tmp += c;
                    }
                    else
                    {
                        return("Error Array Name");
                    }
                    break;

                case 7:
                    if (checkHex(c))
                    {
                        tmp += c;
                    }
                    else if (c == ',' || c == ']')
                    {
                        if (tmp.Length == 4)
                        {
                            int i = Convert.ToInt32(tmp, 16);
                            al.Add(((char)i).ToString());
                            tmp = "";
                            if (c == ',')
                            {
                                state = 1;
                            }
                            else
                            {
                                state = 5;
                            }
                        }
                        else
                        {
                            return("Error Unicode point");
                        }
                    }
                    break;
                }
            }
            TLArray tla = new TLArray();

            tla.name    = tmp;
            tla.content = al;
            Arrays.Add(tla);
            return("OK");
        }
 /// <summary>
 /// Adds the given array to this node's arrays.
 /// </summary>
 /// <param name="array"></param>
 public void AddArray(KONArray array)
 {
     array.Parent = this;
     Arrays.Add(array);
 }
Beispiel #12
0
 public void AddArray(string key, string expression)
 {
     Arrays ??= new Dictionary <string, string>();
     Arrays.Add(key, expression);
 }