private void OnEnable() { #if !UNITY_EDITOR try { #endif controller = UIManager.Instance.GetController(UIConfig.SmithyUI); if (controller == null) { return; } Binding.SetBindDataSource(controller.GetDataModel("")); Binding.SetBindDataSource(controller.GetDataModel("EquipPack")); Binding.SetBindDataSource(PlayerDataManager.Instance.PlayerDataModel.Bags.Resources); EventDispatcher.Instance.AddEventListener(UIEvent_SmithyFlyAnim.EVENT_TYPE, BlacksmithFlyAnim); Tip.SetActive(false); #if !UNITY_EDITOR } catch (Exception ex) { Logger.Error(ex.ToString()); } #endif }
internal static IEnumerable <Binding> Bind(object target, IControllerBase source) { var bindings = new List <Binding>(); var bindableProperties = target.GetType().GetProperties().Where(p => p.CustomAttributes.Any(a => a.AttributeType.Name == "BindAttribute")); foreach (var bindableProperty in bindableProperties) { var bindableAttributes = bindableProperty.GetCustomAttributes(typeof(BindAttribute)).Select(m => m as BindAttribute); var property = target.GetNestedPropertyValue(bindableProperty.Name); foreach (var bindableAttribute in bindableAttributes) { var bindingOperation = new BindingOperation { Source = source, Target = property as View, TargetProperty = bindableAttribute.Target, SourceProperty = bindableAttribute.Source, Mode = bindableAttribute.BindingMode }; bindings.Add(BindInternal(bindingOperation, bindableAttribute)); } } return(bindings); }
public void run(IControllerBase ctl) { var main = (HomeController)ctl; user = main.User; brandId = main.BrandID; view.ShowDialog(); }
private void OnEnable() { #if !UNITY_EDITOR try { #endif controller = UIManager.Instance.GetController(UIConfig.ClimbingTowerUI); if (controller == null) { return; } Binding.SetBindDataSource(controller.GetDataModel("")); Binding.SetBindDataSource(PlayerDataManager.Instance.PlayerDataModel.Bags.Resources); EventDispatcher.Instance.AddEventListener(TowerRefreshBoss_Event.EVENT_TYPE, CreateFakeObj); NetManager.Instance.StartCoroutine(AskCheckTowerInfo()); #if !UNITY_EDITOR } catch (Exception ex) { Logger.Error(ex.ToString()); } #endif }
private void OnEnable() { #if !UNITY_EDITOR try { #endif IControllerBase controllerBase = null; controllerBase = UIManager.Instance.GetController(UIConfig.ComposeUI); if (controllerBase == null) { return; } Binding.SetBindDataSource(controllerBase.GetDataModel("")); Binding.SetBindDataSource(PlayerDataManager.Instance.PlayerDataModel.Bags.Resources); Binding.SetBindDataSource(PlayerDataManager.Instance.NoticeData); #if !UNITY_EDITOR } catch (Exception ex) { Logger.Error(ex.ToString()); } #endif }
public void run(IControllerBase ctl) { var main = (HomeController)ctl; user = main.User; reportName = main.ReportName; main.Body.Controls.Clear(); main.Body.Controls.Add(view); if (reportName == "customer_report") { view.dtFromDate.Enabled = false; view.dtEndDate.Enabled = false; view.chkAll.Enabled = false; view.cbBrand.Enabled = false; } else { brandModel = new BrandModel(); view.cbBrand.DataSource = brandModel.getBrands(); view.cbBrand.DisplayMember = "BrandName"; view.cbBrand.ValueMember = "BrandID"; } }
private void OnEnable() { #if !UNITY_EDITOR try { #endif Binding.SetBindDataSource(PlayerDataManager.Instance.PlayerDataModel); controller = UIManager.Instance.GetController(UIConfig.ExchangeUI); if (controller == null) { return; } Binding.SetBindDataSource(controller.GetDataModel("")); EventDispatcher.Instance.DispatchEvent(new ExChangeInit_Event()); #if !UNITY_EDITOR } catch (Exception ex) { Logger.Error(ex.ToString()); } #endif }
internal static IEnumerable <Binding> BindImages(object target, IControllerBase source) { var bindings = new List <Binding>(); var bindableProperties = target.GetType().GetProperties().Where(p => p.CustomAttributes.Any(a => a.AttributeType.Name == "BindImageAttribute")); foreach (var bindableProperty in bindableProperties) { var bindableAttribute = bindableProperty.GetCustomAttribute(typeof(BindImageAttribute)) as BindImageAttribute; if (bindableAttribute == null) { continue; } var binding = source.SetBinding <IControllerBase, ImageView>(bindableAttribute.Source, bindableProperty.GetValue(target)).WhenSourceChanges(() => { var b = (byte[])source.GetType().GetProperty(bindableAttribute.Source).GetValue(source); var iv = ((ImageView)bindableProperty.GetValue(target)); if (b != null && b.Any()) { iv.SetImageBitmap(BitmapFactory.DecodeByteArray(b, 0, b.Length)); iv.Invalidate(); } }); bindings.Add(binding); } return(bindings); }
private void OnEnable() { #if !UNITY_EDITOR try { #endif if (removeBinding) { EventDispatcher.Instance.AddEventListener(CloseUiBindRemove.EVENT_TYPE, OnCloseUI); controller = UIManager.Instance.GetController(UIConfig.ActivityUI); if (controller == null) { return; } dataModel = controller.GetDataModel("") as ActivityDataModel; dataModel.PropertyChanged += OnEventPropertyChanged; Binding.SetBindDataSource(controller.GetDataModel("")); } FakeObjectCreate(dataModel.BossDataId); removeBinding = true; #if !UNITY_EDITOR } catch (Exception ex) { Logger.Error(ex.ToString()); } #endif }
private void OnEnable() { #if !UNITY_EDITOR try { #endif CreateCharacterModel(); controller = UIManager.Instance.GetController(UIConfig.ShiZhuangUI); if (controller == null) { return; } Binding.SetBindDataSource(controller.GetDataModel("")); Binding.SetBindDataSource(PlayerDataManager.Instance.PlayerDataModel); Binding.SetBindDataSource(UIManager.Instance.GetController(UIConfig.WingUI).GetDataModel("")); Binding.SetBindDataSource(UIManager.Instance.GetController(UIConfig.BackPackUI).GetDataModel("")); EventDispatcher.Instance.AddEventListener(MyEquipChangedEvent.EVENT_TYPE, OnSelfEquipChanged); #if !UNITY_EDITOR } catch (Exception ex) { Logger.Error(ex.ToString()); } #endif }
private List <String> fields; // arraylist for storing entity fields public BaseViewForm(IControllerBase controller) // constructor as parameter { InitializeComponent(); controllerBase = controller; mainEntity = controller.getEntity(); fields = getFields(); }
private void OnEnable() { #if !UNITY_EDITOR try { #endif controller = UIManager.Instance.GetController(UIConfig.MountUI); if (controller == null) { return; } Binding.SetBindDataSource(controller.GetDataModel("")); Binding.SetBindDataSource(PlayerDataManager.Instance.NoticeData); EventDispatcher.Instance.AddEventListener(MountRefreshModel_Event.EVENT_TYPE, CreateFakeObj); EventDispatcher.Instance.AddEventListener(MountEffect_Event.EVENT_TYPE, OnEffectEvent); EventDispatcher.Instance.DispatchEvent(new OnMountAction_Event(10)); #if !UNITY_EDITOR } catch (Exception ex) { Logger.Error(ex.ToString()); } #endif }
public IKZMessage CreateMessage(IControllerBase controller, IModelBase model) { return new KZMessage { Controller = controller, Model = model }; }
private void OnEnable() { #if !UNITY_EDITOR try { #endif if (!EventDispatcher.Instance.HasEventListener(MainUiCharRadar.EVENT_TYPE, OnMainUiCharRadar)) { EventDispatcher.Instance.AddEventListener(MainUiCharRadar.EVENT_TYPE, OnMainUiCharRadar); } FightReady.gameObject.SetActive(false); PkBg.SetActive(false); var myPlayer = ObjManager.Instance.MyPlayer; if (null != myPlayer) { if (myPlayer.IsInSafeArea()) { showSKill = false; } else { showSKill = true; } ChangeState(showSKill); } SkillMove.gameObject.SetActive(false); learnSkillID = -1; isEnable = true; if (countdownTime > Game.Instance.ServerTime) { if (countdownCoroutine != null) { StopCoroutine(countdownCoroutine); } if (displayCountdownTimer) { countdownCoroutine = StartCoroutine(ShowCountDown()); } } currentBlockTime = 0; IControllerBase monsterController = UIManager.Instance.GetController(UIConfig.MonsterSiegeUI); EventDispatcher.Instance.DispatchEvent(new ShowComposFlag_Event()); #if !UNITY_EDITOR } catch (Exception ex) { Logger.Error(ex.ToString()); } #endif }
internal void SetController(IControllerBase controller) { var newController = controller as ScrabbleController; if (newController != null) { this.scrabbleController = newController; } }
private void OnEnable() { mController = UIManager.Instance.GetController(UIConfig.GXRankingUI); if (mController == null) { return; } Binding.SetBindDataSource(mController.GetDataModel("")); }
public void OnShow() { if (BackPack == null) { BackPack = UIManager.Instance.GetController(UIConfig.BackPackUI); } BackPack.CallFromOtherClass("SetPackType", new object[] { BackPackController.BackPackType.Chest }); }
private void OnEnable() { #if !UNITY_EDITOR try { #endif //EventDispatcher.Instance.AddEventListener(MieShiDisappearModelRoot_Event.EVENT_TYPE, DisappearModelRoot); EventDispatcher.Instance.AddEventListener(MieShiRefreshTowers_Event.EVENT_TYPE, RefreshTowers); EventDispatcher.Instance.AddEventListener(MieShiUiToggle_Event.EVENT_TYPE, UIToggleClick); EventDispatcher.Instance.AddEventListener(MieShiRefreshBoss_Event.EVENT_TYPE, CreateFakeObj); if (mRemoveBind) { EventDispatcher.Instance.AddEventListener(CloseUiBindRemove.EVENT_TYPE, OnCloseUiBindRemove); mController = UIManager.Instance.GetController(UIConfig.MonsterSiegeUI); if (mController == null) { return; } MonsterModel = mController.GetDataModel("") as MonsterDataModel; MonsterModel.PropertyChanged += OnMonsterPropertyChangedEvent; Binding.SetBindDataSource(MonsterModel); Binding.SetBindDataSource(PlayerDataManager.Instance.PlayerDataModel); } mRemoveBind = true; var main = UIManager.Instance.MainUIFrame.GetComponent <MainScreenFrame>(); RefreshBtnState(); //报名时间 // MonsterDataModel ad = DataModel.CurMonsterFuben.activity; if (MonsterModel != null) { DateTime time = MonsterModel.ActivityTime; if (time != null) { DateTime tm = time.AddMinutes(-(double)(Table.GetMieShiPublic(1).CanApplyTime)); DateTime tm2 = time; BaoMingTime.text = string.Format("{0}--{1}", string.Format("{0:yyyy/MM/dd HH:mm}", tm), string.Format("{0:yyyy/MM/dd HH:mm}", tm2));// tm + "--" + tm2; } } int FubenId = MonsterModel.MonsterFubens[0].Fuben.FubenId; #if !UNITY_EDITOR } catch (Exception ex) { Logger.Error(ex.ToString()); } #endif }
public void ActivateBookGroup(int groupId) { PlayerDataManager.Instance.SetBookGroupEnable(groupId); IControllerBase mController = UIManager.Instance.GetController(UIConfig.HandBook); if (mController == null) { return; } }
public void NotifyMieShiActivityState(int activityId, int state) { IControllerBase mController = UIManager.Instance.GetController(UIConfig.MonsterSiegeUI); if (mController == null) { return; } ClientDataModel.MonsterDataModel DataModel = mController.GetDataModel("") as ClientDataModel.MonsterDataModel; DataModel.ActivityState = state; }
public ControllerMetaData(Type controllerType, string friendlyName, bool isObsolete, string category, string routePrefix, IControllerBase instance) { ControllerType = controllerType; FriendlyName = friendlyName; IsObsolete = isObsolete; Category = category; RoutePrefix = routePrefix; Instance = instance; ReadInstance = instance as IReadControllerBase; CrudInstance = instance as ICrudControllerBase; }
//装备 private void OnBtnEquipEvent(IEvent ievent) { var _e = ievent as UIEvent_HintEquipEvent; var _index = _e.Index; var _data = m_DataModel.Entrys[_index]; var _bagItem = _data.BagItemData; IControllerBase control = UIManager.Instance.GetController(UIConfig.EquipComPareUI); control.CallFromOtherClass("ReplaceEquip", new[] { _bagItem }); }
public void run(IControllerBase ctl) { var main = (HomeController)ctl; user = main.User; company = main.Company; view.txtCompanyName.Text = company.Name; view.txtDescription.Text = company.Desciption; vcommon.ShowDialog(); }
private void OnEnable() { Binding.SetBindDataSource(PlayerDataManager.Instance.PlayerDataModel); controller = UIManager.Instance.GetController(UIConfig.ExchangeUI); if (controller == null) { return; } Binding.SetBindDataSource(controller.GetDataModel("")); EventDispatcher.Instance.DispatchEvent(new ExChangeInit_Event()); }
public void NotifyMieShiActivityState(int activityId, int state) { EventDispatcher.Instance.DispatchEvent(new ApplyMishiPortrait_Event()); IControllerBase mController = UIManager.Instance.GetController(UIConfig.MonsterSiegeUI); if (mController == null) { return; } ClientDataModel.MonsterDataModel DataModel = mController.GetDataModel("") as ClientDataModel.MonsterDataModel; DataModel.ActivityState = state; }
internal static void BindCommands(object target, IControllerBase source) { var bindableProperties = target.GetType().GetProperties().Where(p => p.CustomAttributes.Any(a => a.AttributeType.Name == "BindCommandAttribute")); foreach (var bindableProperty in bindableProperties) { var bindableAttribute = bindableProperty.GetCustomAttribute(typeof(BindCommandAttribute)) as BindCommandAttribute; if (bindableAttribute != null) { bindableProperty.GetValue(target).SetCommand(bindableAttribute.Target, (ICommand)source.GetType().GetProperty(bindableAttribute.Source).GetValue(source)); } } }
public void UpdateWarFlagName(string name) { if (null == name) { name = string.Empty; } IControllerBase contrl = UIManager.GetInstance().GetController(UIConfig.FieldMineUI); if (contrl != null) { contrl.CallFromOtherClass("UpdateLodeAllianceName", new[] { (object)name }); } }
public AcquirePoint(int id, string name, string title, IControllerBase controllerBase, short channelNo, string channelNoAlias, AcquirePointUnitTypeConst unitType, AcquirePointDataTypeConst dataType) { Id = id; Name = name; Title = title; ControllerObject = controllerBase; ChannelNo = channelNo; ChannelNoAlias = channelNoAlias; UnitType = unitType; DataType = dataType; AV = new AcquireValue(id); }
public void Init() { IControllerBase mController = UIManager.Instance.GetController(UIConfig.MonsterSiegeUI); MonsterDataModel MonsterModel = mController.GetDataModel("MonsterModel") as MonsterDataModel; lIcons.Clear(); float wight = mLineSprite.localSize.x; Table.ForeachMieshiTowerReward(tb => { var temp = NGUITools.AddChild(objReward, mItem.gameObject); if (tb.ShowValue.Count == 2) { temp.transform.localPosition = new Vector3(tb.ShowValue[1] / 100.0f * wight, temp.transform.localPosition.y, temp.transform.localPosition.z); temp.SetActive(true); var trigger = temp.GetComponentInChildren <UIEventTrigger>(); trigger.onPress.Add(new EventDelegate( () => { OpenTips(tb.Id); })); trigger.onRelease.Add(new EventDelegate(CloseTips)); var tbItem = Table.GetItemBase(tb.StepReward); var cell = temp.GetComponent <TowerUpRewardCell>(); if (cell != null) { if (MonsterModel != null) { bool bLingqu = (MonsterModel.RewardFlag & (1 << tb.Id)) > 0; cell.SetLingqu(bLingqu); cell.SetEffect((!bLingqu) && MonsterModel.MyUpTimes >= tb.TimesStep[0]); if (tbItem != null) { cell.SetIcon(tbItem); } } } lIcons.Add(temp.GetComponent <TowerUpRewardCell>()); } return(true); }); }
public void CleanUp() { if (RecycleData != null) { RecycleData.ColorSelect.PropertyChanged -= OnSwitchExchange; } BackPack = UIManager.Instance.GetController(UIConfig.BackPackUI); RecycleData = new RecycleDataModal(); RecycleData.ColorSelect.PropertyChanged += OnSwitchExchange; }
static int GetController(IntPtr L) { try { ToLua.CheckArgsCount(L, 2); UIManager obj = (UIManager)ToLua.CheckObject(L, 1, typeof(UIManager)); UIConfig arg0 = (UIConfig)ToLua.CheckObject(L, 2, typeof(UIConfig)); IControllerBase o = obj.GetController(arg0); ToLua.PushObject(L, o); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static int RegisterUI(IntPtr L) { try { ToLua.CheckArgsCount(L, 3); UIManager obj = (UIManager)ToLua.CheckObject(L, 1, typeof(UIManager)); UIConfig arg0 = (UIConfig)ToLua.CheckObject(L, 2, typeof(UIConfig)); IControllerBase arg1 = (IControllerBase)ToLua.CheckObject(L, 3, typeof(IControllerBase)); obj.RegisterUI(arg0, arg1); return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
public AcquireRawValue(int id, IControllerBase controller, string controllerChannelAlias, double value) { _Id = id; _ControllerId = controller.ControllerId; _ControllerChannelNo = 0; if (controller.ControllerType.IsPLCController()) { _PLCAddr = new FxAddress(controllerChannelAlias, controller.ControllerType); } else { _PLCAddr = null; } Value = new ValueStruct(value); }
public void run(IControllerBase ctl) { var main = (HomeController)ctl; user = main.User; brandId = main.BrandID; main.Body.Controls.Clear(); main.Body.Controls.Add(view); bindingPartList(); //Binding Control Data view.txtLocG.DataBindings.Add("Text", view.bsPartList, "LocG"); view.txtLocIM.DataBindings.Add("Text", view.bsPartList, "LocIM"); view.txtComment.DataBindings.Add("Text", view.bsPartList, "Comment"); view.txtLocG.Leave += new EventHandler(txtLocG_Leave); view.txtLocIM.Leave += new EventHandler(txtLocIM_Leave); view.txtComment.Leave += new EventHandler(txtComment_Leave); }
private void OnEnable() { #if !UNITY_EDITOR try { #endif mController = UIManager.Instance.GetController(UIConfig.ClimbingTowerRewardUI); if (mController == null) { return; } Binding.SetBindDataSource(mController.GetDataModel("")); #if !UNITY_EDITOR } catch (Exception ex) { Logger.Error(ex.ToString()); } #endif }
public void run(IControllerBase ctl) { var main = (HomeController)ctl; user = main.User; vcommon.ShowDialog(); }
public void run(IControllerBase ctl) { view.ShowDialog(); }
public void run(IControllerBase ctl) { var login = (LoginController)ctl; user = login.User; view.toolStripStatusLabel1.Text = "User: "******" " + user.LastName; //admin only manage user enable_menu_admin(user.RoleAdmin == 1); //company CompanyModel companyModel = new CompanyModel(); company = companyModel.getCompany(); view.Text = company.Name + " - Version 1.2.1"; view.Show(); }