CodeOwls.PowerShell.Provider.Provider.SetProperty C# (CSharp) Метод

SetProperty() приватный Метод

private SetProperty ( string path, INodeFactory factory, System.Management.Automation.PSObject propertyValue ) : void
path string
factory INodeFactory
propertyValue System.Management.Automation.PSObject
Результат void
        void SetProperty(string path, INodeFactory factory, PSObject propertyValue)
        {
            var node = factory.GetNodeValue();
            var value = node.Item;
            var propDescs = TypeDescriptor.GetProperties(value);
            var psoDesc = propertyValue.Properties;
            var props = (from PropertyDescriptor prop in propDescs
                         let psod = (from pso in psoDesc
                                     where StringComparer.InvariantCultureIgnoreCase.Equals(pso.Name, prop.Name)
                                     select pso).FirstOrDefault()
                         where null != psod
                         select new {PSProperty = psod, Property = prop});

            props.ToList().ForEach(p => p.Property.SetValue(value, p.PSProperty.Value));
        }

Same methods

Provider::SetProperty ( string path, System.Management.Automation.PSObject propertyValue ) : void