Skip to content

Instantly share code, notes, and snippets.

@johnathan-sewell
Created November 27, 2012 14:15
Show Gist options
  • Save johnathan-sewell/4154426 to your computer and use it in GitHub Desktop.
Save johnathan-sewell/4154426 to your computer and use it in GitHub Desktop.
using System;
namespace Example.ExcelAddin
{
public partial class ThisAddIn
{
[Microsoft.VisualStudio.Tools.Applications.Runtime.Cached()]
public String MyCachedData;
private void ThisAddIn_Startup(object sender, System.EventArgs e)
{
StartCaching("MyCachedData");
if (string.IsNullOrEmpty(MyCachedData))
MyCachedData = "hello cache";
}
private void ThisAddIn_Shutdown(object sender, System.EventArgs e)
{
}
#region VSTO generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InternalStartup()
{
this.Startup += new System.EventHandler(ThisAddIn_Startup);
this.Shutdown += new System.EventHandler(ThisAddIn_Shutdown);
}
#endregion
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment