static void Main(string[] args) { // ShowTypeInfo showText = ShowStudentInfoText; // ShowTypeInfo showHTML = ShowStudentInfoHTML; //Action<kiểu_tham_số_1, kiểu_tham_số_2, ... > var_delegate; // Action<Student> action = (Student student) => // { // Console.WriteLine($"{student.ID}-{student.Name}"); // }; //Func<kiểu_tham_số_1, kiểu_tham_số_2, ..., kiểu_trả_về> var_delegate; Student student = new Student(1, "hung"); ShowTypeInfo showText = new ShowTypeInfo(ShowStudentInfoText); ShowTypeInfo showHTML = new ShowTypeInfo(ShowStudentInfoHTML); ShowTypeInfo sum = showText + showHTML; student.GetStudentInfo(sum); }
/// <summary> /// ����ָ���ĺ�����Ϣ������ /// </summary> /// <param name="ct">Ҫ���ĵĺ�����Ϣ������</param> /// <returns>����,���ڻ����0��ɹ�,�����ʧ��</returns> public int Update(ShowTypeInfo sht) { if (object.Equals(null, sht)) return -2; return DAL.Update(sht); }
/// <summary> /// ���һ���µĺ�����Ϣ������ /// </summary> /// <param name="ct">Ҫ��ӵĺ�����Ϣ������</param> /// <returns>����,���ڻ����0��ɹ�,�����ʧ��,-1��������ͬ���</returns> public int Insert(ShowTypeInfo sht) { if (object.Equals(null, sht)) return -2; return DAL.Insert(sht); }
protected override void OnOpen() { //临时关闭图鉴入口2019.1.8 TZJ GetComponent <Transform>("main/top_left/icons/collection").gameObject.SetActive(false); level = Level.current as Level_Home; m_rankActiveRoot = GetComponent <Transform>("fight/rank/bg"); m_rankCountDown = GetComponent <Text>("fight/rank/bg/Text"); m_rankOpenTime = GetComponent <Text>("fight/rank/decription_text"); m_btnWelfare = GetComponent <Button>("main/top_left/icons/welfare"); m_homeIcons[1] = MarkableIcon.Create(1, m_btnWelfare, () => { CanEnterWelfre(); }); m_btnNotice = GetComponent <Button>("main/top_left/icons/announce"); m_homeIcons[3] = MarkableIcon.Create(3, m_btnNotice, ShowWindow <Window_Announcement>); m_btnQuest = GetComponent <Button>("main/top_left/icons/mission"); m_homeIcons[4] = MarkableIcon.Create(4, m_btnQuest, () => { moduleActive.ActiveClick = 0; ShowWindow <Window_Active>(); }); m_btnNote = GetComponent <Button>("main/top_left/icons/note"); m_homeIcons[34] = MarkableIcon.Create(34, m_btnNote, ShowWindow <Window_DatingSelectNpc>); m_btnChat = GetComponent <Button>("main/bottom_left/chat"); m_homeIcons[7] = MarkableIcon.Create(7, m_btnChat, () => { moduleChat.opChatType = OpenWhichChat.WorldChat; ShowWindow <Window_Chat>(); }); m_btnCollection = GetComponent <Button>("main/top_left/icons/collection"); m_homeIcons[33] = MarkableIcon.Create(33, m_btnCollection, ShowWindow <Window_Collection>); m_btnPet = GetComponent <Button>("main/bottom_right/icons/sprite"); m_homeIcons[25] = MarkableIcon.Create(25, m_btnPet, ShowWindow <Window_Sprite>); m_btnRole = GetComponent <Button>("main/bottom_right/icons/attribute"); m_homeIcons[8] = MarkableIcon.Create(8, m_btnRole, ShowWindow <Window_Attribute>); m_btnSkill = GetComponent <Button>("main/bottom_right/icons/skill"); m_homeIcons[27] = MarkableIcon.Create(27, m_btnSkill, ShowWindow <Window_Skill>); m_btnEquipment = GetComponent <Button>("main/bottom_right/icons/bag"); m_homeIcons[9] = MarkableIcon.Create(9, m_btnEquipment, () => { Module_Equip.selectEquipType = EnumSubEquipWindowType.MainPanel; ShowWindow <Window_Equip>(); }); m_btnRune = GetComponent <Button>("main/bottom_right/icons/rune"); m_homeIcons[10] = MarkableIcon.Create(10, m_btnRune, ShowWindow <Window_RuneStart>); m_btnBag = GetComponent <Button>("main/bottom_right/icons/closet"); m_homeIcons[11] = MarkableIcon.Create(11, m_btnBag, () => { moduleCangku.chickType = WareType.Prop; ShowWindow <Window_Cangku>(); }); m_awake = GetComponent <Button>("main/bottom_right/icons/awake"); m_homeIcons[28] = MarkableIcon.Create(28, m_awake, ShowWindow <Window_Awakeinit>); m_btnTakePhoto = GetComponent <Button>("main/bottom_right/shot/go"); m_btnTakePhoto.onClick.AddListener(TakePhoto); m_btnHideBottom = GetComponent <Toggle>("main/bottom_right/home"); m_btnHideBottom.onValueChanged.AddListener(YouAreBeautyBaby); m_btnShop = GetComponent <Button>("main/middle_right/street"); m_homeIcons[12] = MarkableIcon.Create(12, m_btnShop, () => { SwitchTo(CommStreet); }); m_btnDungeon = GetComponent <Button>("main/middle_right/dungeons_btn"); m_homeIcons[13] = MarkableIcon.Create(13, m_btnDungeon, () => { SwitchTo(Dungeon); }); m_btnFight = GetComponent <Button>("main/middle_right/battle"); m_homeIcons[14] = MarkableIcon.Create(14, m_btnFight, () => { SwitchTo(Fight); }); m_btnAttack = GetComponent <Button>("main/middle_right/attack"); m_homeIcons[15] = MarkableIcon.Create(15, m_btnAttack, ShowWindow <Window_Chase>); m_btnUnion = GetComponent <Button>("main/middle_right/union"); m_homeIcons[29] = MarkableIcon.Create(29, m_btnUnion, ShowWindow <Window_Union>); m_btnStreet = GetComponent <Button>("main/middle_right/npcStreet"); m_homeIcons[31] = MarkableIcon.Create(31, m_btnStreet, OnClickDatingStreet); m_train = GetComponent <Button>("fight/train"); m_homeIcons[16] = MarkableIcon.Create(16, m_train, () => { Game.LoadLevel(GeneralConfigInfo.sTrainLevel); }); m_pvp = GetComponent <Button>("fight/match"); m_homeIcons[17] = MarkableIcon.Create(17, m_pvp, () => { modulePVP.Enter(OpenWhichPvP.FreePvP); }); m_match = GetComponent <Button>("fight/rank"); m_homeIcons[18] = MarkableIcon.Create(18, m_match, () => { modulePVP.Enter(OpenWhichPvP.LolPvP); }); m_labyrinth = GetComponent <Button>("dungeons/labyrinth"); m_homeIcons[19] = MarkableIcon.Create(19, m_labyrinth, () => { moduleLabyrinth.SendLabyrinthEnter(); }); m_bordlands = GetComponent <Button>("dungeons/bordlands"); m_homeIcons[20] = MarkableIcon.Create(20, m_bordlands, () => { moduleBordlands.Enter(); }); m_forge = GetComponent <Button>("commercialstreet/forge"); m_homeIcons[21] = MarkableIcon.Create(21, m_forge, () => { moduleForging.ClickType = EquipType.Weapon; ShowWindow <Window_Forging>(); }); m_fashionShop = GetComponent <Button>("commercialstreet/shizhuangdian"); m_homeIcons[22] = MarkableIcon.Create(22, m_fashionShop, ShowWindow <Window_Shizhuangdian>); m_drifterShop = GetComponent <Button>("commercialstreet/liulangshangdian"); m_homeIcons[23] = MarkableIcon.Create(23, m_drifterShop, ShowWindow <Window_Liulangshangdian>); m_wishingWell = GetComponent <Button>("commercialstreet/wish"); m_homeIcons[24] = MarkableIcon.Create(24, m_wishingWell, ShowWindow <Window_Wish>); m_petSummon = GetComponent <Button>("commercialstreet/summon"); m_homeIcons[26] = MarkableIcon.Create(26, m_petSummon, ShowWindow <Window_Summon>); m_factionBattle = GetComponent <Button>("fight/faction"); m_homeIcons[35] = MarkableIcon.Create(35, m_factionBattle, () => { if (moduleFactionBattle.state >= Module_FactionBattle.State.Processing) { ShowWindow <Window_FactionBattle>(); } else { ShowWindow <Window_FactionSign>(); } }); m_pettip = GetComponent <RectTransform>("tips").gameObject; m_canenter = GetComponent <Button>("dungeons/sprite/highlight"); m_canopen = GetComponent <Button>("dungeons/sprite/progress"); m_waite = GetComponent <Button>("dungeons/sprite/countdown"); m_progressvalue = GetComponent <Image>("dungeons/sprite/progress/progressframe_01/progressframe_02"); m_waitprogress = GetComponent <RectTransform>("dungeons/sprite/countdown/countdownframe_img_01").gameObject; m_mazeReadyImg = GetComponent <Image>("dungeons/labyrinth/icon/ready"); m_mazeChallengeImg = GetComponent <Image>("dungeons/labyrinth/icon/chanllenge"); m_mazeRestImg = GetComponent <Image>("dungeons/labyrinth/icon/rest"); m_mazeSettlementImg = GetComponent <Image>("dungeons/labyrinth/icon/settlement"); m_labyrinthCountDown = GetComponent <Text>("dungeons/labyrinth/stateSign_Txt"); #region faction m_factionTint = GetComponent <Transform>("main/middle_right/battle/faction_battle"); m_rankTint = GetComponent <Transform>("main/middle_right/battle/rank_battle"); m_factionLock = GetComponent <Transform>("fight/faction/lock"); m_stateTintRoot = GetComponent <Transform>("fight/faction/bg"); m_stateTint = GetComponent <Text>("fight/faction/bg/Text (1)"); m_factionActiveTime = GetComponent <Text>("fight/faction/bg/Text"); m_factionOpenTime = GetComponent <Text>("fight/faction/Text"); #endregion m_canenter.onClick.AddListener(SetTip); m_waite.onClick.AddListener(() => { moduleGlobal.ShowMessage(ConfigText.GetDefalutString(239, 6)); }); m_canopen.onClick.AddListener(SetTip); m_unionBossBtn = GetComponent <Button>("main/middle_right/union/mark"); m_unionBossBtn.onClick.RemoveAllListeners(); m_unionBossBtn.onClick.AddListener(delegate { moduleUnion.OpenBossWindow = true; ShowWindow <Window_Union>(); }); m_showTypes[0] = new ShowTypeInfo() { o = transform.Find("main").gameObject, handler = UpdateMain }; m_showTypes[1] = new ShowTypeInfo() { o = transform.Find("fight").gameObject, handler = UpdateFight }; m_showTypes[2] = new ShowTypeInfo() { o = transform.Find("dungeons").gameObject, handler = UpdateDungeon }; m_showTypes[3] = new ShowTypeInfo() { o = transform.Find("commercialstreet").gameObject, handler = UpdateCommStreet }; m_showPetToggle = GetComponent <Toggle>("main/bottom_right/showsprite"); m_showPetToggle.isOn = true; m_showPetToggle.onValueChanged.AddListener(b => ToggleShowPet(b, true)); m_combatValue = GetComponent <Text>("main/top_left/icons/combatEffectiveness/value"); m_tweenTLIcons = GetComponent <TweenPosition>("main/top_left/icons"); m_tfEffectNode = GetComponent <RectTransform>("effectnode"); m_tweenDatingNpc = GetComponent <TweenAlpha>("main/content"); m_datingNpcMono = GetComponent <NpcMono>("main/content/npcInfo"); m_banPrefab = GetComponent <RectTransform>("main/banner/templte"); m_banPlane = GetComponent <RectTransform>("main/banner/banScroll"); m_pagePrefab = GetComponent <RectTransform>("main/banner/pageTog"); m_pagePlane = GetComponent <ToggleGroup>("main/banner/pageScroll"); GetChildenObj(); m_tgSwitchDating = GetComponent <Toggle>("main/top_left/lanternTop"); m_tgSwitchDating.isOn = moduleHome.showDatingModel; m_tgSwitchDating.onValueChanged.AddListener(b => SwitchDatingModel(b)); InitializeIcons(); InitializeUnlockText(); MultiLangrage(); }
/// <summary> /// ��ȡָ����ŵĺ��������� /// </summary> /// <param name="ctid">Ҫ��ȡ�ĺ���������ı��</param> /// <returns>�ñ���µĺ���������</returns> public ShowTypeInfo GetItem(Int64 shtid) { ShowTypeInfo info = null; SqlParameter[] param = new SqlParameter[] { new SqlParameter("@strWhere"," where SHT_ID ="+shtid.ToString()), new SqlParameter("@strTableName","i_ShowType"), new SqlParameter("@strOrder","") }; using (SqlDataReader dr = XYECOM.Core.Data.SqlHelper.ExecuteReader(CommandType.StoredProcedure, "XYP_SelectByWhere", param)) { if (dr.Read()) info = new ShowTypeInfo( Convert.ToInt64(dr["SHT_ID"]), dr["SHT_Name"].ToString(), Convert.ToInt64(dr["SHT_ParentID"]), dr["FullId"].ToString(), Core.MyConvert.GetInt32(dr["InfoCount"].ToString()) ); } return info; }
/// <summary> /// ����ָ���ĺ�����Ϣ������ /// </summary> /// <param name="ct">Ҫ���ĵĺ�����Ϣ������</param> /// <returns>����,���ڻ����0��ɹ�,�����ʧ��</returns> public int Update(ShowTypeInfo info) { string fullId = Core.Utils.AppendComma(GetFullID(info.SHT_ParentID)); SqlParameter[] param = new SqlParameter[] { new SqlParameter("@SHT_ID",info.SHT_ID), new SqlParameter("@SHT_Name",info.SHT_Name), new SqlParameter("@SHT_ParentID",info.SHT_ParentID), new SqlParameter("@FullId",fullId), }; return XYECOM.Core.Data.SqlHelper.ExecuteNonQuery(CommandType.StoredProcedure, "XYP_UpdateShowType", param); }
public void GetStudentInfo(ShowTypeInfo showTypeInfo) { Console.WriteLine("Get student info"); showTypeInfo(this); }