예제 #1
0
        public void CreateShortcut(string Name, string FileName, Size DrawSize)
        {
            //Create shortcut
            var shortcut = new ShortcutView(Name, FileName);

            shortcut.DrawSize = DrawSize;			//Assign size to the ShortcutView
            DrawShortcut(shortcut, shortcuts.Count);		//Calculate drawing pos. of the shortcut

            //Add shortcut
            shortcuts.Add(shortcut);
            panel_container.Controls.Add(shortcut.Container);
        }
예제 #2
0
        public void CreateShortcut(string[] ShortcutInfo, Size DrawSize)
        {
            //Create shortcut
            var shortcut = new ShortcutView(ShortcutInfo[0], ShortcutInfo[1]);

            shortcut.DrawSize = DrawSize;			//Assign size to the ShortcutView
            DrawShortcut(shortcut, shortcuts.Count);		//Calculate drawing pos. of the shortcut

            //Add shortcut
            shortcuts.Add(shortcut);
            panel_container.Controls.Add(shortcut.Container);
        }
예제 #3
0
        private void DrawShortcut(ShortcutView shortcut, int currentIndex)
        {
            //Calculate creation point of the shortcut
            int yPos = 20 + ((shortcut.DrawSize.Height + 10) * (currentIndex / 4));
            if (currentIndex >= 4)
                currentIndex %= 4;
            int xPos = 20 + ((shortcut.DrawSize.Width + 10) * currentIndex);
            var creationPoint = new Point(xPos, yPos);

            shortcut.Location = creationPoint;
        }