public override bool CanCollapse(EventAction action1, EventAction action2) { return action1.Control == action2.Control && action1.MethodName == action2.MethodName && action1.MethodName == Enter; }
public Event(EventAction action, Guid mapId, Vector2 destination, bool fadeScreen) { Action = action; DestinationMapId = mapId; Destination = destination; FadeScreenOnTeleport = fadeScreen; }
public EventHandler(GameEventType t, EventAction e) { //todo(seba) don't think these are interned the way you'd hope filter = @v => v.type == t; action = e; timing = EventTiming.Main; }
internal ActorObject(string name, World world) { _world = world; _name = name; OnStart = new EventAction<EventState>(); OnPing = new EventAction<EventState>(); OnCounter = new EventAction<EventState>(); }
/// <summary> Constructs an Event object to encapsulate in inbound SIF Event. /// This form of the contructor is called internally by the ADK when it receives /// a SIF Event Message and is not intended to be used by ADK developers. /// /// </summary> /// <param name="data">An IDataObjectInputStream that returns SifDataObjects, all of /// which must be of the same class type /// </param> /// <param name="action">One of the EventAction enum values</c> /// </param> /// <param name="objectType">An ElementDef constant from the <see cref="OpenADK.Library.SifDtd"/> class that /// identifies the type of SIF Data Object contained in the event /// </param> public Event(IDataObjectInputStream data, EventAction action, IElementDef objectType) { fData = data; fObjType = objectType; SetAction(action); }
private void AddEventActions(EventAction<EventState> eventAction, AST whenNode) { for (int i = 1; // Skip first, which is event type i < whenNode.Children.Count; i++) { eventAction.Add(GetAction(whenNode.Children[i])); } }
/// <summary> /// Standardkonstruktor zur erstellung eines neuen TimelineEvents /// </summary> /// <param name="time">Zeit, wann das Event eintreten soll</param> /// <param name="length">Länge des Events.</param> /// <param name="color">Farbe durch die das Event repräsentiert werden soll</param> /// <param name="startAction">Funktion die bei Eintreten aufgerufen werden soll</param> /// <param name="endAction">Funktion die beim Ende des Events aufgerufen werden soll</param> public TimelineEvent(double time, double length, Color color, EventAction startAction, EventAction endAction) { this.eventTime = time; this.eventLength = length; this.color = color; this.eventStartAction = startAction; this.eventEndAction = endAction; }
/// <summary> /// Removes an event handler. /// </summary> /// <param name="ID"> The ID of the message that the handler is listening to. </param> /// <param name="EventHandler"> The EventHandler to be removed. </param> public void RemoveEventHandler(uint ID, EventAction<Object, IEvent> EventHandler) { if (EventHandler == null) throw new ArgumentNullException("EventHandler was null."); ThreadedEventHandler<Object, IEvent> Handler; if (EventHandlers.TryGetValue(ID, out Handler)) { Handler.RemoveEventListener(EventHandler); } }
public void RegisterEvent(EventCategory category, EventAction action, string eventName) { try { GoogleAnalytics.EasyTracker.GetTracker().SendEvent(EventCategories[category], EventActions[action], eventName, 0); } catch (Exception) { } }
public static void Log(Level level, EventType type, EventAction action, string data) { using (ApplicationDbContext dbContext = ApplicationDbContext.Create()) { AuditLogModel logModel = new AuditLogModel(); logModel.Level = level.ToString(); logModel.EventType = type.ToString(); logModel.EventAction = action.ToString(); logModel.Data = data; logModel.UTC = DateTime.UtcNow; dbContext.Entry(logModel).State = EntityState.Added; dbContext.SaveChanges(); } }
/// <summary> /// Adds an event handler that listens to a specific event. /// </summary> /// <param name="ID"> The ID of the event to listen to. </param> /// <param name="EventHandler"> The function to be called to handle the event. </param> public void AddEventHandler(uint ID, EventAction<Object, IEvent> EventHandler) { if (EventHandler == null) throw new ArgumentNullException("EventHandler was null."); ThreadedEventHandler<Object, IEvent> Handler; if(EventHandlers.TryGetValue(ID, out Handler)) { Handler.AddEventListener(EventHandler); } else { Handler = new ThreadedEventHandler<object, IEvent>(); Handler.AddEventListener(EventHandler); EventHandlers.TryAdd(ID, Handler); } }
/// <summary> /// Instanciate New Event Message /// </summary> /// <param name="level">as event level</param> /// <param name="action">as event action</param> /// <param name="result">as event result</param> /// <param name="data">as event messages in list</param> /// <param name="app">as application</param> /// <param name="appver">as application version</param> /// <param name="opcode">as operation code</param> /// <param name="keys">as key words</param> /// <param name="uid">us user's identifier</param> /// <param name="ip">as client's ip address</param> /// <param name="url">as assoicated page url</param> public EventMessage(EventLevel level, EventAction action, EventResult result, List<String> data, String app, String appver = "", String opcode = "", String keys = "", String uid = "", String ip = "", String url = "") { SetBase(); Level = level; Action = action; Result = result; Data = data; Application = app; ApplicationVersion = appver; OperationCode = opcode; KeyWords = keys; EventDateTime = DateTime.UtcNow; IP = ip; URL = url; if (!String.IsNullOrEmpty(uid)) UID = new Guid(uid); }
/// <summary> /// Performs the project changed. /// </summary> /// <param name="pHierarchy">The p hierarchy.</param> /// <param name="action">The action.</param> /// <param name="raiseEvent">if set to <c>true</c> [raise event].</param> private void PerformProjectChanged(IVsHierarchy pHierarchy, EventAction action, bool raiseEvent) { #if DEBUG Debug.WriteLine("Enter " + System.Reflection.MethodBase.GetCurrentMethod().Name); #endif if (_solutionManager.CurrentSolution == null) return; ProjectNode prj = ((SolutionNode)_solutionManager.CurrentSolution).GetProject(pHierarchy); // Test ce projet ne doit pas répondre aux événements if (IsProjectEventsEnabled(prj)) { if (action == EventAction.ProjectAdded) RegisterProjectEvents(prj); else if (action == EventAction.ProjectRemoved) UnRegisterProjectEvents(prj); if (raiseEvent ) OnProjectChanged(this, new ProjectChangedEventArg { Project = prj, Action = action }); } }
public void removeListener(string Evt, EventAction callback) { EventAction action = null; if(eventTable.TryGetValue(Evt, out action)) { action -= callback; } #if UNITY_EDITOR else { Debug.LogWarning("Could not find event: " + Evt + ". Could not remove all listeners."); } #endif }
public void OnRemoveEventHandler(EventAction ea, TaskID task) { _eventPath.RefreshEventHandlers(ea); _eventPath.OnRemoveEventHandler(ea, task); onActionAssignmentChange(ea.Event); }
public void BadEventHandlerSignatureThrows() { var cmd = new EventAction(this.subject, null, typeof(Subject).GetEvent("BadEventHandler").EventHandlerType, "DoSomething", ActionUnavailableBehaviour.Enable, ActionUnavailableBehaviour.Enable); Assert.Throws <ActionEventSignatureInvalidException>(() => cmd.GetDelegate()); }
public void AddEvent(EventAction e) { EventQueue queue = queues[queues.Count - 1]; queue.AddEvent(e); }
public void OnActionListOrderChanged(object sender, EventAction ea) { _eventPath.RefreshEventHandlers(ea); onActionAssignmentChange(ea.Event); }
public MusicEvent(EventAction action, int gridPos) { Action = action; GridPos = gridPos; }
public Person WhoArrive; // Кто пришел с плохими вестями? public Engine_Reverse(Person _monster) { WhoKilled = _monster; WhoKills = new List <Person>(); var _persons_could_kill = _locationForPerson.Where(person => person.Value.Select(local => local.LocationVisit).Any(x => _monster.Location.Contains(x))).ToArray(); var _persons_kill = _persons_could_kill[_random.Next(0, _persons_could_kill.Length)]; var _location = _monster.Location.Where(x => _persons_kill.Value.Select(local => local.LocationVisit).Contains(x)).ToArray(); WhereLives = _location[_random.Next(0, _location.Length)]; WhoKills.Add(new Person { Name = $"unknow_agent", Location = new List <LocationVisit> { WhereLives }, Specialization = _persons_kill.Key, Characteristics = Characteristic.AllCharacteristics.Select((typeCharacter, pos) => typeCharacter.Value[_random.Next(typeCharacter.Value.Count)]).ToList() }); var isCoupleInLove = _random.Next(0, 100) < 20; if (isCoupleInLove) // Влюбленная парочка? { WhoKills.Add(new Person { Name = $"girlfrand_for_unknow_agent", Location = new List <LocationVisit> { WhereLives }, Specialization = Specialization.Courtesan, Characteristics = Characteristic.AllCharacteristics.Select((typeCharacter, pos) => typeCharacter.Value[_random.Next(typeCharacter.Value.Count)]).ToList() }); } Relationships = new Dictionary <Person, List <Tuple <PersonsLink, List <PersonAction> > > >(); // Кто рассказал о случившимся? var isBeInPlace = _random.Next(0, 100) > 50; var _listPersonsBeInPlace = _locationForPerson.Where(person => person.Value.Select(local => local.LocationVisit).Any(x => x == WhereLives)).ToArray(); var _personBeInPlace = _listPersonsBeInPlace[_random.Next(0, _listPersonsBeInPlace.Length)]; var _listEvents = new EventAction[] { EventAction.Watch, EventAction.Heard, EventAction.Helped, }; var _eventAction = _listEvents[_random.Next(0, _listEvents.Length)]; var p = new Person { Name = $"unknow_agent_Passer_", Location = new List <LocationVisit> { WhereLives }, Specialization = _personBeInPlace.Key, Characteristics = Characteristic.AllCharacteristics.Select((typeCharacter, pos) => typeCharacter.Value[_random.Next(typeCharacter.Value.Count)]).ToList() }; Relationships.Add( p, new List <Tuple <PersonsLink, List <PersonAction> > > { Tuple.Create( new PersonsLink { Persons = WhoKills, Relationships = new List <Relationship> { Relationship.Passer } }, new List <PersonAction> { new PersonAction { Action = _eventAction, ActionPerson = new List <Person> { p }, ObservedPersons = WhoKills } }) }); if (isBeInPlace) //Был на мест? { WhoArrive = p; } else { var num_person_level = _random.Next(1, 3); var _list = new List <EventAction> { EventAction.Worried, EventAction.Searching, EventAction.HeardTheTalk, }; var lastEvent = _list[_random.Next(0, _list.Count)]; var _person = p; var spec = Specialization.Outlaw; var p_temp = default(Person); for (int i = 0; i < num_person_level; ++i) { spec = (Specialization)_random.Next(0, Enum.GetValues(typeof(Specialization)).Length); p_temp = new Person { Name = $"unknow_agent_Passer{i}", Location = new List <LocationVisit> { _locationForPerson[spec][_random.Next(0, _locationForPerson[spec].Count)].LocationVisit }, Specialization = spec, Characteristics = Characteristic.AllCharacteristics.Select((typeCharacter, pos) => typeCharacter.Value[_random.Next(typeCharacter.Value.Count)]).ToList() }; Relationships.Add( p_temp, new List <Tuple <PersonsLink, List <PersonAction> > > { Tuple.Create( new PersonsLink { Persons = new List <Person> { _person }, Relationships = new List <Relationship> { Relationship.Passer } }, new List <PersonAction> { new PersonAction { Action = EventAction.HeardTheTalk, ActionPerson = new List <Person> { p_temp }, ObservedPersons = new List <Person> { _person } } }) }); _person = p_temp; } if (lastEvent != EventAction.HeardTheTalk) { var listSpec = new List <Specialization> { Specialization.TavernKeeper, Specialization.Warder, Specialization.ChiefGuard, }; spec = listSpec[_random.Next(0, listSpec.Count)]; var previousLast_p = new Person { Name = $"unknow_agent_previousLast", Location = new List <LocationVisit> { _locationForPerson[spec][_random.Next(0, _locationForPerson[spec].Count)].LocationVisit }, Specialization = spec, Characteristics = Characteristic.AllCharacteristics.Select((typeCharacter, pos) => typeCharacter.Value[_random.Next(typeCharacter.Value.Count)]).ToList() }; Relationships.Add( previousLast_p, new List <Tuple <PersonsLink, List <PersonAction> > > { Tuple.Create( new PersonsLink { Persons = new List <Person> { _person }, Relationships = new List <Relationship> { Relationship.Passer } }, new List <PersonAction> { new PersonAction { Action = EventAction.HeardTheTalk, ActionPerson = new List <Person> { previousLast_p }, ObservedPersons = new List <Person> { _person } } }) }); _person = previousLast_p; } spec = (Specialization)_random.Next(0, Enum.GetValues(typeof(Specialization)).Length); var last_p = new Person { Name = $"unknow_agent_Last", Location = new List <LocationVisit> { _locationForPerson[spec][_random.Next(0, _locationForPerson[spec].Count)].LocationVisit }, Specialization = spec, Characteristics = Characteristic.AllCharacteristics.Select((typeCharacter, pos) => typeCharacter.Value[_random.Next(typeCharacter.Value.Count)]).ToList() }; Relationships.Add( last_p, new List <Tuple <PersonsLink, List <PersonAction> > > { Tuple.Create( new PersonsLink { Persons = new List <Person> { _person }, Relationships = new List <Relationship> { (Relationship)_random.Next(0, Enum.GetValues(typeof(Relationship)).Length) } }, new List <PersonAction> { new PersonAction { Action = lastEvent, ActionPerson = new List <Person> { last_p }, ObservedPersons = new List <Person> { _person } } }) }); WhoArrive = last_p; } }
public ActionDescriptor(EventAction model) { this.model = model; }
public override object CreateCheckBox(CloseEvent closed, string label, bool allowUndefined, out EventAction <bool?> boolEdit, out EventAction <bool?> boolChanged) { boolEdit = new EventAction <bool?>(); boolChanged = new EventAction <bool?>(); var localBoolChanged = boolChanged; CheckBox cb = new CheckBox() { Text = label, ThreeState = allowUndefined }; EventHandler changed = (_, __) => { bool?val = cb.CheckState switch { CheckState.Unchecked => false, CheckState.Checked => true, _ => null, };
/// <summary> /// The method to call on the Ext.EventObject after this KeyNav intercepts a key. Valid values are Ext.EventObject.stopEvent, Ext.EventObject.preventDefault and Ext.EventObject.stopPropagation. /// </summary> public virtual TBuilder DefaultEventAction(EventAction defaultEventAction) { this.ToComponent().DefaultEventAction = defaultEventAction; return(this as TBuilder); }
public static void AddListener(EventAction <T> handler, EventManager manager = null) { EventManager.AddListener(handler, manager); }
public static void RemoveListener <T>(EventAction <T> handler, EventManager manager = null) { manager = manager ?? Instance; manager.RemoveListenerInternal(handler); }
public void Add(string control, string method, string arg) { EventAction action = new EventAction(method, arg); action.Definition = new Definition(null, control, null, null); list.Add(action); }
private void SetAction(string action) { try { SetAction((EventAction)Enum.Parse(typeof(EventAction), action, true)); } catch { fEventAction = EventAction.Undefined; fAction = action; } }
public void PostTestEvent() { EventAction e = new EventAction(EventType.Mandatory, UseReroll); GameManager.SingleInstance.App.Controller.queueController.AddCallBack(e); }
public void SelectedIndexChanged(object sender, EventArgs e) { EventAction action = new EventAction("Select", ((ToolStripComboBox) sender).SelectedIndex); action.Comment = ((ToolStripComboBox) sender).Text; Listener.FireEvent(TesterType, sender, action); }
/// <summary> /// /// </summary> /// /// <param name="eventAction"></param> /// /// <returns></returns> /// public bool RemoveAction(EventAction eventAction) { return actions.Remove(eventAction); }
public override void OnEnter() { dispatcher = Service.Get <EventDispatcher>(); DQuestMessage dQuestMessage = new DQuestMessage(); DialogList.Entry entry = default(DialogList.Entry); if (!UseDialogList) { dQuestMessage.Text = Service.Get <Localizer>().GetTokenTranslation(i18nContents); } else if (DialogList != null) { entry = ((!RandomDialog) ? DialogList.Entries[DialogListItemIndex] : DialogList.Entries[Random.Range(0, DialogList.Entries.Length)]); dQuestMessage.Text = Service.Get <Localizer>().GetTokenTranslation(entry.ContentToken); } dQuestMessage.MascotName = MascotName; dQuestMessage.DismissTime = ((AutoCloseTime > 0f) ? AutoCloseTime : ((float)DismissTime)); dQuestMessage.Buttons = null; dQuestMessage.ContentImageKey = ImageContentKey; dQuestMessage.RichText = RichText; dQuestMessage.ClickToClose = ClickToClose; dispatcher.AddListener <HudEvents.QuestMessageComplete>(OnSpeechComplete); dispatcher.DispatchEvent(new HudEvents.ShowQuestMessage(dQuestMessage)); string text = ""; string overrideAnimationName = ""; string overrideStopAnimationName = ""; bool flag = false; if (UseDialogList && DialogList != null) { text = entry.AudioEventName; overrideAnimationName = entry.DialogAnimationTrigger; overrideStopAnimationName = entry.DialogAnimationEndTrigger; flag = entry.AdvanceSequence; } else if (!AudioEventName.IsNone) { text = AudioEventName.Value; overrideAnimationName = DialogAnimationOverride.Value; overrideStopAnimationName = EndDialogAnimationOverride.Value; flag = AdvanceSequence; } if (!string.IsNullOrEmpty(text)) { EventAction eventAction = EventAction.PlaySound; if (flag) { eventAction = EventAction.AdvanceSequence; } GameObject mascotObject = Service.Get <MascotService>().GetMascotObject(MascotName); if (mascotObject != null && PlayDialogAnimation) { MascotController component = mascotObject.GetComponent <MascotController>(); EventManager.Instance.PostEventNotify(text, eventAction, base.Owner, component.dialogAudioCallback); component.StartDialogAnimation(text, overrideAnimationName, AutoStopDialogAnimation, overrideStopAnimationName); } else { EventManager.Instance.PostEventNotify(text, eventAction, base.Owner, onMascotAudioComplete); } } if (!WaitForFinish) { Finish(); } }
public static extern int PeepEvents([Out] Event[] events, int numevents, EventAction action, EventType minType, EventType maxType);
public EventComponent(EventAction action, T value) { Action = action; Value = value; }
public void ThrowsIfTargetNullBehaviourIsThrowAndTargetBecomesNull() { var cmd = new EventAction(this.subject, null, this.eventInfo.EventHandlerType, "DoSomething", ActionUnavailableBehaviour.Throw, ActionUnavailableBehaviour.Enable); Assert.Throws <ActionTargetNullException>(() => View.SetActionTarget(this.subject, null)); }
/// <summary> /// /// </summary> /// /// <param name="eventAction"></param> /// public void AddAction(EventAction eventAction) { actions.Add(eventAction); }
/** 注册玩家消息监听(初始化阶段用) */ protected void registPlayerEventListener(int type, Action <object> listener) { _playerEventListenerDic.put(type, EventAction.create(listener)); }
/// <summary> /// Add Event Message to system /// </summary> /// <param name="pconstring">as data source connection string</param> /// <param name="level">as event level</param> /// <param name="action">as event action</param> /// <param name="result">as event result</param> /// <param name="message">as event messages in list</param> /// <param name="app">as application</param> /// <param name="appver">as application version</param> /// <param name="opcode">as operation code</param> /// <param name="keys">as key words</param> /// <param name="user">as assoicated user</param> /// <param name="ip">as client's ip address</param> /// <param name="url">as assoicated page url</param> /// <returns></returns> public static bool Add(string pconstring, EventLevel level, EventAction action, EventResult result, String message, String app, String appver = "", String opcode = "", String keys = "", CustomSecurity.User user = null, String ip = "", String url = "") { String suid = ""; if (user != null && user.UID != null) suid = user.UID.ToString(); EventMessage ev = new EventMessage(level: level, action: action, result: result, app: app, message: message, appver: appver, opcode: opcode, keys: keys.ToLower(), uid: suid, ip: ip, url: url); return ev.Add(pconstring); }
public abstract void SendOut(EventAction message, params Tuple <string, object>[] objects);
public static int PeepEvents(Event[] e, int count, EventAction action, EventType min, EventType max) { if (e == null) throw new ArgumentNullException(); if (count <= 0 || count > e.Length) throw new ArgumentOutOfRangeException(); unsafe { fixed (Event *pe = e) { return PeepEvents(pe, count, action, min, max); } } }
/// <summary> /// Returns true if the given actions can be collapsed. /// </summary> /// <param name="action1">The earlier event to test.</param> /// <param name="action2">The latter event to test.</param> /// <returns>True if these events can be collapsed; else false.</returns> public abstract bool CanCollapse(EventAction action1, EventAction action2);
public FollowState whenArrive(EventAction whenArrive, GameObject target) { this.nextAction = whenArrive; setTarget(target); return(this); }
public void OnAssignAction(EventAction ea) { _eventPath.RefreshEventHandlers(ea); _eventPath.OnAssignAction(ea); onActionAssignmentChange(ea.Event); }
public static int PeepEvents(ref Event e, EventAction action, EventType min, EventType max) { unsafe { fixed (Event* pe = &e) { return PeepEvents(pe, 1, action, min, max); } } }
public void OnAssignAction(EventAction ea) { }
unsafe static extern int PeepEvents(Event* e, int count, EventAction action, EventType min, EventType max);
public void OnRemoveEventHandler(EventAction ea, TaskID task) { }
public static extern int PeepEvents([Out] Event[] events, int numevents, EventAction action, uint mask);
public void OnActionListOrderChanged(object sender, EventAction ea) { }
public void addListener(string Evt, EventAction callback) { // First check if the event is in the table. EventAction action = null; if(eventTable.TryGetValue(Evt, out action)) { action += callback; } else // It isn't in the table. { eventTable.Add(Evt, callback); } }
private void Set <TInput>(Action <TInput> action, [CallerMemberName] string name = null) { _handlers[name] = new EventAction <TInput>(action); }
public void FireEvent(Type testerType, object control, EventAction action) { if (!InProcess(testerType, control, action.MethodName)) { OnEvent(testerType, control, action); } CheckForNewForms(); }
/// <summary> Generates event name for standard action </summary> /// <param name="modelElement"></param> /// <param name="eventDirection"></param> /// <param name="eventAction"></param> /// <param name="phaseAction"></param> /// <returns></returns> public static string GetEventCode(string path, EventAction eventAction, PhaseAction phaseAction, EventDirection eventDirection) { return(GetEventCode(path, StandardActionsNames[eventAction], phaseAction, eventDirection)); }
/// <summary> Constructs an Event object to encapsulate /// an outbound SIF Event, which describes /// one or more SifDataObjects that have been added, changed, /// or deleted by the local application. This form of the constructor is called /// by agents when reporting a SIF_Event message to a zone /// </summary> /// <param name="data">An array of SifDataObjects, all of which must be of the same class type /// </param> /// <param name="action">Describes how the data has changed.</param> /// <remarks> /// <seealso cref="OpenADK.Library.IZone.ReportEvent"/> /// </remarks> public Event(SifDataObject[] data, EventAction action) { try { fData = DataObjectInputStreamImpl.newInstance(); if (data != null) { ((DataObjectInputStreamImpl)fData).Data = data; } } catch (AdkException adke) { throw new SystemException(adke.ToString()); } fObjType = data != null && data.Length > 0 && data[0] != null ? data[0].ElementDef : null; SetAction(action); }
public void AddEventListener(EventAction <TSender, TEventArgs> e) { AddQueue.Enqueue(e); }
private void SetAction(EventAction action) { if (action == EventAction.Undefined) { throw new ArgumentException("Event action code " + action + " is not valid"); } fEventAction = action; fAction = action.ToString(); }
public void RemoveEventListener(EventAction <TSender, TEventArgs> e) { RemoveQueue.Enqueue(e); }
public override void OnEnter() { dispatcher = Service.Get <EventDispatcher>(); DCinematicSpeech dCinematicSpeech = new DCinematicSpeech(); DialogList.Entry entry = default(DialogList.Entry); if (!UseDialogList) { dCinematicSpeech.Text = Service.Get <Localizer>().GetTokenTranslation(i18nContents); } else if (DialogList != null) { entry = ((!RandomDialog) ? DialogList.Entries[DialogListItemIndex] : DialogList.Entries[Random.Range(0, DialogList.Entries.Length)]); dCinematicSpeech.Text = Service.Get <Localizer>().GetTokenTranslation(entry.ContentToken); } dCinematicSpeech.BubbleContentKey = DialogPrefabKey; dCinematicSpeech.Buttons = null; dCinematicSpeech.BackgroundImageKey = BackgroundImageKey; dCinematicSpeech.ContentImageKey = ContentImageKey; dCinematicSpeech.TextStyle = TextStyle; dCinematicSpeech.RichText = RichText; dCinematicSpeech.MascotName = (string.IsNullOrEmpty(CustomName) ? MascotName : CustomName); dCinematicSpeech.DismissTime = ((AutoCloseTime > 0f) ? AutoCloseTime : ((float)DismissTime)); dCinematicSpeech.CenterX = CenterX; dCinematicSpeech.CenterY = CenterY; dCinematicSpeech.OffsetY = OffsetY; dCinematicSpeech.OffsetYPercent = OffsetYPercent; dCinematicSpeech.HideTail = HideTail; dCinematicSpeech.ClickToClose = ClickToClose; dispatcher.DispatchEvent(new CinematicSpeechEvents.ShowSpeechEvent(dCinematicSpeech, HideQuestHud)); dispatcher.AddListener <CinematicSpeechEvents.SpeechCompleteEvent>(OnSpeechComplete); string text = ""; string overrideAnimationName = ""; string overrideStopAnimationName = ""; bool flag = false; if (UseDialogList && DialogList != null) { text = entry.AudioEventName; overrideAnimationName = entry.DialogAnimationTrigger; overrideStopAnimationName = entry.DialogAnimationEndTrigger; flag = entry.AdvanceSequence; } else if (!AudioEventName.IsNone) { text = AudioEventName.Value; overrideAnimationName = DialogAnimationOverride.Value; overrideStopAnimationName = EndDialogAnimationOverride.Value; flag = AdvanceSequence; } if (!string.IsNullOrEmpty(text)) { EventAction eventAction = EventAction.PlaySound; if (flag) { eventAction = EventAction.AdvanceSequence; } GameObject mascotObject = Service.Get <MascotService>().GetMascotObject(MascotName); if (mascotObject != null && PlayDialogAnimation) { MascotController component = mascotObject.GetComponent <MascotController>(); EventManager.Instance.PostEventNotify(text, eventAction, base.Owner, component.dialogAudioCallback); component.StartDialogAnimation(text, overrideAnimationName, AutoStopDialogAnimation, overrideStopAnimationName); } else { EventManager.Instance.PostEventNotify(text, eventAction, base.Owner, onMascotAudioComplete); } } if (!WaitForFinish) { Finish(); } }
/// <summary> /// Returns true if the given actions can be collapsed. /// </summary> /// <param name="action1">The earlier event to test.</param> /// <param name="action2">The latter event to test.</param> /// <returns>True if these events can be collapsed; else false.</returns> public override bool CanCollapse(EventAction action1, EventAction action2) { return(action1.Control == action2.Control && action1.MethodName == Enter && action2.MethodName == Select); }
private void RaiseEvent(EventAction action, IList<IVssWMComponent> components, IDictionary<string, string> volumeMap) { if (BackupProgress != null) { var ebp = new BackupProgressEventArgs() { Action = action }; if (components != null) { ebp.Components = new Dictionary<string, string>(); foreach (var component in components) ebp.Components.Add(component.ComponentName, component.Caption); } if (volumeMap != null) { ebp.VolumeMap = new Dictionary<string, string>(); foreach (var volume in volumeMap) ebp.VolumeMap.Add(volume); } BackupProgress(this, ebp); if (ebp.Cancel) throw new BackupCancelledException(); } }
public void RegisterToEvent(string name, object source, EventAction callback) { RegisterCallback(name, source, callback, _eventCallbacks); }