コード例 #1
0
ファイル: Timer.cs プロジェクト: salt26/chordingcoding
 /// <summary>
 /// 새 타이머를 생성하고 시작합니다.
 /// </summary>
 /// <param name="interval">tick이 호출되는 주기 (millisecond)</param>
 /// <param name="timerTickDelegate">호출될 tick 함수 대리자</param>
 public Timer(int interval, TickDelegate timerTickDelegate)
 {
     m_Action = timerTickDelegate;
     timeBeginPeriod(1);
     m_Handler = new TimerEventDelegate((id, msg, user, dw1, dw2) => m_Action());
     m_TimerId = timeSetEvent(interval, 0, m_Handler, IntPtr.Zero, EVENT_TYPE);
 }
コード例 #2
0
ファイル: Quote.cs プロジェクト: blueysnow/cj-at-project
        void rightticket(object sender, EventArgs e)
        {
            Security s = GetVisibleSecurity(CurrentRow);

            if (s.Type == SecurityType.IDX)
            {
                return;
            }
            string sym = s.Symbol;

            if ((s.FullName == string.Empty) || (sym == string.Empty))
            {
                return;
            }
            Order o = new OrderImpl(s.FullName, 0);

            o.ex          = s.DestEx;
            o.Security    = s.Type;
            o.LocalSymbol = sym;
            Ticket t = new Ticket(o);

            t.SendOrder += new OrderDelegate(t_neworder);
            spillTick   += new TickDelegate(t.newTick);
            orderStatus += new OrderStatusDel(t.orderStatus);
            System.Drawing.Point p = new System.Drawing.Point(MousePosition.X, MousePosition.Y);
            p.Offset(-315, 20);
            t.SetDesktopLocation(p.X, p.Y);
            t.Show();
        }
コード例 #3
0
        public readonly float Delay;              //Its depend on weight of the items being moved

        public DelayedOperation(float delay, OperationDelegate onOperationComplete,
                                TickDelegate onTimerTick = null,
                                OperationDelegate onOperationCancelled = null)
        {
            this.Delay           = delay;
            OnOperationComplete  = onOperationComplete;
            OnTimerTick          = onTimerTick ?? (value => { UIController.Instance.OperationBarUI.fillAmount = value; });
            OnOperationCancelled = onOperationCancelled ?? (() => { UIController.Instance.OperationBarUI.fillAmount = 0; });
        }
コード例 #4
0
 public Animation(string name, int duration, TriggerDelegate trigger = null, FirstDelegate first = null, TickDelegate tick = null, FinalDelegate final = null)
 {
     Name     = name;
     Duration = duration;
     AnimationManager.Instance.Add(this);
     this.trigger = trigger;
     this.onFirst = first;
     onTick       = tick;
     onFinal      = final;
 }
コード例 #5
0
 private void Initialize()
 {
     mode             = TimerMode.Periodic;
     period           = Capabilities.PeriodMin;
     Resolution       = TimeSpan.FromMilliseconds(1);
     IsRunning        = false;
     timeProcPeriodic = new TimeProc(PeriodicEventCallback);
     timeProcOneShot  = new TimeProc(OneShotEventCallback);
     tickRaiser       = new TickDelegate(OnTick);
 }
コード例 #6
0
ファイル: Timer.cs プロジェクト: darwin/silverstunts
 public void Attach(Canvas canvas, string name, TickDelegate tickEvent, TimeSpan interval)
 {
     if (this.canvas != null) return;
     this.canvas = canvas;
     this.tickEvent = tickEvent;
     storyboard = new Storyboard();
     storyboard.SetValue<string>(Storyboard.NameProperty, name);
     canvas.Resources.Add(storyboard);
     lastUpdateTime = DateTime.Now;
     storyboard.Duration = new Duration(interval);
     storyboard.Completed += new EventHandler(Tick);
 }
コード例 #7
0
        public Visual(GBA gba)
        {
            InitializeComponent();
            MenuStrip ms = new MenuStrip();

            MenuStripHeight = ms.Bounds.Height;

            this.ClientSize = new Size((int)(scale * width), (int)(scale * height) + MenuStripHeight);

            this.gba         = gba;
            this.Tick        = new TickDelegate(TickDisplay);
            this.DebugScreen = new Debug(gba);
            this._display    = new ushort[width * height];

            // disable resizing
            this.FormBorderStyle = FormBorderStyle.FixedSingle;
            this.MinimizeBox     = false;
            this.MaximizeBox     = false;

            this.SetStyle(
                ControlStyles.UserPaint |
                ControlStyles.AllPaintingInWmPaint |
                ControlStyles.DoubleBuffer, true
                );

            this.Text = "GBAC-";

            System.Windows.Forms.Timer timer = new System.Windows.Forms.Timer();
            timer.Interval = interval;
            timer.Tick    += new EventHandler(TickDebug);
            timer.Start();

            this.FPSTimer = Stopwatch.StartNew();

            this.InitMenustrip(ms);

            this.Load  += new EventHandler(Visual_CreateBackBuffer);
            this.Paint += new PaintEventHandler(Visual_Paint);

            this.KeyDown += new KeyEventHandler(Visual_KeyDown);

            // Keyboard input handling
            this.KeyDown += this.gba.mem.IO.KEYINPUT.keyboard.KeyDown;
            this.KeyUp   += this.gba.mem.IO.KEYINPUT.keyboard.KeyUp;


            if (!Directory.Exists(ScreenshotFolder))
            {
                Directory.CreateDirectory(ScreenshotFolder);
            }
            this.Icon = Properties.Resources.dillonbeeg_icon;
        }
コード例 #8
0
        /// <summary>
        /// This creates a new timer that runs on a new thread (not threadpool thread).  All three of the delegates passed in will be executed
        /// from that newly created threads
        /// </summary>
        /// <param name="prep">
        /// This gives the caller a chance to set up objects for the tick to use (those objects won't need to be threadsafe, because they will be created and
        /// used only on the background thread for this instance of timer
        /// </param>
        /// <param name="tick">
        /// This gets fired every internal (arg is the object returned from prep
        /// NOTE: If the code in this tick takes longer than interval, subsequent ticks will just get eaten, so no danger
        /// </param>
        /// <param name="tearDown">
        /// This gets called when this timer is disposed.  Gives the user a chance to dispose anything they created in prep
        /// </param>
        public TimerCreateThread(PrepDelegate prep = null, TickDelegate tick = null, TearDownDelegate tearDown = null, params object[] prepArgs)
        {
            //TODO: figure out how to use ParameterizedThreadStart instead of using member variables
            _prep     = prep;
            _prepArgs = prepArgs;
            _tick     = tick;
            _tearDown = tearDown;

            Thread workerThread = new Thread(WorkerMethod);

            workerThread.IsBackground = true;
            workerThread.Start();
        }
コード例 #9
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Timer"/> class.
        /// </summary>
        /// <param name="callback">
        /// The callback to execute at each tick
        /// </param>
        /// <param name="maxFps">
        /// The max tick per second
        /// </param>
        public Timer(TickDelegate callback, FpsLimiter maxFps = FpsLimiter.Fps30)
        {
            if (callback == null)
            {
                throw new ArgumentNullException("callback");
            }

            this.callback = callback;
            this.MaxFps = maxFps;
            if (timerThread != null)
                return;
            timerThread = new Thread(ThreadCycle) { IsBackground = true };
            timerThread.Start();
        }
コード例 #10
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Timer"/> class.
        /// </summary>
        /// <param name="callback">
        /// The callback to execute at each tick
        /// </param>
        /// <param name="maxFps">
        /// The max tick per second
        /// </param>
        public Timer(TickDelegate callback, FpsLimiter maxFps = FpsLimiter.Fps30)
        {
            if (callback == null)
            {
                throw new ArgumentNullException("callback");
            }

            this.callback = callback;
            this.MaxFps   = maxFps;
            if (timerThread != null)
            {
                return;
            }
            timerThread = new Thread(ThreadCycle)
            {
                IsBackground = true
            };
            timerThread.Start();
        }
コード例 #11
0
ファイル: KadinaMain.cs プロジェクト: antonywu/tradelink
 public kadinamain()
 {
     InitializeComponent();
     boxlist.DropDownItemClicked += new ToolStripItemClickedEventHandler(boxlist_DropDownItemClicked);
     playtobut.DropDownItemClicked += new ToolStripItemClickedEventHandler(playtobut_DropDownItemClicked);
     broker.GotOrder += new OrderDelegate(broker_GotOrder);
     broker.GotFill += new FillDelegate(broker_GotFill);
     KadTick += new TickDelegate(kadinamain_KadTick);
     InitPlayTo();
     InitTickGrid();
     InitPGrid();
     InitOFGrids();
     InitContext();
     restorerecent();
     FormClosing += new FormClosingEventHandler(kadinamain_FormClosing);
     bw.DoWork += new DoWorkEventHandler(Play);
     bw.WorkerReportsProgress = false;
     bw.WorkerSupportsCancellation = true;
     bw.RunWorkerCompleted += new RunWorkerCompletedEventHandler(PlayComplete);
     status(Util.TLSIdentity());
 }
コード例 #12
0
ファイル: KadinaMain.cs プロジェクト: michaelwills/tradelink
 public kadinamain()
 {
     InitializeComponent();
     boxlist.DropDownItemClicked   += new ToolStripItemClickedEventHandler(boxlist_DropDownItemClicked);
     playtobut.DropDownItemClicked += new ToolStripItemClickedEventHandler(playtobut_DropDownItemClicked);
     broker.GotOrder += new OrderDelegate(broker_GotOrder);
     broker.GotFill  += new FillDelegate(broker_GotFill);
     KadTick         += new TickDelegate(kadinamain_KadTick);
     InitPlayTo();
     InitTickGrid();
     InitPGrid();
     InitOFGrids();
     InitContext();
     restorerecent();
     FormClosing += new FormClosingEventHandler(kadinamain_FormClosing);
     bw.DoWork   += new DoWorkEventHandler(Play);
     bw.WorkerReportsProgress      = false;
     bw.WorkerSupportsCancellation = true;
     bw.RunWorkerCompleted        += new RunWorkerCompletedEventHandler(PlayComplete);
     status(Util.TLSIdentity());
 }
コード例 #13
0
 internal static extern void CSharpResource_SetMain(IntPtr resourcePointer, MainDelegate mainDelegate,
                                                    StopDelegate stopDelegate,
                                                    TickDelegate tickDelegate, ServerEventDelegate serverEventDelegate,
                                                    CheckpointDelegate checkpointDelegate,
                                                    ClientEventDelegate clientEventDelegate, PlayerDamageDelegate playerDamageDelegate,
                                                    PlayerConnectDelegate playerConnectDelegate, PlayerDeathDelegate playerDeathDelegate,
                                                    PlayerDisconnectDelegate playerDisconnectDelegate, PlayerRemoveDelegate playerRemoveDelegate,
                                                    VehicleRemoveDelegate vehicleRemoveDelegate,
                                                    PlayerChangeVehicleSeatDelegate playerChangeVehicleSeatDelegate,
                                                    PlayerEnterVehicleDelegate playerEnterVehicleDelegate,
                                                    PlayerLeaveVehicleDelegate playerLeaveVehicleDelegate,
                                                    CreatePlayerDelegate createPlayerDelegate, RemovePlayerDelegate removePlayerDelegate,
                                                    CreateVehicleDelegate createVehicleDelegate, RemoveVehicleDelegate removeVehicleDelegate,
                                                    CreateBlipDelegate createBlipDelegate, RemoveBlipDelegate removeBlipDelegate,
                                                    CreateCheckpointDelegate createCheckpointDelegate, RemoveCheckpointDelegate removeCheckpointDelegate,
                                                    CreateVoiceChannelDelegate createVoiceChannelDelegate,
                                                    RemoveVoiceChannelDelegate removeVoiceChannelDelegate,
                                                    ConsoleCommandDelegate consoleCommandDelegate,
                                                    MetaDataChange metaDataChange,
                                                    MetaDataChange syncedMetaDataChange,
                                                    CreateColShapeDelegate createColShapeDelegate,
                                                    RemoveColShapeDelegate removeColShapeDelegate,
                                                    ColShapeDelegate colShapeDelegate
                                                    );
コード例 #14
0
        void rightticket(object sender, EventArgs e)
        {
            Security s = GetVisibleSecurity(qg.CurrentRowIndex);

            if (s.Type == SecurityType.IDX)
            {
                return;
            }
            string sym = s.Symbol;
            Order  o   = new Order(sym, -1 * tl.PosSize(sym));

            o.Exchange    = s.DestEx;
            o.Security    = s.Type;
            o.LocalSymbol = sym;
            Ticket t = new Ticket(o);

            t.neworder  += new QuotopiaOrderDel(t_neworder);
            spillTick   += new TickDelegate(t.newTick);
            orderStatus += new OrderStatusDel(t.orderStatus);
            System.Drawing.Point p = new System.Drawing.Point(MousePosition.X, MousePosition.Y);
            p.Offset(-315, 20);
            t.SetDesktopLocation(p.X, p.Y);
            t.Show();
        }
コード例 #15
0
 public WardenMaiev()
 {
     WardenModule    = Array.Empty <byte>();
     ModuleName      = "";
     ModuleKey       = Array.Empty <byte>();
     ModuleData      = Array.Empty <byte>();
     ModuleSize      = 0;
     CheckIDs        = new byte[8];
     Script          = null;
     delegateCache   = new Dictionary <string, Delegate>();
     dwModuleSize    = 0;
     dwLibraryCount  = 0;
     SendPacketD     = null;
     CheckModuleD    = null;
     ModuleLoadD     = null;
     AllocateMemD    = null;
     FreeMemoryD     = null;
     SetRC4DataD     = null;
     GetRC4DataD     = null;
     GenerateRC4Keys = null;
     UnloadModule    = null;
     PacketHandler   = null;
     Tick            = null;
     m_Mod           = 0;
     m_ModMem        = 0;
     InitPointer     = 0;
     init            = null;
     myFuncList      = IntPtr.Zero;
     myFunctionList  = default;
     pFuncList       = 0;
     ppFuncList      = 0;
     myWardenList    = default;
     pWardenList     = 0;
     m_RC4           = 0;
     m_PKT           = Array.Empty <byte>();
 }
コード例 #16
0
 internal static extern void CSharpResourceImpl_SetTickDelegate(IntPtr resource,
                                                                TickDelegate @delegate);
コード例 #17
0
        private bool InitModule(ref byte[] Data)
        {
            int          A;
            int          B;
            int          C;
            var          bCode = new byte[16];
            MemoryStream ms    = new(Data);
            BinaryReader br    = new(ms);

            Marshal.Copy(Data, 0, new IntPtr(m_Mod), Data.Length);
            br.BaseStream.Position = 0x18L;
            C = br.ReadInt32();
            B = 1 - C;
            br.BaseStream.Position = 0x14L;
            if (B > br.ReadInt32())
            {
                return(false);
            }

            br.BaseStream.Position = 0x10L;
            A = br.ReadInt32();
            br.BaseStream.Position = A + (B * 4);
            A           = br.ReadInt32() + m_Mod;
            InitPointer = A;
            Console.WriteLine("Initialize Function is mapped at 0x{0:X}", InitPointer);
            SendPacketD    = SendPacket;
            CheckModuleD   = CheckModule;
            ModuleLoadD    = ModuleLoad;
            AllocateMemD   = AllocateMem;
            FreeMemoryD    = FreeMemory;
            SetRC4DataD    = SetRC4Data;
            GetRC4DataD    = GetRC4Data;
            myFunctionList = new FuncList
            {
                fpSendPacket     = Marshal.GetFunctionPointerForDelegate(SendPacketD).ToInt32(),
                fpCheckModule    = Marshal.GetFunctionPointerForDelegate(CheckModuleD).ToInt32(),
                fpLoadModule     = Marshal.GetFunctionPointerForDelegate(ModuleLoadD).ToInt32(),
                fpAllocateMemory = Marshal.GetFunctionPointerForDelegate(AllocateMemD).ToInt32(),
                fpReleaseMemory  = Marshal.GetFunctionPointerForDelegate(FreeMemoryD).ToInt32(),
                fpSetRC4Data     = Marshal.GetFunctionPointerForDelegate(SetRC4DataD).ToInt32(),
                fpGetRC4Data     = Marshal.GetFunctionPointerForDelegate(GetRC4DataD).ToInt32()
            };
            Console.WriteLine("Imports: ");
            Console.WriteLine("  SendPacket: 0x{0:X}", myFunctionList.fpSendPacket);
            Console.WriteLine("  CheckModule: 0x{0:X}", myFunctionList.fpCheckModule);
            Console.WriteLine("  LoadModule: 0x{0:X}", myFunctionList.fpLoadModule);
            Console.WriteLine("  AllocateMemory: 0x{0:X}", myFunctionList.fpAllocateMemory);
            Console.WriteLine("  ReleaseMemory: 0x{0:X}", myFunctionList.fpReleaseMemory);
            Console.WriteLine("  SetRC4Data: 0x{0:X}", myFunctionList.fpSetRC4Data);
            Console.WriteLine("  GetRC4Data: 0x{0:X}", myFunctionList.fpGetRC4Data);

            // http://forum.valhallalegends.com/index.php?topic=17758.0
            myFuncList = new IntPtr(malloc(0x1C));
            Marshal.StructureToPtr(myFunctionList, myFuncList, false);
            pFuncList = myFuncList.ToInt32();
            int localVarPtr()
            {
                object argobj = pFuncList; var ret = VarPtr(ref argobj); return(ret);
            }

            ppFuncList = localVarPtr();
            Console.WriteLine("Initializing module");
            init         = (InitializeModule)Marshal.GetDelegateForFunctionPointer(new IntPtr(InitPointer), typeof(InitializeModule));
            m_ModMem     = init.Invoke(ppFuncList);
            pWardenList  = Marshal.ReadInt32(new IntPtr(m_ModMem));
            myWardenList = (WardenFuncList)Marshal.PtrToStructure(new IntPtr(pWardenList), typeof(WardenFuncList));
            Console.WriteLine("Exports:");
            Console.WriteLine("  GenerateRC4Keys: 0x{0:X}", myWardenList.fpGenerateRC4Keys);
            Console.WriteLine("  Unload: 0x{0:X}", myWardenList.fpUnload);
            Console.WriteLine("  PacketHandler: 0x{0:X}", myWardenList.fpPacketHandler);
            Console.WriteLine("  Tick: 0x{0:X}", myWardenList.fpTick);
            GenerateRC4Keys = (GenerateRC4KeysDelegate)Marshal.GetDelegateForFunctionPointer(new IntPtr(myWardenList.fpGenerateRC4Keys), typeof(GenerateRC4KeysDelegate));
            UnloadModule    = (UnloadModuleDelegate)Marshal.GetDelegateForFunctionPointer(new IntPtr(myWardenList.fpUnload), typeof(UnloadModuleDelegate));
            PacketHandler   = (PacketHandlerDelegate)Marshal.GetDelegateForFunctionPointer(new IntPtr(myWardenList.fpPacketHandler), typeof(PacketHandlerDelegate));
            Tick            = (TickDelegate)Marshal.GetDelegateForFunctionPointer(new IntPtr(myWardenList.fpTick), typeof(TickDelegate));
            ms.Close();
            ms.Dispose();
            ms = null;
            br = null;
            return(true);
        }
コード例 #18
0
        private void WorkerMethod()
        {
            // Doing this so TaskScheduler.FromCurrentSynchronizationContext() will work
            SynchronizationContext.SetSynchronizationContext(new SynchronizationContext());

            // Since _tearDown gets called after dispose, there's a slight chance that the underlying object could get garbage collected, so store local copies of these
            // two delegates up front
            TickDelegate     tick     = _tick;
            TearDownDelegate tearDown = _tearDown;

            // Let the client create an object from this thread
            T prepResults = default(T);

            if (_prep != null)
            {
                prepResults = _prep(_prepArgs);
            }

            #region Set up the timer

            DateTime lastTick = DateTime.UtcNow;

            ManualResetEvent tickEvent = new ManualResetEvent(false);

            System.Timers.Timer timer = new System.Timers.Timer();
            //timer.SynchronizingObject     //NOTE: I tried to implement ISynchonizeInvoke, but that approach was a mess.  I think this approach of creating a thead for the user is way cleaner
            timer.Interval  = this.Interval;
            timer.Elapsed  += delegate { tickEvent.Set(); };
            timer.AutoReset = false;
            if (_isTimerRunning)
            {
                timer.Start();
            }

            #endregion

            WaitHandle[] handles = new WaitHandle[] { _disposeEvent, _timerSettingsChanged, tickEvent };

            while (true)
            {
                // Hang this thread until something happens
                int handleIndex = WaitHandle.WaitAny(handles);

                if (handleIndex == 0)       // I would prefer a switch statement, but there is no Exit While statement
                {
                    // Dispose was called, this thread needs to finish
                    //_disposeEvent.Reset();        // just leave this one tripped so that
                    break;
                }
                else if (handleIndex == 1)
                {
                    #region Timer settings changed

                    _timerSettingsChanged.Reset();

                    // Settings for the timer have changed
                    timer.Interval = this.Interval;

                    if (_isTimerRunning)
                    {
                        timer.Start();      // it appears to be safe to call this even when started
                    }
                    else
                    {
                        timer.Stop();       // and to call this again when stopped
                    }

                    #endregion
                }
                else if (handleIndex == 2)
                {
                    #region Timer ticked

                    DateTime currentTick = DateTime.UtcNow;
                    double   elapsed     = (currentTick - lastTick).TotalMilliseconds;
                    lastTick = currentTick;

                    tickEvent.Reset();

                    if (_isTimerRunning)
                    {
                        timer.Start();

                        if (tick != null)       // putting this inside the _isTimerRunning, because they may have wanted the timer stopped between ticks, so in that case, just ignore this tick event
                        {
                            tick(prepResults, elapsed);
                        }
                    }

                    #endregion
                }
                else
                {
                    throw new ApplicationException("Unknown wait handle: " + handleIndex.ToString());
                }
            }

            timer.Stop();
            timer.Dispose();

            if (tearDown != null)
            {
                tearDown(prepResults);
            }
        }
コード例 #19
0
 public void RegisterTick(TickDelegate listener)
 {
     Tick += listener;
 }
コード例 #20
0
ファイル: Quote.cs プロジェクト: antonywu/tradelink
 void rightticket(object sender, EventArgs e)
 {
     Security s = GetVisibleSecurity(qg.CurrentRowIndex);
     if (s.Type == SecurityType.IDX) return;
     string sym = s.Symbol;
     Order o = new Order(sym,-1*tl.PosSize(sym));
     o.Exchange = s.DestEx;
     o.Security = s.Type;
     o.LocalSymbol = sym;
     Ticket t = new Ticket(o);
     
     t.neworder += new QuotopiaOrderDel(t_neworder);
     spillTick +=new TickDelegate(t.newTick);
     orderStatus+=new OrderStatusDel(t.orderStatus);
     System.Drawing.Point p = new System.Drawing.Point(MousePosition.X, MousePosition.Y);
     p.Offset(-315, 20);
     t.SetDesktopLocation(p.X, p.Y);
     t.Show();
 }
コード例 #21
0
 public AttackAnimation(string name, int duration, TriggerDelegate trigger = null, FirstDelegate first = null, TickDelegate tick = null, FinalDelegate final = null)
     : base(name, duration, trigger, first, tick, final)
 {
 }
コード例 #22
0
ファイル: Timer.cs プロジェクト: darwin/silverstunts
 public void Attach(Canvas canvas, string name, TickDelegate tickEvent)
 {
     Attach(canvas, name, tickEvent, new TimeSpan());
 }
コード例 #23
0
 /// <summary>
 /// Adds a subscriber
 /// </summary>
 /// <param name="tick"> Subscriber tick delegate </param>
 public virtual void Subscribe( TickDelegate tick )
 {
     m_Tick += tick;
 }
コード例 #24
0
 /// <summary>
 /// Removes a subscriber
 /// </summary>
 /// <param name="tick"> Subscriber tick delegate </param>
 public virtual void Unsubscribe( TickDelegate tick )
 {
     m_Tick -= tick;
 }
コード例 #25
0
 public MethodContoller(TickDelegate tick)
 {
     this.tick = tick;
 }
コード例 #26
0
 public LockSelector(params Composite[] children)
     : base(children)
 {
     if (SingularSettings.Instance.UseFrameLock)
         _TickSelectedByUser = TickWithFrameLock;
     else
         _TickSelectedByUser = TickNoFrameLock;
 }
コード例 #27
0
ファイル: Quote.cs プロジェクト: blueysnow/cj-at-project
 void rightticket(object sender, EventArgs e)
 {
     Security s = GetVisibleSecurity(CurrentRow);
     if (s.Type == SecurityType.IDX) return;
     string sym = s.Symbol;
     if ((s.FullName == string.Empty) || (sym == string.Empty))
     {
         return;
     }
     Order o = new OrderImpl(s.FullName,0);
     o.ex = s.DestEx;
     o.Security = s.Type;
     o.LocalSymbol = sym;
     Ticket t = new Ticket(o);
     t.SendOrder += new OrderDelegate(t_neworder);
     spillTick +=new TickDelegate(t.newTick);
     orderStatus+=new OrderStatusDel(t.orderStatus);
     System.Drawing.Point p = new System.Drawing.Point(MousePosition.X, MousePosition.Y);
     p.Offset(-315, 20);
     t.SetDesktopLocation(p.X, p.Y);
     t.Show();
 }
コード例 #28
0
ファイル: Level.cs プロジェクト: darwin/silverstunts
        public bool EvalLogic()
        {
            string res = shell.ExecuteAsString(LogicSource);
            if (!IsOK(res)) return false;

            try
            {
                initDelegate = shell.Engine.EvaluateAs<InitDelegate>("init", shell.Module);
            }
            catch (Exception e)
            {
                res = shell.ExceptionToString(e);
                Page.Current.PrintConsole(res, Page.ConsoleOutputKind.Exception);
                initDelegate = null;
            }

            try
            {
                tickDelegate = shell.Engine.EvaluateAs<TickDelegate>("tick", shell.Module);
            }
            catch (Exception e)
            {
                res = shell.ExceptionToString(e);
                Page.Current.PrintConsole(res, Page.ConsoleOutputKind.Exception);
                tickDelegate = null;
            }

            return true;
        }