Example #1
0
        private void BtnAbout_MouseLeftButtonUp(object sender, System.Windows.Input.MouseButtonEventArgs e)
        {
            AlertDialog Dialog = new AlertDialog(Application.Current.MainWindow,
                "정보",
                "이름: " + ExpandedWidget.Title + "\n" +
                "제작: " + ExpandedWidget.Author + "\n" +
                "설명: " + ExpandedWidget.Summary,
                false);

            Dialog.ShowDialog();
        }
Example #2
0
        private void GridWidget_LongClick()
        {
            AlertDialog Dialog = new AlertDialog(Application.Current.MainWindow,
                "선택된 위젯 삭제",
                "선택한 위젯을 삭제하시겠습니까? 삭제한 위젯은 애플리케이션의 위젯 서랍에서 다시 불러올 수 있습니다.",
                true);

            Dialog.ShowDialog();
            LongClick = false;
            if (Dialog.GetResult())
            {
                ParentDock.Remove(this);
            }
        }
Example #3
0
        private void LoadWidgets()
        {
            // 위젯 검색
            string[] Widgets = Directory.GetFiles(ConfigManager.WidgetPath, "*.ini", SearchOption.AllDirectories);

            // 검색된 위젯 추가
            foreach(string Path in Widgets)
            {
                // 위젯 구성 분석
                INI Widget = new INI(Path);
                string Title = Widget.GetValue("General", "Title");

                // 위젯 섬네일 컨트롤 생성
                StackPanel WidgetStack = new StackPanel
                {
                    Width = 120,
                    Height = 120,
                    Margin = new Thickness(15, 10, 0, 0)
                };

                Image WidgerThumb = new Image
                {
                    Width = 80,
                    Height = 80,
                    Source = ImageLoad(Directory.GetParent(Path) + "\\" + System.IO.Path.GetFileNameWithoutExtension(Path) + ".png")
                };
                WidgetStack.Children.Add(WidgerThumb);

                TextBlock WidgetTitle = new TextBlock
                {
                    Text = Title,
                    Margin = new Thickness(0, 10, 0, 0),
                    VerticalAlignment = VerticalAlignment.Bottom,
                    HorizontalAlignment = HorizontalAlignment.Center
                };
                WidgetStack.Children.Add(WidgetTitle);

                // 위젯 섬네일 컨트롤 이벤트 설정
                WidgetStack.MouseLeftButtonDown += (s, e) =>
                {
                    IsDrawerOpen = false;
                    GridWidget Target = new GridWidget
                    {
                        NowLoading = true,
                        LazyLoading = Path,
                        LoadingImage = (BitmapImage)WidgerThumb.Source
                    };

                    if (Target.LoadConfig(Path))
                    {
                        Add(Target);
                        Target.StartMouseDown();
                    }
                    else
                    {
                        AlertDialog Dialog = new AlertDialog(Application.Current.MainWindow,
                            "오류",
                            "위젯을 로드할 수 없습니다.\n" +
                            "구성 파일 오류가 발생하였습니다.",
                            false);

                        Dialog.ShowDialog();
                    }
                };

                // 콘텐츠 스택에 섬네일 컨트롤 추가
                StackDrawerContent.Children.Add(WidgetStack);
            }
        }
Example #4
0
        private void GridWidget_PreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
        {
            if (!Expand)
            {
                if (LongClickTimer != null)
                {
                    LongClickTimer.Stop();
                    LongClickTimer = null;
                }

                if (!LongClick)
                {
                    if (!NowLoading)
                    {
                        Expand = true;
                    }
                    else
                    {
                        StopMouseDown();
                        NowLoading = false;

                        if (LazyLoading != null)
                        {
                            if (Load(LazyLoading, true))
                            {
                                ImgLoading.Visibility = Visibility.Collapsed;
                            }
                            else if (ParentDock != null)
                            {
                                ParentDock.Remove(this);

                                AlertDialog Dialog = new AlertDialog(Application.Current.MainWindow,
                                    "오류",
                                    "위젯을 로드할 수 없습니다.\n" +
                                    "어셈블리 오류가 발생하였습니다.",
                                    false);

                                Dialog.ShowDialog();
                            }
                        }
                    }
                }
                else
                {
                    LongClick = false;
                }
            }
        }