private void WriteResource(CommandInput resource) { if (resource == null) { throw new ArgumentNullException("resource"); } WriteResourcePreSettings(resource); var inputResource = new Input(resource.Resource); BuilderBase.Append(" "); BuilderBase.Append(SettingSerializer.Serialize(inputResource)); WriteResourcePostSettings(resource); }
private void WriteResourcePostSettings(CommandInput resource) { if (resource == null) { throw new ArgumentNullException("resource"); } resource.Settings.SettingsList.ForEach(setting => { if (!setting.IsPostSetting()) { return; } BuilderBase.Append(" "); BuilderBase.Append(SettingSerializer.Serialize(setting)); }); }
public List <StreamIdentifier> Add(CommandInput resource) { if (resource == null) { throw new ArgumentNullException("resource"); } resource.Owner = Owner; if (Owner.Objects.ContainsInput(resource)) { throw new ArgumentException("Command already contains the specified resource.", "resource"); } Owner.Objects.Inputs.Add(resource); return(resource.GetStreamIdentifiers()); }
private void WriteResource(CommandInput resource) { if (resource == null) { throw new ArgumentNullException("resource"); } var settingsData = Validate.GetSettingCollectionData(resource.Settings); WriteResourcePreSettings(resource, settingsData); var inputResource = new Input(resource.Resource); _builderBase.Append(" "); _builderBase.Append(inputResource); WriteResourcePostSettings(resource, settingsData); }
public bool ContainsInput(CommandInput commandInput) { return(Inputs.Any(input => input.Id == commandInput.Id)); }