2025-08-10 18:19:27 +08:00
|
|
|
|
using KellyReport_D.Properties;
|
|
|
|
|
|
using Microsoft.Office.Tools;
|
|
|
|
|
|
using Microsoft.Office.Tools.Ribbon;
|
|
|
|
|
|
using System;
|
|
|
|
|
|
using System.Collections.Generic;
|
2025-12-30 01:05:26 +08:00
|
|
|
|
using System.Diagnostics;
|
2025-08-10 18:19:27 +08:00
|
|
|
|
using System.Linq;
|
2025-12-30 01:05:26 +08:00
|
|
|
|
using System.Reflection;
|
2025-08-10 18:19:27 +08:00
|
|
|
|
using System.Text;
|
|
|
|
|
|
|
|
|
|
|
|
namespace KellyReport_D
|
|
|
|
|
|
{
|
|
|
|
|
|
public partial class Ribbon1
|
|
|
|
|
|
{
|
|
|
|
|
|
private CustomTaskPane jqSalesSummaryPanel;
|
|
|
|
|
|
|
2025-12-30 01:05:26 +08:00
|
|
|
|
private string GetAppVersion()
|
|
|
|
|
|
{
|
|
|
|
|
|
var asm = Assembly.GetExecutingAssembly();
|
|
|
|
|
|
try
|
|
|
|
|
|
{
|
|
|
|
|
|
var fvi = FileVersionInfo.GetVersionInfo(asm.Location);
|
|
|
|
|
|
if (!string.IsNullOrWhiteSpace(fvi.FileVersion))
|
|
|
|
|
|
return fvi.FileVersion;
|
|
|
|
|
|
}
|
|
|
|
|
|
catch { }
|
|
|
|
|
|
|
|
|
|
|
|
return asm.GetName().Version.ToString();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-08-10 18:19:27 +08:00
|
|
|
|
private void Ribbon1_Load(object sender, RibbonUIEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
this.button1.Label = Resources.APP_NAME;
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void button1_Click(object sender, RibbonControlEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (jqSalesSummaryPanel == null)
|
|
|
|
|
|
{
|
|
|
|
|
|
var panel = new JQSalesSummaryPanel();
|
2025-12-30 01:05:26 +08:00
|
|
|
|
jqSalesSummaryPanel = Globals.ThisAddIn.CustomTaskPanes.Add(panel, $"{Resources.APP_NAME} v{GetAppVersion()}");
|
2025-08-10 18:19:27 +08:00
|
|
|
|
jqSalesSummaryPanel.Width = 600;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
jqSalesSummaryPanel.Visible = true;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|