public Fellow(IFellow fellow, string machineTypename) { _fellow = fellow; _machineTypename = machineTypename; var stateData = _fellow.StateData(); if (stateData != null) { ContextStateData = ContextInfo.Deserialize(stateData); } CheckAttributes(); }
public void Bind(IFellow fellow) { if (IsBound) { FloomeenException.Raise(_machineName, "AlreadyBound"); } BoundFellow = new Fellow(fellow, _machineName); if (!BoundFellow.IsSet()) { FloomeenException.Raise(_machineName, "CannotBindFellowBecauseNotSet.TryPlugging"); } BoundFellow.CheckMachineType(); Flow.StatesContains(BoundFellow.State); }
public void Plug(IFellow fellow) { if (IsBound) { FloomeenException.Raise(_machineName, "AlreadyBound"); } BoundFellow = new Fellow(fellow, _machineName); if (BoundFellow.IsSet()) { FloomeenException.Raise(_machineName, "CannotPlugFellowBecauseAlreadySet.TryBinding"); } var startState = Flow.StartState(); BoundFellow.Plug(_machineName, startState); EnterNewState(startState, CreateContext()); }
public static string GetPropNameByAttribute <TAttribute>(this IFellow fellow) where TAttribute : Attribute { return(FloomeenExtensions.GetPropNameByAttribute <TAttribute>(fellow)); }
public static void ChangedOn(this IFellow fellow, object value) { fellow.SetPropValueByAttribute <FloomeenChangedOn>(value); }
public static DateTime ChangedOn(this IFellow fellow) { return((DateTime)fellow.GetPropValueByAttribute <FloomeenChangedOn>()); }
public static void StateData(this IFellow fellow, object value) { fellow.SetPropValueByAttribute <FloomeenStateData>(value); }
public static string StateData(this IFellow fellow) { return(fellow.GetPropValueByAttribute <FloomeenStateData>()?.ToString()); }
public static void Machine(this IFellow fellow, object value) { fellow.SetPropValueByAttribute <FloomeenMachine>(value); }
public static string Machine(this IFellow fellow) { return(fellow.GetPropValueByAttribute <FloomeenMachine>()?.ToString()); }
public static void Id(this IFellow fellow, object value) { fellow.SetPropValueByAttribute <FloomeenId>(value); }
public static object Id(this IFellow fellow) { return(fellow.GetPropValueByAttribute <FloomeenId>()); }
public static void SetPropValueByAttribute <TAttribute>(this IFellow fellow, object value) where TAttribute : Attribute { FloomeenExtensions.SetPropValueByAttribute <TAttribute>(fellow, value); }
public static object GetPropValueByAttribute <TAttribute>(this IFellow fellow) where TAttribute : Attribute { return(FloomeenExtensions.GetPropValueByAttribute <TAttribute>(fellow)); }
static void PlugFlipperFloomeen(out FlipperFloomeen flipper, IFellow customer) { flipper = Factory <FlipperFloomeen> .Create(); flipper.Plug(customer); }