Permalink
Browse files

Added Office2010InstructorModeAddin

  • Loading branch information...
fvideon committed Jan 10, 2014
1 parent 5d74557 commit 2b406b4df277452407b4c3a03b2ea39cfb2447be
Showing with 5,645 additions and 0 deletions.
  1. +1 −0 .gitignore
  2. +28 −0 Miscellaneous/Office2010InstructorModeAddin/Office2010InstructorModeAddin.sln
  3. +221 −0 Miscellaneous/Office2010InstructorModeAddin/Office2010InstructorModeAddin/InstructorModeRibbon.cs
  4. +45 −0 Miscellaneous/Office2010InstructorModeAddin/Office2010InstructorModeAddin/InstructorModeRibbon.xml
  5. +232 −0 .../Office2010InstructorModeAddin/Office2010InstructorModeAddin/Office2010InstructorModeAddin.csproj
  6. BIN ...0InstructorModeAddin/Office2010InstructorModeAddin/Office2010InstructorModeAddin_TemporaryKey.pfx
  7. +655 −0 Miscellaneous/Office2010InstructorModeAddin/Office2010InstructorModeAddin/PPT.cs
  8. +1,025 −0 Miscellaneous/Office2010InstructorModeAddin/Office2010InstructorModeAddin/PPTPaneManager.cs
  9. +37 −0 Miscellaneous/Office2010InstructorModeAddin/Office2010InstructorModeAddin/Properties/AssemblyInfo.cs
  10. +62 −0 ...eous/Office2010InstructorModeAddin/Office2010InstructorModeAddin/Properties/Resources.Designer.cs
  11. +117 −0 Miscellaneous/Office2010InstructorModeAddin/Office2010InstructorModeAddin/Properties/Resources.resx
  12. +26 −0 ...neous/Office2010InstructorModeAddin/Office2010InstructorModeAddin/Properties/Settings.Designer.cs
  13. +7 −0 ...llaneous/Office2010InstructorModeAddin/Office2010InstructorModeAddin/Properties/Settings.settings
  14. +620 −0 Miscellaneous/Office2010InstructorModeAddin/Office2010InstructorModeAddin/TagDictionary.cs
  15. +231 −0 Miscellaneous/Office2010InstructorModeAddin/Office2010InstructorModeAddin/ThisAddIn.Designer.cs
  16. +4 −0 Miscellaneous/Office2010InstructorModeAddin/Office2010InstructorModeAddin/ThisAddIn.Designer.xml
  17. +47 −0 Miscellaneous/Office2010InstructorModeAddin/Office2010InstructorModeAddin/ThisAddIn.cs
  18. +1,154 −0 ...0InstructorModeAddin/Office2010InstructorModeAddinSetup/Office2010InstructorModeAddinSetup.vdproj
  19. +1,133 −0 ...torModeAddin/Office2010InstructorModeAddinSetup_x64/Office2010InstructorModeAddinSetup_x64.vdproj
View
@@ -113,3 +113,4 @@ UpgradeLog*.XML
*_h.h
dlldata.c
Thumbs.db
@@ -0,0 +1,28 @@

Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Office2010InstructorModeAddin", "Office2010InstructorModeAddin\Office2010InstructorModeAddin.csproj", "{652C7FA1-167C-4FD2-8057-1C083E711AE1}"
EndProject
Project("{54435603-DBB4-11D2-8724-00A0C9A8B90C}") = "Office2010InstructorModeAddinSetup", "Office2010InstructorModeAddinSetup\Office2010InstructorModeAddinSetup.vdproj", "{A396CEFC-3D84-42C8-9C5C-21EB3988CBA4}"
EndProject
Project("{54435603-DBB4-11D2-8724-00A0C9A8B90C}") = "Office2010InstructorModeAddinSetup_x64", "Office2010InstructorModeAddinSetup_x64\Office2010InstructorModeAddinSetup_x64.vdproj", "{CAF47F03-0E30-4119-8B29-9A6517564C31}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{652C7FA1-167C-4FD2-8057-1C083E711AE1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{652C7FA1-167C-4FD2-8057-1C083E711AE1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{652C7FA1-167C-4FD2-8057-1C083E711AE1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{652C7FA1-167C-4FD2-8057-1C083E711AE1}.Release|Any CPU.Build.0 = Release|Any CPU
{A396CEFC-3D84-42C8-9C5C-21EB3988CBA4}.Debug|Any CPU.ActiveCfg = Debug
{A396CEFC-3D84-42C8-9C5C-21EB3988CBA4}.Release|Any CPU.ActiveCfg = Release
{CAF47F03-0E30-4119-8B29-9A6517564C31}.Debug|Any CPU.ActiveCfg = Debug
{CAF47F03-0E30-4119-8B29-9A6517564C31}.Release|Any CPU.ActiveCfg = Release
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
@@ -0,0 +1,221 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.InteropServices;
using System.Text;
using Office = Microsoft.Office.Core;
using System.Windows.Forms;
// TODO: Follow these steps to enable the Ribbon (XML) item:
// 1: Copy the following code block into the ThisAddin, ThisWorkbook, or ThisDocument class.
// protected override Microsoft.Office.Core.IRibbonExtensibility CreateRibbonExtensibilityObject()
// {
// return new InstructorModeRibbon();
// }
// 2. Create callback methods in the "Ribbon Callbacks" region of this class to handle user
// actions, such as clicking a button. Note: if you have exported this Ribbon from the Ribbon designer,
// move your code from the event handlers to the callback methods and modify the code to work with the
// Ribbon extensibility (RibbonX) programming model.
// 3. Assign attributes to the control tags in the Ribbon XML file to identify the appropriate callback methods in your code.
// For more information, see the Ribbon XML documentation in the Visual Studio Tools for Office Help.
namespace Office2010InstructorModeAddin {
public delegate void ChangedEventHandler(bool newValue);
[ComVisible(true)]
public class InstructorModeRibbon : Office.IRibbonExtensibility {
private Office.IRibbonUI ribbon;
// OnClick is an event, implemented by a delegate ButtonEventHandler.
public event ChangedEventHandler PresentationModeChanged;
public event ChangedEventHandler ShapeModeChanged;
public InstructorModeRibbon() {
}
#region IRibbonExtensibility Members
public string GetCustomUI(string ribbonID) {
return GetResourceText("Office2010InstructorModeAddin.InstructorModeRibbon.xml");
}
#endregion
#region Properties
private bool projectedViewState = true;
public bool ProjectedViewState {
get {
return projectedViewState;
}
set {
if (value != projectedViewState) {
projectedViewState = value;
PresentationModeChanged(value);
}
this.InvalidateButtons();
}
}
private bool unrestrictedState = true;
public bool UnrestrictedState {
get {
return unrestrictedState;
}
set {
if (value != unrestrictedState) {
unrestrictedState = value;
ShapeModeChanged(value);
}
this.InvalidateButtons();
}
}
private const string ProjectedView = "ProjectedView";
private const string ProjectedSet = "ProjectedSet";
private const string InstructorView = "InstructorView";
private const string InstructorSet = "InstructorSet";
private bool projectedViewEnabled = true;
public bool ProjectedViewEnabled {
get {
return projectedViewEnabled;
}
set {
projectedViewEnabled = value;
this.InvalidateButtons();
}
}
private bool projectedSetEnabled = true;
public bool ProjectedSetEnabled {
get {
return projectedSetEnabled;
}
set {
projectedSetEnabled = value;
this.InvalidateButtons();
}
}
private bool instructorViewEnabled = true;
public bool InstructorViewEnabled {
get {
return instructorViewEnabled;
}
set {
instructorViewEnabled = value;
this.InvalidateButtons();
}
}
private bool instructorSetEnabled = true;
public bool InstructorSetEnabled {
get {
return instructorSetEnabled;
}
set {
instructorSetEnabled = value;
this.InvalidateButtons();
}
}
#endregion Properties
#region Ribbon Callbacks
//Create callback methods here. For more information about adding callback methods, select the Ribbon XML item in Solution Explorer and then press F1
public void Ribbon_Load(Office.IRibbonUI ribbonUI) {
this.ribbon = ribbonUI;
}
public bool OnGetEnabled(Office.IRibbonControl control) {
switch (control.Id) {
case ProjectedView:
return ProjectedViewEnabled;
case InstructorView:
return InstructorViewEnabled;
case ProjectedSet:
return ProjectedSetEnabled;
case InstructorSet:
return InstructorSetEnabled;
}
return false;
}
public bool OnGetPressed(Office.IRibbonControl control) {
switch (control.Id) {
case ProjectedView:
return this.ProjectedViewState;
case InstructorView:
return !this.ProjectedViewState;
case ProjectedSet:
return this.UnrestrictedState;
case InstructorSet:
return !this.UnrestrictedState;
}
return false;
}
public void OnClick(Office.IRibbonControl control, bool isPressed) {
switch (control.Id) {
case ProjectedView:
this.ProjectedViewState = true;
break;
case InstructorView:
this.ProjectedViewState = false;
break;
case ProjectedSet:
this.UnrestrictedState = true;
break;
case InstructorSet:
this.UnrestrictedState = false;
break;
}
this.InvalidateButtons();
}
public void OnExport(Office.IRibbonControl control) {
MessageBox.Show("Saving...NOT IMPLEMENTED");
}
#endregion
private void InvalidateButtons() {
if (this.ribbon != null) {
this.ribbon.InvalidateControl(ProjectedView);
this.ribbon.InvalidateControl(InstructorView);
this.ribbon.InvalidateControl(ProjectedSet);
this.ribbon.InvalidateControl(InstructorSet);
}
}
#region Helpers
private static string GetResourceText(string resourceName) {
Assembly asm = Assembly.GetExecutingAssembly();
string[] resourceNames = asm.GetManifestResourceNames();
for (int i = 0; i < resourceNames.Length; ++i) {
if (string.Compare(resourceName, resourceNames[i], StringComparison.OrdinalIgnoreCase) == 0) {
using (StreamReader resourceReader = new StreamReader(asm.GetManifestResourceStream(resourceNames[i]))) {
if (resourceReader != null) {
return resourceReader.ReadToEnd();
}
}
}
}
return null;
}
#endregion
}
}
@@ -0,0 +1,45 @@
<?xml version="1.0" encoding="UTF-8"?>
<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui" onLoad="Ribbon_Load">
<ribbon>
<tabs>
<tab idMso="TabAddIns">
<group id="CP3Group" label="Classroom Presenter 3.0">
<box id="box1" boxStyle="vertical">
<toggleButton id="ProjectedView"
size="normal"
label="Projected View"
screentip="Set the slide to show the projected view of the slide"
getPressed="OnGetPressed"
getEnabled="OnGetEnabled"
onAction="OnClick" />
<toggleButton id="InstructorView"
size="normal"
label="Instructor View"
screentip="Set the slide to show the instructors view of the slide"
getPressed="OnGetPressed"
getEnabled="OnGetEnabled"
onAction="OnClick" />
</box>
<separator id="separator1"/>
<box id="box2" boxStyle="vertical">
<toggleButton id="ProjectedSet"
size="normal"
label="Unrestricted"
screentip="Set the selected objects to be viewable in the projected view"
getPressed="OnGetPressed"
getEnabled="OnGetEnabled"
onAction="OnClick" />
<toggleButton id="InstructorSet"
size="normal"
label="Instructor Note"
screentip="Set the selected objects to be viewable only by the instructor"
getPressed="OnGetPressed"
getEnabled="OnGetEnabled"
onAction="OnClick" />
</box>
</group>
</tab>
</tabs>
</ribbon>
</customUI>
Oops, something went wrong.

0 comments on commit 2b406b4

Please sign in to comment.