コード例 #1
0
        private void btnExportStyle_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                string style = string.Format(@"<Style x:Key=""MyGridStyle"" TargetType=""c1dg:C1DataGrid"">
    <Setter Property=""Background"" Value=""{0}""/>
    <Setter Property=""BorderBrush"" Value=""{1}""/>
    <Setter Property=""HorizontalGridLinesBrush"" Value=""{2}""/>
    <Setter Property=""MouseOverBrush"" Value=""{3}""/>
    <Setter Property=""PressedBrush"" Value=""{11}""/>
    <Setter Property=""RowBackground"" Value=""{4}""/>
    <Setter Property=""AlternatingRowBackground"" Value=""{5}""/>
    <Setter Property=""SelectedBackground"" Value=""{6}""/>
    <Setter Property=""VerticalGridLinesBrush"" Value=""{7}""/>
    <Setter Property=""Foreground"" Value=""{8}""/>
    <Setter Property=""RowForeground"" Value=""{9}""/>
    <Setter Property=""AlternatingRowForeground"" Value=""{10}""/>
    <Setter Property=""ValidationBackground"" Value=""{12}""/>
    <Setter Property=""ValidationForeground"" Value=""{13}""/>
    <Setter Property=""HeaderBackground"" Value=""{14}""/>
    <Setter Property=""HeaderForeground"" Value=""{15}""/>
    <Setter Property=""GroupingPanelBackground"" Value=""{16}""/>
    <Setter Property=""GroupingPanelForeground"" Value=""{17}""/>
</Style>",
                                             (grid.Background as SolidColorBrush).Color,
                                             (grid.BorderBrush as SolidColorBrush).Color,
                                             (grid.HorizontalGridLinesBrush as SolidColorBrush).Color,
                                             (grid.MouseOverBrush as SolidColorBrush).Color,
                                             (grid.RowBackground as SolidColorBrush).Color,
                                             (grid.AlternatingRowBackground as SolidColorBrush).Color,
                                             (grid.SelectedBackground as SolidColorBrush).Color,
                                             (grid.VerticalGridLinesBrush as SolidColorBrush).Color,
                                             (grid.Foreground as SolidColorBrush).Color,
                                             (grid.RowForeground as SolidColorBrush).Color,
                                             (grid.AlternatingRowForeground as SolidColorBrush).Color,
                                             (grid.PressedBrush as SolidColorBrush).Color,
                                             (grid.ValidationBackground as SolidColorBrush).Color,
                                             (grid.ValidationForeground as SolidColorBrush).Color,
                                             (grid.HeaderBackground as SolidColorBrush).Color,
                                             (grid.HeaderForeground as SolidColorBrush).Color,
                                             (grid.GroupingPanelBackground as SolidColorBrush).Color,
                                             (grid.GroupingPanelForeground as SolidColorBrush).Color);
                var window = new C1Window();
                window.Content = new System.Windows.Controls.TextBox()
                {
                    Text = style, FontSize = 16
                };
                window.ShowModal();
                window.CenterOnScreen();
            }
            catch
            {
            }
        }
コード例 #2
0
        private void CreateModal_Click(object sender, RoutedEventArgs e)
        {
            C1Window wnd = new C1Window();

            wnd.Header  = "This is the header.";
            wnd.Height  = 300;
            wnd.Width   = 300;
            wnd.Content = new WindowContent();
            wnd.CenterOnScreen();
            wnd.ShowModal();
        }
コード例 #3
0
 private void ShowWindow(bool showModal)
 {
     C1Window wnd = new C1Window();
     wnd.Header = "This is the header.";
     wnd.Height = 300;
     wnd.Width = 300;
     wnd.Content = new WindowContent();
     wnd.CenterOnScreen();
     if (showModal)
         wnd.ShowModal();
     else
         wnd.Show();
 }
コード例 #4
0
        private void btnPrintSettings_Click(object sender, RoutedEventArgs e)
        {
            // show editor in a dialog
            C1Window w = new C1Window();

            w.Header     = C1.WPF.Olap.Resources.Resources.DocumentOptions;
            w.FontFamily = FontFamily;
            w.FontSize   = FontSize;
            w.Content    = new C1OlapReportOptions(_reportOptions);
            w.Width      = 600;
            w.Height     = 350;
            w.CenterOnScreen();
            w.ModalBackground = new SolidColorBrush(Color.FromArgb(80, 80, 80, 80));
            w.ShowModal();
        }
コード例 #5
0
        private void Border_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            Border   bdr = (Border)sender;
            C1Window wnd = new C1Window()
            {
                ShowMaximizeButton = false,
                ShowMinimizeButton = false,
                IsResizable        = false
            };
            Image contImg = new Image()
            {
                MaxWidth  = 400,
                MaxHeight = 400,
                Stretch   = Stretch.None
            };

            wnd.Content = contImg;
            ShowImage(wnd, contImg, bdr, "");
            wnd.ShowModal();

            // Find other images covered by the current images
            Point pt0 = e.GetPosition(bdr);

            Point pt = e.GetPosition(maps);
            Point pt1 = pt, pt2 = pt;

            pt1.X -= pt0.X;
            pt1.Y -= pt0.Y;
            pt2.X  = pt1.X + bdr.ActualWidth;
            pt2.Y  = pt1.Y + bdr.ActualWidth;

            pt1 = maps.ScreenToGeographic(pt1);
            pt2 = maps.ScreenToGeographic(pt2);

            Point min = new Point(Math.Min(pt1.X, pt2.X), Math.Min(pt1.Y, pt2.Y));
            Point max = new Point(Math.Max(pt1.X, pt2.X), Math.Max(pt1.Y, pt2.Y));

            List <C1VectorPlacemark> list = new List <C1VectorPlacemark>();

            foreach (C1VectorPlacemark pm in vl.Children)
            {
                if (pm.GeoPoint.X >= min.X && pm.GeoPoint.X <= max.X &&
                    pm.GeoPoint.Y >= min.Y && pm.GeoPoint.Y <= max.Y)
                {
                    list.Add(pm);
                }
            }

            // start "slideshow"
            if (list.Count > 1)
            {
                DispatcherTimer dp;
                int             tcnt = 0;

                dp = new DispatcherTimer()
                {
                    Interval = TimeSpan.FromSeconds(2)
                };
                dp.Tick += (se, ea) =>
                {
                    tcnt++;
                    if (tcnt >= list.Count)
                    {
                        tcnt = 0;
                    }

                    ShowImage(wnd, contImg, list[tcnt].LabelUI as FrameworkElement,
                              string.Format("{0}/{1} ", tcnt + 1, list.Count));
                };

                wnd.Closing += (s1, e1) =>
                {
                    dp.Stop();
                };

                dp.Start();
            }
        }
コード例 #6
0
 private void btnPrintSettings_Click(object sender, RoutedEventArgs e)
 {
     // show editor in a dialog
     C1Window w = new C1Window();
     w.Header = C1.WPF.Olap.Resources.Resources.DocumentOptions;
     w.FontFamily = FontFamily;
     w.FontSize = FontSize;
     w.Content = new C1OlapReportOptions(_reportOptions);
     w.Width = 600;
     w.Height = 350;
     w.CenterOnScreen();
     w.ModalBackground = new SolidColorBrush(Color.FromArgb(80, 80, 80, 80));
     w.ShowModal();
 }
コード例 #7
0
 private void btnExportStyle_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         string style = string.Format(@"<Style x:Key=""MyGridStyle"" TargetType=""c1dg:C1DataGrid"">
     <Setter Property=""Background"" Value=""{0}""/>
     <Setter Property=""BorderBrush"" Value=""{1}""/>
     <Setter Property=""HorizontalGridLinesBrush"" Value=""{2}""/>
     <Setter Property=""MouseOverBrush"" Value=""{3}""/>
     <Setter Property=""PressedBrush"" Value=""{11}""/>
     <Setter Property=""RowBackground"" Value=""{4}""/>
     <Setter Property=""AlternatingRowBackground"" Value=""{5}""/>
     <Setter Property=""SelectedBackground"" Value=""{6}""/>
     <Setter Property=""VerticalGridLinesBrush"" Value=""{7}""/>
     <Setter Property=""Foreground"" Value=""{8}""/>
     <Setter Property=""RowForeground"" Value=""{9}""/>
     <Setter Property=""AlternatingRowForeground"" Value=""{10}""/>
     <Setter Property=""ValidationBackground"" Value=""{12}""/>
     <Setter Property=""ValidationForeground"" Value=""{13}""/>
     <Setter Property=""HeaderBackground"" Value=""{14}""/>
     <Setter Property=""HeaderForeground"" Value=""{15}""/>
     <Setter Property=""GroupingPanelBackground"" Value=""{16}""/>
     <Setter Property=""GroupingPanelForeground"" Value=""{17}""/>
     </Style>",
      (grid.Background as SolidColorBrush).Color,
      (grid.BorderBrush as SolidColorBrush).Color,
      (grid.HorizontalGridLinesBrush as SolidColorBrush).Color,
      (grid.MouseOverBrush as SolidColorBrush).Color,
      (grid.RowBackground as SolidColorBrush).Color,
      (grid.AlternatingRowBackground as SolidColorBrush).Color,
      (grid.SelectedBackground as SolidColorBrush).Color,
      (grid.VerticalGridLinesBrush as SolidColorBrush).Color,
      (grid.Foreground as SolidColorBrush).Color,
      (grid.RowForeground as SolidColorBrush).Color,
      (grid.AlternatingRowForeground as SolidColorBrush).Color,
      (grid.PressedBrush as SolidColorBrush).Color,
      (grid.ValidationBackground as SolidColorBrush).Color,
      (grid.ValidationForeground as SolidColorBrush).Color,
      (grid.HeaderBackground as SolidColorBrush).Color,
      (grid.HeaderForeground as SolidColorBrush).Color,
      (grid.GroupingPanelBackground as SolidColorBrush).Color,
      (grid.GroupingPanelForeground as SolidColorBrush).Color);
         var window = new C1Window();
         window.Content = new System.Windows.Controls.TextBox() { Text = style, FontSize = 16 };
         window.ShowModal();
         window.CenterOnScreen();
     }
     catch
     {
     }
 }
コード例 #8
0
        private void Border_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            Border bdr = (Border)sender;
              C1Window wnd = new C1Window()
              {
            ShowMaximizeButton = false,
            ShowMinimizeButton = false,
            IsResizable = false
              };
              Image contImg  = new Image()
              {
            MaxWidth = 400,
            MaxHeight = 400,
            Stretch = Stretch.None
              };
              wnd.Content = contImg;
              ShowImage(wnd, contImg, bdr, "");
              wnd.ShowModal();

              // Find other images covered by the current images
              Point pt0 = e.GetPosition(bdr);

              Point pt = e.GetPosition(maps);
              Point pt1 = pt, pt2 = pt;
              pt1.X -= pt0.X;
              pt1.Y -= pt0.Y;
              pt2.X = pt1.X + bdr.ActualWidth;
              pt2.Y = pt1.Y + bdr.ActualWidth;

              pt1 = maps.ScreenToGeographic(pt1);
              pt2 = maps.ScreenToGeographic(pt2);

              Point min = new Point(Math.Min(pt1.X, pt2.X), Math.Min(pt1.Y, pt2.Y));
              Point max = new Point(Math.Max(pt1.X, pt2.X), Math.Max(pt1.Y, pt2.Y));

              List<C1VectorPlacemark> list = new List<C1VectorPlacemark>();

              foreach (C1VectorPlacemark pm in vl.Children)
              {
            if (pm.GeoPoint.X >= min.X && pm.GeoPoint.X <= max.X &&
              pm.GeoPoint.Y >= min.Y && pm.GeoPoint.Y <= max.Y)
            {
              list.Add(pm);
            }
              }

              // start "slideshow"
              if (list.Count > 1)
              {
            DispatcherTimer dp;
            int tcnt = 0;

            dp = new DispatcherTimer() { Interval = TimeSpan.FromSeconds(2) };
            dp.Tick += (se, ea) =>
              {
            tcnt++;
            if( tcnt>= list.Count)
              tcnt = 0;

            ShowImage(wnd, contImg, list[tcnt].LabelUI as FrameworkElement,
              string.Format("{0}/{1} ", tcnt+1, list.Count));
              };

            wnd.Closing += (s1,e1) =>
              {
            dp.Stop();
              };

            dp.Start();
              }
        }