Example #1
0
        // 取出尚未添加的第一个帖子
        private MergedData getNextTopic_Merged(List <TData> topics, List <MergedData> mergedList, List <TPick> customList)
        {
            foreach (TData x in topics)
            {
                if (hasAdded(mergedList, x) == false)
                {
                    MergedData mPost = new MergedData();
                    mPost.Topic = x;

                    // 是否编辑过?
                    TPick editPost = getEditPost(x, customList);
                    if (editPost != null)
                    {
                        mPost.Title   = editPost.Title;
                        mPost.Link    = editPost.Link;
                        mPost.Summary = editPost.Summary;
                        mPost.IsEdit  = 1;
                    }
                    else
                    {
                        mPost.Title   = x.Title;
                        mPost.Link    = alink.ToAppData(x);
                        mPost.Summary = getSummary(x);
                    }

                    return(mPost);
                }
            }
            return(null);
        }
Example #2
0
 private MergedData getPinedPost_Merged(List <TPick> pinList, int i)
 {
     foreach (TPick x in pinList)
     {
         if (x.PinIndex == i + 1)
         {
             MergedData mPost = new MergedData();
             mPost.Title   = x.Title;
             mPost.Link    = x.Link;
             mPost.Summary = x.Summary;
             return(mPost);
         }
     }
     return(null);
 }
Example #3
0
        private List <MergedData> getMergedDatas(List <TData> topics, List <TPick> pinList, List <TPick> customList)
        {
            List <MergedData> mergedList = new List <MergedData>();
            int iCount = 13;

            for (int i = 0; i < iCount; i++)
            {
                MergedData mpost = getPinedPost_Merged(pinList, i);
                if (mpost != null)
                {
                    mergedList.Add(mpost);
                    continue;
                }

                MergedData tpost = getNextTopic_Merged(topics, mergedList, customList);
                if (tpost != null)
                {
                    mergedList.Add(tpost);
                }
            }

            return(mergedList);
        }
Example #4
0
        private void bindPick( MergedData x, IBlock block, int index )
        {
            block.Set( "x.Title", x.Title );
            block.Set( "x.Summary", x.Summary );

            String lnk = x.Topic == null ? x.Link : alink.ToAppData( x.Topic );
            block.Set( "x.LinkShow", lnk );

            block.Next();
        }