public void Initialize(ContentManager Content)
        {
            // Create a new render scene
            RenderScene = new RenderScene();

            // Create the default package
            if (!Content.Packages.ContainsKey(ChessGame.DefaultPackage))
            {
                ContentPackage newPackage = new ContentPackage(ChessGame.DefaultPackage);
                Content.Add(newPackage);
            }

            // Load the content
            ContentPackage package = Content.Packages[ChessGame.DefaultPackage];

            CreateBoardModels(package);
            CreatePieceMaterials(package);
            CreatePieceModels(package);
            CreateSelector(package);

            // Place the pieces
            PlacePieces();

            // Place the lights
            PlaceLights();

            cameraObject.Position = InitialCameraPosition;
        }
Beispiel #2
0
        public ActionResult Add(Content content)
        {
            string email        = (string)Session["WriterMail"];
            var    writerIdInfo = _efContext.Writers.Where(w => w.WriterMail == email).Select(x => x.WriterId).FirstOrDefault();

            content.WriterId = writerIdInfo;
            _contentManager.Add(content);
            return(RedirectToAction("MyContent"));
        }
Beispiel #3
0
        public ActionResult AddContent(Content p)
        {
            string mail         = (string)Session["WriterMail"];
            var    writeridinfo = c.Writers.Where(x => x.WriterMail == mail).Select(y => y.WriterId).FirstOrDefault();

            p.ContentDate   = DateTime.Parse(DateTime.Now.ToShortDateString());
            p.WriterId      = writeridinfo;
            p.ContentStatus = true;
            contentManager.Add(p);
            return(RedirectToAction("MyContent"));
        }
        public ActionResult AddContent(Content content)
        {
            Context context      = new Context();
            string  p            = (string)Session["WriterMail"];
            var     writeridinfo = context.Writers.Where(x => x.WriterMail == p)
                                   .Select(y => y.WriterID).FirstOrDefault();

            content.ContentDate   = DateTime.Parse(DateTime.Now.ToShortDateString());
            content.WriterID      = writeridinfo;
            content.ContentStatus = true;
            _contentManager.Add(content);
            return(RedirectToAction("MyContent"));
        }
Beispiel #5
0
        private MediaContent SaveFile(string folderName, HttpFileCollectionBase files)
        {
            if (files != null)
            {
                var @overrided    = true;
                var currentFolder = FolderManager.Get(Repository, folderName);
                foreach (var f in files.AllKeys)
                {
                    var file = files[f];
                    if (file.ContentLength > 0)
                    {
                        //if upload from ie filename will be fullpath include disk symbol
                        var fileName = file.FileName.Contains("\\") ? file.FileName.Substring(file.FileName.LastIndexOf("\\") + 1) : file.FileName;

                        return(ContentManager.Add(Repository, currentFolder, fileName, file.InputStream, overrided, User.Identity.Name));
                    }
                }
            }
            return(null);
        }
        protected override void LoadContent()
        {
            spriteBatch = new SpriteBatch(GraphicsDevice);

            // Load Assets
            Assets.LoadContent(Content);

            // A style for buttons to use.
            ControlStyle buttonStyle = new ControlStyle(
                Assets.Button,
                Assets.ButtonHover,
                Assets.ButtonPressed,
                null,
                Rectangle.Empty
                );

            buttonStyle.FontStyle = new FontStyle(Assets.Font_MineCraftia11, Color.White);


            // Control Manager - updates / draws all controls
            WindowContentManager = new ContentManager(
                GraphicsDevice,
                new AnchoredRectangle(
                    0, 0,
                    Graphics.PreferredBackBufferWidth,
                    Graphics.PreferredBackBufferHeight
                    )
                );


            // Panel:
            ControlStyle panelStyle = new ControlStyle(Assets.Panel_Bg);

            panelStyle.FontStyle     = buttonStyle.FontStyle;
            panelStyle.ScrollerStyle = Assets.ScrollerStyle;


            myPanel = new Panel("Test Window", panelStyle, true, true);
            // HACKY HACK HACK - hard coding for simplicity right now
            myPanel.MoveTo(new Vector2(200, 350));
            myPanel.DragAreaOffset = new Rectangle(5, 1, 488, 25);
            myPanel.SetContentArea(40, 37, 417, 445);


            // Button:
            Button btn = new Button("Click Me", buttonStyle);

            btn.OnClicked += btn_click;
            btn.AnchorTo(myPanel, PositionType.Inside_Top_Left, 40, 75, AnchorType.Bounds);

            // Label:  will re-use the same FontStyle as buttons
            Label myLabel1 =
                new Label("Scroll Down?", buttonStyle.FontStyle);

            myLabel1.AnchorTo(btn, PositionType.Below_Left, 0, 50, AnchorType.Bounds);

            Label myLabel2 =
                new Label("-- That's All Folks! --", buttonStyle.FontStyle);

            myLabel2.AnchorTo(myLabel1, PositionType.Below_Left, 0, 150, AnchorType.Bounds);

            myPanel.ContentManager.Add(btn);
            myPanel.ContentManager.Add(myLabel1);
            myPanel.ContentManager.Add(myLabel2);

            WindowContentManager.Add(myPanel);      // Important :)


            // FPS Counter:
            // ServiceProvider.AddService(new FramesPerSecondCounter(100));

            // Dev Console
            ControlStyle styleDevConsole = new ControlStyle(Assets.DevConsole_Bg);

            styleDevConsole.FontStyle = buttonStyle.FontStyle;

            var console = new DevConsole(GraphicsDevice, Keys.OemTilde, new Panel("DevConsole", styleDevConsole));

            console.TextStartPosition = new Vector2(15, 20);

            ServiceProvider.AddService(console);

            // Cursor - note this needs to be added last
            ServiceProvider.AddService(new Cursor(this));
            ServiceProvider.GetService <Cursor>().SetCursor(Assets.Cursor);
        }
    protected void Button1_Click1(object sender, EventArgs e)
    {
        LiveSupport.LiveSupportModel.Content ad = new LiveSupport.LiveSupportModel.Content();
        ad.UserName = txtName.Text.Trim();
        ad.PicUrl   = ddllPic.SelectedValue.ToString();
        ad.UserMail = txtEmail.Text.Trim();
        ad.UserUrl  = txtUrl.Text.Trim();
        ad.UserQQ   = txtQQ.Text.Trim();

        string faceurl = "";

        if (this.Radio1.Checked)
        {
            faceurl = "Imgs/face/face1.gif";
        }
        if (this.Radio2.Checked)
        {
            faceurl = "Imgs/face/face2.gif";
        }
        if (this.Radio3.Checked)
        {
            faceurl = "Imgs/face/face3.gif";
        }
        if (this.Radio4.Checked)
        {
            faceurl = "Imgs/face/face4.gif";
        }
        if (this.Radio5.Checked)
        {
            faceurl = "Imgs/face/face5.gif";
        }
        if (this.Radio6.Checked)
        {
            faceurl = "Imgs/face/face6.gif";
        }
        if (this.Radio7.Checked)
        {
            faceurl = "Imgs/face/face7.gif";
        }
        if (this.Radio8.Checked)
        {
            faceurl = "Imgs/face/face8.gif";
        }
        if (this.Radio9.Checked)
        {
            faceurl = "Imgs/face/face9.gif";
        }
        if (this.Radio10.Checked)
        {
            faceurl = "Imgs/face/face10.gif";
        }
        if (this.Radio11.Checked)
        {
            faceurl = "Imgs/face/face11.gif";
        }
        if (this.Radio12.Checked)
        {
            faceurl = "Imgs/face/face12.gif";
        }
        if (this.Radio13.Checked)
        {
            faceurl = "Imgs/face/face13.gif";
        }
        if (this.Radio14.Checked)
        {
            faceurl = "Imgs/face/face14.gif";
        }
        if (this.Radio15.Checked)
        {
            faceurl = "Imgs/face/face15.gif";
        }
        if (this.Radio16.Checked)
        {
            faceurl = "Imgs/face/face16.gif";
        }
        if (this.Radio17.Checked)
        {
            faceurl = "Imgs/face/face17.gif";
        }
        if (this.Radio18.Checked)
        {
            faceurl = "Imgs/face/face18.gif";
        }
        if (this.Radio19.Checked)
        {
            faceurl = "Imgs/face/face19.gif";
        }
        if (this.Radio20.Checked)
        {
            faceurl = "Imgs/face/face20.gif";
        }
        ad.FaceUrl = faceurl;
        ad.UserIp  = HttpContext.Current.Request.UserHostAddress;

        ad.Contents = FCKeditor1.Value;
        ad.AddTime  = System.DateTime.Now;
        if (CheckBox1.Checked == true)
        {
            ad.IsHid = 1;
        }
        else
        {
            ad.IsHid = 0;
        }

        ContentManager bll = new ContentManager();

        if (bll.Add(ad))
        {
            ClientScript.RegisterStartupScript(this.GetType(), "Error", "<script>alert('留言发表成功!'); window.location='LiveSupportLeaveWord.aspx';</script>");
        }
        else
        {
            ClientScript.RegisterStartupScript(this.GetType(), "Error", "<script>alert('发表失败!');</script>");
        }
    }