예제 #1
0
        public PlanetMapControl(IServiceProvider services)
        {
            _content = (ContentController)services.GetService(typeof(ContentController));
            _spritebatch = (SpriteBatch)services.GetService(typeof(SpriteBatch));
            _consoleManager = (ConsoleManager)services.GetService(typeof(ConsoleManager));
            _black = _content.GetContent<Texture2D>(@"StarFields\black");
            _font = _content.GetContent<SpriteFont>("Fonts/SpriteFont1");

            Name = "PlanetMap";
            ClipContent = true;
            BuildingCellSize = 128;
        }
        public void GetContentTest()
        {
            var controller = new ContentController();
            var temp       = controller.GetContent();

            Assert.NotEmpty(temp);
        }
예제 #3
0
        public Planet(IServiceProvider services, SystemMapPlanetViewModel viewModel)
        {
            ViewModel = viewModel;
            Scale = ViewModel.Scale;

            ImageControl = new Image();

            _content = (ContentController)services.GetService(typeof(ContentController));
            ImageControl.Texture = _content.GetContent<Texture2D>(@"SystemMap\Planet1");
            Content = ImageControl;
            RenderScale = new Vector2F(Scale);
        }
예제 #4
0
        public void GetContentTest_View()
        {
            #region Setup Test Data

            var controller = new ContentController();
            #endregion


            #region Execute Test

            var result = controller.GetContent();

            #endregion


            #region Evaluate Results

            JsonResult jsonResult = (JsonResult)result;
            Assert.IsInstanceOfType(result, typeof(JsonResult), "Should return json result");

            #endregion
        }
예제 #5
0
 public BuildingCellTile(ContentController content, SpriteBatch spritebatch, BuildingCellViewModel buildingCell)
 {
     _spritebatch = spritebatch;
     _buildingCell = buildingCell;
     _testTexture = content.GetContent<Texture2D>("StarFields/test");
     _testTexture2 = content.GetContent<Texture2D>("SystemMap/Planet1");
 }
예제 #6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                MenuController mc = new MenuController();
                ddlMenuID.DataSource     = mc.GetParentMenus();
                ddlMenuID.DataTextField  = "Title";
                ddlMenuID.DataValueField = "MenuID";
                ddlMenuID.DataBind();
                ddlMenuID.Items.Insert(0, new ListItem("Root Menus", "0"));

                AlbumController ac = new AlbumController();
                ddlAlbumID.DataSource     = ac.GetAlbums();
                ddlAlbumID.DataTextField  = "EnglishAlbumName";
                ddlAlbumID.DataValueField = "AlbumID";
                ddlAlbumID.DataBind();
                ddlAlbumID.Items.Insert(0, new ListItem("Select Album", "0"));

                LanguageController lc = new LanguageController();
                ddlLanguageID.DataSource     = lc.GetLanguages();
                ddlLanguageID.DataTextField  = "LanguageTitle";
                ddlLanguageID.DataValueField = "LanguageID";
                ddlLanguageID.DataBind();
                ddlLanguageID.Items.Insert(0, new ListItem("Select Language", "0"));

                CategoryController cc = new CategoryController();
                ddlCategoryID.DataSource     = cc.GetParentCategory();
                ddlCategoryID.DataTextField  = "CategoryName";
                ddlCategoryID.DataValueField = "CategoryID";
                ddlCategoryID.DataBind();
                ddlCategoryID.Items.Insert(0, new ListItem("Root Category", "0"));

                AuthorController auc = new AuthorController();
                ddlAuthorID.DataSource     = auc.GetAuthors();
                ddlAuthorID.DataTextField  = "AuthorName";
                ddlAuthorID.DataValueField = "AuthorID";
                ddlAuthorID.DataBind();
                ddlAuthorID.Items.Insert(0, new ListItem("Select Author", "0"));

                ContentController oc = new ContentController();
                //Check if no paratmeter exist, redirect to list page.
                Uri    myUri     = new Uri(Request.Url.ToString());
                string ContentID = HttpUtility.ParseQueryString(myUri.Query).Get("ID");
                if (ContentID == null)
                {
                    Response.Redirect("/UserControl/Template/Content/ListContent.aspx");
                }
                oc.GetContent(int.Parse(ContentID));
                txtContentTitle.Text                   = oc.ContentTitle;
                txtContentSubTitle.Text                = oc.ContentSubTitle;
                PublishedDate.Text                     = Convert.ToDateTime(oc.PublishedDate).Date.ToString("yyyy-MM-dd");
                chkPublished.Checked                   = oc.IsPublished;
                ddlMenuID.SelectedValue                = oc.MenuID.ToString();
                ddlAlbumID.SelectedValue               = oc.AlbumID.ToString();
                ddlLanguageID.SelectedValue            = oc.LanguageID.ToString();
                txtStartDateTime.Text                  = Convert.ToDateTime(oc.StartDateTime).Date.ToString("yyyy-MM-ddTHH:mm");
                txtEndDateTime.Text                    = Convert.ToDateTime(oc.EndDateTime).Date.ToString("yyyy-MM-ddTHH:mm");
                ddlAuthorID.SelectedValue              = oc.AuthorID.ToString();
                ddlCategoryID.SelectedValue            = oc.ContentCategoryID.ToString();
                txtMetaTitle.Text                      = oc.MetaTitle;
                txtMetaKeyword.Text                    = oc.MetaKeyword;
                MetaDescription.Value                  = oc.MetaDescription;
                lblFileUploadContentImagePath.Text     = oc.UploadContentImage;
                lblFileUploadContentFilePath.Text      = oc.UploadContentFile;
                lblFileUploadThumbnailContentPath.Text = oc.UploadThumbnailContentImage;
                txtSummary.Text     = oc.Summary;
                txtCustomText1.Text = oc.CustomText1;
                txtCustomText2.Text = oc.CustomText2;
                txtCustomText3.Text = oc.CustomText3;
                Description.Value   = oc.Description;
            }
        }