コード例 #1
0
ファイル: PlayerInput.cs プロジェクト: Uhha/MonoG
        private void ManagerInput_FireNewInput(object sender, MyEventArgs.NewInputEventArgs e)
        {
            var sprite = GetComponent<Sprite>(ComponentType.Sprite);
            if (sprite == null)
            {
                return;
            }
            //switch (e.Input)
            //{
            //    case Input.Left:
            //        sprite.Move(-1.5f, 0);
            //        break;
            //    case Input.Right:
            //        sprite.Move(1.5f, 0);
            //        break;
            //    case Input.Up:
            //        sprite.Move(0, -1.5f);
            //        break;
            //    case Input.Down:
            //        sprite.Move(0, 1.5f);
            //        break;
            //    case Input.N:
            //        break;
            // }

            //sprite.Destination = e.Point;

            System.IO.File.AppendAllText(@"C:\WriteText.txt", "lst.Add(new Vector2("+e.Point.X.ToString()+","+e.Point.Y.ToString()+"));");
            System.IO.File.AppendAllText(@"C:\WriteText.txt", Environment.NewLine);
        }
コード例 #2
0
ファイル: Chapter7.cs プロジェクト: saniainf/uchebnik
 public void Handler(object sender, MyEventArgs e)
 {
     Console.WriteLine("Event " + e.EventNum +
                       " received by an X object.");
     Console.WriteLine("Source is " + sender);
     Console.WriteLine();
 }
コード例 #3
0
ファイル: PlayerInput.cs プロジェクト: Uhha/Zelda
        private void ManagerInput_FireNewInput(object sender, MyEventArgs.NewInputEventArgs e)
        {
            var sprite = GetComponent<Sprite>(ComponentType.Sprite);
            if (sprite == null)
            {
                return;
            }

            var collision = GetComponent<Collision>(ComponentType.Collision);
            var x = 0f;
            var y = 0f;

            switch (e.Input)
            {
                case Input.Left:
                    x = -1.5f;
                    break;
                case Input.Right:
                    x = 1.5f;
                    break;
                case Input.Up:
                    y = -1.5f;
                    break;
                case Input.Down:
                    y = 1.5f;
                    break;
             }
            if (collision == null || !collision.CheckCollision(new Rectangle((int) (sprite.Position.X + x), (int) (sprite.Position.Y + y), sprite.Width, sprite.Height)))
            {
                sprite.Move(x, y);
            }
        }
コード例 #4
0
ファイル: ScreenStart.cs プロジェクト: Bribz/SpeedCodingZelda
 void ManagerInput_FireNewInput(object sender, MyEventArgs.NewInputEventArgs e)
 {
     if(e.Input == Input.Enter)
     {
         ManagerScreen.LoadNewScreen(new ScreenWorld(ManagerScreen));
     }
 }
コード例 #5
0
 void managerMouse_MouseEventHandler(object sender, MyEventArgs.MouseEventArgs e)
 {
     if (_sprite.Rectangle.Intersects(e.SelectRectangle))
         _selected = true;
     else
         _selected = false;
 }
コード例 #6
0
 void ManagerInput_FireNewInput(object sender, MyEventArgs.NewInputEventArgs e)
 {
     switch (e.Input)
     {
         case Input.Left:
             ManagerNetwork.SendInput(Keys.Left);
             break;
         case Input.Right:
             ManagerNetwork.SendInput(Keys.Right);
             break;
         case Input.Up:
             ManagerNetwork.SendInput(Keys.Up);
             break;
         case Input.Down:
             ManagerNetwork.SendInput(Keys.Down);
             break;
         case Input.None:
             break;
         case Input.Enter:
             break;
         case Input.A:
             break;
         case Input.S:
             break;
         case Input.Select:
             break;
         case Input.Start:
             break;
         default:
             throw new ArgumentOutOfRangeException();
     }
 }
コード例 #7
0
ファイル: myevent.cs プロジェクト: EdiCarlos/MyPractices
public virtual void RaiseClick(MyEventArgs b)
{
if(ClickEvent != null)
{
ClickEvent(this, b);
}
}
コード例 #8
0
ファイル: Chapter7.cs プロジェクト: saniainf/uchebnik
    // This raises SomeEvent.
    public void OnSomeEvent()
    {
        MyEventArgs arg = new MyEventArgs();

        if (SomeEvent != null)
        {
            arg.EventNum = count++;
            SomeEvent(this, arg);
        }
    }
コード例 #9
0
 void PlayerUpdate(object sender, MyEventArgs.PlayerUpdateEventArgs e)
 {
     foreach (var player in e.Players)
     {
         var baseObject = _players.FirstOrDefault(b => b.Username == player.Username);
         if (baseObject != null)
         {
             var sprite = baseObject.GetComponent<Sprite>(ComponentType.Sprite);
             sprite.UpdatePosition(player, e.CameraUpdate);
         }
         else
         {
             CreateObject(player);
         }
     }
 }
コード例 #10
0
 void EnemyUpdate(object sender, MyEventArgs.EnemyUpdateEventArgs e)
 {
     foreach (var enemy in e.Enemies)
     {
         var baseObject = _enemies.FirstOrDefault(en => en.Username == enemy.UniqueId.ToString());
         if (baseObject != null)
         {
             var sprite = baseObject.GetComponent<Sprite>(ComponentType.Sprite);
             sprite.UpdatePosition(enemy, e.CameraUpdate);
         }
         else
         {
             CreateObject(enemy);
         }
     }
 }
コード例 #11
0
ファイル: UClogin.cs プロジェクト: nanxiaodong/CodeManage
        private void btnLogin_Click(object sender, EventArgs e)
        {
            MyEventArgs myEventArgs = new MyEventArgs();
            myEventArgs.LoginName = this.txtLoginName.Text;
            myEventArgs.LoginPwd = this.txtPwd.Text;
            myEventArgs.Result = false;

            //this指的是btnLogin这个控件
            MyLoginDelegate(this, myEventArgs);

            if (myEventArgs.Result)
            {
                this.txtLoginName.BackColor = Color.Green;
                this.txtPwd.BackColor = Color.Green;
            }
            else
            {
                this.txtLoginName.BackColor = Color.Red;
                this.txtPwd.BackColor = Color.Red;
            }
        }
コード例 #12
0
 private void MaxReached(object obj, MyEventArgs e)
 {
     _myEventRaised = true;
 }
コード例 #13
0
 static void NewDeviceAdded(object source, MyEventArgs e)
 {
     Console.WriteLine("New Device Attached at Port : " + e.ComPort);
 }
コード例 #14
0
        void ManagerInput_FireNewInput(object sender, MyEventArgs.NewInputEventArgs e)
        {
            switch (e.Input)
            {
                case Input.Left:
                    _cursorPosition.X--;
                    if (_cursorPosition.X < 0)
                    {
                        _cursorPosition.X = 1;
                        _cursorPosition.Y--;
                        if (_cursorPosition.Y < 0)
                        {
                            _cursorPosition.Y = 7;
                        }
                    }
                    break;

                case Input.Right:
                    _cursorPosition.X++;
                    if (_cursorPosition.X > 1)
                    {
                        _cursorPosition.X = 0;
                        _cursorPosition.Y++;
                        if (_cursorPosition.Y > 7)
                            _cursorPosition.Y = 0;
                    }
                    break;

                case Input.Down:
                    _cursorPosition.Y++;
                    if (_cursorPosition.Y > 7)
                    {
                        _cursorPosition.X = 0;
                        _cursorPosition.Y = 0;
                    }
                    break;

                case Input.Up:
                    _cursorPosition.Y--;
                    if (_cursorPosition.Y < 0)
                    {
                        _cursorPosition.X = 1;
                        _cursorPosition.Y = 7;
                    }
                    break;
                case Input.Select:
                    ManagerScreen.GoBackOneScreen();
                    break;
                case Input.A:
                    _equipment.SwitchEquipment(ItemSlot.A, _cursorPosition);
                    break;
                case Input.S:
                    _equipment.SwitchEquipment(ItemSlot.B, _cursorPosition);
                    break;
            }
        }
コード例 #15
0
 internal void SomeHandler(object sender, MyEventArgs e)
 {
 }
コード例 #16
0
 private void MyEventHandlerMethod(object sender, MyEventArgs e) //okay, event handler
 {
 }
コード例 #17
0
 private void OnFooBar(object sender, MyEventArgs e)
 {
     Debug.Log("Method OnFoobar Event");
 }
コード例 #18
0
ファイル: ItemShow.cs プロジェクト: simarsenault/UOFiddler
        public void OnLoad(object sender, EventArgs e)
        {
            MyEventArgs args = e as MyEventArgs;

            if (IsLoaded && (args == null || args.Type != MyEventArgs.Types.ForceReload))
            {
                return;
            }

            Cursor.Current = Cursors.WaitCursor;
            Options.LoadedUltimaClass["TileData"] = true;
            Options.LoadedUltimaClass["Art"]      = true;
            Options.LoadedUltimaClass["Animdata"] = true;
            Options.LoadedUltimaClass["Hues"]     = true;
            if (!IsLoaded) // only once
            {
                Plugin.PluginEvents.FireModifyItemShowContextMenuEvent(contextMenuStrip1);
            }

            _showFreeSlots = false;
            showFreeSlotsToolStripMenuItem.Checked = false;
            listView1.BeginUpdate();
            listView1.Clear();
            List <ListViewItem> itemcache = new List <ListViewItem>();

            if (Files.UseHashFile && Files.CompareHashFile("Art", Options.AppDataPath) && !Art.Modified)
            {
                string path     = Options.AppDataPath;
                string fileName = Path.Combine(path, "UOFiddlerArt.hash");
                if (File.Exists(fileName))
                {
                    using (FileStream bin = new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.Read))
                    {
                        unsafe
                        {
                            byte[] buffer = new byte[bin.Length];
                            bin.Read(buffer, 0, (int)bin.Length);
                            fixed(byte *bf = buffer)
                            {
                                int *poffset = (int *)bf;
                                int  offset  = *poffset + 4;
                                int *dat     = (int *)(bf + offset);
                                int  i       = offset;

                                while (i < buffer.Length)
                                {
                                    int          j    = *dat++;
                                    ListViewItem item = new ListViewItem(j.ToString(), 0)
                                    {
                                        Tag = j
                                    };
                                    itemcache.Add(item);
                                    i += 4;
                                }
                            }
                        }
                    }
                    listView1.Items.AddRange(itemcache.ToArray());
                }
            }
            else
            {
                int staticlength = Art.GetMaxItemID() + 1;
                for (int i = 0; i < staticlength; ++i)
                {
                    if (Art.IsValidStatic(i))
                    {
                        ListViewItem item = new ListViewItem(i.ToString(), 0)
                        {
                            Tag = i
                        };
                        itemcache.Add(item);
                    }
                }
                listView1.Items.AddRange(itemcache.ToArray());

                if (Files.UseHashFile)
                {
                    MakeHashFile();
                }
            }

            listView1.TileSize = new Size(Options.ArtItemSizeWidth, Options.ArtItemSizeHeight);
            listView1.EndUpdate();

            if (!IsLoaded)
            {
                ControlEvents.FilePathChangeEvent += OnFilePathChangeEvent;
                ControlEvents.ItemChangeEvent     += OnItemChangeEvent;
                ControlEvents.TileDataChangeEvent += OnTileDataChangeEvent;
            }
            IsLoaded = true;

            Cursor.Current = Cursors.Default;
        }
コード例 #19
0
 protected virtual void OnClientDisconnected(MyEventArgs e)
 {
     ClientDisconnected?.Invoke(this, e);
 }
コード例 #20
0
 protected virtual void OnShapeChanged(MyEventArgs e)
 {
     ShapeChanged?.Invoke(this, e);
 }
コード例 #21
0
        void Ok(object sender, MyEventArgs e)
        {
            if ((UserControl)sender is Login)
            {
                if (File.Exists("users.txt"))
                {
                    sr = new StreamReader("users.txt");
                    string name  = e.name;
                    bool   exist = false;

                    while (sr.Peek() > -1)
                    {
                        sr.ReadLine();
                        if (name == sr.ReadLine())
                        {
                            exist = true;
                            if (e.password == sr.ReadLine())
                            {
                                MessageBox.Show("Добро пожаловать");
                            }
                            else
                            {
                                MessageBox.Show("Не верный пароль");
                            }
                            break;
                        }
                        sr.ReadLine();
                        sr.ReadLine();
                        sr.ReadLine();
                    }
                    sr.Close();
                    if (!exist)
                    {
                        MessageBox.Show("Такого пользователя не существует");
                    }
                }
                else
                {
                    MessageBox.Show("Такого пользователя не существует");
                }

                //MessageBox.Show(string.Format("OkLog {0}", e.name));
            }
            if ((UserControl)sender is Registration)
            {
                if (File.Exists("users.txt"))
                {
                    sr = new StreamReader("users.txt");
                    string name  = e.name;
                    bool   exist = false;

                    while (sr.Peek() > -1)
                    {
                        sr.ReadLine();
                        if (name == sr.ReadLine())
                        {
                            exist = true;
                            MessageBox.Show("Пользователь уже существует");
                            break;
                        }
                        sr.ReadLine();
                        sr.ReadLine();
                        sr.ReadLine();
                    }
                    sr.Close();
                    if (!exist)
                    {
                        sw = new StreamWriter("users.txt", true);
                        sw.WriteLine();
                        sw.WriteLine(e.name);
                        sw.WriteLine(e.password);
                        sw.WriteLine(e.quastion);
                        sw.WriteLine(e.answer);
                        sw.Close();
                        MessageBox.Show("Вы зарегистрированы");
                    }
                }
                else
                {
                    sw = new StreamWriter("users.txt", true);
                    sw.WriteLine();
                    sw.WriteLine(e.name);
                    sw.WriteLine(e.password);
                    sw.WriteLine(e.quastion);
                    sw.WriteLine(e.answer);
                    sw.Close();
                    MessageBox.Show("Вы зарегистрированы");
                }

                //MessageBox.Show(string.Format("OkReg {0}", e.name));
            }
            if ((UserControl)sender is Restore)
            {
                if (File.Exists("users.txt"))
                {
                    sr = new StreamReader("users.txt");
                    string name  = e.name;
                    bool   exist = false;

                    while (sr.Peek() > -1)
                    {
                        sr.ReadLine();
                        if (name == sr.ReadLine())
                        {
                            exist = true;
                            string pass = sr.ReadLine();
                            if (e.quastion == sr.ReadLine() && e.answer == sr.ReadLine())
                            {
                                MessageBox.Show(string.Format("Ваш пароль: {0}", pass));
                            }
                            else
                            {
                                MessageBox.Show("Не верный вопрос || не верный ответ на него ");
                            }
                            break;
                        }
                        sr.ReadLine();
                        sr.ReadLine();
                        sr.ReadLine();
                    }
                    sr.Close();
                    if (!exist)
                    {
                        MessageBox.Show("Такого пользователя не существует");
                    }
                }
                else
                {
                    MessageBox.Show("Такого пользователя не существует");
                }

                //MessageBox.Show(string.Format("OkRes {0}", e.name));
            }
        }
コード例 #22
0
 protected virtual void OnReceivedMessage(MyEventArgs e)
 {
     RecievedMessage?.Invoke(this, e);
 }
コード例 #23
0
 public void Reaction(Object sender, MyEventArgs e)
 {
     Console.WriteLine("Event{0}:\t{1}\n" ,Number ,e.Message);
 }
コード例 #24
0
 private void DoReflashData(object sender, MyEventArgs e)
 {
     ReflashData();
 }
コード例 #25
0
        public void button1_Click(object sender, MyEventArgs e)
        {
            var arg = e.Arg1;

            return;
        }
コード例 #26
0
ファイル: Browser1.cs プロジェクト: tancfeng/YZ_WinForm
        void center2_11_OnPageClicked(object sender, MyEventArgs e)
        {
            switch (e.Action)
            {
                case 11:
                    {

                        index--;
                        //if (index < 0)
                        //    index = 0;
                        if (index >= 0)
                        {
                            SRRC_ResourceEntity ent = lvic[index].Tag as SRRC_ResourceEntity;
                            this.PicId = ent.Id;
                            this.inPutBuffer(ent.Serverip + ent.Path, 0);
                            this.center2_11.SetSelectedState(index);
                            this.right1.SetBiaoJiStatusByString(this.PicId.ToString());

                        }
                        else
                        {
                            index = 0;
                            MessageBox.Show("已是第一张");
                        }

                    }
                    break;
                case 12:
                    {
                        index++;
                        if (lvic.Count > index)
                        {
                            SRRC_ResourceEntity ent = lvic[index].Tag as SRRC_ResourceEntity;
                            this.PicId = ent.Id;
                            this.inPutBuffer(ent.Serverip + ent.Path, 0);
                            this.center2_11.SetSelectedState(index);
                            this.right1.SetBiaoJiStatusByString(this.PicId.ToString());
                        }
                        else
                        {
                            index = lvic.Count - 1;
                            MessageBox.Show("已是最后一张");
                        }
                    }
                    break;
                case 13:
                    {
                        this.inPutBuffer(strPic, -1);
                    }
                    break;
                case 14:
                    {
                        this.inPutBuffer(strPic, 0);
                    }
                    break;
                case 15:
                    {
                        this.inPutBuffer(strPic, 0);
                    }
                    break;
                case 16://显示图片
                    {
                        if (String.IsNullOrEmpty(e.Parameter.ToString()) == false)
                        {
                            //1:1显示
                            String[] arrls = e.Parameter.ToString().Split(new char[] { '|' });
                            index = SRLibFun.StringConvertToInt32(arrls[1]);
                            PicId = SRLibFun.StringConvertToInt32(arrls[2]);
                            inPutBuffer(arrls[0], 0);
                            this.right1.SetBiaoJiStatusByString(this.PicId.ToString());
                        }
                    }
                    break;
                default:
                    break;
            }
        }
コード例 #27
0
 // PlayerAtEdge Event method.
 void PlayerAtEdge(object source, MyEventArgs e)
 {
     Vector3 testPosition = UnityTools.Ceiling(transform.position + (transform.forward * ((chunkLength / 2) - 1)), chunkLength);
 }
コード例 #28
0
 public void InvokeAnEvent(MyEventArgs arg2)
 {
     InvokeExternal(AnEvent, this, arg2);
 }
コード例 #29
0
 void MyEventHandler(Object sender, MyEventArgs e)
 {
     // This will get fired when B's event is raised
 }
 void OnValueChanged(object sender, MyEventArgs ea)
 {
     Console.WriteLine($"OnValueChanged {ea.Value}");
 }
コード例 #31
0
ファイル: Complex.cs プロジェクト: bul-bash/start_.net
 public static void ThrowException(MyEventArgs args)
 {
     throw new Exception("Деление на ноль(");
 }
コード例 #32
0
ファイル: ManagerMap.cs プロジェクト: Bribz/SpeedCodingZelda
 void LoadMap(object sender, MyEventArgs.MapNameEventArgs e)
 {
     _tiles = new Manager.ManagerMap(e.MapName, _managerCamera);
     _tiles.LoadContent();
     _tiles.LoadCollisionTexture();
 }
 private void GridLayoutHelper_Trigger(object sender, MyEventArgs e)
 {
     Debug.WriteLine(string.Join(" | ", e.LayoutChangedTypes));
 }
コード例 #34
0
        void ManagerInput_FireNewInput(object sender, MyEventArgs.NewInputEventArgs e)
        {
            var sprite = GetComponent<Sprite>(ComponentType.Sprite);
            if (sprite == null)
                return;

            var collision = GetComponent<Collision>(ComponentType.Collision);

            var x = 0f;
            var y = 0f;

            var camera = GetComponent<Camera>(ComponentType.Camera);
            if (camera == null)
                return;
            var animation = GetComponent<Animation>(ComponentType.Animation);
            Equipment equipment;
            if (!camera.CameraInTransition())
            {
                switch (e.Input)
                {
                    case Input.Up:
                        y = -1.5f;
                        break;

                    case Input.Down:
                        y = 1.5f;
                        break;

                    case Input.Left:
                        x = -1.5f;
                        break;

                    case Input.Right:
                        x = 1.5f;
                        break;
                    case Input.A:
                        if(animation.CurrentState == State.Walking)
                            animation.StopAnimation();
                        equipment = GetComponent<Equipment>(ComponentType.Equipment);
                        equipment.FireItem(ItemSlot.A);
                        break;
                    case Input.S:
                        if (animation.CurrentState == State.Walking)
                            animation.StopAnimation();
                        //ManagerEvents.AddEvents(new List<IGameEvent> {new GameEventMessage("I just started a new event with my s button")});
                        equipment = GetComponent<Equipment>(ComponentType.Equipment);
                        equipment.FireItem(ItemSlot.B);
                        break;
                    case Input.Start:
                        _managerScreen.LoadNewScreen(
                            new ScreenMainMenu(_managerScreen,
                                GetComponent<Stats>(ComponentType.Stats),
                                GetComponent<Equipment>(ComponentType.Equipment)));
                        break;

                    case Input.Select:
                        camera = GetComponent<Camera>(ComponentType.Camera);
                        if(camera != null)
                            _managerScreen.LoadNewScreen(new ScreenOverworldMap(_managerScreen,_managerPlayer,
                                camera.CameraTilePositon));
                        break;

                    default:
                        return;

                }
            }

            if(collision == null || !collision.CheckCollisionWithTiles(new Rectangle((int) (sprite.Position.X + x), (int) (sprite.Position.Y + y),sprite.Width,sprite.Height)))
                sprite.Move(x, y);

            Vector2 position;
            if(!camera.GetPosition(sprite.Position,out position))
            {
                camera.MoveCamera(animation.CurrentDirection);
                UpdateMap(camera, animation.CurrentDirection);
            }
        }
コード例 #35
0
 void MyEventHandlerMethod(object sender, MyEventArgs e) //okay, event handler
 { }
コード例 #36
0
 private void DoRerflashData(object sender, MyEventArgs e)
 {
     new PA.ViewModel.ViewModel_科目管理().UpdateMainSubjectsFee(DoubleClickSubject);
     TabControl_五大科目_SelectionChanged(null, null);
 }
コード例 #37
0
 public static void OnMyEvent(object o, MyEventArgs msg)
 {
     Console.WriteLine($"I heard {msg.num}");
 }
コード例 #38
0
 static void DeviceRemoved(object source, MyEventArgs e)
 {
     Console.WriteLine("Device Removed at Port : " + e.ComPort);
 }
コード例 #39
0
 void btn_EnterHandler(object sender, MyEventArgs e)
 {
     Console.WriteLine(e.Message);
     Console.WriteLine(e.Sender);
 }
コード例 #40
0
 public static void RaiseEvent(this EventMarshalDel @event, IMyEventActions sender, MyEventArgs e)
 {
     if (@event != null)
     {
         @event(sender, e);
     }
 }
コード例 #41
0
ファイル: Program.cs プロジェクト: karlobrien/HowTo
 private static void MaxReached(object obj, MyEventArgs e)
 {
     Console.WriteLine(e.ToString());
 }
コード例 #42
0
ファイル: MyEventManager.cs プロジェクト: branjsmo1983/unity
 //Metodo per lanciare gli eventi.
 public void CastEvent(MyIndexEvent eventToCast, MyEventArgs e)
 {
     myEvents[(int)eventToCast].Invoke(e);
 }
コード例 #43
0
        void wc_DownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e)
        {
            if (e.Error == null)
            {
                textBlock_addText(e.Result);
                //textBlock1.Text = e.Result;
            }

            // 注册事件,下面的两种方法是一样的
            MyEevent += this.WebService_MyEevent;
            //MyEevent += new MyEventHandler(WebService_MyEevent);

            // something happened
            if (MyEevent != null)
            {
                MyEventArgs arg = new MyEventArgs(36);
                //MyEevent.BeginInvoke(null, null, null, null);
                //compact .Net framework does not support BeginInvoke
                MyEevent(this, arg);
            }
        }
コード例 #44
0
 public virtual void RaiseOnEnter(MyEventArgs e)
 {
     if (EnterHandler != null)
     {
         EnterHandler(this, e);
     }
 }
コード例 #45
0
 private void WorkerOnWorkComplete(object sender, MyEventArgs eventArgs)
 {
     // Do something with result here
 }
コード例 #46
0
ファイル: msgqueue.cs プロジェクト: hjgode/rdmInject
 void onUpdateHandler(MyEventArgs args)
 {
     //anyone listening?
     if (this.updateEvent == null)
         return;
     MyEventArgs a = args;
     this.updateEvent(this, a);
 }
コード例 #47
0
 public void Receive(object sender, MyEventArgs param)
 {
     ++Count;
 }
コード例 #48
0
ファイル: Browser1.cs プロジェクト: tancfeng/YZ_WinForm
 //右边事件
 void right1_OnPageClicked(object sender, MyEventArgs e)
 {
     SROperation2.Instance.CenterLanZhiTemp = "";
     if (SROperation2.Instance.KeywordFilter.Length == 0)//无关键字
     {
         recEntList = null;
     }
     else //有关键字
     {
         //and
         if (SROperation2.Instance.KeywordLogical == "and")
         {
             int count = SROperation2.Instance.KeywordFilter.Split(',').Length;
             recEntList = DataBase.Instance.tSRRC_Resource.Get_EntityCollectionBySQL("select * from SRRC_Resource where id in (SELECT Resource_id  FROM SRRC_Resourcebiaojirel  WHERE Biaoji_id IN (" + SROperation2.Instance.KeywordFilter + ")  GROUP BY Resource_id  HAVING COUNT(*)=" + count + ")");
         }
         //or
         if (SROperation2.Instance.KeywordLogical == "or")
         {
             recEntList = DataBase.Instance.tSRRC_Resource.Get_EntityCollectionBySQL("select * from SRRC_Resource where id in (SELECT Resource_id  FROM SRRC_Resourcebiaojirel  WHERE Biaoji_id IN (" + SROperation2.Instance.KeywordFilter + ")  GROUP BY Resource_id)");
         }
     }
     if (recEntList != null && recEntList.Count > 0)
     {
         foreach (SRRC_ResourceEntity item in recEntList)
         {
             SROperation2.Instance.CenterLanZhiTemp += item.Id + ",";
         }
     }
     SROperation2.Instance.CenterLanZhiTemp = SROperation2.Instance.CenterLanZhiTemp.Trim(',');
     if (SROperation2.Instance.CenterLanZhiTemp == "") SROperation2.Instance.CenterLanZhiTemp = "0";
     this.center2_11.BindData();
 }
コード例 #49
0
ファイル: Program.cs プロジェクト: ElianaArt/2015
 private static void OnNewMail(object sender, MyEventArgs e)
 {
     Console.WriteLine("New mail! : {0}",e.Letter);
 }
コード例 #50
0
        void ManagerInput_FireNewInput(object sender, MyEventArgs.NewInputEventArgs e)
        {
            if (Done || !Active || e.Input != Input.Enter) return;

            //_currentIndex++;

            //Just for now
            Done = true;
            Active = false;
        }
コード例 #51
0
 private void PagerCtrl1_OnNextPageClicked(object sender, MyEventArgs <int> e)
 {
     loadGridData(e.Value1 + 1);
 }
コード例 #52
0
 void managerMouse_MouseClickEventHandler(object sender, MyEventArgs.MouseClickEventArgs e)
 {
     if (_selected)
         _movement.Move(e.XTile, e.YTile);
 }
コード例 #53
0
        void ManagerInput_FireNewInput(object sender, MyEventArgs.NewInputEventArgs e)
        {
            if(e.Input == Input.Select)
                ManagerScreen.GoBackOneScreen();

            switch (e.Input)
            {
                case Input.Left:
                    if (_cursorPosition.X - 1 < 0)
                        return;
                    if (!_managerPlayer.TileExplored((int)_cursorPosition.X - 1, (int)_cursorPosition.Y))
                        return;
                    _cursorPosition = new Vector2(_cursorPosition.X - 1, _cursorPosition.Y);
                    break;
                case Input.Right:
                    if (_cursorPosition.X + 1 > 15)
                        return;
                    if (!_managerPlayer.TileExplored((int)_cursorPosition.X + 1, (int)_cursorPosition.Y))
                        return;
                    _cursorPosition = new Vector2(_cursorPosition.X + 1, _cursorPosition.Y);
                    break;
                case Input.Up:
                    if (_cursorPosition.Y - 1 < 0)
                        return;
                    if (!_managerPlayer.TileExplored((int)_cursorPosition.X, (int)_cursorPosition.Y - 1))
                        return;
                    _cursorPosition = new Vector2(_cursorPosition.X, _cursorPosition.Y - 1);
                    break;
                case Input.Down:
                    if (_cursorPosition.Y + 1 > 15)
                        return;
                    if (!_managerPlayer.TileExplored((int)_cursorPosition.X, (int)_cursorPosition.Y + 1))
                        return;
                    _cursorPosition = new Vector2(_cursorPosition.X, _cursorPosition.Y + 1);
                    break;
            }
        }
コード例 #54
0
ファイル: myevent.cs プロジェクト: EdiCarlos/MyPractices
public static void btnClick(object sender, MyEventArgs e)
{
Console.WriteLine(e.Message);
Console.WriteLine(e.Sender);
}
コード例 #55
0
ファイル: Program.cs プロジェクト: ElianaArt/2015
 public void OnChange(MyEventArgs e)
 {
     EventHandler<MyEventArgs> temp = Interlocked.CompareExchange(ref myEvent, null, null);
     if (temp != null)
         temp(this, e);
 }
コード例 #56
0
 /// <summary>
 /// Quote Dispatcher
 /// </summary>
 /// <param name="e"></param>
 private void QuoteDispatcher(MyEventArgs<Tick> e)
 {
     // 1. strategies
     _feedstrategyquoteservice.FeedStrategies(e.Value);
     // 2. tick archive
     _tickarchiveservice.newTick(e.Value);
     // 3. Views
     _quoteviewupdateservice.UpdateViews(e.Value);
 }
コード例 #57
0
 void Foo_Changed(object sender, MyEventArgs args)     // the Handler
 {
     string s = args.Info;
コード例 #58
0
 void eventMethod(MyEventArgs e)
 {
     e.Value = false;
 }
コード例 #59
0
        void center2_11_OnPageClicked(object sender, MyEventArgs e)
        {
            switch (e.Action)
            {
            case 11:
            {
                index--;
                //if (index < 0)
                //    index = 0;
                if (index >= 0)
                {
                    SRRC_ResourceEntity ent = lvic[index].Tag as SRRC_ResourceEntity;
                    this.PicId = ent.Id;
                    this.inPutBuffer(ent.Serverip + ent.Path, 0);
                    this.center2_11.SetSelectedState(index);
                    this.right1.SetBiaoJiStatusByString(this.PicId.ToString());
                }
                else
                {
                    index = 0;
                    MessageBox.Show("已是第一张");
                }
            }
            break;

            case 12:
            {
                index++;
                if (lvic.Count > index)
                {
                    SRRC_ResourceEntity ent = lvic[index].Tag as SRRC_ResourceEntity;
                    this.PicId = ent.Id;
                    this.inPutBuffer(ent.Serverip + ent.Path, 0);
                    this.center2_11.SetSelectedState(index);
                    this.right1.SetBiaoJiStatusByString(this.PicId.ToString());
                }
                else
                {
                    index = lvic.Count - 1;
                    MessageBox.Show("已是最后一张");
                }
            }
            break;

            case 13:
            {
                this.inPutBuffer(strPic, -1);
            }
            break;

            case 14:
            {
                this.inPutBuffer(strPic, 0);
            }
            break;

            case 15:
            {
                this.inPutBuffer(strPic, 0);
            }
            break;

            case 16:    //显示图片
            {
                if (String.IsNullOrEmpty(e.Parameter.ToString()) == false)
                {
                    //1:1显示
                    String[] arrls = e.Parameter.ToString().Split(new char[] { '|' });
                    index = SRLibFun.StringConvertToInt32(arrls[1]);
                    PicId = SRLibFun.StringConvertToInt32(arrls[2]);
                    inPutBuffer(arrls[0], 0);
                    this.right1.SetBiaoJiStatusByString(this.PicId.ToString());
                }
            }
            break;

            default:
                break;
            }
        }