Пример #1
0
        public CircleVisual(GMapMarker m, Brush background)
        {
            Marker        = m;
            Marker.ZIndex = 100;

            Popup.AllowsTransparency = true;
            Popup.PlacementTarget    = this;
            Popup.Placement          = PlacementMode.Mouse;
            Popup.Child         = Tooltip;
            Popup.Child.Opacity = 0.777;

            SizeChanged += new SizeChangedEventHandler(CircleVisual_SizeChanged);
            MouseEnter  += new System.Windows.Input.MouseEventHandler(CircleVisual_MouseEnter);
            MouseLeave  += new System.Windows.Input.MouseEventHandler(CircleVisual_MouseLeave);
            Loaded      += new RoutedEventHandler(OnLoaded);

            Text = "?";

            StrokeArrow.EndLineCap = PenLineCap.Triangle;
            StrokeArrow.LineJoin   = PenLineJoin.Round;

            RenderTransform = scale;

            Width    = Height = 22;
            FontSize = (Width / 1.55);

            Background = background;
            Angle      = null;
        }
Пример #2
0
        public CircleVisual(GMapMarker m, Brush background)
        {
            Marker = m;
             Marker.ZIndex = 100;

             Popup.AllowsTransparency = true;
             Popup.PlacementTarget = this;
             Popup.Placement = PlacementMode.Mouse;
             Popup.Child.Opacity = 0.777;

             SizeChanged += new SizeChangedEventHandler(CircleVisual_SizeChanged);
             MouseEnter += new System.Windows.Input.MouseEventHandler(CircleVisual_MouseEnter);
             MouseLeave += new System.Windows.Input.MouseEventHandler(CircleVisual_MouseLeave);
             Loaded += new RoutedEventHandler(OnLoaded);

             Text = "?";

             StrokeArrow.EndLineCap = PenLineCap.Triangle;
             StrokeArrow.LineJoin = PenLineJoin.Round;

             RenderTransform = scale;

             Width = Height = 22;
             FontSize = (Width/1.55);

             Background = background;
             Angle = null;
        }
Пример #3
0
        private void OnSuccess()
        {
            MouseDown += new MouseButtonEventHandler(Window1_MouseDown);
            MouseMove += new System.Windows.Input.MouseEventHandler(Window1_MouseMove);
            MouseUp += new MouseButtonEventHandler(Window1_MouseUp);
            _Canvas.Children.Add(_Image);
            string fname = _OpenFileDialog.FileNames[0];
            _Image.Source = new BitmapImage(new Uri(fname));

            _Canvas.Children.Add(_Rectangle);
            _Rectangle.Stroke = new SolidColorBrush(Colors.Blue);
            _Rectangle.StrokeThickness = 2;
            KeyDown += new System.Windows.Input.KeyEventHandler(Window1_KeyDown);
        }
Пример #4
0
        private void OnSuccess()
        {
            MouseDown += new MouseButtonEventHandler(Window1_MouseDown);
            MouseMove += new System.Windows.Input.MouseEventHandler(Window1_MouseMove);
            MouseUp   += new MouseButtonEventHandler(Window1_MouseUp);
            _Canvas.Children.Add(_Image);
            string fname = _OpenFileDialog.FileNames[0];

            _Image.Source = new BitmapImage(new Uri(fname));

            _Canvas.Children.Add(_Rectangle);
            _Rectangle.Stroke          = new SolidColorBrush(Colors.Blue);
            _Rectangle.StrokeThickness = 2;
            KeyDown += new System.Windows.Input.KeyEventHandler(Window1_KeyDown);
        }
Пример #5
0
        public PieGraph()
        {
            ColorList = new List<Color>();
            ColorList.Add(Color.FromRgb(255, 91, 43));
            ColorList.Add(Color.FromRgb(177, 34, 28));
            ColorList.Add(Color.FromRgb(52, 57, 62));
            ColorList.Add(Color.FromRgb(140, 198, 215));
            ColorList.Add(Color.FromRgb(255, 218, 140));
            //System.Windows.Media.Effects.DropShadowBitmapEffect shadow = new System.Windows.Media.Effects.DropShadowBitmapEffect();
            //BitmapEffect = shadow;

            MouseMove += new System.Windows.Input.MouseEventHandler( onMouseMove );
            MouseLeave += new System.Windows.Input.MouseEventHandler( onMouseLeave );

            MouseDown += new MouseButtonEventHandler( onMouseDown );
        }
Пример #6
0
        public MainWindow()
        {
            InitializeComponent();

            mL.Enabled = true;
            mL.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(mL_MouseDoubleClick);

            MouseEnter += new System.Windows.Input.MouseEventHandler(MainWindow_MouseEnter);
            MouseLeave += new System.Windows.Input.MouseEventHandler(MainWindow_MouseLeave);

            Thread Worker = new Thread(() =>
                {
                    Action action = delegate { Update(); };
                    while (running)
                    {
                        this.Dispatcher.Invoke(action);
                        Thread.Sleep(25);
                    }
                });
            Worker.Start();
            this.Background = BackGround;
        }
 private void MoveWindowLock(object sender, RoutedEventArgs e)
 {
     _windowMoveLock = false;
     MouseMove      -= new System.Windows.Input.MouseEventHandler(MoveWindow);
 }
Пример #8
0
        private void InitEvent()
        {
            MVWindow_IsInSync_And_IsSyncOwner_Callback = new MVWindow_IsInSync_And_IsSyncOwner_Function(IsInSync_And_IsSyncOwner);
            MVWindow_MVAction_Callback = new MVWindow_MVAction_Function(MVAction);
            Singleton_Socket.mvWindow_OpenIEventManager.MVWindow_IsInSync_And_IsSyncOwner_Event += MVWindow_IsInSync_And_IsSyncOwner_Callback;
            Singleton_Socket.mvWindow_OpenIEventManager.MVWindow_MVAction_Event += MVWindow_MVAction_Callback;
            MouseTimer          = new DispatcherTimer();
            MouseTimer.Interval = TimeSpan.FromMilliseconds(1100.0);
            MouseTimer.Tick    += new EventHandler(MouseTimer_Tick);
            MouseTimer.Start();
            MediaPlayerTimer          = new DispatcherTimer();
            MediaPlayerTimer.Interval = TimeSpan.FromMilliseconds(200.0);
            MediaPlayerTimer.Tick    += new EventHandler(MediaPlayerTimer_Tick);
            Image image = btnClose;

            if (CS_0024_003C_003E9__CachedAnonymousMethodDelegatee == null)
            {
                CS_0024_003C_003E9__CachedAnonymousMethodDelegatee = new System.Windows.Input.MouseEventHandler(_003CInitEvent_003Eb__2);
            }
            image.MouseEnter += CS_0024_003C_003E9__CachedAnonymousMethodDelegatee;
            Image image2 = btnClose;

            if (CS_0024_003C_003E9__CachedAnonymousMethodDelegatef == null)
            {
                CS_0024_003C_003E9__CachedAnonymousMethodDelegatef = new System.Windows.Input.MouseEventHandler(_003CInitEvent_003Eb__3);
            }
            image2.MouseLeave            += CS_0024_003C_003E9__CachedAnonymousMethodDelegatef;
            btnClose.MouseLeftButtonDown += new MouseButtonEventHandler(btnClose_MouseLeftButtonDown);
            Image image3 = btnSync;

            if (CS_0024_003C_003E9__CachedAnonymousMethodDelegate10 == null)
            {
                CS_0024_003C_003E9__CachedAnonymousMethodDelegate10 = new System.Windows.Input.MouseEventHandler(_003CInitEvent_003Eb__4);
            }
            image3.MouseEnter += CS_0024_003C_003E9__CachedAnonymousMethodDelegate10;
            Image image4 = btnSync;

            if (CS_0024_003C_003E9__CachedAnonymousMethodDelegate11 == null)
            {
                CS_0024_003C_003E9__CachedAnonymousMethodDelegate11 = new System.Windows.Input.MouseEventHandler(_003CInitEvent_003Eb__5);
            }
            image4.MouseLeave           += CS_0024_003C_003E9__CachedAnonymousMethodDelegate11;
            btnSync.MouseLeftButtonDown += new MouseButtonEventHandler(btnSync_MouseLeftButtonDown);
            Image image5 = btnLight;

            if (CS_0024_003C_003E9__CachedAnonymousMethodDelegate12 == null)
            {
                CS_0024_003C_003E9__CachedAnonymousMethodDelegate12 = new System.Windows.Input.MouseEventHandler(_003CInitEvent_003Eb__6);
            }
            image5.MouseEnter += CS_0024_003C_003E9__CachedAnonymousMethodDelegate12;
            Image image6 = btnLight;

            if (CS_0024_003C_003E9__CachedAnonymousMethodDelegate13 == null)
            {
                CS_0024_003C_003E9__CachedAnonymousMethodDelegate13 = new System.Windows.Input.MouseEventHandler(_003CInitEvent_003Eb__7);
            }
            image6.MouseLeave            += CS_0024_003C_003E9__CachedAnonymousMethodDelegate13;
            btnLight.MouseLeftButtonDown += new MouseButtonEventHandler(btnSync_MouseLeftButtonDown);
            Image image7 = btnFunction;

            if (CS_0024_003C_003E9__CachedAnonymousMethodDelegate14 == null)
            {
                CS_0024_003C_003E9__CachedAnonymousMethodDelegate14 = new System.Windows.Input.MouseEventHandler(_003CInitEvent_003Eb__8);
            }
            image7.MouseEnter += CS_0024_003C_003E9__CachedAnonymousMethodDelegate14;
            Image image8 = btnFunction;

            if (CS_0024_003C_003E9__CachedAnonymousMethodDelegate15 == null)
            {
                CS_0024_003C_003E9__CachedAnonymousMethodDelegate15 = new System.Windows.Input.MouseEventHandler(_003CInitEvent_003Eb__9);
            }
            image8.MouseLeave       += CS_0024_003C_003E9__CachedAnonymousMethodDelegate15;
            HeaderDP.MouseEnter     += new System.Windows.Input.MouseEventHandler(_003CInitEvent_003Eb__a);
            HeaderDP.MouseLeave     += new System.Windows.Input.MouseEventHandler(_003CInitEvent_003Eb__b);
            FooterDP.MouseEnter     += new System.Windows.Input.MouseEventHandler(_003CInitEvent_003Eb__c);
            FooterDP.MouseLeave     += new System.Windows.Input.MouseEventHandler(_003CInitEvent_003Eb__d);
            SeekBar.ValueChanged    += new RoutedPropertyChangedEventHandler <double>(SeekBar_ValueChanged);
            mediaPlayer.MediaOpened += new RoutedEventHandler(MediaPlayer_MediaOpened);
            mediaPlayer.Play();
            btnFunction.Source = new BitmapImage(new Uri("images/mv_pause.png", UriKind.Relative));
            img_animation.MouseLeftButtonDown += new MouseButtonEventHandler(AnimationController_MouseLeftButtonDown);
            btnFunction.MouseLeftButtonDown   += new MouseButtonEventHandler(AnimationController_MouseLeftButtonDown);
            mediaPlayer.MouseLeftButtonDown   += new MouseButtonEventHandler(AnimationController_MouseLeftButtonDown);
            cbBooks.SelectionChanged          += new SelectionChangedEventHandler(cbBooks_SelectionChanged);
            ParsePageJson();
        }
Пример #9
0
        //MainWindow构造函数
        public MainWindow()
        {
            #region "读取注册表(必须在初始化之前读取)"
            //背景图片
            string bg        = RegeditRW.RegReadString("Background");
            double bgStretch = RegeditRW.RegRead("BackgroundStretch");
            //透明度
            double bgAlpha      = RegeditRW.RegRead("BGAlpha");
            double bgPanelAlpha = RegeditRW.RegRead("BGPanelAlpha");
            double windowAlpha  = RegeditRW.RegRead("WindowAlpha");
            //窗口大小
            double mainWindowHeight = RegeditRW.RegRead("MainWindowHeight");
            double mainWindowWidth  = RegeditRW.RegRead("MainWindowWidth");
            //字体
            string mainWindowFont = RegeditRW.RegReadString("MainWindowFont");
            //设置菜单
            double winTopmost = RegeditRW.RegRead("Topmost");
            //游戏版本
            double gameVersion = RegeditRW.RegRead("GameVersion");
            #endregion
            //初始化
            InitializeComponent();
            //窗口缩放
            SourceInitialized += delegate(object sender, EventArgs e) { _HwndSource = PresentationSource.FromVisual((Visual)sender) as HwndSource; };
            MouseMove         += new System.Windows.Input.MouseEventHandler(Window_MouseMove);
            //mainWindow初始化标志
            MWInit = true;
            #region "读取设置"
            //设置字体
            if (mainWindowFont == "" || mainWindowFont == null)
            {
                RegeditRW.RegWrite("MainWindowFont", "微软雅黑");
                mainWindowFont = "微软雅黑";
            }
            mainWindow.FontFamily = new FontFamily(mainWindowFont);
            //版本初始化
            UI_Version.Text = "v" + System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString();
            //窗口可视化计时器
            VisiTimer.Enabled  = true;
            VisiTimer.Interval = 200;
            VisiTimer.Tick    += new EventHandler(VisiTimerEvent);
            VisiTimer.Start();
            //设置光标资源字典路径
            cursorDictionary.Source = new Uri("Dictionary/CursorDictionary.xaml", UriKind.Relative);
            //显示窗口
            MWVisivility = true;
            //右侧面板Visibility属性初始化
            RightPanelVisibility("Welcome");

            //窗口置顶
            if (winTopmost == 1)
            {
                Se_button_Topmost_Click(null, null);
            }
            //设置背景
            if (bg == "")
            {
                Se_BG_Alpha_Text.Foreground = Brushes.Silver;
                Se_BG_Alpha.IsEnabled       = false;
            }
            else
            {
                Se_BG_Alpha_Text.Foreground = Brushes.Black;
                try
                {
                    var brush = new ImageBrush()
                    {
                        ImageSource = new BitmapImage(new Uri(bg))
                    };
                    UI_BackGroundBorder.Background = brush;
                }
                catch
                {
                    Visi.VisiCol(true, UI_BackGroundBorder);
                }
            }
            //设置背景拉伸方式
            if (bgStretch == 0)
            {
                bgStretch = 2;
            }
            Se_ComboBox_Background_Stretch.SelectedIndex = (int)bgStretch - 1;
            //设置背景透明度
            if (bgAlpha == 0)
            {
                bgAlpha = 101;
            }
            Se_BG_Alpha.Value           = bgAlpha - 1;
            Se_BG_Alpha_Text.Text       = "背景不透明度:" + (int)Se_BG_Alpha.Value + "%";
            UI_BackGroundBorder.Opacity = (bgAlpha - 1) / 100;
            //设置面板透明度
            if (bgPanelAlpha == 0)
            {
                bgPanelAlpha = 61;
            }
            Se_Panel_Alpha.Value         = bgPanelAlpha - 1;
            Se_Panel_Alpha_Text.Text     = "面板不透明度:" + (int)Se_Panel_Alpha.Value + "%";
            RightGrid.Background.Opacity = (bgPanelAlpha - 1) / 100;
            //设置窗口透明度
            if (windowAlpha == 0)
            {
                windowAlpha = 101;
            }
            Se_Window_Alpha.Value     = windowAlpha - 1;
            Se_Window_Alpha_Text.Text = "窗口不透明度:" + (int)Se_Window_Alpha.Value + "%";
            Opacity = (windowAlpha - 1) / 100;
            //设置高度和宽度
            Width  = mainWindowWidth;
            Height = mainWindowHeight;
            //设置游戏版本
            UI_gameversion.SelectedIndex = (int)gameVersion;
            #endregion
        }