/// <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); }
private void Get(CodeValue codeValue, WamInstructionRegister sourceRegister) { InstructionStreamBuilder.Write(new WamInstruction(WamInstructionOpCodes.GetValue, sourceRegister, WamValue.Create(codeValue))); }
private void Put(CodeValue codeValue, WamInstructionRegister targetRegister) { InstructionStreamBuilder.Write(new WamInstruction(WamInstructionOpCodes.PutValue, WamValue.Create(codeValue), targetRegister)); }
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); }
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); }
public static void Write(CodeValue codeValue, int indentation, TextWriter wtr) { wtr.WriteLine("{0}{1} - CodeValue", Indentation(indentation), codeValue.ToString()); }
void Get(CodeValue codeValue, WamInstructionRegister sourceRegister) { InstructionStreamBuilder.Write(new WamInstruction(WamInstructionOpCodes.GetValue, sourceRegister, WamValue.Create(codeValue))); }
void Put(CodeValue codeValue, WamInstructionRegister targetRegister) { InstructionStreamBuilder.Write(new WamInstruction(WamInstructionOpCodes.PutValue, WamValue.Create(codeValue), targetRegister)); }