本文整理汇总了C#中EventManager类的典型用法代码示例。如果您正苦于以下问题:C# EventManager类的具体用法?C# EventManager怎么用?C# EventManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
EventManager类属于命名空间,在下文中一共展示了EventManager类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Init
public void Init(IntPtr hwnd)
{
if (!m_fInit)
{
m_fInit = true;
// Register
m_mouseDevice.WindowHandle = hwnd;
m_mouseDevice.Usage = RawInput.Usage.Mouse;
m_mouseDevice.UsagePage = RawInput.UsagePage.Generic;
m_mouseDevice.Flags = RawInput.DeviceFlags.InputSink;
RegisterRawInputDevice(m_mouseDevice);
m_keyboardDevice.WindowHandle = hwnd;
m_keyboardDevice.Usage = RawInput.Usage.Keyboard;
m_keyboardDevice.UsagePage = RawInput.UsagePage.Generic;
m_keyboardDevice.Flags = RawInput.DeviceFlags.InputSink;
RegisterRawInputDevice(m_keyboardDevice);
// Register
m_eventManager = EventManager.Instance;
}
}
示例2: Init
public static void Init()
{
ContextSettings settings = new ContextSettings (32, 8, 4, 3, 3);
Styles windowStyle = Styles.Close;
if (FULLSCREEN) {
windowStyle = Styles.Fullscreen;
Game.Width = FULLSCREEN_WIDTH;
Game.Height = FULLSCREEN_HEIGHT;
Game.CameraWidth = FULLSCREEN_WIDTH;
Game.CameraHeight = FULLSCREEN_HEIGHT;
}
Context = new RenderWindow (new VideoMode ((uint)Game.Width, (uint)Game.Height), WindowTitleText, windowStyle, settings);
Context.Closed += OnClose;
Context.KeyPressed += KeyPressed;
Context.KeyReleased += KeyReleased;
Context.SetKeyRepeatEnabled (true);
Rand = new Random ();
EventMgr = new EventManager ();
World = new GameWorld ();
Camera = new View ();
Camera.Center = new Vector2f (CameraWidth / 2, CameraHeight / 2);
Camera.Size = new Vector2f (CameraWidth, CameraHeight); // Half Size
Context.SetView (Camera);
}
示例3: TellLove
public TellLove(EventManager eventManager, string targetKey, int priority, float seconds)
: base(eventManager)
{
this.priority = priority;
this.targetKey = targetKey;
this.seconds = seconds;
}
示例4: Initialize
public void Initialize()
{
EventManager = new EventManager();
Logger = new Logger(EventManager);
services = (IList<ServiceInfo>)ConfigurationManager.GetSection("Services");
profileStore = new XmlProfileStore("profile.xml");
}
示例5: Start
void Start()
{
_view = this.GetComponent<CoherentUIView>();
LocalAppURL = _view.Page;
_view.OnViewCreated += new UnityViewListener.CoherentUI_OnViewCreated(this.OnViewReady);
_userManager = Object.FindObjectOfType(typeof(UserManager)) as UserManager;
_eventManager = GameObject.Find("EventManager").GetComponent<EventManager>();
_eventManager.RepopulateEvents();
_view.Listener.ReadyForBindings += (frameId, path, isMainFrame) =>
{
_view.View.BindCall("RequestUsername", (System.Action)RequestUsername);
_view.View.BindCall("CheckPin", (System.Action<string>)OnJournalClicked);
_view.View.BindCall("OnSaveEntryClicked", (System.Action<string, string>)OnSaveEntryClicked);
_view.View.BindCall("DeleteEntry", (System.Action<string>)DeleteEntry);
_view.View.BindCall("GetCategories", (System.Action)GetCategories);
_view.View.BindCall("UpdateCategories", (System.Action<string>)UpdateCategories);
_view.View.BindCall("GetCommerce", (System.Action)GetCommerce);
_view.View.BindCall("UpdateCommerce", (System.Action<string>)UpdateCommerce);
_view.View.BindCall("SignOut", (System.Action)SignOut);
_view.View.BindCall("GetFacebookInfoMB", (System.Action)GetFacebookInfoMB);
_view.View.BindCall("RetrieveInvitations", (System.Action)RetrieveInvitations);
_view.View.BindCall("RetrieveBusinesses", (System.Action)RetrieveBusinesses);
_view.View.BindCall("JoinEvent", (System.Action<string>)JoinEvent);
_view.View.BindCall("IsFacebookLoggedIn", (System.Action)IsFacebookLoggedIn);
_view.View.BindCall("SignIntoFacebook", (System.Action)SignIntoFacebook);
_view.View.BindCall("SignOutOfFacebook", (System.Action)SignOutOfFacebook);
_view.View.BindCall("BusinessClicked", (System.Action<string>)BusinessClicked);
_view.View.BindCall("JournalsLoaded", (System.Action)JournalsLoaded);
_view.View.BindCall("GetFacebookAuth", (System.Action)GetFacebookAuth);
};
_viewReady = false;
}
示例6: ChangeSetAlreadyExists
public void ChangeSetAlreadyExists()
{
IEventManager mgr = new EventManager();
var svc = new TestChangeSetWriterService();
svc.StubCentral.Services.BeforeSave += Services_BeforeSave;
svc.Initialize(ConfigNoLink, mgr, null);
mgr.Subscribe(typeof(LogMessage), LogMessageListener);
IList<string> references = new List<string>();
references.Add("S-1000");
mgr.Publish(new ChangeSetInfo("Author", "Message", new List<string>(), "5", referenceDate, references));
IAttributeDefinition changesetreferencedef = svc.StubCentral.MetaModel.GetAttributeDefinition("ChangeSet.Reference");
IAttributeDefinition changesetprimaryworkitemsdef = svc.StubCentral.MetaModel.GetAttributeDefinition("ChangeSet.PrimaryWorkitems");
IAttributeDefinition changesetnamedef = svc.StubCentral.MetaModel.GetAttributeDefinition("ChangeSet.Name");
IAttributeDefinition changesetdescriptionref = svc.StubCentral.MetaModel.GetAttributeDefinition("ChangeSet.Description");
Assert.AreEqual(1, _lastsaved.Count);
Asset beforesave = _lastsaved[0].Assets[0];
Assert.AreEqual(GetReferenceChangeSetNameDef(), beforesave.GetAttribute(changesetnamedef).Value);
Assert.AreEqual("Message", beforesave.GetAttribute(changesetdescriptionref).Value);
Assert.AreEqual("5", beforesave.GetAttribute(changesetreferencedef).Value);
Assert.AreEqual(svc.StubCentral.Services.GetOid("Story:1004"), beforesave.GetAttribute(changesetprimaryworkitemsdef).ValuesList[0]);
//Assert.AreEqual(1,_logmessages.Count);
Assert.AreEqual("Using existing Change Set: 5 (ChangeSet:1003:105)", _logmessages[0].Message);
}
示例7: DropBags
public DropBags(EventManager eventManager, string roomKey, GameObject room)
: base(eventManager)
{
this.roomKey = roomKey;
AddToBlackboard(roomKey, room);
AddToBlackboard("bags", new Sentence(null, Sentence.Verb.Bag, null));
}
示例8: Awake
private void Awake()
{
if (Instance == null)
{
Instance = this;
DontDestroyOnLoad(gameObject);
LogManager.IsEnabled = true;
// Setup the Unity Logger!
//LogManager.AttachLogTarget(new UnityTarget(Logger.Level.Trace, Logger.Level.Error, true));
StartupTime = DateTime.Now;
Loader = new DataLoader();
Loader.DataLoadPath = Application.dataPath;
Loader.LoadAll();
// This will pull the player data, after we have instantiated all available cards
PlayerProfile profile = new PlayerProfile();
// Losd the Board Scene into the world!
Application.LoadLevelAdditive("UI");
Application.LoadLevelAdditive("BoardScene");
InitializeControllers();
_eventManager = new EventManager();
Events = _eventManager;
_currentGameState = GameState.Invalid;
}
}
示例9: Lockup
public Lockup(EventManager eventManager, float time, GameObject room)
: base(eventManager)
{
this.time = time;
AddToBlackboard("destination_key", room);
AddToBlackboard("shock", new Sentence(null, Sentence.Verb.Shocked, null));
}
示例10: Convert
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
var e = value as Event;
if (e != null)
{
if ((String)parameter == "title")
{
return new EventManager().GetTitle(e);
}
if ((String)parameter == "description")
{
var description = new EventManager().GetDescription(e);
if (description != null) {
description = new Regex("\\s+").Replace(description, " ");
if (description.Length > 128) {
description = description.Substring(0, 128).Trim() + "...";
}
}
return description;
}
else if ((String)parameter == "image")
{
return new EventManager().GetImage(e);
}
}
return null;
}
示例11: Start
// Use this for initialization
void Start()
{
//Screen.SetResolution(1080 / 2, 1920 / 2, false);
EventManager = new EventManager();
EventManager.InitEvents();
EventManager.InvokeNextEvent();
}
示例12: Init
public void Init()
{
_trainerManager = new TrainerManager();
_eventManager = new EventManager();
_trainer1 = new Trainer()
{
Id = 1,
FirstName = "Test FirstName 9",
LastName = "Test LastName 9",
Email = "[email protected]",
PhoneNo = "99119911",
Description = "A description 9"
};
_trainer2 = new Trainer()
{
Id = 2,
FirstName = "Test FirstName 10"
};
_trainer3 = new Trainer()
{
Id = 3,
FirstName = "Test FirstName 11"
};
}
示例13: OnEnable
void OnEnable()
{
GameObject.Find("TopAnchor").GetComponent<TopBarManager>().prevPanel = returnTo;
GameObject.Find("TopAnchor").GetComponent<TopBarManager>().currentPanel = gameObject;
foreach (Transform child in Grid.transform)
DestroyImmediate(child.gameObject);
manager = GameObject.Find("EventManager").GetComponent<EventManager>();
foreach (UnionHallEvent ev in manager.events)
{
Debug.Log (ev.Email);
if (ev.Email.ToLower() == GameObject.FindGameObjectWithTag("UserManager").GetComponent<UserManager>().CurrentUser.Email.ToLower())
{
Transform newEvent =
Instantiate(eventButton, buttonTransform.position, buttonTransform.rotation) as Transform;
newEvent.Find("EventName").GetComponent<UILabel>().text = ev.Title;
newEvent.Find("EventDateTime").GetComponent<UILabel>().text = ev.GetEventDateTime();
newEvent.parent = Grid.transform;
newEvent.localScale = buttonTransform.localScale;
newEvent.GetComponent<UIDragPanelContents>().draggablePanel =
scrollPanel.GetComponent<UIDraggablePanel>();
newEvent.GetComponent<UIButtonMessage>().target = gameObject;
newEvent.gameObject.name = "Event";
Grid.GetComponent<UIGrid>().Reposition();
}
}
}
示例14: Execute
public void Execute(Room room, ref EventManager evMan, Dictionary<string, object> data)
{
// No point parsing all this data if no one's listening.
if (!evMan.ConnectedListeners.ContainsKey(EventType.MessageStarToggled)) { return; }
if (data.ContainsKey("user_id") && room.IgnoreOwnEvents) { return; }
var id = int.Parse(data["message_id"].ToString());
var starCount = 0;
var pinCount = 0;
if (data.ContainsKey("message_stars") && data["message_stars"] != null)
{
starCount = int.Parse(data["message_stars"].ToString());
}
if (data.ContainsKey("message_owner_stars") && data["message_owner_stars"] != null)
{
pinCount = int.Parse(data["message_owner_stars"].ToString());
}
var message = room[id];
evMan.TrackMessage(message);
evMan.CallListeners(EventType.MessageStarToggled, message, starCount, pinCount);
}
示例15: TellTravelTo
public TellTravelTo(EventManager eventManager, Dictionary<string, object> blackboard, string targetKey, string destinationKey, int priority)
: base(eventManager, blackboard)
{
this.targetKey = targetKey;
this.priority = priority;
this.destinationKey = destinationKey;
}