// Systemwide logic public void ProcessSettings(bool initialize = false) { if (initialize) { VolumeBar.Value = App.Config.Volume; ChangeTabs(App.Config.CurrentMenu); } if (App.Config.PlaybackTracking) { TrackingHandler = new PlaytimeTrackingHandler(this); } else if (TrackingHandler != null) { TrackingHandler?.Close(); TrackingHandler = null; } var version = Assembly.GetEntryAssembly().GetName().Version.ToString(); if (version != App.Config.LastRecordedVersion && App.Config.LastRecordedVersion != null) { NotificationHandler.Add(new Notification { ContentText = string.Format(Properties.Resources.NOTIFICATION_UPTODATE, version), ButtonText = Properties.Resources.NOTIFICATION_UPTODATE_CHANGELOG, Type = NotificationType.Success, OnButtonClicked = () => { Process.Start("https://github.com/royce551/freshmusicplayer/releases/latest"); return(true); } }); } App.Config.LastRecordedVersion = version; }
public static void Patch() { if (playerCallback != null) { UnPatch(); } playerCallback = new PlayerCallback(); TrackingHandler <Player> .Subscribe(playerCallback, true); }
public override void Load(Imbue imbue) { if (imbue.colliderGroup.collisionHandler.item == summonedDagger) { return; } base.Load(imbue); TrackingHandler handler = imbue.colliderGroup.collisionHandler.item.gameObject.AddComponent <TrackingHandler>(); handler.imbue = imbue; }
void Start() { try { trackingHandler = GameObject.Find("AtmoTracking").GetComponent <TrackingHandler>(); } catch (System.Exception ex) { Debug.LogError(ex.Message + ": AtmoTracking gameObject is missing from Scene or named differently."); } // checks every second StartCoroutine(RemoveOverdueHiddenMarkers()); }
public static void Main(string[] args) { // Register the TCP channel. TcpChannel channel = new TcpChannel(1234); ChannelServices.RegisterChannel(channel); //<snippet21> // Register a tracking handler. ITrackingHandler handler1 = new TrackingHandler(); TrackingServices.RegisterTrackingHandler(handler1); //</snippet21> // Register a second handler. ITrackingHandler handler2 = new TrackingHandler(); TrackingServices.RegisterTrackingHandler(handler2); //<snippet22> // Get the number of currently registered handlers. Console.WriteLine("Registered tracking handlers: " + TrackingServices.RegisteredHandlers.Length); //</snippet22> //<snippet23> // Remove the tracking handler from the registered handlers. TrackingServices.UnregisterTrackingHandler(handler2); //</snippet23> Console.WriteLine("Registered tracking handlers: " + TrackingServices.RegisteredHandlers.Length); // Create and marshal an object for remote invocation. RemoteService service = new RemoteService(); ObjRef obj = RemotingServices.Marshal(service, "TcpService"); // Wait for the user prompt. Console.WriteLine("\r\nPress ENTER to unmarshal the object."); Console.ReadLine(); // Unmarshal the object. RemotingServices.Unmarshal(obj); // Wait for the user prompt. Console.WriteLine("Press ENTER to disconnect the object."); Console.ReadLine(); // Disconnect the object. RemotingServices.Disconnect(service); }
public static void UnPatch() { TrackingHandler <Player> .Unsubscribe(playerCallback, true); playerCallback = null; }