Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Windows.Forms;
- using CobolTest1.CustomTypes;
- namespace CobolTest1
- {
- public class ComplexTypesTest
- {
- // Properties for ACUCOBOLGT
- public StructTest Struct
- {
- get { return GetStruct(); }
- }
- public InterfaceClass InterfacedClass
- {
- get { return GetInterfacedClass(); }
- }
- public DerivedClass DerivedClass
- {
- get { return GetDerivedClass(); }
- }
- public ClassTest BaseClass {
- get { return GetBaseClass(); }
- }
- public InterfaceClass GetInterfacedClass()
- {
- return new InterfaceClass();
- }
- public ICobolTest GetInterfacedClassAsInterface()
- {
- return new InterfaceClass();
- }
- public DerivedClass GetDerivedClass()
- {
- return new DerivedClass();
- }
- public ICobolTest GetDerivedClassAsInterface()
- {
- return new DerivedClass();
- }
- public ClassTest GetBaseClass()
- {
- return new ClassTest();
- }
- public StructTest GetStruct()
- {
- MessageBox.Show( "Called GetStruct!" );
- var ret = new StructTest();
- var rand = new Random();
- ret.DateTime = DateTime.Now;
- ret.Int = rand.Next();
- ret.Double = rand.NextDouble();
- ret.Float = (float)rand.NextDouble();
- ret.String = "Hat geklappt!";
- return ret;
- }
- public bool IsInterfacedClass(object ic)
- {
- return (ic is InterfaceClass);
- }
- public string GetType(ICobolTest ict)
- {
- if (ict is DerivedClass) return "DerivedClass" ;
- if (ict is InterfaceClass) return "InterfaceClass";
- return "unknown or null";
- }
- public DateTime GetStructDatreTime(StructTest s)
- {
- return (s.DateTime);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement