static void Main(string[] args) { SimpleWriteInstance inst1 = new SimpleWriteInstance(); inst1.name = "Jeff"; inst1.length = 33; inst1.Published = true; Console.WriteLine("inst1 published"); Console.ReadLine(); inst1.Published = false; Console.WriteLine("inst1 revoked"); Instrumentation.Publish(typeof(App)); Console.WriteLine("Get ready to start"); Console.ReadLine(); NestedABC nest = new NestedABC(); nest.Fire(); MyInstanceABC abc = new MyInstanceABC(); abc.Name = "Lauren"; Instrumentation.Publish(abc); // abc.Published = true; Console.WriteLine("Get ready to end"); // return; ManagementClass classNamespace = new ManagementClass("root:__NAMESPACE"); IntPtr ip = (IntPtr)classNamespace; #if xxx string[] installArgs = new String[] { "/logfile=", "/LogToConsole=false", "/ShowCallStack", typeof(App).Assembly.Location, }; System.Configuration.Install.ManagedInstallerClass.InstallHelper(installArgs); #endif Console.WriteLine("done"); Beep1 beep = new Beep1(); beep.tone = 37; beep.tone2 = 55; beep.Fire(); Beep2 beep2 = new Beep2(); beep2.tone = 1; beep2.tone2 = 3; beep2.xxx = 12; beep2.yyy = 31; beep2.str = "Hello there"; beep2.rg = new int[3]; beep2.rg[0] = 73; beep2.rg[2] = 88; beep2.embed = new Embedded(); beep2.embed.i = 987; beep2.embed.j = 654; beep2.embeds2 = new Embedded[4]; beep2.embeds2[0] = new Embedded(); beep2.embeds2[0].i = 23; beep2.embeds2[0].j = 24; beep2.embeds2[1] = new Embedded(); beep2.embeds2[1].i = 25; beep2.embeds2[1].j = 26; beep2.embeds2[2] = new Embedded(); beep2.embeds2[2].i = 27; beep2.embeds2[2].j = 28; beep2.embeds2[3] = new Embedded(); beep2.embeds2[3].i = 29; beep2.embeds2[3].j = 30; beep2.embeds3 = new Embedded[3]; beep2.embeds3[0] = new Embedded(); beep2.embeds3[0].i = 23; beep2.embeds3[0].j = 24; beep2.embeds3[2] = new Embedded(); beep2.embeds3[2].i = 27; beep2.embeds3[2].j = 28; beep2.Fire(); ChangeEvent change = new ChangeEvent(); Embedded embed = new Embedded(); embed.i = 12; embed.j = 24; change.Fire(); change.PreviousInstance = embed; change.Fire(); change.TargetInstance = new OutterEmbedded(); change.Fire(); // PreviousInstance should be null change.PreviousInstance = new UnknownObject(); change.Fire(); // TargetInstance should be null change.TargetInstance = "how are you"; change.Fire(); // TargetInstance should be null change.TargetInstance = 37; change.Fire(); change.TargetInstance = new ManagementObject("root:__Namespace.Name='cimv2'"); change.Fire(); new ComplexBeep().Fire(); ManyThings things = new ManyThings(); things.Fire(); things.obj = new ManagementClass(@"root\cimv2:Win32_Process"); things.Fire(); things.obj = new ManagementObject("root:__Namespace.Name='cimv2'"); things.objects = new ManagementObject[] { new ManagementObject("root:__Namespace.Name='cimv2'"), new ManagementObject("root:__Namespace.Name='default'") }; things.things = new Object[] {}; things.Fire(); things.obj = null; things.objects = null; things.things = new Object[] { new OutterEmbedded(), new ManagementObject("root:__Namespace.Name='cimv2'") }; things.Fire(); things.things = new Object[] { new OutterEmbedded(), null, new ManagementObject("root:__Namespace.Name='cimv2'") }; things.Fire(); things.things = null; things.objects = null; things.obj = null; things.Fire(); // BUG Wbem Test crashes if you try to view array of ManagementObjects!!!!!!!!!!!!!!! things.obj = new ManagementClass(); things.objects = new ManagementObject[] { new ManagementObject() }; things.things = new Object[] { new OutterEmbedded(), new ManagementObject(), new ManagementObject("root:__Namespace.Name='cimv2'") }; things.Fire(); DiverseEvent diverse = new DiverseEvent(); diverse.dt = DateTime.Now; diverse.ts2 = new TimeSpan(3, 2, 1, 5, 654); diverse.Fire(); DiverseEvent2 diverse2 = new DiverseEvent2(); diverse2.name = "hello"; diverse2.i = 74; diverse2.Fire(); Console.WriteLine("fired"); Console.WriteLine("press enter"); Console.ReadLine(); SimpleInstance inst = new SimpleInstance(); DiverseInstance inst2 = new DiverseInstance(); DiverseInstance inst3 = new DiverseInstance(); inst.i = 12; inst.name = "Lauren"; inst.Published = true; inst2.Published = true; inst3.Published = true; Console.WriteLine("published"); Console.ReadLine(); inst.Published = false; inst2.Published = false; inst3.Published = false; Console.WriteLine("revoked"); Console.ReadLine(); inst.Published = true; inst2.Published = true; inst3.Published = true; Console.WriteLine("published"); Console.ReadLine(); inst.Published = false; inst2.Published = false; inst3.Published = false; Console.WriteLine("revoked"); Console.ReadLine(); }