Beispiel #1
0
        public PoshTimeliner(string url, int port)
        {
            FUrl = url;
            FPoshServer = new PoshServer(port);
            FPoshServer.AutoPublishAllAfterRemoteCall = false;
            FPoshServer.OnSessionCreated += PoshServer_SessionCreated;
            FPoshServer.OnSessionClosed += PoshServer_SessionClosed;
            FPoshServer.OnKeyDown += PoshServer_OnKeyDown;
            FPoshServer.OnKeyUp += PoshServer_OnKeyUp;
            FPoshServer.OnKeyPress += PoshServer_OnKeyPress;
            FPoshServer.OnDump += PoshServer_OnDump;

            Context.Initialize();
            Context.MappingRegistry.RegisterDefaultInstance<ICommandHistory>(Context.History);
            Context.MappingRegistry.RegisterDefaultInstance<PoshServer>(FPoshServer);
            Context.MappingRegistry.RegisterDefaultInstance<RemoteContext>(FPoshServer.RemoteContext);
            Context.MappingRegistry.RegisterDefaultInstance<ISvgEventCaller>(FPoshServer.SvgEventCaller);

            Timeliner = new Timeliner(Context);

            //apparently initializing the timeline with tracks adds something to the contexts but they are not flushed
            //since info goes out via initial dump. so clear them here
            FPoshServer.RemoteContext.ClearAll();

            //register context sending
            Timeliner.TimelineView.History.CommandInserted += HistoryChanged;
            Timeliner.TimelineView.History.Undone += HistoryChanged;
            Timeliner.TimelineView.History.Redone += HistoryChanged;
        }
Beispiel #2
0
        public PoshTimeliner(string url, int port)
        {
            FUrl        = url;
            FPoshServer = new PoshServer(port);
            FPoshServer.AutoPublishAllAfterRemoteCall = false;
            FPoshServer.OnSessionCreated += PoshServer_SessionCreated;
            FPoshServer.OnSessionClosed  += PoshServer_SessionClosed;
            FPoshServer.OnKeyDown        += PoshServer_OnKeyDown;
            FPoshServer.OnKeyUp          += PoshServer_OnKeyUp;
            FPoshServer.OnKeyPress       += PoshServer_OnKeyPress;
            FPoshServer.OnDump           += PoshServer_OnDump;

            Context.Initialize();
            Context.MappingRegistry.RegisterDefaultInstance <ICommandHistory>(Context.History);
            Context.MappingRegistry.RegisterDefaultInstance <PoshServer>(FPoshServer);
            Context.MappingRegistry.RegisterDefaultInstance <RemoteContext>(FPoshServer.RemoteContext);
            Context.MappingRegistry.RegisterDefaultInstance <ISvgEventCaller>(FPoshServer.SvgEventCaller);

            Timeliner = new Timeliner(Context);

            //apparently initializing the timeline with tracks adds something to the contexts but they are not flushed
            //since info goes out via initial dump. so clear them here
            FPoshServer.RemoteContext.ClearAll();

            //register context sending
            Timeliner.TimelineView.History.CommandInserted += HistoryChanged;
            Timeliner.TimelineView.History.Undone          += HistoryChanged;
            Timeliner.TimelineView.History.Redone          += HistoryChanged;
        }
Beispiel #3
0
        // Dispose(bool disposing) executes in two distinct scenarios.
        // If disposing equals true, the method has been called directly
        // or indirectly by a user's code. Managed and unmanaged resources
        // can be disposed.
        // If disposing equals false, the method has been called by the
        // runtime from inside the finalizer and you should not reference
        // other objects. Only unmanaged resources can be disposed.
        protected virtual void Dispose(bool disposing)
        {
            // Check to see if Dispose has already been called.
            if (!FDisposed)
            {
                if (disposing)
                {
                    Timeliner.Dispose();
                    Timeliner = null;

                    FPoshServer.Dispose();
                    FPoshServer = null;
                }
                // Release unmanaged resources. If disposing is false,
                // only the following code is executed.


                // Note that this is not thread safe.
                // Another thread could start disposing the object
                // after the managed resources are disposed,
                // but before the disposed flag is set to true.
                // If thread safety is necessary, it must be
                // implemented by the client.
            }
            FDisposed = true;
        }
Beispiel #4
0
        // Dispose(bool disposing) executes in two distinct scenarios.
        // If disposing equals true, the method has been called directly
        // or indirectly by a user's code. Managed and unmanaged resources
        // can be disposed.
        // If disposing equals false, the method has been called by the
        // runtime from inside the finalizer and you should not reference
        // other objects. Only unmanaged resources can be disposed.
        protected virtual void Dispose(bool disposing)
        {
            // Check to see if Dispose has already been called.
            if(!FDisposed)
            {
                if(disposing)
                {
                    Timeliner.Dispose();
                    Timeliner = null;

                    FPoshServer.Dispose();
                    FPoshServer = null;
                }
                // Release unmanaged resources. If disposing is false,
                // only the following code is executed.

                // Note that this is not thread safe.
                // Another thread could start disposing the object
                // after the managed resources are disposed,
                // but before the disposed flag is set to true.
                // If thread safety is necessary, it must be
                // implemented by the client.
            }
            FDisposed = true;
        }