Example #1
0
        private void PrepareGrid()
        {
            var functionInfos = _majorContext.FunctionInfos;
            int columnCount, useRowIndex, useColumnIndex;

            GridUtility.PrepareBuutonGrid(CoreGrid, functionInfos.Count, true, out columnCount, out useRowIndex, out useColumnIndex);

            foreach (var oneFunctionInfo in functionInfos)
            {
                var button = ButtonUtility.CreateButton(oneFunctionInfo.Value.ImagePath, oneFunctionInfo.Key,
                                                        oneFunctionInfo.Value.MouseEnterImagePath);
                if (oneFunctionInfo.Value.Kind == FunctionKind.Video)
                {
                    var majorVideoContext = GetMajorVideoContext();

                    button.Tag    = majorVideoContext;
                    button.Click += NavigateVideoPageButton_Click;
                    if (!_appConfig.ShowVideoButtonToolTip)
                    {
                        button.ToolTip = null;
                    }
                }
                else if (oneFunctionInfo.Value.Kind == FunctionKind.OpenFile)
                {
                    button.Tag    = oneFunctionInfo.Value;
                    button.Click += OpenFileButton_Click;
                    ;
                }

                GridUtility.SetButton(CoreGrid, button, true, columnCount, ref useRowIndex, ref useColumnIndex);
            }
        }
Example #2
0
        private void PrepareGrid(Grid grid, IDictionary <string, FolderInfo> infos)
        {
            int columnCount, useRowIndex, useColumnIndex;

            GridUtility.PrepareBuutonGrid(grid, infos.Count, false, out columnCount, out useRowIndex, out useColumnIndex);

            foreach (var oneInfoPair in infos)
            {
                var button = ButtonUtility.CreateButton(oneInfoPair.Value.ImagePath, oneInfoPair.Key, oneInfoPair.Value.MoveEnterImagePath);
                button.Tag    = oneInfoPair.Value.Path;
                button.Click += OpenFolderButton_Click;
                GridUtility.SetButton(grid, button, false, columnCount, ref useRowIndex, ref useColumnIndex);
            }
        }
Example #3
0
        private void PrepareGrid(Grid grid, IDictionary <string, FolderInfo> infos, bool isMajorRequest)
        {
            int columnCount, useRowIndex, useColumnIndex;

            GridUtility.PrepareBuutonGrid(grid, infos.Count, isMajorRequest, out columnCount, out useRowIndex, out useColumnIndex);

            foreach (var oneInfoPair in infos)
            {
                var button = ButtonUtility.CreateButton(oneInfoPair.Value.ImagePath, oneInfoPair.Key, oneInfoPair.Value.MoveEnterImagePath);
                if (isMajorRequest)
                {
                    MajorContext majorContext = MajorsContext.PrepareMajorContext(_majorsContext, _appConfig, oneInfoPair);
                    button.Tag    = majorContext;
                    button.Click += NavigateMajorPageButton_Click;
                }
                else
                {
                    button.Tag    = oneInfoPair.Value.Path;
                    button.Click += OpenFolderButton_Click;
                }

                GridUtility.SetButton(grid, button, isMajorRequest, columnCount, ref useRowIndex, ref useColumnIndex);
            }
        }