Exemplo n.º 1
0
        public void get(UsingType ut)
        {
            foreach (IRule rule in Rules)
            {
                if (rule.test(semi))
                {
                    break;
                }
                if (!semi.open(file as string))
                {
                    Console.Write("\n  Can't open {0}\n\n", args[0]);
                    return;
                }
            }

            try
            {
                while (semi.getSemi())
                {
                    parser.parse(semi);
                }
                Console.Write("\n\n  locations table contains:");
            }
            catch (Exception ex)
            {
                Console.Write("\n\n  {0}\n", ex.Message);
            }
        }
Exemplo n.º 2
0
		public void get(UsingType ut)
		{
            foreach (IRule rule in Rules)
            {
                if (rule.test(semi))
                    break;
				if (!semi.open(file as string))
                {
                    Console.Write("\n  Can't open {0}\n\n", args[0]);
                    return;
                }
            }
			
			try
			{
				while (semi.getSemi())
					parser.parse(semi);
				Console.Write("\n\n  locations table contains:");
			}
			catch (Exception ex)
			{
				Console.Write("\n\n  {0}\n", ex.Message);
			}

		}
Exemplo n.º 3
0
 public void setUsingType(UsingType type)
 {
     if (type == UsingType.Normal)
     {
         m_colDiscount.Visible = true;
         m_colBarCode.Visible  = true;
         m_colID.Visible       = true;
         m_colName.Visible     = true;
         m_colPrice.Visible    = true;
         m_colQuantity.Visible = true;
         m_colTotal.Visible    = true;
     }
     else if (type == UsingType.ImportProduct)
     {
         m_colDiscount.Visible = false;
         m_colBarCode.Visible  = true;
         m_colID.Visible       = true;
         m_colName.Visible     = true;
         m_colPrice.Visible    = true;
         m_colQuantity.Visible = true;
         m_colTotal.Visible    = true;
     }
 }
Exemplo n.º 4
0
        /* Function: FromParameters
         * Creates a UsingString from the passed parameters.
         */
        static public UsingString FromParameters(UsingType type, SymbolString prefixToAdd, SymbolString prefixToRemove = default(SymbolString))
        {
            StringBuilder stringBuilder = new System.Text.StringBuilder(prefixToAdd.ToString().Length + 1);

            if (type == UsingType.AddPrefix)
            {
                stringBuilder.Append('A');

                if (prefixToAdd == null)
                {
                    throw new InvalidOperationException();
                }

                stringBuilder.Append(prefixToAdd.ToString());
            }

            else if (type == UsingType.ReplacePrefix)
            {
                stringBuilder.Append('R');

                if (prefixToAdd == null || prefixToRemove == null)
                {
                    throw new InvalidOperationException();
                }

                stringBuilder.Append(prefixToRemove);
                stringBuilder.Append(SeparatorChar);
                stringBuilder.Append(prefixToAdd);
            }

            else
            {
                throw new InvalidOperationException();
            }

            return(new UsingString(stringBuilder.ToString()));
        }
Exemplo n.º 5
0
 public Using(UsingType type, string value)
 {
     this.Type  = type;
     this.Value = value;
 }
Exemplo n.º 6
0
 public void get(UsingType ut)
 {
 }