void SetCollection(object value) { if (value == null) { value = GetVariableValue(Actor.CollectionVariable); if (value == null) throw new PSArgumentException("Specify a collection by the parameter or variable Collection."); } value = Actor.BaseObject(value); var mc = value as MongoCollection; if (mc != null) { _Collection = new MongoCollectionHost(mc); return; } var fc = value as FileCollection; if (fc != null) { _Collection = fc; return; } throw new PSArgumentException("Unexpected type of parameter or variable Collection."); }
void SetCollection(object value) { if (value == null) { value = GetVariableValue(Actor.CollectionVariable); if (value == null) { throw new PSArgumentException("Specify a collection by the parameter or variable Collection."); } } value = Actor.BaseObject(value); var mc = value as MongoCollection; if (mc != null) { _Collection = new MongoCollectionHost(mc); return; } var fc = value as FileCollection; if (fc != null) { _Collection = fc; return; } throw new PSArgumentException("Unexpected type of parameter or variable Collection."); }