private void UpdateFilter(string propertyValue, string filterValue, MyObject objectToAdd, IList<MyObject> filterResult)
 {
     if (propertyValue.Equals(filterValue, StringComparison.CurrentCultureIgnoreCase))
         filterResult.Add(objectToAdd);
 }
        private MyObject getTrustee(string SID, string domain, string name)
        {
            MyObject trusteeObj = new MyObject();
            trusteeObj.AddProperty("SID", SID);
            trusteeObj.AddProperty("Domain", domain);
            trusteeObj.AddProperty("Name", name);

            return trusteeObj;
        }
        private MyObject createDACL(MyObject trustee, string mask, string ace, string token)
        {
            MyObject newDACL = new MyObject();
            newDACL.AddProperty("Trustee", trustee);
            newDACL.AddProperty("AccessMask", mask);
            newDACL.AddProperty("AccessToken", token);
            newDACL.AddProperty("ACE", ace);

            return newDACL;
        }
        private object getDescriptor()
        {
            MyObject trusteeLCOSTA = this.getTrustee("123", "mss", "lcosta");
            MyObject trusteeMGASPAR = this.getTrustee("456", "mss", "mgaspar");
            MyObject trusteeLFERNANDES = this.getTrustee("666", "mss", "lfernandes");


            MyObject[] DACLs = new MyObject[] { 
                this.createDACL(trusteeLCOSTA, "XXX", "000", Guid.NewGuid().ToString()),
                this.createDACL(trusteeMGASPAR, "YYY", "101", Guid.NewGuid().ToString()),
                this.createDACL(trusteeLFERNANDES, "ZZZ", "010", Guid.NewGuid().ToString())
            };

            MyObject descriptor = new MyObject();
            descriptor.AddProperty("DACL", DACLs);

            MyObject WmiResult = new MyObject();
            WmiResult.AddProperty("Descriptor", descriptor);

            return WmiResult;
        }