private string PrintTag(StateName tag) { string output = ""; if (tag < 0) { tag = ~tag; output += "~"; } return output + tag.ToString(); }
//public Dictionary<string, State> substates = new Dictionary<string, State>(); public override void GetElements(ref XmlDocument doc, ref XmlElement xStateMachine) { XmlElement xState = doc.CreateElement("State"); xState.SetAttribute("Name", StateName.ToString()); xState.SetAttribute("Type", "ExceptionState"); GetEntryElements(ref doc, ref xState); GetExitElements(ref doc, ref xState); xStateMachine.AppendChild(xState); }
public static string StateBaseToString(StateName sn) { switch (sn) { case StateName.AmericanSamoa: return("American Samoa"); case StateName.MarianaIslands: return("Norther Mariana Islands"); case StateName.WashingtonDC: return("District of Columbia"); case StateName.NewHampshire: return("New Hampshire"); case StateName.NewJersey: return("New Jersey"); case StateName.NewMexico: return("New Mexico"); case StateName.NewYork: return("New York"); case StateName.NorthCarolina: return("North Carolina"); case StateName.NorthDakota: return("North Dakota"); case StateName.RhodeIsland: return("Rhode Island"); case StateName.SouthCarolina: return("South Carolina"); case StateName.SouthDakota: return("South Dakota"); case StateName.WestVirginia: return("West Virginia"); default: return(sn.ToString()); } }
private void ReadStateData() { if (_read_state_data) { return; } _read_state_data = true; using (ObjectAttributes obj_attr = new ObjectAttributes(_root_keys[(int)Lifetime], AttributeFlags.CaseInsensitive)) { using (var key = NtKey.Open(obj_attr, KeyAccessRights.QueryValue, KeyCreateOptions.NonVolatile, false)) { if (!key.IsSuccess) { return; } var value = key.Result.QueryValue(StateName.ToString("X016"), false); if (value.IsSuccess) { ReadStateData(value.Result); } } } }
public CreateState(Guid id, StateName name) : base(id) { Name = name; Alias = name.ToString(); }
public static string PrettyPrint(StateName state, bool value) { return (value == true) ? state.ToString() : ""; //switch (state) //{ // case StateName.RoleActor: return value ? " Rac" : ""; // case StateName.RoleChair: return value ? " Rch" : ""; // case StateName.RoleTable: return value ? " Rta" : ""; // case StateName.RoleCrowd: return value ? " Rcr" : ""; // case StateName.RoleVendorStand: return value ? " Rvs" : ""; // case StateName.RoleWaypoint: return value ? " Rwp" : ""; // case StateName.RoleLamp: return value ? " Rla" : ""; // case StateName.RoleContainer: return value ? " Rla" : ""; // case StateName.RoleTelevision: return value ? " Rtv" : ""; // case StateName.RoleAttraction: return value ? " Rat" : ""; // case StateName.HoldingBall: return value ? " Hba" : ""; // case StateName.HoldingWallet: return value ? " Hwa" : ""; // case StateName.IsStanding: return value ? " Ist" : ""; // case StateName.IsIncapacitated: return value ? " Iic" : ""; // case StateName.IsDead: return value ? " Idd" : ""; // case StateName.IsOccupied: return value ? " Ioc" : ""; // case StateName.IsTurnedOn: return value ? " Ito" : ""; // default: return value ? " Xxx" : ""; //} }
///// <summary> ///// Returns a string representation of a single role. ///// </summary> private string RoleToString(StateName role) { if (role < 0) { return "~" + (~role).ToString(); } else { return role.ToString(); } }