Пример #1
0
 public ForumThreadItem(ForumThreadItem item)
 {
     Id = item.Id;
     CreatedDateTime  = item.CreatedDateTime;
     Title            = item.Title;
     Description      = item.Description;
     CreatorName      = item.CreatorName;
     CreatorEmail     = item.CreatorEmail;
     NumberOfPosts    = item.NumberOfPosts;
     LastPostDateTime = item.LastPostDateTime;
 }
        public InnerForumThreadPage(ForumThreadItem forumThread)
        {
            InitializeComponent();

            sts = new SendToServer(this);

            if (forumThread == null) //should not be null
            {
                Navigation.PopAsync();
            }

            _forumThread = forumThread;

            Title = "Thread Posts";

            ForumPostsListView.ItemsSource = _ForumPostsListViewItems;

            ToolbarItems.Add(new ToolbarItem("New", "Add_Icon.png", ToolbarItem_OnAdd, ToolbarItemOrder.Primary));
        }
        public ForumPostDetailsPage(ForumThreadItem thread, ForumPostItem post)
        {
            InitializeComponent();

            sts = new SendToServer(this);

            if (thread == null)
            {
                isNewThread = true;
                Title       = "Create Thread";
            }
            else
            {
                isNewThread      = false;
                this.thread      = thread;
                Title_Entry.Text = thread.Title;
                if (post == null)
                {
                    isNewPost = true;
                    Title     = "Create Post";
                    Title_StackLayout.IsVisible = false;
                }
                else
                {
                    isNewPost = false;
                    this.post = post;
                    Description_Editor.Text = post.Content;
                    Title = "Edit Post";
                    if (!post.isFirstPost || App.curClassroom.curUserIsOwner)
                    {
                        ToolbarItems.Add(new ToolbarItem("Delete", "Trashcan_Icon", ToolbarItem_OnDelete, ToolbarItemOrder.Primary));
                    }
                    if (!post.isFirstPost)
                    {
                        Title_StackLayout.IsVisible = false;
                    }
                }
            }
        }