Exemple #1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!this.IsPostBack)
     {
         IconsList.DataSource = ResourceProvider.GetIconImageFileNameList(this.IconSize);
         IconsList.DataBind();
     }
 }
Exemple #2
0
        private FileViewModel CreateViewModelFile(Models.File file)
        {
            var fileViewModel = new ViewModels.FileViewModel();

            fileViewModel.Id    = file.Id;
            fileViewModel.Title = file.Title;
            fileViewModel.Link  = file.Link;

            fileViewModel.IconStyle = IconsList.GetIconTypeName(file.Type);

            return(fileViewModel);
        }
Exemple #3
0
        private ViewModels.DocumentViewModel CreateViewModelDocument(Models.Document document)
        {
            var documentViewModel = new ViewModels.DocumentViewModel();

            documentViewModel.Id          = document.Id;
            documentViewModel.Title       = document.Title;
            documentViewModel.Link        = document.Link;
            documentViewModel.Description = document.Description;
            documentViewModel.IconStyle   = IconsList.GetIconTypeName(document.Type);

            return(documentViewModel);
        }
    void SetupStuff()
    {
        playerHeadLook = transform.Find("Head").GetComponent <MouseLook>();
        playerTurn     = GetComponent <MouseLook>();
        playerMove     = GetComponent <Movement>();

        shopString  = "Press TAB to access the Shop";
        chestString = "Press TAB to access this Chest";

        slotX = 6f;
        slotY = 1f;

        iconsListFromGameManager = gameManager.GetComponent <IconsList>();
    }
Exemple #5
0
        private void OnClosing(object sender, CancelEventArgs e)
        {
            if (!IsResultOk)
            {
                return;
            }

            foreach (var item in IconsList.FindVisualChildren <FrameworkElement>().Where(x => x.Name == @"NewIcon"))
            {
                if (!(item.DataContext is AppWindowItem data) || !data.IsInEditMode)
                {
                    continue;
                }

                item.DataContext = data;
                data.Save();
                var size   = new Size(CommonAcConsts.AppIconWidth, CommonAcConsts.AppIconHeight);
                var result = new ContentPresenter {
                    Width = size.Width, Height = size.Height, Content = item
                };

                SaveIcon();
                data.ShowEnabled = !data.ShowEnabled;
                SaveIcon();

                void SaveIcon()
                {
                    result.Measure(size);
                    result.Arrange(new Rect(size));
                    result.ApplyTemplate();
                    result.UpdateLayout();

                    var bmp = new RenderTargetBitmap(CommonAcConsts.AppIconWidth, CommonAcConsts.AppIconHeight, 96, 96, PixelFormats.Pbgra32);

                    bmp.Render(result);
                    bmp.SaveTo(data.IconOriginal);
                    BetterImage.Refresh(data.IconOriginal);
                }
            }
        }
 public static void Initialize()
 {
     Icons = Resources.Load <IconsList>("Data/icons");
 }