Exemplo n.º 1
0
        // METODOS PARA RECEBER WEBSERVICE RESPONSES JSON

        public void receiveCourseTopics(List <jsonValues.Topics> topics)
        {
            Topic    placeHolder = null;
            modules  moduleP     = null;
            contents contentP    = null;

            this.topics = new LinkedList <Topic>();
            foreach (jsonValues.Topics t in topics)
            {
                if (t.visible > 0)
                {
                    placeHolder                  = new Topic();
                    placeHolder.id               = t.id;
                    placeHolder.name             = t.name;
                    placeHolder.summary          = HtmlDecode(t.summary);
                    placeHolder.visible          = t.visible;
                    placeHolder.userVisible      = (t.uservisible.Equals("true")) ? 1 : 0;
                    placeHolder.availabilityinfo = t.availabilityinfo;
                    foreach (jsonValues.Modules m in t.modules)
                    {
                        if (m.visibleoncoursepage > 0 & m.visible > 0)
                        {
                            moduleP      = new modules();
                            moduleP.id   = m.id;
                            moduleP.name = m.name;
                            if (m.description != null)
                            {
                                moduleP.description = HtmlDecode(m.description);
                            }
                            moduleP.visible             = m.visible;
                            moduleP.url                 = m.url;
                            moduleP.uservisible         = (m.uservisible.Equals("true")) ? 1 : 0;
                            moduleP.visibleOnCoursePage = m.visibleoncoursepage;

                            foreach (jsonValues.Contents c in m.contents)
                            {
                                contentP                = new contents();
                                contentP.fileUrl        = c.fileurl;
                                contentP.fileSize       = c.filesize;
                                contentP.filePath       = c.filepath;
                                contentP.fileName       = c.filename;
                                contentP.isExternalFile = c.isexternalfile;
                                contentP.type           = c.type;
                                contentP.author         = c.author;
                                contentP.userId         = c.userid;
                                if (c.summary != null)
                                {
                                    contentP.summary = HtmlDecode(c.summary);
                                }

                                //TODO Times to be ADDED
                                moduleP.contents.AddLast(contentP);
                            }
                            placeHolder.modules.AddLast(moduleP);
                        }
                    }
                    this.topics.AddLast(placeHolder);
                }
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// 抢沙发
        /// </summary>
        public void getSofa()
        {
            //获取投稿列表并选出文章投稿
            string  s1      = webutil.getPublish(webutil.cookiec);
            JObject jsonObj = JObject.Parse(s1);
            JArray  jar     = JArray.Parse(jsonObj["contents"].ToString());
            JObject j       = JObject.Parse(jar[0].ToString());

            contentList = JsonConvert.DeserializeObject(s1, typeof(List <contents>)) as List <contents>;
            if (contentList.Count > 0)
            {
                contents con = contentList[0];
                if (con.getIsArticle() == "1")
                {
                    CommentBox comment = new CommentBox();
                    comment.Show();
                }
            }
        }
Exemplo n.º 3
0
 void Awake()
 {
     gc         = GameControllerSingleton.get();
     pc         = GetComponent <PlayerController>();
     myContents = new contents();
 }
Exemplo n.º 4
0
 Configure(contents, CreateLogger);
Exemplo n.º 5
0
        protected void btn_kaydet_Click(object sender, EventArgs e)
        {
            switch (mode)
            {
                case "add":
                    {
                        contents cont = new contents();
                        catId = int.Parse(drp_ustkategori.SelectedValue);
                        cont.Title = tx_baslik.Text;
                        cont.LangId = GetLangId();

                        if (tx_link.Text != "")
                            cont.Link = tx_link.Text;
                        else
                        {
                            cont.Link = Tools.makelink(tx_baslik.Text);
                        }

                        cont.Queue = GetQueue();
                        cont.Yayin = IsOnline();
                        cont.Contents1 = HttpUtility.HtmlEncode(ck_icerik.Text);
                        cont.CatId = int.Parse(drp_ustkategori.SelectedValue);
                        cont.TamSayfa = chk_yayin.Checked;
                        idc.contents.Add(cont);
                        idc.SaveChanges();

                        Response.Redirect("content.aspx");
                        break;
                    }
                case "edit":
                    {
                        int tid = int.Parse(id);
                        contents cont = idc.contents.First(k => k.Id == tid);
                        cont.Title = tx_baslik.Text;
                        cont.LangId = GetLangId();

                        if (tx_link.Text != "")
                            cont.Link = tx_link.Text;
                        else
                        {
                            cont.Link = Tools.makelink(tx_baslik.Text);
                        }

                        cont.TamSayfa = chk_yayin.Checked;
                        cont.Queue = GetQueue();
                        cont.Yayin = IsOnline();
                        cont.Contents1 = HttpUtility.HtmlEncode(ck_icerik.Text);
                        cont.CatId = int.Parse(drp_ustkategori.SelectedValue);

                        idc.SaveChanges();

                        Response.Redirect("content.aspx");
                        break;
                    }
            }
        }
Exemplo n.º 6
0
        private void addcontent_Click(object sender, EventArgs e)
        {
            quesPlotNum++;
            String _questions = questions.Text;

            addcontent.Hide();

            int optCount = Int32.Parse(optioncount.Text);

            String[] OptArr   = new String[optCount];
            int      countVal = 0;

            quesLen.Text = "Question " + quesPlotNum.ToString();
            int emptystring = 0;


            for (int i = 1; i <= optCount; ++i)
            {
                string name = "Options" + i;

                RichTextBox txtBox = optionplot.Controls[name] as RichTextBox;
                if (txtBox.Text == "")
                {
                    emptystring++;
                }
                else
                {
                }
                OptArr[countVal] = txtBox.Text;
                countVal++;
            }
            if (emptystring != 0)
            {
                quesPlotNum = quesPlotNum - 1;
                addcontent.Show();
                MessageBox.Show("All the option box should have content.");
            }
            else
            {
                inxLen++;
                optCountNum = inxLen;
                contents contentList1 = new contents()
                {
                    ques   = _questions,
                    OptArr = OptArr
                };
                contentsobj.Add(contentList1);

                GenerateModel();
                clearGroup();
                enableDisableGroup(true, "");
                if (quesPlotNum > totalQues)
                {
                    addcontent.Hide();
                    questionbox.Hide();
                    optionplot.Hide();
                    generatormodel.Show();

                    generatormodel.Height = 120;
                    generatormodel.Top    = 306;
                }
            }
        }
Exemplo n.º 7
0
this.GetContent(contents, ContentType);
Exemplo n.º 8
0
 void Awake()
 {
     gc = GameControllerSingleton.get();
     pc = GetComponent<PlayerController>();
     myContents = new contents();
 }
Exemplo n.º 9
0
 public String Substring(Number start, Number stop) => new String(contents[start.integerValue..stop.integerValue]);