protected virtual void OnRemovedFromPool(ISupportElement arg0) { if (onRemoveFromPool != null && SupportType(arg0.GetType())) { onRemoveFromPool.Invoke(arg0); } }
protected void OnAddedToPool(ISupportElement arg0) { if (statu == ExecuteStatu.Executing) { TryComplete(); } }
public void RemoveElement(ISupportElement item) { if (elementList.Contains(item)) { elementList.Remove(item); } }
/// <summary> /// 试图解除绑定 /// </summary> /// <param name="arg0"></param> protected override void OnRemoveElement(ISupportElement arg0) { if (ropeItem) { ropeItem.BindingTarget = null; ropeItem = null; } }
/// <summary> /// 移除可点击元素 /// </summary> /// <param name="arg0"></param> protected void OnRemoveElement(ISupportElement arg0) { if (arg0 is ActionItem) { var element = arg0 as ActionItem; elementPool.ScureRemove(element); } }
protected override void OnAddedToPool(ISupportElement arg0) { base.OnAddedToPool(arg0); if (SupportType(arg0.GetType())) { RegistComplete(arg0); } }
/// <summary> /// 元素解锁 /// </summary> /// <param name="item"></param> public bool UnLockElement(ISupportElement item, object lk) { if (lockDic.ContainsKey(item) && lockDic[item].Contains(lk)) { lockDic[item].Remove(lk); return(true); } return(false); }
protected override void OnRemovedFromPool(ISupportElement arg0) { base.OnRemovedFromPool(arg0); if (!SupportType(arg0.GetType())) { return; } RemoveComplete(arg0 as ActionItem); }
private void Awake() { supportElement = GetComponent <ISupportElement>(); if (supportElement == null) { Debug.LogError("have no supportElement!"); Destroy(this); } }
/// <summary> /// 注册可点击元素 /// </summary> /// <param name="arg0"></param> protected void OnRegistElement(ISupportElement arg0) { if (SupportType(arg0.GetType()) && itemList.Contains(arg0.Name)) { if (!elementPool.Contains(arg0)) { elementPool.ScureAdd(arg0); } } }
/// <summary> /// 移除可点击元素 /// </summary> /// <param name="arg0"></param> protected void OnRemoveElement(ISupportElement arg0) { if (arg0 is T && itemList.Contains(arg0.Name)) { if (elementPool.Contains((T)arg0)) { elementPool.ScureRemove((T)arg0); } } }
public override void RowSelected(UITableView tableView, NSIndexPath indexPath) { //base.RowSelected(tableView, indexPath); ISupportElement selectditm = Data[indexPath.Row]; tableView.DeselectRow(indexPath, true); if (OnRowSelected != null) { OnRowSelected(this, new RowSelectedEventArgs(tableView, indexPath)); } }
/// <summary> /// 外部添加Element /// </summary> public void RegistElement(ISupportElement item) { if (!elementList.Contains(item)) { elementList.Add(item); } else { Debug.LogError("不要重复注册:" + item); } }
protected override void OnRemoveElement(ISupportElement arg0) { if (arg0.IsRuntimeCreated) { var old = hoders.Find(x => x.elementName == arg0.Name); if (old != null) { supportPool.ScureRemove(arg0); } } }
protected void OnRegistElement(ISupportElement arg0) { if (arg0.GetType() == type && arg0 is ActionItem && arg0.Name == elementName) { var element = arg0 as ActionItem; if (!elementPool.Contains(element)) { elementPool.ScureAdd(element); } } }
/// <summary> /// 注销 /// </summary> /// <param name="arg0"></param> protected override void OnRemoveElement(ISupportElement arg0) { if (arg0.IsRuntimeCreated && arg0 is LinkItem) { var linkItem = arg0 as LinkItem; if (linkPool.Contains(linkItem)) { linkPool.ScureRemove(linkItem); } } }
private ISupportElement CreateElement(ISupportElement prefab, Transform parent) { var instence = UnityEngine.Object.Instantiate(prefab.Body); instence.transform.SetParent(parent); instence.gameObject.SetActive(true); var element = instence.GetComponent <ISupportElement>(); element.IsRuntimeCreated = true; return(element); }
/// <summary> /// 注册结束事件(仅元素在本步骤开始后创建时执行注册) /// </summary> /// <param name="arg0"></param> protected void RegistComplete(ISupportElement arg0) { if (target.Statu == ExecuteStatu.Executing) { if (arg0 is ActionItem) { // 注册元素结束事件 var feature = (arg0 as ActionItem).RetriveFeature <CompleteAbleItemFeature>(); feature.RegistOnCompleteSafety(target, TryComplete); } } }
/// <summary> /// 试图绑定绳子 /// </summary> /// <param name="arg0"></param> protected void OnRegistElement(ISupportElement arg0) { if (ropeElement == null && arg0 is RopeElement) { var element = arg0 as RopeElement; if (Actived && element.OperateAble) { element.SetActive(this); element.RegistOnPlace(TryPlaceRope); } } }
/// <summary> /// 试图绑定绳子 /// </summary> /// <param name="arg0"></param> protected override void OnRegistElement(ISupportElement arg0) { if (ropeItem == null && arg0 is RopeItem) { ropeItem = arg0 as RopeItem; if (Started && ropeItem.BindingTarget == null) { ropeItem.StepActive(); ropeItem.BindingTarget = this; } } }
/// <summary> /// 移除Eelement /// </summary> /// <param name="item"></param> public void RemoveElement(ISupportElement item) { if (elementList.Contains(item)) { elementList.ScureRemove(item); if (onRemoveElememt != null) { onRemoveElememt.Invoke(item); } } }
/// <summary> /// 尝试销毁一个元素 /// </summary> /// <param name="item"></param> public bool TryDestroyElement(ISupportElement item) { if (!IsLocked(item)) { RemoveElement(item); if (item.Body != null) { UnityEngine.Object.DestroyImmediate(item.Body); } return(true); } return(false); }
/// <summary> /// 注销 /// </summary> /// <param name="arg0"></param> protected override void OnRemoveElement(ISupportElement arg0) { if (arg0.IsRuntimeCreated && arg0 is PlaceElement) { if (arg0.Name == Name) { var placeItem = arg0 as PlaceElement; if (elementPool.Contains(placeItem)) { elementPool.ScureRemove(placeItem); } } } }
/// <summary> /// 元素动态注册 /// </summary> /// <param name="arg0"></param> protected override void OnRegistElement(ISupportElement arg0) { if (arg0.IsRuntimeCreated) { if (hoders.Find(x => x.elementName == arg0.Name) != null) { supportPool.ScureAdd(arg0); if (Started && !Completed) { arg0.StepActive(); TryComplete(); } } } }
/// <summary> /// 元素加锁 /// </summary> /// <param name="item"></param> public void LockElement(ISupportElement item, object lk) { if (lockDic.ContainsKey(item)) { if (!lockDic[item].Contains(lk)) { lockDic[item].Add(lk); } } else { lockDic[item] = new List <object>() { lk }; } }
/// <summary> /// 注册 /// </summary> /// <param name="arg0"></param> protected override void OnRegistElement(ISupportElement arg0) { if (arg0 is PlaceElement) { if (arg0.Name == Name) { var placeItem = arg0 as PlaceElement; if (!elementPool.Contains(placeItem)) { elementPool.ScureAdd(placeItem); if (Started && !Completed) { placeItem.StepActive(); } } } } }
/// <summary> /// 注册 /// </summary> /// <param name="arg0"></param> protected override void OnRegistElement(ISupportElement arg0) { if (arg0 is LinkItem) { if (linkItems.Contains(arg0.Name)) { var linkItem = arg0 as LinkItem; if (!linkPool.Contains(linkItem)) { linkPool.ScureAdd(linkItem); if (Started) { linkItem.StepActive(); } } } } }
protected virtual void OnAddedToPool(ISupportElement arg0) { if (arg0 is IActiveAble) { var activeAble = arg0 as IActiveAble; if (target.Statu == ExecuteStatu.Executing && !activeAble.Actived && activeAble.OperateAble) { if (autoActive) { ActiveElement(activeAble); } } } if (onAddToPool != null) { onAddToPool.Invoke(arg0); } }
async Task DoLoadData() { ModernHttpClient.NativeMessageHandler m = new ModernHttpClient.NativeMessageHandler(); Newtonsoft.Json.JsonSerializer serializer = new Newtonsoft.Json.JsonSerializer(); JsonClient client = new JsonClient(serializer); var response = await client.GetAsync <IEnumerable <ActivityListDTO> >(TimeCapServices.ActivityMaster, new Dictionary <string, string>() { { "projectNumber", lblprojectnum.Text }, { "transformedActivityNumber", lbltransfrmactnum.Text } }); var tablesource = new ElementTableSource(); var data = new List <ISupportElement>(); foreach (var item in response.Value) { data.Add(new ElementSearch() { TransformedActivityElementNumber = item.TransformedActivityElementNumber, ActivityElementDescription = item.ActivityElementDescription, }); } tablesource.Data = data; tablesource.OnRowSelected += (object sender, ElementTableSource.RowSelectedEventArgs e) => { ISupportElement selecteditm = tablesource.Data[e.indexPath.Row]; lbltransfrmactnum.Text = selecteditm.Transformedactnumber; activitylist = new TaskListDTO { ProjectNumber = lblprojectnum.Text, ProjectDescription = "Concrete Structure", WorkDate = wrkdt.ToString(), TimekeeperPersonnelNumber = Convert.ToInt32(timekprid), TransformedActivityElementNumber = selecteditm.Transformedactnumber, NetworkNumber = "N.10018.1002", ActivityNumber = selecteditm.Activitynum, ActivityDescription = selecteditm.ActivityDescription, ElementNumber = "0100", ActualQuantity = null, UoM = "CY", Notes = null, CreateDate = wrkdt.ToString(), CreateUser = timekprname.ToString(), LastChangeDate = wrkdt.ToString(), LastChangeUser = timekprname.ToString(), WBSElementNumber = "10018.1002", WBSElementDescription = "FRP Columns", TakeoffQuantity = 250, TransformedActivityNumber = lbltransfrmactnum.Text, ActivityElementDescription = "Concrete Test Project", EstimatedQuantity = 1, Percent = 1, Factor = 1, BudgetLaborAmountByUnit = 1, BudgetLaborHoursByUnit = 1, BudgetEquipAmountByUnit = 1, UpdateFlag = "I", }; var act = SaveTask(); }; TableView.Source = tablesource; TableView.ReloadData(); }
/// <summary> /// 手动注册 /// </summary> /// <param name="element"></param> public void RegistRuntimeCreated(ISupportElement element) { rutimeCreatedList.ScureAdd(element); }