Exemplo n.º 1
0
        protected override void OnDocumentClosing(IDocument document)
        {
            var sd = document as ISledDocument;

            if (sd == null)
            {
                return;
            }

            Closing.Raise(this, new SledDocumentServiceEventArgs(sd));
        }
Exemplo n.º 2
0
 protected virtual void close()
 {
     Closing.Raise(this, null);
     if (Parent is Interface)
     {
         (Parent as Interface).DeleteWidget(this);
     }
     else
     {
         GraphicObject p = Parent as GraphicObject;
         if (p is Group)
         {
             lock (IFace.UpdateMutex) {
                 RegisterClip(p.ScreenCoordinates(p.LastPaintedSlot));
                 (p as Group).DeleteChild(this);
             }
             //(Parent as Group).RegisterForRedraw ();
         }
         else if (Parent is PrivateContainer)
         {
             (Parent as Container).Child = null;
         }
     }
 }
Exemplo n.º 3
0
        private static unsafe int OnMessage(UOMessage msg, int arg1, int arg2, int arg3, byte *data)
        {
            try
            {
                switch (msg)
                {
                case UOMessage.Ready:
                    Ready = true;
                    hooks.Send(UOMessage.ConnectionInfo, (int)ServerIP, ServerPort);
                    hooks.Send(UOMessage.GameSize, Width, Height);
                    OnInit();
                    break;

                case UOMessage.Connected:
                    Connected.Raise();
                    break;

                case UOMessage.Disconnecting:
                    Disconnecting.Raise();
                    break;

                case UOMessage.Closing:
                    Closing.Raise();
                    break;

                case UOMessage.Focus:
                    FocusChanged.Raise(arg1 != 0);
                    break;

                case UOMessage.Visibility:
                    VisibilityChanged.Raise(arg1 != 0);
                    break;

                case UOMessage.KeyDown:
                    UOKeyEventArgs keyArgs = new UOKeyEventArgs(arg1, arg2);
                    KeyDown.Raise(keyArgs);
                    if (keyArgs.Filter)
                    {
                        return(1);
                    }
                    break;

                case UOMessage.PacketToClient:
                    Packet toClient = new Packet(data, arg1);
                    PacketToClient.Raise(toClient);
                    if (toClient.Filter)
                    {
                        return(1);
                    }
                    if (toClient.Changed)
                    {
                        return(2);
                    }
                    break;

                case UOMessage.PacketToServer:
                    Packet toServer = new Packet(data, arg1);
                    PacketToServer.Raise(toServer);
                    if (toServer.Filter)
                    {
                        return(1);
                    }
                    if (toServer.Changed)
                    {
                        return(2);
                    }
                    break;
                }
            }
            catch (Exception ex) { OnException(ex); }
            return(0);
        }
Exemplo n.º 4
0
 protected void close()
 {
     Closing.Raise(this, null);
     CurrentInterface.DeleteWidget(this);
 }
Exemplo n.º 5
0
 private void CloseButtonClick(object sender, RoutedEventArgs e)
 {
     Closing.Raise(this, e);
 }