/// <summary> /// Safe way to add Put to gate /// </summary> /// <param name="type">Type of the put to be added</param> /// <param name="name">Name of the put to be added</param> public void AddPut(PutType type, string name = "", bool togglable = false) { GameObject go = Instantiate(putGO, transform); go.transform.localScale = new Vector3(0.2f, 0.2f, 0.2f); Put newPut = go.GetComponent <Put>(); newPut.name = name; newPut.type = type; newPut.gate = this; newPut.connected = false; newPut.wires = new List <Wire>(); newPut.value = false; newPut.toggleable = togglable; if (type == PutType.In) { _inputs.Add(newPut); } else if (type == PutType.Out) { _outputs.Add(newPut); } else { throw new Exception($"Unknown PutType value \"{type.ToString()}\""); } if (_postStart) { UpdatePutsPosition(); } }
public void RemovePut(PutType type) { Put toRemove; if (type == PutType.In) { toRemove = _inputs[_inputs.Count - 1]; } else { toRemove = _outputs[_outputs.Count - 1]; } for (int i = 0; i < toRemove.wires.Count; i++) { toRemove.wires[i].Remove(); i--; } if (type == PutType.In) { _inputs.Remove(toRemove); } else { _outputs.Remove(toRemove); } Destroy(toRemove.gameObject); UpdatePutsPosition(); }
public void Put(string action, object value, PutType putType = PutType.NotSafe) { if (HasFact(action)) { if (putType == PutType.NotSafe) { throw new FactsException("Duplicated action name."); } _collector[action] = value; } _collector.Add(action, value); }
public PutOptions(ManagementNamedValueCollection context, TimeSpan timeout, bool useAmendedQualifiers, PutType putType) { }
public PutOptions(ManagementNamedValueCollection context, TimeSpan timeout, bool useAmendedQualifiers, PutType putType) : base(context, timeout) { this.UseAmendedQualifiers = useAmendedQualifiers; this.Type = putType; }
// Module defining this command // Optional custom code for this activity /// <summary> /// Returns a configured instance of System.Management.Automation.PowerShell, pre-populated with the command to run. /// </summary> /// <param name="context">The NativeActivityContext for the currently running activity.</param> /// <returns>A populated instance of System.Management.Automation.PowerShell</returns> /// <remarks>The infrastructure takes responsibility for closing and disposing the PowerShell instance returned.</remarks> protected override ActivityImplementationContext GetPowerShell(NativeActivityContext context) { System.Management.Automation.PowerShell invoker = global::System.Management.Automation.PowerShell.Create(); System.Management.Automation.PowerShell targetCommand = invoker.AddCommand(PSCommandName); // Initialize the arguments if (InputObject.Expression != null) { targetCommand.AddParameter("InputObject", InputObject.Get(context)); } if (Path.Expression != null) { targetCommand.AddParameter("Path", Path.Get(context)); } if (Class.Expression != null) { targetCommand.AddParameter("Class", Class.Get(context)); } if (Arguments.Expression != null) { targetCommand.AddParameter("Arguments", Arguments.Get(context)); } if (PutType.Expression != null) { targetCommand.AddParameter("PutType", PutType.Get(context)); } if (AsJob.Expression != null) { targetCommand.AddParameter("AsJob", AsJob.Get(context)); } if (Impersonation.Expression != null) { targetCommand.AddParameter("Impersonation", Impersonation.Get(context)); } if (Authentication.Expression != null) { targetCommand.AddParameter("Authentication", Authentication.Get(context)); } if (Locale.Expression != null) { targetCommand.AddParameter("Locale", Locale.Get(context)); } if (EnableAllPrivileges.Expression != null) { targetCommand.AddParameter("EnableAllPrivileges", EnableAllPrivileges.Get(context)); } if (Authority.Expression != null) { targetCommand.AddParameter("Authority", Authority.Get(context)); } if (Credential.Expression != null) { targetCommand.AddParameter("Credential", Credential.Get(context)); } if (ThrottleLimit.Expression != null) { targetCommand.AddParameter("ThrottleLimit", ThrottleLimit.Get(context)); } if (ComputerName.Expression != null) { targetCommand.AddParameter("ComputerName", ComputerName.Get(context)); } if (Namespace.Expression != null) { targetCommand.AddParameter("Namespace", Namespace.Get(context)); } return(new ActivityImplementationContext() { PowerShellInstance = invoker }); }
public PutOptions(ManagementNamedValueCollection context, TimeSpan timeout, bool useAmendedQualifiers, PutType putType) : base(context, timeout) { this.UseAmendedQualifiers = useAmendedQualifiers; this.Type = putType; }
public PutOptions (ManagementNamedValueCollection context, TimeSpan timeout, bool useAmendedQualifiers, PutType putType) { }