示例#1
0
        protected void dataForm_DataBound(object sender, EventArgs e)
        {
            var serverList = dataForm.FindControl("serversRepeater") as Repeater;

            if (serverList != null)
            {
                serverList.DataSource = currentItem.Servers;
                serverList.DataBind();
            }
            var publishedShardMap = dataForm.FindControl("publishedShardsRepeater") as Repeater;

            if (publishedShardMap != null)
            {
                if (currentItem.CurrentPublishedShardMapID != null)
                {
                    publishedShardMap.DataSource = ShardMap.Load(currentItem.CurrentPublishedShardMapID.Value).Shards;
                }
                else
                {
                    publishedShardMap.DataSource = new List <Shard>();
                }

                publishedShardMap.DataBind();
            }
            var proposedShardmap = dataForm.FindControl("proposedShardsRepeater") as Repeater;

            if (proposedShardmap != null)
            {
                if (currentItem.ShardMap != null)
                {
                    proposedShardmap.DataSource = currentItem.ShardMap.Shards;
                }
                proposedShardmap.DataBind();
            }
            var pointerShardList = dataForm.FindControl("pointerShardRepeater") as Repeater;

            if (pointerShardList != null)
            {
                pointerShardList.DataSource = currentItem.PointerShards;
                pointerShardList.DataBind();
            }
        }