/// <inheritdoc/> public void Switch(SwitchOperation operation) { int sequence; if (Operation == null) { Operation = SwitchFactory.InitializeSwitchOperationStatus(sequenceGenerator, operation); sequence = Operation.Sequence; } else { sequence = SwitchExistingClass(operation); } SwitchAll(operation, sequence); }
/// <summary> /// Initializes a new instance of of <see cref="SwitchOperationStatus"/>. Switch operation status will be calculated based on Default status and operation. /// </summary> /// <param name="sequenceGenerator">Sequence generator used to generate sequence number.</param> /// <param name="operation">Switch operation status.</param> /// <returns>The initialized <see cref="SwitchOperationStatus"/></returns> public static SwitchOperationStatus InitializeSwitchOperationStatus(SequenceGenerator sequenceGenerator, SwitchOperationStatus operation) { return(new SwitchOperationStatus(sequenceGenerator, operation)); }