Skip to content

Commit

Permalink
whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeremy Tammik committed Feb 2, 2017
1 parent c431bf8 commit 60f79a0
Show file tree
Hide file tree
Showing 3 changed files with 326 additions and 310 deletions.
105 changes: 54 additions & 51 deletions CS/App.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,71 +23,74 @@
#endregion // Header

using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;

using Autodesk.Revit.ApplicationServices;
using Autodesk.Revit.UI;
using Autodesk.Revit.Attributes;
using Autodesk.Revit.DB;
using Autodesk.Revit.UI;

namespace RevitLookup
{

[Autodesk.Revit.Attributes.Transaction(Autodesk.Revit.Attributes.TransactionMode.Manual)]
[Autodesk.Revit.Attributes.Regeneration(Autodesk.Revit.Attributes.RegenerationOption.Manual)]
public class App : IExternalApplication
{
static Autodesk.Revit.DB.AddInId m_appId = new Autodesk.Revit.DB.AddInId(new Guid("356CDA5A-E6C5-4c2f-A9EF-B3222116B8C8"));
// get the absolute path of this assembly
static string ExecutingAssemblyPath = System.Reflection.Assembly.GetExecutingAssembly().Location;
private AppDocEvents m_appDocEvents;
[Transaction( TransactionMode.Manual )]
[Regeneration( RegenerationOption.Manual )]
public class App : IExternalApplication
{
static AddInId m_appId = new AddInId( new Guid(
"356CDA5A-E6C5-4c2f-A9EF-B3222116B8C8" ) );

// get the absolute path of this assembly
static string ExecutingAssemblyPath = System.Reflection.Assembly
.GetExecutingAssembly().Location;

private AppDocEvents m_appDocEvents;

public Autodesk.Revit.UI.Result OnStartup(UIControlledApplication application)
{
public Result OnStartup(
UIControlledApplication application )
{

// Call this method explicitly in App.cs when Revit starts up because
// in .Net 4, the static variables will not be initialized until use them,
Snoop.Collectors.CollectorObj.InitializeCollectors();
AddMenu(application);
AddAppDocEvents(application.ControlledApplication);
// Call this method explicitly in App.cs when Revit starts up because,
// in .NET 4, the static variables will not be initialized until use them.
Snoop.Collectors.CollectorObj.InitializeCollectors();
AddMenu( application );
AddAppDocEvents( application.ControlledApplication );

return Autodesk.Revit.UI.Result.Succeeded;
}
return Result.Succeeded;
}

public Autodesk.Revit.UI.Result OnShutdown(UIControlledApplication application)
{
RemoveAppDocEvents();
public Result OnShutdown(
UIControlledApplication application )
{
RemoveAppDocEvents();

return Autodesk.Revit.UI.Result.Succeeded;
}
return Result.Succeeded;
}

private void AddMenu(UIControlledApplication app)
{
Autodesk.Revit.UI.RibbonPanel rvtRibbonPanel = app.CreateRibbonPanel("Revit Lookup");
PulldownButtonData data = new PulldownButtonData("Options", "Revit Lookup");
private void AddMenu( UIControlledApplication app )
{
RibbonPanel rvtRibbonPanel = app.CreateRibbonPanel( "Revit Lookup" );
PulldownButtonData data = new PulldownButtonData( "Options", "Revit Lookup" );

RibbonItem item = rvtRibbonPanel.AddItem(data);
PulldownButton optionsBtn = item as PulldownButton;
RibbonItem item = rvtRibbonPanel.AddItem( data );
PulldownButton optionsBtn = item as PulldownButton;

optionsBtn.AddPushButton(new PushButtonData("HelloWorld", "Hello World...", ExecutingAssemblyPath, "RevitLookup.HelloWorld"));
optionsBtn.AddPushButton(new PushButtonData("Snoop Db..", "Snoop DB...", ExecutingAssemblyPath, "RevitLookup.CmdSnoopDb"));
optionsBtn.AddPushButton(new PushButtonData("Snoop Current Selection...", "Snoop Current Selection...", ExecutingAssemblyPath, "RevitLookup.CmdSnoopModScope"));
optionsBtn.AddPushButton(new PushButtonData("Snoop Active View...", "Snoop Active View...", ExecutingAssemblyPath, "RevitLookup.CmdSnoopActiveView"));
optionsBtn.AddPushButton(new PushButtonData("Snoop Application...", "Snoop Application...", ExecutingAssemblyPath, "RevitLookup.CmdSnoopApp"));
optionsBtn.AddPushButton(new PushButtonData("Test Framework...", "Test Framework...", ExecutingAssemblyPath, "RevitLookup.CmdTestShell"));
optionsBtn.AddPushButton(new PushButtonData("Events...", "Events...", ExecutingAssemblyPath, "RevitLookup.CmdEvents"));
}
optionsBtn.AddPushButton( new PushButtonData( "HelloWorld", "Hello World...", ExecutingAssemblyPath, "RevitLookup.HelloWorld" ) );
optionsBtn.AddPushButton( new PushButtonData( "Snoop Db..", "Snoop DB...", ExecutingAssemblyPath, "RevitLookup.CmdSnoopDb" ) );
optionsBtn.AddPushButton( new PushButtonData( "Snoop Current Selection...", "Snoop Current Selection...", ExecutingAssemblyPath, "RevitLookup.CmdSnoopModScope" ) );
optionsBtn.AddPushButton( new PushButtonData( "Snoop Active View...", "Snoop Active View...", ExecutingAssemblyPath, "RevitLookup.CmdSnoopActiveView" ) );
optionsBtn.AddPushButton( new PushButtonData( "Snoop Application...", "Snoop Application...", ExecutingAssemblyPath, "RevitLookup.CmdSnoopApp" ) );
optionsBtn.AddPushButton( new PushButtonData( "Test Framework...", "Test Framework...", ExecutingAssemblyPath, "RevitLookup.CmdTestShell" ) );
optionsBtn.AddPushButton( new PushButtonData( "Events...", "Events...", ExecutingAssemblyPath, "RevitLookup.CmdEvents" ) );
}

private void AddAppDocEvents(Autodesk.Revit.ApplicationServices.ControlledApplication app)
{
m_appDocEvents = new AppDocEvents(app);
m_appDocEvents.EnableEvents();
}
private void AddAppDocEvents( ControlledApplication app )
{
m_appDocEvents = new AppDocEvents( app );
m_appDocEvents.EnableEvents();
}

private void RemoveAppDocEvents()
{
m_appDocEvents.DisableEvents();
}
}
private void RemoveAppDocEvents()
{
m_appDocEvents.DisableEvents();
}
}
}
5 changes: 3 additions & 2 deletions CS/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@
// 2017-01-06 - 2017.0.0.10 - merged pull #20 from @luftbanana supporting close-with-ESC to all forms by assigning the cancel button
// 2017-01-06 - 2017.0.0.11 - fixed issue #19 raised by LeeJaeYoung spot dimension position and text position error
// 2017-02-02 - 2017.0.0.12 - merged pull #21 from @eibre adding UnitType property on the parameter Definition class
// 2017-02-02 - 2017.0.0.13 - whitespace
//
[assembly: AssemblyVersion( "2017.0.0.12" )]
[assembly: AssemblyFileVersion( "2017.0.0.12" )]
[assembly: AssemblyVersion( "2017.0.0.13" )]
[assembly: AssemblyFileVersion( "2017.0.0.13" )]
Loading

0 comments on commit 60f79a0

Please sign in to comment.