예제 #1
0
        //Add Features
        public DeviceFactory WithFeature(FeatureFactory feature)
        {
            if (feature?.Feature == null)
            {
                throw new ArgumentNullException(nameof(feature));
            }

            if (_features == null)
            {
                _features = new List <HsFeature>();
            }

            _features.Add(feature.Feature);

            return(this);
        }
예제 #2
0
        public static FeatureFactory CreateFeature(string pluginId)
        {
            var ff      = new FeatureFactory();
            var feature = new HsFeature
            {
                Relationship = ERelationship.Feature,
                Interface    = pluginId
            };

            feature.Changes.Add(EProperty.Misc,
                                AbstractHsDevice.GetMiscForFlags(
                                    EMiscFlag.ShowValues,
                                    EMiscFlag.SetDoesNotChangeLastChange)
                                );
            feature.Changes.Add(EProperty.UserAccess, "Any");
            feature.Changes.Add(EProperty.Location2, "Plugin");
            feature.Changes.Add(EProperty.Location, pluginId);
            ff._feature = feature;

            return(ff);
        }