Skip to content
This repository was archived by the owner on Aug 28, 2021. It is now read-only.

Commit 84c1179

Browse files
committed
Revert "updated speckle core"
This reverts commit 8c22b1a.
1 parent 8c22b1a commit 84c1179

File tree

2 files changed

+262
-260
lines changed

2 files changed

+262
-260
lines changed

SpeckleRevitReboot/Entry.cs

Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -20,81 +20,81 @@ namespace SpeckleRevit
2020
{
2121
public class SpecklePlugin : IExternalApplication
2222
{
23-
public Result OnShutdown(UIControlledApplication application)
23+
public Result OnShutdown( UIControlledApplication application )
2424
{
2525
return Result.Succeeded;
2626
}
2727

28-
public Result OnStartup(UIControlledApplication application)
28+
public Result OnStartup( UIControlledApplication application )
2929
{
30-
var SpecklePanel = application.CreateRibbonPanel("Speckle");
31-
var SpeckleButton = SpecklePanel.AddItem(new PushButtonData("Speckle", "Speckle Revit", typeof(SpecklePlugin).Assembly.Location, "SpeckleRevit.SpeckleRevitCommand")) as PushButton;
30+
var SpecklePanel = application.CreateRibbonPanel( "Speckle" );
31+
var SpeckleButton = SpecklePanel.AddItem( new PushButtonData( "Speckle", "Speckle Revit", typeof( SpecklePlugin ).Assembly.Location, "SpeckleRevit.SpeckleRevitCommand" ) ) as PushButton;
3232

33-
if (SpeckleButton != null)
33+
if ( SpeckleButton != null )
3434
{
35-
string path = typeof(SpecklePlugin).Assembly.Location;
36-
SpeckleButton.Image = LoadPngImgSource("SpeckleRevit.Assets.speckle16.png", path);
37-
SpeckleButton.LargeImage = LoadPngImgSource("SpeckleRevit.Assets.speckle32.png", path);
35+
string path = typeof( SpecklePlugin ).Assembly.Location;
36+
SpeckleButton.Image = LoadPngImgSource( "SpeckleRevit.Assets.speckle16.png", path );
37+
SpeckleButton.LargeImage = LoadPngImgSource( "SpeckleRevit.Assets.speckle32.png", path );
3838
SpeckleButton.ToolTip = "Speckle";
3939

40-
SpeckleButton.SetContextualHelp(new ContextualHelp(ContextualHelpType.Url, "https://speckle.works"));
40+
SpeckleButton.SetContextualHelp( new ContextualHelp( ContextualHelpType.Url, "https://speckle.works" ) );
4141
}
4242

4343
return Result.Succeeded;
4444
}
4545

46-
private ImageSource LoadPngImgSource(string sourceName, string path)
46+
private ImageSource LoadPngImgSource( string sourceName, string path )
4747
{
4848
try
4949
{
5050
// Assembly & Stream
51-
var assembly = Assembly.LoadFrom(Path.Combine(path));
52-
var icon = assembly.GetManifestResourceStream(sourceName);
51+
var assembly = Assembly.LoadFrom( Path.Combine( path ) );
52+
var icon = assembly.GetManifestResourceStream( sourceName );
5353

5454
// Decoder
55-
PngBitmapDecoder m_decoder = new PngBitmapDecoder(icon, BitmapCreateOptions.PreservePixelFormat, BitmapCacheOption.Default);
55+
PngBitmapDecoder m_decoder = new PngBitmapDecoder( icon, BitmapCreateOptions.PreservePixelFormat, BitmapCacheOption.Default );
5656

5757
// Source
58-
ImageSource m_source = m_decoder.Frames[0];
59-
return (m_source);
58+
ImageSource m_source = m_decoder.Frames[ 0 ];
59+
return ( m_source );
6060
}
6161
catch { }
6262
// Fail
6363
return null;
6464
}
6565
}
6666

67-
[Transaction(TransactionMode.Manual)]
67+
[Transaction( TransactionMode.Manual )]
6868
public class SpeckleRevitCommand : IExternalCommand
6969
{
7070
public static bool Launched = false;
7171
public static SpeckleUiWindow SpeckleWindow;
7272

73-
public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
73+
public Result Execute( ExternalCommandData commandData, ref string message, ElementSet elements )
7474
{
75-
if (!Launched)
75+
if ( !Launched )
7676
{
7777
// Create a new speckle binding instance
78-
var bindings = new SpeckleUiBindingsRevit(commandData.Application);
78+
var bindings = new SpeckleUiBindingsRevit( commandData.Application );
7979

8080
// Create an external event handler to raise actions
81-
var eventHandler = ExternalEvent.Create(new SpeckleRevitExternalEventHandler(bindings));
81+
var eventHandler = ExternalEvent.Create( new SpeckleRevitExternalEventHandler( bindings ) );
8282

8383
// Give it to our bindings so we can actually do stuff with revit
84-
bindings.SetExecutorAndInit(eventHandler);
84+
bindings.SetExecutorAndInit( eventHandler );
8585

8686
// Initialise the window
87-
//#if DEBUG
88-
// SpeckleWindow = new SpeckleUiWindow( bindings, @"http://localhost:8080/" );
87+
#if DEBUG
88+
SpeckleWindow = new SpeckleUiWindow( bindings, @"http://localhost:8080/" );
8989
//SpeckleWindow = new SpeckleUiWindow( bindings, @"https://matteo-dev.appui.speckle.systems/#/" );
90-
//#else
91-
SpeckleWindow = new SpeckleUiWindow(bindings, @"https://appui.speckle.systems/#/"); // On release, default to the latest ci-ed version from https://appui.speckle.systems
92-
//#endif
90+
#else
91+
SpeckleWindow = new SpeckleUiWindow( bindings, @"https://appui.speckle.systems/#/" ); // On release, default to the latest ci-ed version from https://appui.speckle.systems
92+
#endif
9393

9494
SpeckleWindow.Height = 1000;
9595

9696
SpeckleUiBindingsRevit.SpeckleWindow = SpeckleWindow;
97-
var helper = new System.Windows.Interop.WindowInteropHelper(SpeckleWindow);
97+
var helper = new System.Windows.Interop.WindowInteropHelper( SpeckleWindow );
9898
helper.Owner = System.Diagnostics.Process.GetCurrentProcess().MainWindowHandle;
9999

100100
// TODO: find a way to set the parent/owner of the speckle window so it minimises/maximises etc. together with the revit window.
@@ -119,34 +119,34 @@ public class SpeckleRevitExternalEventHandler : IExternalEventHandler
119119
public SpeckleUiBindingsRevit myBindings { get; set; }
120120
public bool Running = false;
121121

122-
public SpeckleRevitExternalEventHandler(SpeckleUiBindingsRevit _uiBindings)
122+
public SpeckleRevitExternalEventHandler( SpeckleUiBindingsRevit _uiBindings )
123123
{
124124
myBindings = _uiBindings;
125125
}
126126

127-
public void Execute(UIApplication app)
127+
public void Execute( UIApplication app )
128128
{
129-
Debug.WriteLine("Current queue len is: " + myBindings.Queue.Count);
130-
if (Running) return; // queue will run itself through
129+
Debug.WriteLine( "Current queue len is: " + myBindings.Queue.Count );
130+
if ( Running ) return; // queue will run itself through
131131

132132
Running = true;
133133
try
134134
{
135-
myBindings.Queue[0]();
135+
myBindings.Queue[ 0 ]();
136136
}
137-
catch (Exception e)
137+
catch ( Exception e )
138138
{
139-
Debug.WriteLine(e.Message);
139+
Debug.WriteLine( e.Message );
140140
}
141141

142-
myBindings.Queue.RemoveAt(0);
142+
myBindings.Queue.RemoveAt( 0 );
143143
Running = false;
144144

145-
if (myBindings.Queue.Count != 0)
145+
if ( myBindings.Queue.Count != 0 )
146146
myBindings.Executor.Raise();
147147
}
148148

149-
public string GetName()
149+
public string GetName( )
150150
{
151151
return "SpeckleSmackleSpockle";
152152
}

0 commit comments

Comments
 (0)