Ejemplo n.º 1
0
        private void PopulateTiles()
        {
            //if (_authContext.CheckPermission(PredefinedPermissions.OrdersAll))
            _tileManager.AddTile(new NumberTileItem()
            {
                IdModule        = NavigationNames.MenuName,
                IdTile          = "OrdersNeedAttention",
                TileNumber      = "",
                TileTitle       = "Need attention",
                TileCategory    = NavigationNames.ModuleName,
                Order           = 0,
                IdColorSchema   = TileColorSchemas.Schema1,
                NavigateCommand = new DelegateCommand(NavigateToHome)
            });

            _tileManager.AddTile(new NumberTileItem()
            {
                IdModule        = NavigationNames.MenuName,
                IdTile          = "OrdersProcessedToday",
                TileNumber      = "",
                TileTitle       = "Processed today",
                TileCategory    = NavigationNames.ModuleName,
                Order           = 2,
                IdColorSchema   = TileColorSchemas.Schema4,
                NavigateCommand = new DelegateCommand(NavigateToHome)
            });

            _tileManager.AddTile(new NumberTileItem()
            {
                IdModule        = NavigationNames.MenuName,
                IdTile          = "OrdersActive",
                TileTitle       = "ACTIVE ORDERS",
                Order           = 5,
                IdColorSchema   = TileColorSchemas.Schema3,
                NavigateCommand = new DelegateCommand(NavigateToHome)
            });

            _tileManager.AddTile(new LinearChartTileItem()
            {
                IdModule          = NavigationNames.MenuName,
                IdTile            = "OrderChart",
                TileTitle         = "MONTHLY SALES CHART",
                TileCategory      = NavigationNames.ModuleName,
                Order             = 6,
                Width             = (double)TileSize.Triple,
                Height            = (double)TileSize.Triple,
                IdColorSchema     = TileColorSchemas.Schema3,
                SeriasBackground1 = new SolidColorBrush(Color.FromRgb(153, 153, 153)),
                SeriasBackground2 = new SolidColorBrush(Color.FromRgb(35, 159, 217)),
                ColumnSeriesName1 = "Last Year Sales".Localize(),
                ColumnSeriesName2 = "This Year Sales".Localize()
            });
        }
Ejemplo n.º 2
0
        private void PopulateTiles()
        {
            if (_tileManager == null)
            {
                return;
            }

            if (_authContext.CheckPermission(PredefinedPermissions.PricingPrice_ListsManage))
            {
                _tileManager.AddTile(new NumberTileItem()
                {
                    IdModule        = NavigationNames.MenuName,
                    IdTile          = "PriceLists",
                    TileTitle       = "Price lists",
                    TileCategory    = NavigationNames.ModuleName,
                    Order           = 3,
                    IdColorSchema   = TileColorSchemas.Schema3,
                    NavigateCommand = new DelegateCommand(() => NavigateToTabPage(NavigationNames.HomeNamePriceList)),
                    Refresh         = async(tileItem) =>
                    {
                        try
                        {
                            using (var repository = _pricelistRepository.GetRepositoryInstance())
                            {
                                if (tileItem is NumberTileItem)
                                {
                                    var query = await Task.Factory.StartNew(() => repository.Pricelists.Count());
                                    (tileItem as NumberTileItem).TileNumber = query.ToString();
                                }
                            }
                        }
                        catch
                        {
                        }
                    }
                });
            }

            //if (_authContext.CheckPermission(PredefinedPermissions.PricingPrice_ItemPricingManage))
            //{
            //	_tileManager.AddTile(new IconTileItem()
            //		{
            //			IdModule = NavigationNames.MenuName,
            //			IdTile = "NewPriceList",
            //			TileIconSource = "Icon_Module_PriceLists",
            //			TileTitle = "New price list",
            //			Order = 6,
            //			IdColorSchema = TileColorSchemas.Schema2,
            //			NavigateCommand = new DelegateCommand(() => OnUIThread(async () =>
            //				{
            //					if (NavigateToTabPage(NavigationNames.HomeNamePriceList))
            //					{
            //						await Task.Run(() => Thread.Sleep(300)); // we need some time to parse xaml
            //						ItemAddCommand.Execute();

            //					}
            //				}))
            //		});
            //}
        }
Ejemplo n.º 3
0
 private void PopulateTiles()
 {
     if (_authContext.CheckPermission(PredefinedPermissions.Name_OrdersOrder_PaymentsAll))
     {
         _tileManager.AddTile(new NumberTileItem()
         {
             IdModule        = VirtoCommerce.ManagementClient.Configuration.NavigationNames.MenuName,
             IdTile          = "PaymentMethodsSettings",
             TileTitle       = "Payment methods",
             TileCategory    = NavigationNames.ModuleName,
             Order           = 2,
             IdColorSchema   = TileColorSchemas.Schema2,
             NavigateCommand = new DelegateCommand(() => NavigateToTabPage(NavigationNames.PaymentsSettingsHomeName)),
             Refresh         = async(tileItem) =>
             {
                 using (var repository = _repositoryFactory.GetRepositoryInstance())
                 {
                     try
                     {
                         if (tileItem is NumberTileItem)
                         {
                             var query = await Task.Factory.StartNew(() => repository.PaymentMethods.Count());
                             (tileItem as NumberTileItem).TileNumber = query.ToString();
                         }
                     }
                     catch
                     {
                     }
                 }
             }
         });
     }
 }
 private void PopulateTiles()
 {
     if (_authContext.CheckPermission(PredefinedPermissions.SecurityAccounts))
     {
         _tileManager.AddTile(new NumberTileItem()
         {
             IdModule        = "ConfigurationMenu",
             IdTile          = "Users",
             TileTitle       = "Users",
             TileCategory    = NavigationNames.ModuleName,
             Order           = 0,
             IdColorSchema   = TileColorSchemas.Schema1,
             NavigateCommand = new DelegateCommand(() => NavigateToTabPage(NavigationNames.HomeName)),
             Refresh         = async(tileItem) =>
             {
                 try
                 {
                     using (var repository = _securityRepository.GetRepositoryInstance())
                     {
                         if (tileItem is NumberTileItem)
                         {
                             var query = await Task.Factory.StartNew(() => repository.Accounts.Count());
                             (tileItem as NumberTileItem).TileNumber = query.ToString();
                         }
                     }
                 }
                 catch
                 {
                 }
             }
         });
     }
 }
 private void PopulateTiles()
 {
     if (_authContext.CheckPermission(PredefinedPermissions.SettingsShippingMethods) ||
         _authContext.CheckPermission(PredefinedPermissions.SettingsShippingOptions) ||
         _authContext.CheckPermission(PredefinedPermissions.SettingsShippingPackages))
     {
         _tileManager.AddTile(new NumberTileItem()
         {
             IdModule        = Configuration.NavigationNames.MenuName,
             IdTile          = "ShippindMethodsSettings",
             TileTitle       = "Shipping methods",
             TileCategory    = NavigationNames.ModuleName,
             Order           = 3,
             IdColorSchema   = TileColorSchemas.Schema3,
             NavigateCommand = new DelegateCommand(() => NavigateToTabPage(NavigationNames.ShippingSettingsHomeName)),
             Refresh         = async(tileItem) =>
             {
                 using (var repository = _repositoryFactory.GetRepositoryInstance())
                 {
                     try
                     {
                         if (tileItem is NumberTileItem)
                         {
                             var query = await Task.Factory.StartNew(() => repository.ShippingMethods.Count());
                             (tileItem as NumberTileItem).TileNumber = query.ToString();
                         }
                     }
                     catch
                     {
                     }
                 }
             }
         });
     }
 }
Ejemplo n.º 6
0
        public override void LoadContent()
        {
            spriteBatch = ScreenManager.SpriteBatch;

            tileManager.AddTile(new LargeTreeTile(new Vector2(150, ScreenManager.ScreenSize.Y - 135)));
            tileManager.AddTile(new BushTile(new Vector2(ScreenManager.ScreenSize.X - 300, ScreenManager.ScreenSize.Y - 99)));

            int screenHeight = (int)ScreenManager.ScreenSize.Y / 33;

            for (int i = 0; i < ScreenManager.ScreenSize.X / 33; i++)
            {
                tileManager.AddTile(new FloorTile(new Vector2(i, (screenHeight))));
                tileManager.AddTile(new FloorTile(new Vector2(i, (screenHeight - 1))));
            }

            base.LoadContent();
        }
Ejemplo n.º 7
0
 public Tile(int Id, LogController log, GameController game, string searchText)
 {
     this.id         = Id;
     this.log        = log;
     this.game       = game;
     this.searchText = searchText;
     SetDefaultActions();
     TileManager.AddTile(this);
 }
Ejemplo n.º 8
0
        /// <summary>
        /// Allows the game to run logic such as updating the world,
        /// checking for collisions, gathering input, and playing audio.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        protected override void Update(GameTime gameTime)
        {
            // Allows the game to exit
            if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed)
            {
                this.Exit();
            }

            //Update the mouse manager to update mouse input
            MouseManager.Update();

            //Get the mouse position
            int mousePosX, mousePosY;

            MouseManager.GetPosition(out mousePosX, out mousePosY);

            //Get the tile position under the mouse
            int mouseTilePosX = mousePosX / 64;
            int mouseTilePosY = mousePosY / 64;

            //Left button: Add a tile
            if (MouseManager.ButtonPressed(MouseButton.LEFT))
            {
                //Add a tile under mouse
                tileManager.AddTile(mouseTilePosX, mouseTilePosY);

                //Update the tile generators (regenerate them currently)
                tileRectangleDrawer.SetTileRectangles(TileRectangleCombiner.Combine(tileManager));
                tileRectangleDebugDrawer.SetTileRectangles(TileRectangleCombiner.Combine(tileManager));

                //Create the edge decals
                edgeDecalManager.CreateEdgeDecals(tileManager.GetAllTiles(), tileManager.Width, tileManager.Height, tileManager.TileSize);
            }

            //Right button: Remove a tile
            if (MouseManager.ButtonPressed(MouseButton.RIGHT))
            {
                //Remove the tile under mouse
                tileManager.RemoveTile(mouseTilePosX, mouseTilePosY);

                //Update the tile generators (regenerate them currently)
                tileRectangleDrawer.SetTileRectangles(TileRectangleCombiner.Combine(tileManager));
                tileRectangleDebugDrawer.SetTileRectangles(TileRectangleCombiner.Combine(tileManager));

                //Create the edge decals
                edgeDecalManager.CreateEdgeDecals(tileManager.GetAllTiles(), tileManager.Width, tileManager.Height, tileManager.TileSize);
            }

            //Middle button: Toggle debug drawing
            if (MouseManager.ButtonPressed(MouseButton.MIDDLE))
            {
                debugDraw = !debugDraw;
            }

            base.Update(gameTime);
        }
        private void PopulateTiles()
        {
            // news section
            AllNewsUrl = "http://virtocommerce.com/"; // main news web page
            _tileManager.AddTile(new NewsTileItem()
            {
                IdModule      = NavigationNames.MenuName,
                IdTile        = "NewsFeed",
                Height        = (double)TileSize.Triple,
                Width         = (double)TileSize.Double,
                IdColorSchema = TileColorSchemas.Schema3,
                Refresh       = async(tileItem) =>
                {
                    var currTile = tileItem as INewsTileItem;
                    if (currTile != null && currTile.NewsList == null)
                    {
                        try
                        {
                            currTile.NewsList = await Task.Run(() =>
                            {
                                var assembly   = Assembly.GetExecutingAssembly();
                                var webRequest = (HttpWebRequest)WebRequest.Create(newsFeedUrl);

                                webRequest.UserAgent = "Commerce Manager";
                                webRequest.Headers.Add("InformationalVersion", assembly.GetInformationalVersion());
                                webRequest.Headers.Add("FileVersion", assembly.GetFileVersion());
                                webRequest.Headers.Add("Is64BitOperatingSystem", Environment.Is64BitOperatingSystem.ToString());
                                webRequest.Headers.Add("OSVersion", Environment.OSVersion.ToString());
                                webRequest.Headers.Add("SiteUrl", _loginViewModel.CurrentUser.BaseUrl);

                                using (var reader = new XmlTextReader(webRequest.GetResponse().GetResponseStream()))
                                {
                                    var feed = SyndicationFeed.Load(reader);
                                    return(feed.Items);
                                }
                            });
                        }
                        catch { }
                    }
                }
            });

            // get all registered tiles
            OnUIThread(() =>
            {
                NewsTile       = _tileManager.GetTile("NewsFeed") as INewsTileItem;
                CustomerTiles  = _tileManager.GetTilesByIdModule(Customers.NavigationNames.MenuName);
                OrderTiles     = _tileManager.GetTilesByIdModule(Order.NavigationNames.MenuName);
                CatalogTiles   = _tileManager.GetTilesByIdModule(Catalog.NavigationNames.MenuName);
                MarketingTiles = _tileManager.GetTilesByIdModule(Marketing.NavigationNames.MenuName);
                SettingTiles   = _tileManager.GetTilesByIdModule(Configuration.NavigationNames.MenuName);
            });
        }
 private void PopulateTiles()
 {
     if (_authContext.CheckPermission(PredefinedPermissions.CatalogCustomerReviewsManage) ||
         _authContext.CheckPermission(PredefinedPermissions.CatalogEditorialReviewsCreateEdit) ||
         _authContext.CheckPermission(PredefinedPermissions.CatalogEditorialReviewsPublish) ||
         _authContext.CheckPermission(PredefinedPermissions.CatalogEditorialReviewsRemove)
         )
     {
         _tileManager.AddTile(new NumberTileItem()
         {
             IdModule        = NavigationNames.CatalogMenu,
             IdTile          = "Reviews",
             TileTitle       = "Reviews",
             TileCategory    = NavigationNames.ModuleName,
             Order           = 3,
             IdColorSchema   = TileColorSchemas.Schema2,
             NavigateCommand = new DelegateCommand(() => NavigateToTabPage(NavigationNames.HomeName)),
             Refresh         = async(tileItem) =>
             {
                 try
                 {
                     using (var repository = _repository)
                     {
                         if (tileItem is NumberTileItem)
                         {
                             var query = await Task.Factory.StartNew(() =>
                             {
                                 var retVal = 0;
                                 //TODO pending amount should be taken from Statistics
                                 retVal  = repository.Reviews.Where(review => review.Status == (int)ReviewStatus.Pending).Count();
                                 retVal += repository.ReviewComments.Where(comment => comment.Status == (int)ReviewStatus.Pending).Count();
                                 return(retVal);
                             });
                             (tileItem as NumberTileItem).TileNumber = query.ToString();
                         }
                     }
                 }
                 catch
                 {
                 }
             }
         });
     }
 }
Ejemplo n.º 11
0
    public bool DecomposePiece()
    {
        Component[] tileXForms       = gameObject.GetComponentsInChildren <Transform>();
        int         numTilesInBuffer = 0;

        foreach (Transform t in tileXForms)
        {
            if (t.gameObject != gameObject)
            {
                Vector3 newLoc = transform.position + t.localPosition;
                if (TileManagerScript.AddTile(IndividualTile, newLoc))
                {
                    numTilesInBuffer++;
                }
            }
        }

        return(numTilesInBuffer > 0);
    }
        private void PopulateTiles()
        {
            if (_tileManager == null)
            {
                return;
            }

            if (_authContext.CheckPermission(PredefinedPermissions.FulfillmentInventoryManage))
            {
                _tileManager.AddTile(new IconTileItem
                {
                    IdModule        = Catalog.NavigationNames.MenuName,
                    IdTile          = "Fulfillments",
                    TileIconSource  = "Icon_Module_Fulfillment",
                    TileTitle       = "Fulfillment",
                    TileCategory    = NavigationNames.ModuleName,
                    Order           = 6,
                    IdColorSchema   = TileColorSchemas.Schema3,
                    NavigateCommand = new DelegateCommand(NavigateHome)
                });
            }
        }
 private void PopulateTiles()
 {
     if (_authContext.CheckPermission(PredefinedPermissions.MarketingContent_PublishingManage))
     {
         _tileManager.AddTile(new IconTileItem()
         {
             IdModule        = NavigationNames.MenuName,
             IdTile          = "PublishAd",
             TileIconSource  = "Icon_ContentPublishing",
             TileTitle       = "Publish ad",
             TileCategory    = NavigationNames.ModuleName,
             Order           = 6,
             IdColorSchema   = TileColorSchemas.Schema4,
             NavigateCommand = new DelegateCommand(() => OnUIThread(async() =>
             {
                 if (NavigateToTabPage(NavigationNames.HomeNameContentPublishing))
                 {
                     await Task.Run(() => Thread.Sleep(300));                      // we need some time to parse xaml
                     //AddItemCommand.Execute();
                 }
             }))
         });
     }
 }
Ejemplo n.º 14
0
        public MenuScreen(Rectangle screenSize)
            : base(screenSize)
        {
            Texture2D menuLogoTexture = Content_Manager.GetInstance().Textures["menu_screen"];

            MenuLogo    = new Sprite(menuLogoTexture, new Vector2(ScreenSize.Width / 2 - menuLogoTexture.Width / 2, 75));
            tileManager = new TileManager();

            tileManager.AddTile(Content_Manager.GetInstance().Textures["scenery hill"], new Vector2(2, ScreenSize.Height / 32 - 3));
            tileManager.AddTile(Content_Manager.GetInstance().Textures["scenery hill"], new Vector2(12, ScreenSize.Height / 32 - 3));

            for (int x = 0; x <= ScreenSize.Width / 32; x++)
            {
                tileManager.AddTile(Content_Manager.GetInstance().Textures["ground"], new Vector2(x, ScreenSize.Height / 32));
                tileManager.AddTile(Content_Manager.GetInstance().Textures["ground"], new Vector2(x, ScreenSize.Height / 32 - 1));
            }

            tileManager.AddTile(Content_Manager.GetInstance().Textures["mario sprite"], new Vector2(4, ScreenSize.Height / 32 - 3), new Vector2(0, 21));

            tileManager.AddTile(Content_Manager.GetInstance().Textures["coinsAnim"], new Vector2(12, 1));
        }
Ejemplo n.º 15
0
        private void PopulateTiles()
        {
            //customers:customer:create && (customers:case:view:all || customers:case:view:assigned)
            if (_authContext.CheckPermission(PredefinedPermissions.CustomersCreateCustomer))
            {
                _tileManager.AddTile(new IconTileItem()
                {
                    IdModule        = NavigationNames.MenuName,
                    IdTile          = "NewCustomer",
                    TileIconSource  = "Icon_Module_Customers",
                    TileTitle       = "New customer",
                    TileCategory    = NavigationNames.ModuleName,
                    Order           = 0,
                    IdColorSchema   = TileColorSchemas.Schema1,
                    NavigateCommand = new DelegateCommand(async() =>
                    {
                        if (NavigateToTabPage(NavigationNames.HomeName))
                        {
                            await Task.Run(() => Thread.Sleep(300));         // we need some time to parse xaml
                            CreateCustomerCommand.Execute();
                        }
                    })
                });
            }

            if (_authContext.CheckPermission(PredefinedPermissions.CustomersCreateNewCase))
            {
                _tileManager.AddTile(new IconTileItem()
                {
                    IdModule        = NavigationNames.MenuName,
                    IdTile          = "NewEmailCase",
                    TileIconSource  = "Icon_New_Case",
                    TileTitle       = "New case",
                    TileCategory    = NavigationNames.ModuleName,
                    Order           = 1,
                    IdColorSchema   = TileColorSchemas.Schema2,
                    NavigateCommand = new DelegateCommand(async() =>
                    {
                        if (NavigateToTabPage(NavigationNames.HomeName))
                        {
                            await Task.Run(() => Thread.Sleep(300));         // we need some time to parse xaml
                            CreateNewCommerceManagerCase(new Contact(), ContactActionState.New, CaseActionState.New);
                        }
                    })
                });
            }

            if (_authContext.CheckPermission(PredefinedPermissions.Name_CustomersViewAssignedCases) ||
                _authContext.CheckPermission(PredefinedPermissions.CustomersViewAllCasesAll))
            {
                _tileManager.AddTile(new ListTileItem()
                {
                    IdModule        = NavigationNames.MenuName,
                    IdTile          = "Activity",
                    TileTitle       = "Activity",
                    TileCategory    = NavigationNames.ModuleName,
                    Order           = 3,
                    IdColorSchema   = TileColorSchemas.Schema3,
                    NavigateCommand = new DelegateCommand(() => { }),
                    Refresh         = async(tileItem) =>
                    {
                        var stringResult = await UpdateActivityTileOnShell();

                        var listTile      = (ListTileItem)tileItem;
                        listTile.InfoList = new ObservableCollection <string>(stringResult);
                    }
                });
            }

            if (_authContext.CheckPermission(PredefinedPermissions.Name_CustomersViewAssignedCases) ||
                _authContext.CheckPermission(PredefinedPermissions.CustomersViewAllCasesAll))
            {
                _tileManager.AddTile(new NumberTileItem()
                {
                    IdModule        = NavigationNames.MenuName,
                    IdTile          = "PendingCases",
                    TileTitle       = "Pending cases",
                    TileCategory    = NavigationNames.ModuleName,
                    Order           = 4,
                    IdColorSchema   = TileColorSchemas.Schema2,
                    NavigateCommand = new DelegateCommand(() => NavigateToTabPage(NavigationNames.HomeName)),
                    Refresh         = async(tileItem) =>
                    {
                        using (var repository = _customerRepository.GetRepositoryInstance())
                        {
                            try
                            {
                                if (tileItem is NumberTileItem)
                                {
                                    var query =
                                        await
                                        Task.Run(
                                            () =>
                                            repository.Cases.Where(c => c.Status == CaseStatus.Pending.ToString())
                                            .Count());
                                    (tileItem as NumberTileItem).TileNumber = query.ToString();
                                }
                            }
                            catch
                            {
                            }
                        }
                    }
                });
            }

            if (_authContext.CheckPermission(PredefinedPermissions.Name_CustomersViewAssignedCases) ||
                _authContext.CheckPermission(PredefinedPermissions.CustomersViewAllCasesAll))
            {
                _tileManager.AddTile(new ListTileItem()
                {
                    IdModule        = NavigationNames.MenuName,
                    IdTile          = "LastestCases",
                    TileTitle       = "Latest cases",
                    TileCategory    = NavigationNames.ModuleName,
                    Order           = 2,
                    Width           = (double)TileSize.Double,
                    IdColorSchema   = TileColorSchemas.Schema4,
                    NavigateCommand = new DelegateCommand(() => { }),
                    Refresh         = async(tileItem) =>
                    {
                        using (var repository = _customerRepository.GetRepositoryInstance())
                        {
                            try
                            {
                                var currTile = tileItem as ListTileItem;
                                if (currTile != null)
                                {
                                    var query =
                                        await
                                        Task.Run(() => repository.Cases.OrderBy(x => x.Created).Take(4));
                                    if (currTile.InfoList == null)
                                    {
                                        currTile.InfoList = new ObservableCollection <string>();
                                    }
                                    currTile.InfoList.Clear();
                                    foreach (var item in query)
                                    {
                                        currTile.InfoList.Add(item.Title);
                                    }
                                }
                            }
                            catch
                            {
                            }
                        }
                    }
                });
            }
        }
Ejemplo n.º 16
0
        private void PopulateTiles()
        {
            if (_authContext.CheckPermission(PredefinedPermissions.MarketingPromotionsManage))
            {
                _tileManager.AddTile(new NumberTileItem()
                {
                    IdModule        = NavigationNames.MenuName,
                    IdTile          = "ActiveAds",
                    TileTitle       = "Active ads",
                    TileCategory    = NavigationNames.ModuleName,
                    Order           = 3,
                    IdColorSchema   = TileColorSchemas.Schema3,
                    NavigateCommand = new DelegateCommand(() => NavigateToTabPage(NavigationNames.HomeNameDynamicContent)),
                    Refresh         = async(tileItem) =>
                    {
                        try
                        {
                            using (var repository = _dynamicContentRepository.GetRepositoryInstance())
                            {
                                if (tileItem is NumberTileItem)
                                {
                                    var query = await Task.Factory.StartNew(() => repository.Items.Count());
                                    (tileItem as NumberTileItem).TileNumber = query.ToString();
                                }
                            }
                        }
                        catch
                        {
                        }
                    }
                });
            }

            if (_authContext.CheckPermission(PredefinedPermissions.MarketingDynamic_ContentManage))
            {
                _tileManager.AddTile(new NumberTileItem()
                {
                    IdModule        = NavigationNames.MenuName,
                    IdTile          = "TotalAds",
                    TileTitle       = "Total ads",
                    TileCategory    = NavigationNames.ModuleName,
                    Order           = 3,
                    IdColorSchema   = TileColorSchemas.Schema2,
                    NavigateCommand = new DelegateCommand(() => NavigateToTabPage(NavigationNames.HomeNameDynamicContent)),
                    Refresh         = async(tileItem) =>
                    {
                        try
                        {
                            using (var repository = _dynamicContentRepository.GetRepositoryInstance())
                            {
                                if (tileItem is NumberTileItem)
                                {
                                    var query = await Task.Factory.StartNew(() => repository.Items.Count());
                                    (tileItem as NumberTileItem).TileNumber = query.ToString();
                                }
                            }
                        }
                        catch
                        {
                        }
                    }
                });
            }

            if (_authContext.CheckPermission(PredefinedPermissions.MarketingDynamic_ContentManage))
            {
                _tileManager.AddTile(new IconTileItem()
                {
                    IdModule        = NavigationNames.MenuName,
                    IdTile          = "NewAd",
                    TileIconSource  = "Icon_Dynamic",
                    TileTitle       = "New ad",
                    TileCategory    = NavigationNames.ModuleName,
                    Order           = 5,
                    IdColorSchema   = TileColorSchemas.Schema1,
                    NavigateCommand = new DelegateCommand(() => OnUIThread(async() =>
                    {
                        if (NavigateToTabPage(NavigationNames.HomeNameDynamicContent))
                        {
                            await Task.Run(() => Thread.Sleep(300));         // we need some time to parse xaml
                            AddItemCommand.Execute();
                        }
                    }))
                });
            }
        }
Ejemplo n.º 17
0
 private void CreateTile(string name, bool isShore, bool isOcean, bool isMountain, float rainfallMin, float rainfallMax, float temperatureMin, float temperateMax)
 {
     tileManager.AddTile(new Tile(name, isShore, isOcean, isMountain, rainfallMin, rainfallMax, temperatureMin, temperateMax));
 }
        private void PopulateTiles()
        {
            if (_authContext.CheckPermission(PredefinedPermissions.MarketingPromotionsManage))
            {
                _tileManager.AddTile(new NumberTileItem()
                {
                    IdModule        = NavigationNames.MenuName,
                    IdTile          = "ActivePromotions",
                    TileTitle       = "Active promotions",
                    TileCategory    = NavigationNames.ModuleName,
                    Order           = 0,
                    IdColorSchema   = TileColorSchemas.Schema3,
                    NavigateCommand = new DelegateCommand(() => OnUIThread(async() =>
                    {
                        if (NavigateToTabPage(NavigationNames.HomeName))
                        {
                            SearchFilterState = SearchFilterStates[0];
                            await Task.Run(() => Thread.Sleep(300));                              // we need some time to parse xaml
                            SearchItemsCommand.Execute();
                        }
                    })),
                    Refresh = async(tileItem) =>
                    {
                        try
                        {
                            using (var repository = _marketingRepository.GetRepositoryInstance())
                            {
                                if (tileItem is NumberTileItem)
                                {
                                    var query = await Task.Factory.StartNew(() => repository.Promotions.Count());
                                    (tileItem as NumberTileItem).TileNumber = query.ToString();
                                }
                            }
                        }
                        catch
                        {
                        }
                    }
                });
            }

            if (_authContext.CheckPermission(PredefinedPermissions.MarketingPromotionsManage))
            {
                _tileManager.AddTile(new IconTileItem()
                {
                    IdModule        = NavigationNames.MenuName,
                    IdTile          = "NewPromotion",
                    TileIconSource  = "Icon_Module_Promotions",
                    TileTitle       = "New promotion",
                    TileCategory    = NavigationNames.ModuleName,
                    Order           = 1,
                    IdColorSchema   = TileColorSchemas.Schema1,
                    NavigateCommand = new DelegateCommand(() => OnUIThread(async() =>
                    {
                        if (NavigateToTabPage(NavigationNames.HomeName))
                        {
                            await Task.Run(() => Thread.Sleep(300));                                             // we need some time to parse xaml
                            CreateItemCommand.Execute();
                        }
                    }))
                });
            }
        }