@@ -48,34 +48,37 @@ private static RibbonPanel AddOnePanel()
4848 rci . Name = "Python Shell Console" ;
4949 rps . DialogLauncher = rci ;
5050 //create button1
51- RibbonButton rb = new RibbonButton ( ) ;
52- rb . Orientation = Orientation . Vertical ;
53- rb . AllowInStatusBar = true ;
54- rb . Size = RibbonItemSize . Large ;
55- rb . Name = "Run CPS" ;
56- rb . ShowText = true ;
57- rb . Text = "Run CPS" ;
58- rb . Description = "Start Write Python Console\n Command: PythonShellConsole" ;
5951 var addinAssembly = typeof ( IronPythonConsoleApp ) . Assembly ;
60- rb . Image = CADPythonShellApplication . GetEmbeddedPng ( addinAssembly , "CADPythonShell.Resources.Python-16.png" ) ;
61- rb . LargeImage = CADPythonShellApplication . GetEmbeddedPng ( addinAssembly , "CADPythonShell.Resources.Python-32.png" ) ;
62- rb . CommandHandler = new RelayCommand ( new IronPythonConsoleCommand ( ) . Execute ) ;
63- rps . Items . Add ( rb ) ;
52+ RibbonButton btnPythonShell = new RibbonButton
53+ {
54+ Orientation = Orientation . Vertical ,
55+ AllowInStatusBar = true ,
56+ Size = RibbonItemSize . Large ,
57+ Name = "Run CPS" ,
58+ ShowText = true ,
59+ Text = "Run CPS" ,
60+ Description = "Start Write Python Console\n Command: PythonShellConsole" ,
61+ Image = CADPythonShellApplication . GetEmbeddedPng ( addinAssembly , "CADPythonShell.Resources.Python-16.png" ) ,
62+ LargeImage = CADPythonShellApplication . GetEmbeddedPng ( addinAssembly , "CADPythonShell.Resources.Python-32.png" ) ,
63+ CommandHandler = new RelayCommand ( new IronPythonConsoleCommand ( ) . Execute )
64+ } ;
65+ rps . Items . Add ( btnPythonShell ) ;
6466 //create button2
65- RibbonButton rb2 = new RibbonButton ( ) ;
66- rb2 . Orientation = Orientation . Vertical ;
67- rb2 . AllowInStatusBar = true ;
68- rb2 . Size = RibbonItemSize . Large ;
69- rb2 . Name = "Configure CPS" ;
70- rb2 . ShowText = true ;
71- rb2 . Text = "Configure CPS" ;
72- rb2 . Description = "Configure Cad Python Shell\n Command: PythonShellSetting" ;
73- rb2 . Image = CADPythonShellApplication . GetEmbeddedPng ( addinAssembly , "CADPythonShell.Resources.Settings-16.png" ) ;
74- rb2 . LargeImage = CADPythonShellApplication . GetEmbeddedPng ( addinAssembly , "CADPythonShell.Resources.Settings-32.png" ) ;
75-
76- rb2 . CommandHandler = new RelayCommand ( new ConfigureCommand ( ) . Execute ) ;
67+ RibbonButton btnConfig = new RibbonButton
68+ {
69+ Orientation = Orientation . Vertical ,
70+ AllowInStatusBar = true ,
71+ Size = RibbonItemSize . Large ,
72+ Name = "Configure CPS" ,
73+ ShowText = true ,
74+ Text = "Configure CPS" ,
75+ Description = "Configure Cad Python Shell\n Command: PythonShellSetting" ,
76+ Image = CADPythonShellApplication . GetEmbeddedPng ( addinAssembly , "CADPythonShell.Resources.Settings-16.png" ) ,
77+ LargeImage = CADPythonShellApplication . GetEmbeddedPng ( addinAssembly , "CADPythonShell.Resources.Settings-32.png" ) ,
78+ CommandHandler = new RelayCommand ( new ConfigureCommand ( ) . Execute )
79+ } ;
7780 //Add the Button to the Tab
78- rps . Items . Add ( rb2 ) ;
81+ rps . Items . Add ( btnConfig ) ;
7982 return rp ;
8083 }
8184 }
0 commit comments