コード例 #1
0
        static string SerializeSystem(PropertyDataCollection properties)
        {
            NativeCimProperties obj = new NativeCimProperties();

            foreach (var p in properties)
            {
                obj.Add(p.Name, p.Origin, p.IsArray, p.IsLocal, Transform(p.Type), p.Value);
            }
            return(NativeCimPropertiesHelper.Serialize(obj));
        }
コード例 #2
0
        static string Serialize(PropertyDataCollection properties, bool isLocal)
        {
            NativeCimProperties obj = new NativeCimProperties();

            foreach (var p in properties)
            {
                obj.Add(p.Name, p.Origin, p.IsArray, p.IsLocal, Transform(p.Type), p.Value);
            }
            obj.Add("PSShowComputerName", "", false, true, Microsoft.Management.Infrastructure.CimType.Boolean, true);
            obj.Add("PSComputerName", "", false, true, Microsoft.Management.Infrastructure.CimType.String, isLocal ? "localhost" : properties["__SERVER"].Value);
            return(NativeCimPropertiesHelper.Serialize(obj));
        }