Ejemplo n.º 1
0
        /// <remarks>
        /// See also CodeValue.Create.
        /// </remarks>
        public static WamValue Create(CodeValue value)
        {
            if (value == null) return WamValueObject.Create(null);

            if (value is CodeValueBoolean) return WamValueBoolean.Create(((CodeValueBoolean)value).Value);
            if (value is CodeValueDateTime) return WamValueDateTime.Create(((CodeValueDateTime)value).Value);
            if (value is CodeValueDouble) return WamValueDouble.Create(((CodeValueDouble)value).Value);
            if (value is CodeValueException) return WamValueException.Create(((CodeValueException)value).Value);
            if (value is CodeValueInteger) return WamValueInteger.Create(((CodeValueInteger)value).Value);
            if (value is CodeValueString) return WamValueString.Create(((CodeValueString)value).Value);
            if (value is CodeValueType) return WamValueType.Create(((CodeValueType)value).Value);

            return WamValueObject.Create(value.Object);
        }
Ejemplo n.º 2
0
 private void Get(CodeValue codeValue, WamInstructionRegister sourceRegister)
 {
     InstructionStreamBuilder.Write(new WamInstruction(WamInstructionOpCodes.GetValue, sourceRegister, WamValue.Create(codeValue)));
 }
Ejemplo n.º 3
0
 private void Put(CodeValue codeValue, WamInstructionRegister targetRegister)
 {
     InstructionStreamBuilder.Write(new WamInstruction(WamInstructionOpCodes.PutValue, WamValue.Create(codeValue), targetRegister));
 }
Ejemplo n.º 4
0
 private void AddSubCategory(Items.ItemSubCategory SubCat)
 {
     //cboSubCategory.Items.Add(Utility.FormParen((int)SubCat, 3) + " " + Items.SubCategoryLookup(SubCat));
     CodeValue codeValue = new CodeValue();
     codeValue.code = (Int32)SubCat;
     codeValue.value = SubCat.ToString() + " (" + (Int32)SubCat + ")";
     cboSubCategory.Items.Add(codeValue);
 }
Ejemplo n.º 5
0
 private void AddCategory(Items.ItemCategory Cat)
 {
     //cboCategory.Items.Add(Utility.FormParen((int)Cat, 2) + " " + Items.CategoryLookup(Cat));
     CodeValue codeValue = new CodeValue();
     codeValue.code  = (Int32) Cat;
     codeValue.value = Cat.ToString() + " (" + (Int32) Cat + ")";
     cboCategory.Items.Add(codeValue);
 }
Ejemplo n.º 6
0
 public static void Write(CodeValue codeValue, int indentation, TextWriter wtr)
 {
     wtr.WriteLine("{0}{1} - CodeValue", Indentation(indentation), codeValue.ToString());
 }
Ejemplo n.º 7
0
 void Get(CodeValue codeValue, WamInstructionRegister sourceRegister)
 {
     InstructionStreamBuilder.Write(new WamInstruction(WamInstructionOpCodes.GetValue, sourceRegister, WamValue.Create(codeValue)));
 }
Ejemplo n.º 8
0
 void Put(CodeValue codeValue, WamInstructionRegister targetRegister)
 {
     InstructionStreamBuilder.Write(new WamInstruction(WamInstructionOpCodes.PutValue, WamValue.Create(codeValue), targetRegister));
 }