|
@@ -40,6 +40,10 @@ namespace XHWK.WKTool
|
40
|
40
|
public partial class XHMicroLessonSystemWindow : Window
|
41
|
41
|
{
|
42
|
42
|
#region 字段
|
|
43
|
+ /// <summary>
|
|
44
|
+ /// 页码下拉列表
|
|
45
|
+ /// </summary>
|
|
46
|
+ List<PageData> PageData =null;
|
43
|
47
|
private FolderBrowserDialog Ofd;
|
44
|
48
|
private DialogResult Result;
|
45
|
49
|
public BlackboardNew myblackboard;
|
|
@@ -960,6 +964,19 @@ namespace XHWK.WKTool
|
960
|
964
|
APP.pageData.currpage = APP.pageData.pagenum;
|
961
|
965
|
myblackboard.changepage(APP.pageData.currpage - 1);
|
962
|
966
|
gridPage.Visibility = Visibility.Visible;//页码大于0 显示
|
|
967
|
+
|
|
968
|
+ #region 插入页码
|
|
969
|
+ PageData = new List<PageData>();
|
|
970
|
+ for (int i = 1; i <= APP.pageData.pagenum; i++)
|
|
971
|
+ {
|
|
972
|
+ PageData pd = new PageData();
|
|
973
|
+ pd.PageName = i.ToString();// + "页";
|
|
974
|
+ pd.PageCode = i;
|
|
975
|
+ PageData.Add(pd);
|
|
976
|
+ }
|
|
977
|
+ CbxPageList.ItemsSource = PageData;
|
|
978
|
+ CbxPageList.SelectedIndex = APP.pageData.currpage - 1;
|
|
979
|
+ #endregion
|
963
|
980
|
}
|
964
|
981
|
if (APP.PageDrawList.Count >= APP.pageData.currpage)
|
965
|
982
|
{
|
|
@@ -1095,7 +1112,6 @@ namespace XHWK.WKTool
|
1095
|
1112
|
APP.myloading.Show();
|
1096
|
1113
|
myblackboard.changepage(APP.pageData.pagenum);
|
1097
|
1114
|
}));
|
1098
|
|
- #region PPT转PDF
|
1099
|
1115
|
string filepath = ofd.FileName;
|
1100
|
1116
|
string path = ofd.SafeFileName.Replace(".ppt", "").Replace(".pptx", "").Trim();
|
1101
|
1117
|
string type = ofd.SafeFileName.Replace(".ppt", "typezsygppt").Replace(".pptx", "typezsygppt").Replace(".pdf", "typepdf").Trim();
|
|
@@ -1103,6 +1119,7 @@ namespace XHWK.WKTool
|
1103
|
1119
|
{
|
1104
|
1120
|
try
|
1105
|
1121
|
{
|
|
1122
|
+ #region PPT转PDF
|
1106
|
1123
|
string pathTemp = AppDomain.CurrentDomain.BaseDirectory + "Temp\\";
|
1107
|
1124
|
path = pathTemp + path + ".pdf";
|
1108
|
1125
|
FileToolsCommon.CreateDirectory(pathTemp);
|
|
@@ -1435,6 +1452,22 @@ namespace XHWK.WKTool
|
1435
|
1452
|
LogHelper.WriteErrLog("【XHMicroLessonSystemWindow】(OpenDialog 导入文档)" + ex.Message, ex);
|
1436
|
1453
|
}
|
1437
|
1454
|
}
|
|
1455
|
+ #region 插入页码
|
|
1456
|
+
|
|
1457
|
+ Dispatcher.Invoke(new Action(() =>
|
|
1458
|
+ {
|
|
1459
|
+ PageData = new List<PageData>();
|
|
1460
|
+ for (int i = 1; i <= APP.pageData.pagenum; i++)
|
|
1461
|
+ {
|
|
1462
|
+ PageData pd = new PageData();
|
|
1463
|
+ pd.PageName = i.ToString();//+ "页";
|
|
1464
|
+ pd.PageCode = i;
|
|
1465
|
+ PageData.Add(pd);
|
|
1466
|
+ }
|
|
1467
|
+ CbxPageList.ItemsSource = PageData;
|
|
1468
|
+ CbxPageList.SelectedIndex = APP.pageData.currpage - 1;
|
|
1469
|
+ }));
|
|
1470
|
+ #endregion
|
1438
|
1471
|
}
|
1439
|
1472
|
}
|
1440
|
1473
|
//OpenDialog();
|
|
@@ -3543,6 +3576,19 @@ namespace XHWK.WKTool
|
3543
|
3576
|
ImgScreenshotTwo.Visibility = Visibility.Collapsed;
|
3544
|
3577
|
btnScreenshot.IsEnabled = true;
|
3545
|
3578
|
}
|
|
3579
|
+
|
|
3580
|
+ #region 插入页码
|
|
3581
|
+ PageData = new List<PageData>();
|
|
3582
|
+ for (int i = 1; i <= APP.pageData.pagenum; i++)
|
|
3583
|
+ {
|
|
3584
|
+ PageData pd = new PageData();
|
|
3585
|
+ pd.PageName = i.ToString();// + "页";
|
|
3586
|
+ pd.PageCode = i;
|
|
3587
|
+ PageData.Add(pd);
|
|
3588
|
+ }
|
|
3589
|
+ CbxPageList.ItemsSource = PageData;
|
|
3590
|
+ CbxPageList.SelectedIndex = APP.pageData.currpage - 1;
|
|
3591
|
+ #endregion
|
3546
|
3592
|
}
|
3547
|
3593
|
/// <summary>
|
3548
|
3594
|
/// 打印事件
|
|
@@ -3683,9 +3729,10 @@ namespace XHWK.WKTool
|
3683
|
3729
|
HideAngleBorder();
|
3684
|
3730
|
|
3685
|
3731
|
//隐藏跳转
|
3686
|
|
- txbCurrpage.Visibility = Visibility.Visible;
|
3687
|
|
- txtJump.Visibility = Visibility.Hidden;
|
3688
|
|
- BtnJumpPage.Visibility = Visibility.Hidden;
|
|
3732
|
+ //txbCurrpage.Visibility = Visibility.Visible;
|
|
3733
|
+ //txtJump.Visibility = Visibility.Hidden;
|
|
3734
|
+ //BtnJumpPage.Visibility = Visibility.Hidden;
|
|
3735
|
+
|
3689
|
3736
|
//if(!APP.PageDrawList[APP.pageData.currpage - 1].IsImageLocation)
|
3690
|
3737
|
//{
|
3691
|
3738
|
// ImgWG();
|
|
@@ -3778,6 +3825,9 @@ namespace XHWK.WKTool
|
3778
|
3825
|
imgCanvas.Source = null;
|
3779
|
3826
|
imgDocumentation.Source = null;
|
3780
|
3827
|
}
|
|
3828
|
+ #region 修改跳转页码
|
|
3829
|
+ CbxPageList.SelectedIndex = APP.pageData.currpage - 1;
|
|
3830
|
+ #endregion
|
3781
|
3831
|
}
|
3782
|
3832
|
}
|
3783
|
3833
|
private void ImgXY()
|
|
@@ -3816,9 +3866,9 @@ namespace XHWK.WKTool
|
3816
|
3866
|
HideAngleBorder();
|
3817
|
3867
|
|
3818
|
3868
|
//隐藏跳转
|
3819
|
|
- txbCurrpage.Visibility = Visibility.Visible;
|
3820
|
|
- txtJump.Visibility = Visibility.Hidden;
|
3821
|
|
- BtnJumpPage.Visibility = Visibility.Hidden;
|
|
3869
|
+ //txbCurrpage.Visibility = Visibility.Visible;
|
|
3870
|
+ //txtJump.Visibility = Visibility.Hidden;
|
|
3871
|
+ //BtnJumpPage.Visibility = Visibility.Hidden;
|
3822
|
3872
|
|
3823
|
3873
|
//if (!APP.PageDrawList[APP.pageData.currpage - 1].IsImageLocation)
|
3824
|
3874
|
//{
|
|
@@ -4965,6 +5015,8 @@ namespace XHWK.WKTool
|
4965
|
5015
|
double proportion = 210.0 / 297.0;
|
4966
|
5016
|
gridM.Height = gridM.ActualWidth / proportion;
|
4967
|
5017
|
}
|
|
5018
|
+
|
|
5019
|
+ #region 原跳转
|
4968
|
5020
|
/// <summary>
|
4969
|
5021
|
/// 跳转页
|
4970
|
5022
|
/// </summary>
|
|
@@ -4978,12 +5030,12 @@ namespace XHWK.WKTool
|
4978
|
5030
|
{
|
4979
|
5031
|
if (int.Parse(txbCurrpage.Text) > 0)
|
4980
|
5032
|
{
|
4981
|
|
- txtJump.Text = txbCurrpage.Text;
|
4982
|
|
- txbCurrpage.Visibility = Visibility.Hidden;
|
4983
|
|
- txtJump.Visibility = Visibility.Visible;
|
4984
|
|
- BtnJumpPage.Visibility = Visibility.Visible;
|
4985
|
|
- txtJump.Focus();
|
4986
|
|
- txtJump.SelectAll();
|
|
5033
|
+ //txtJump.Text = txbCurrpage.Text;
|
|
5034
|
+ //txbCurrpage.Visibility = Visibility.Hidden;
|
|
5035
|
+ //txtJump.Visibility = Visibility.Visible;
|
|
5036
|
+ //BtnJumpPage.Visibility = Visibility.Visible;
|
|
5037
|
+ //txtJump.Focus();
|
|
5038
|
+ //txtJump.SelectAll();
|
4987
|
5039
|
}
|
4988
|
5040
|
}
|
4989
|
5041
|
catch (Exception)
|
|
@@ -4999,15 +5051,15 @@ namespace XHWK.WKTool
|
4999
|
5051
|
private void BtnJumpPage_Click(object sender, RoutedEventArgs e)
|
5000
|
5052
|
{
|
5001
|
5053
|
int JumpPage = 0;
|
5002
|
|
- try
|
5003
|
|
- {
|
5004
|
|
- JumpPage = int.Parse(txtJump.Text);
|
5005
|
|
- }
|
5006
|
|
- catch (Exception ex)
|
5007
|
|
- {
|
5008
|
|
- MessageWindow.Show("操作有误!请输入有效的页码!");
|
5009
|
|
- return;
|
5010
|
|
- }
|
|
5054
|
+ //try
|
|
5055
|
+ //{
|
|
5056
|
+ // JumpPage = int.Parse(txtJump.Text);
|
|
5057
|
+ //}
|
|
5058
|
+ //catch (Exception ex)
|
|
5059
|
+ //{
|
|
5060
|
+ // MessageWindow.Show("操作有误!请输入有效的页码!");
|
|
5061
|
+ // return;
|
|
5062
|
+ //}
|
5011
|
5063
|
if (JumpPage < 1)
|
5012
|
5064
|
{
|
5013
|
5065
|
JumpPage = 1;
|
|
@@ -5021,9 +5073,9 @@ namespace XHWK.WKTool
|
5021
|
5073
|
JumpPageClick();
|
5022
|
5074
|
#endregion
|
5023
|
5075
|
|
5024
|
|
- txbCurrpage.Visibility = Visibility.Visible;
|
5025
|
|
- txtJump.Visibility = Visibility.Hidden;
|
5026
|
|
- BtnJumpPage.Visibility = Visibility.Hidden;
|
|
5076
|
+ //txbCurrpage.Visibility = Visibility.Visible;
|
|
5077
|
+ //txtJump.Visibility = Visibility.Hidden;
|
|
5078
|
+ //BtnJumpPage.Visibility = Visibility.Hidden;
|
5027
|
5079
|
}
|
5028
|
5080
|
/// <summary>
|
5029
|
5081
|
/// 只允许输入数字
|
|
@@ -5043,5 +5095,53 @@ namespace XHWK.WKTool
|
5043
|
5095
|
BtnJumpPage_Click(null, null);
|
5044
|
5096
|
}
|
5045
|
5097
|
}
|
|
5098
|
+ #endregion
|
|
5099
|
+ #region 跳转
|
|
5100
|
+ /// <summary>
|
|
5101
|
+ /// 跳转
|
|
5102
|
+ /// </summary>
|
|
5103
|
+ /// <param name="sender"></param>
|
|
5104
|
+ /// <param name="e"></param>
|
|
5105
|
+ private void CbxPageList_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
|
5106
|
+ {
|
|
5107
|
+ #region 安全
|
|
5108
|
+ if(CbxPageList.SelectedValue==null)
|
|
5109
|
+ {
|
|
5110
|
+ return;
|
|
5111
|
+ }
|
|
5112
|
+ if (APP.pageData.currpage == int.Parse(CbxPageList.SelectedValue.ToString()))
|
|
5113
|
+ {
|
|
5114
|
+ return;
|
|
5115
|
+ }
|
|
5116
|
+ #endregion
|
|
5117
|
+ int JumpPage = 0;
|
|
5118
|
+ try
|
|
5119
|
+ {
|
|
5120
|
+ JumpPage = int.Parse(CbxPageList.SelectedValue.ToString());
|
|
5121
|
+ }
|
|
5122
|
+ catch (Exception ex)
|
|
5123
|
+ {
|
|
5124
|
+ MessageWindow.Show("操作有误!请输入有效的页码!");
|
|
5125
|
+ return;
|
|
5126
|
+ }
|
|
5127
|
+ if (JumpPage < 1)
|
|
5128
|
+ {
|
|
5129
|
+ JumpPage = 1;
|
|
5130
|
+ }
|
|
5131
|
+ if (JumpPage > int.Parse(txbTotalpage.Text))
|
|
5132
|
+ {
|
|
5133
|
+ JumpPage = int.Parse(txbTotalpage.Text);
|
|
5134
|
+ }
|
|
5135
|
+ #region 跳转
|
|
5136
|
+ APP.pageData.currpage = JumpPage;
|
|
5137
|
+ JumpPageClick();
|
|
5138
|
+ #endregion
|
|
5139
|
+ }
|
|
5140
|
+ #endregion
|
|
5141
|
+ }
|
|
5142
|
+ public class PageData
|
|
5143
|
+ {
|
|
5144
|
+ public int PageCode { get; set; }
|
|
5145
|
+ public string PageName { get; set; }
|
5046
|
5146
|
}
|
5047
|
5147
|
}
|