protected override void OnPreRender(EventArgs e)
        {
            if (Visible)
            {
                if (!string.IsNullOrEmpty(_rootFolder))
                {
                    SetRootFolder();
                }
                //_viewHtml = _view.RenderAsHtml();
                //_viewHtml = _view.RenderAsHtml(true, false, _view.Url);

                if (_listViewWebPart.ViewType == ViewType.Html)
                {
                    _viewHtml2 = GetHtml();
                }
                else
                {
                    //TextWriter wr = new StringWriter();
                    //HtmlTextWriter hwr = new HtmlTextWriter(wr);
                    //typeof(ListViewWebPart).InvokeMember("RenderWebPart",
                    //                                                           BindingFlags.NonPublic |
                    //                                                           BindingFlags.Instance |
                    //                                                           BindingFlags.InvokeMethod,
                    //                                                           null,
                    //                                                           _listViewWebPart,
                    //                                                           new object[] { hwr });


                    _viewHtml2 = SPSResources.GetResourceString("SPSPE_NotSupportedView").ToCharArray();
                }
            }
        }
        void BtnGetMailClick(object sender, EventArgs e)
        {
            using (var longOperation = new SPLongOperation(Page))
            {
                longOperation.LeadingHTML  = SPSResources.GetResourceString("SPS_FetchMail_Message");
                longOperation.TrailingHTML = SPSResources.GetResourceString("SPS_FetchMail_Message2");
                longOperation.Begin();

                int port;
                Int32.TryParse(_mailPort, out port);

                var fetchMail = new FetchMail(_login,
                                              _password,
                                              _mailServer,
                                              port,
                                              _ssl,
                                              _listGuid);

                fetchMail.GetMessages();

                _error = fetchMail.GetErrorMessage();

                if (!string.IsNullOrEmpty(_error))
                {
                    SPUtility.TransferToErrorPage(_error);
                }
                else
                {
                    longOperation.End(Page.Request.Url.ToString());
                }
            }
        }
示例#3
0
        protected override void RenderContents(HtmlTextWriter writer)
        {
            tools.SectionHeaderTag(SPSResources.GetResourceString("SPS_Login"));
            txtLogin.RenderControl(writer);
            tools.SectionFooterTag();

            tools.SectionHeaderTag(SPSResources.GetResourceString("SPS_Password"));
            txtPassword.RenderControl(writer);
            tools.SectionFooterTag();

            tools.SectionHeaderTag(SPSResources.GetResourceString("SPS_MailServer"));
            txtMailServer.RenderControl(writer);
            tools.SectionFooterTag();

            tools.SectionHeaderTag(SPSResources.GetResourceString("SPS_MailPort"));
            txtMailPort.RenderControl(writer);
            tools.SectionFooterTag();

            tools.SectionHeaderTag();
            chkUseSSL.RenderControl(writer);
            tools.SectionFooterTag();

            tools.SectionHeaderTag(SPSResources.GetResourceString("SPS_List"));
            ddlLists.RenderControl(writer);
            tools.SectionFooterTag();

            tools.SectionHeaderTag();
            chkManual.RenderControl(writer);
            tools.SectionFooterTag();

            tools.SectionHeaderTag();
        }
示例#4
0
        protected override void CreateChildControls()
        {
            ddlLists = new DropDownList
            {
                Width = new Unit("100%")
            };

            FillLists(ddlLists);

            Controls.Add(ddlLists);

            txtLogin = new TextBox
            {
                ID   = "t1",
                Text = string.Empty
            };
            Controls.Add(txtLogin);

            txtPassword = new TextBox
            {
                ID       = "t2",
                TextMode = TextBoxMode.Password,
                Text     = string.Empty
            };
            Controls.Add(txtPassword);

            txtMailServer = new TextBox
            {
                ID   = "t3",
                Text = string.Empty
            };
            Controls.Add(txtMailServer);

            txtMailPort = new TextBox
            {
                ID   = "t4",
                Text = string.Empty
            };
            Controls.Add(txtMailPort);

            chkUseSSL = new CheckBox
            {
                Text = SPSResources.GetResourceString("SPS_SSL"),
                ID   = "c1"
            };
            Controls.Add(chkUseSSL);

            chkManual = new CheckBox
            {
                Text = SPSResources.GetResourceString("SPS_ManualGet"),
                ID   = "c2"
            };
            Controls.Add(chkManual);
        }
        protected override void CreateChildControls()
        {
            base.CreateChildControls();

            if (_manualConnection)
            {
                _btnGetMail = new Button
                {
                    Text = SPSResources.GetResourceString("SPS_GetMail")
                };
                _btnGetMail.Click += BtnGetMailClick;
                Controls.Add(_btnGetMail);
            }
        }
示例#6
0
        protected override void Render(HtmlTextWriter writer)
        {
            EnsureChildControls();

            writer.WriteLine("<!-- ListView -->");

            Debug.WriteLine(string.Format("** Render **{0}", _list.Title));
            //SyncFolder();

            if (_listViewWebPart.ViewType == ViewType.Html)
            {
                //_listViewWebPart.GetDesignTimeHtml();
                _listViewWebPart.RenderControl(writer);
            }
            else
            {
                writer.Write(SPSResources.GetResourceString("SPSPE_NotSupportedView"));
            }

            writer.WriteLine("<!-- EndListView -->");
        }