public virtual async Task GetStreamDelete(TweetDelete delete) { RowBase row = null; await Task.Run(() => { foreach (var t in TimeLine) { if (t is TimelineRow) { TimelineRow tr = (t as TimelineRow); if (tr.Tweet.id_str == delete.status.id_str) { row = tr; } } else if (t is DirectMessageRow) { DirectMessageRow tr = (t as DirectMessageRow); if (tr.DirectMessage.id_str == delete.status.id_str) { row = tr; } } } }); await SharedDispatcher.RunAsync(() => { if (row != null) { TimeLine.Remove(row); } }); }
protected async Task InsertStreamInTimeLineAsync(RowBase row) { if (await IsAllFilterClearAsync(row.Tweet)) { if (IsNewNotification == true) { if (row is NotificationRow) { var r = row as NotificationRow; timelineActionCallback(new TimelineAction(TimelineActionType.NewNotification, new NotificationMessage { Message = r.Message, TweetMessage = row.Tweet })); } else { timelineActionCallback(new TimelineAction(TimelineActionType.NewNotification, new NotificationMessage { Message = "Notification", TweetMessage = row.Tweet })); } } await SharedDispatcher.RunAsync(() => { TimeLine.Insert(0, row); }); await LiveTileImageUpdateAsync(row.Tweet); } }
private static void AddRowBase( this CellCursor cursor, RowBase rowBase, ReportToWorkbookProjectionContext context, PassKind passKind) { if (passKind == PassKind.Formatting) { cursor.CanvassedRowRange.ApplyRowFormat(rowBase.Format); } for (var x = 0; x < rowBase.Cells.Count; x++) { if (x > 0) { cursor.MoveRight(rowBase.Cells[x - 1].ColumnsSpanned ?? 1); } if (passKind == PassKind.Formatting) { cursor.CanvassedRowRange.ApplyRowFormat(rowBase.Format); } cursor.AddCell(rowBase.Cells[x], context, passKind); } }
public void AddRow() { RowBase row = new RowBase(); RowList.Add(row); vScroll.Maximum = (RowList.Count - 1) * 1d; RecalcRows(); }
protected void ApplyStyleToRow ( RowBase row, string alternateRowCss=null) { if (RowsCount % 2 == 0) row.Style = RowStyle; else { row.Style = AlternateRowStyle ?? RowStyle; if (!string.IsNullOrEmpty (alternateRowCss)) row.Attributes ["class"] = alternateRowCss; } }
void RecalcRows() { double curY = 0; for (int rowIdx = 0; rowIdx < RowList.Count; rowIdx++) { RowBase row = RowList[rowIdx]; row.StartY = curY; curY += OnGetRowHeight(rowIdx) + 1; } }
protected void ApplyStyleToRow(RowBase row, string alternateRowCss = null) { if (RowsCount % 2 == 0) { row.Style = RowStyle; } else { row.Style = AlternateRowStyle ?? RowStyle; if (!string.IsNullOrEmpty(alternateRowCss)) { row.Attributes ["class"] = alternateRowCss; } } }
protected async Task InsertRestInTimeLineAsync(List <RowBase> tweetList) { if (tweetList != null) { List <RowBase> tempTweetList = new List <RowBase>(); RowBase[] tweetListCopy = null; await Task.Run(async() => { tweetList.Reverse(); tweetListCopy = new RowBase[TimeLine.Count]; TimeLine.CopyTo(tweetListCopy, 0); foreach (var tweet in tweetList) { if (await IsAllFilterClearAsync(tweet.Tweet)) { if (await isCompetition(tweetListCopy.ToList(), tweet.Tweet) == false) { tempTweetList.Add(tweet); } } } }); await SharedDispatcher.RunAsync(() => { foreach (var tweet in tempTweetList) { TimeLine.Insert(0, tweet); } }); //TimeLine.OrderBy(q => q.Tweet.created_at_time).Select(q => q); } }
public void AddRow() { RowBase row = new RowBase(); RowList.Add(row); vScroll.Maximum = (RowList.Count-1) * 1d; RecalcRows(); }
public void AddRow(RowBase row){ InnerHtml=InnerHtml+row.ToString(); }
public string GetName(RowBase row) { return("oink"); }
public void EvalIfcRow(ifcSQL.ifcInstance.Entity_Row e) { try{ Type t = Type.GetType("ifc." + ifc.ENTITY.TypeDictionary.TypeIdNameDict[e.EntityTypeId], true, true); // 2. true: ignoreCase ENTITY CurrentEntity = (ENTITY)Activator.CreateInstance(t); CurrentEntity.LocalId = LocalIdFromGlobalIdDict[e.GlobalEntityInstanceId]; // e.LocalId; CurrentEntity.ifcSqlGlobalId = e.GlobalEntityInstanceId; // commment-handling: if (CurrentEntity is EntityComment) { ((EntityComment)CurrentEntity).CommentLine = ((ifcSQL.ifcInstance.EntityAttributeOfString_Row)e.AttributeValueDict[-1]).Value; } else if (e.AttributeValueDict.ContainsKey(-1)) { CurrentEntity.EndOfLineComment = ((ifcSQL.ifcInstance.EntityAttributeOfString_Row)e.AttributeValueDict[-1]).Value; } object[] TypeCtorArgs = new object[1]; int OrdinalPosition = 0; ENTITY.AttribListType AttribList = ENTITY.TypeDictionary.GetComponents(CurrentEntity.GetType()).AttribList; foreach (ENTITY.AttribInfo attrib in AttribList) { ++OrdinalPosition; if (e.AttributeValueDict.ContainsKey(OrdinalPosition))//---------------------------------------------------------------------------------------------------------- { RowBase rb = e.AttributeValueDict[OrdinalPosition]; if (rb is ifcSQL.ifcInstance.EntityAttributeOfVector_Row) { ifcSQL.ifcInstance.EntityAttributeOfVector_Row a = (ifcSQL.ifcInstance.EntityAttributeOfVector_Row)rb; if (a.TypeId == 25) { if (a.Z != null) { ((ifc.CartesianPoint)CurrentEntity).Coordinates = new List1to3_LengthMeasure((LengthMeasure)a.X, (LengthMeasure)a.Y, (LengthMeasure)(double)a.Z); } else { ((ifc.CartesianPoint)CurrentEntity).Coordinates = new List1to3_LengthMeasure((LengthMeasure)a.X, (LengthMeasure)a.Y); } } #if IFC2X3 if (a.TypeId == 42) { if (a.Z != null) { ((ifc.Direction)CurrentEntity).DirectionRatios = new List2to3_double(a.X, a.Y, (double)a.Z); } else { ((ifc.Direction)CurrentEntity).DirectionRatios = new List2to3_double(a.X, a.Y); } } #else if (a.TypeId == 42) { if (a.Z != null) { ((ifc.Direction)CurrentEntity).DirectionRatios = new List2to3_Real((Real)a.X, (Real)a.Y, (Real)(double)a.Z); } else { ((ifc.Direction)CurrentEntity).DirectionRatios = new List2to3_Real((Real)a.X, (Real)a.Y); } } #endif } else if (rb is ifcSQL.ifcInstance.EntityAttributeOfString_Row) { ifcSQL.ifcInstance.EntityAttributeOfString_Row a = (ifcSQL.ifcInstance.EntityAttributeOfString_Row)rb; TypeCtorArgs[0] = ifc.IfcString.Decode(a.Value); attrib.field.SetValue(CurrentEntity, Activator.CreateInstance(attrib.field.FieldType, TypeCtorArgs)); } else if (rb is ifcSQL.ifcInstance.EntityAttributeOfEnum_Row) { ifcSQL.ifcInstance.EntityAttributeOfEnum_Row a = (ifcSQL.ifcInstance.EntityAttributeOfEnum_Row)rb; Type UnderlyingType = Nullable.GetUnderlyingType(attrib.field.FieldType); if (UnderlyingType != null && UnderlyingType.IsEnum) { attrib.field.SetValue(CurrentEntity, Enum.ToObject(UnderlyingType, a.Value)); } else { attrib.field.SetValue(CurrentEntity, a.Value); } } else if (rb is ifcSQL.ifcInstance.EntityAttributeOfInteger_Row) { ifcSQL.ifcInstance.EntityAttributeOfInteger_Row a = (ifcSQL.ifcInstance.EntityAttributeOfInteger_Row)rb; object o = Activator.CreateInstance(ENTITY.TypeDictionary.TypeIdTypeDict[a.TypeId], a.Value); if (attrib.field.FieldType.IsSubclassOf(typeof(SELECT))) { TypeCtorArgs[0] = o; o = Activator.CreateInstance(attrib.field.FieldType, TypeCtorArgs); } attrib.field.SetValue(CurrentEntity, o); } else if (rb is ifcSQL.ifcInstance.EntityAttributeOfFloat_Row) { ifcSQL.ifcInstance.EntityAttributeOfFloat_Row a = (ifcSQL.ifcInstance.EntityAttributeOfFloat_Row)rb; object o = Activator.CreateInstance(ENTITY.TypeDictionary.TypeIdTypeDict[a.TypeId], a.Value); if (attrib.field.FieldType.IsSubclassOf(typeof(SELECT))) { TypeCtorArgs[0] = o; o = Activator.CreateInstance(attrib.field.FieldType, TypeCtorArgs); } attrib.field.SetValue(CurrentEntity, o); } else if (rb is ifcSQL.ifcInstance.EntityAttributeOfEntityRef_Row) { ifcSQL.ifcInstance.EntityAttributeOfEntityRef_Row a = (ifcSQL.ifcInstance.EntityAttributeOfEntityRef_Row)rb; if (a.Value > 0) { Type AttributeInstanceType = ifc.ENTITY.TypeDictionary.TypeIdTypeDict[a.TypeId]; object o = Activator.CreateInstance(AttributeInstanceType); ((ENTITY)o).LocalId = LocalIdFromGlobalIdDict[a.Value]; if (attrib.field.FieldType.IsSubclassOf(typeof(SELECT))) { TypeCtorArgs[0] = o; o = Activator.CreateInstance(attrib.field.FieldType, TypeCtorArgs); } attrib.field.SetValue(CurrentEntity, o); } } else if (rb is ifcSQL.ifcInstance.EntityAttributeOfList_Row) { ifcSQL.ifcInstance.EntityAttributeOfList_Row a = (ifcSQL.ifcInstance.EntityAttributeOfList_Row)rb; Type GenericType = null; if (attrib.field.FieldType.BaseType.GetGenericArguments().Length > 0) { GenericType = attrib.field.FieldType.BaseType.GetGenericArguments()[0]; //LengthMeasure or CartesianPoint } else { GenericType = attrib.field.FieldType.BaseType.BaseType.GetGenericArguments()[0]; //CompoundPlaneAngleMeasure } Type AttributeInstanceType = ifc.ENTITY.TypeDictionary.TypeIdTypeDict[a.TypeId]; int ListDim1Count = a.AttributeValueDict.Count; object[] FieldCtorArgs = new object[ListDim1Count]; if (ListDim1Count > 0) { if (a.AttributeValueDict[0] is ifcSQL.ifcInstance.EntityAttributeListElementOfEntityRef_Row) { for (int ListDim1Position = 0; ListDim1Position < ListDim1Count; ListDim1Position++) { int Id = LocalIdFromGlobalIdDict[((ifcSQL.ifcInstance.EntityAttributeListElementOfEntityRef_Row)a.AttributeValueDict[ListDim1Position]).Value]; object[] GenericCtorArgs = new object[1]; FieldCtorArgs[ListDim1Position] = Activator.CreateInstance(GenericType); // Console.WriteLine("GenericType= "+GenericType.ToString()); if (GenericType.IsSubclassOf(typeof(SELECT))) { ((SELECT)FieldCtorArgs[ListDim1Position]).Id = Id; } else if (GenericType.IsSubclassOf(typeof(ENTITY))) { ((ENTITY)FieldCtorArgs[ListDim1Position]).LocalId = Id; } else { Console.WriteLine("unkown type"); } } } } attrib.field.SetValue(CurrentEntity, Activator.CreateInstance(attrib.field.FieldType, FieldCtorArgs)); } } //---------------------------------------------------------------------------------------------------------- } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ EntityList.Add(CurrentEntity); }catch (Exception ex) { Console.WriteLine("ERROR on EvalIfcRow:" + ex.Message); } //Console.ReadLine();} }
public void AddRow(RowBase row) { InnerHtml = InnerHtml + row.ToString(); }