@@ -320,6 +320,7 @@ private void Routine_NewComponent()
320
320
txtControlName . Clear ( ) ;
321
321
txtControlDisplayName . Clear ( ) ;
322
322
txtControlDescription . Clear ( ) ;
323
+ cboxControlType . SelectedIndex = - 1 ;
323
324
cboxTemplate . SelectedIndex = - 1 ;
324
325
cboxAdditionalPackages . SelectedIndex = - 1 ;
325
326
txtComponentVersion . Clear ( ) ;
@@ -335,6 +336,7 @@ private void Routine_NewComponent()
335
336
txtNamespace . Enabled = true ;
336
337
txtControlDisplayName . Enabled = true ;
337
338
txtControlDescription . Enabled = true ;
339
+ cboxControlType . Enabled = true ;
338
340
cboxTemplate . Enabled = true ;
339
341
cboxAdditionalPackages . Enabled = true ;
340
342
txtSolutionName . Enabled = true ;
@@ -368,6 +370,7 @@ private void Routine_EditComponent()
368
370
{
369
371
txtControlName . Enabled = false ;
370
372
txtNamespace . Enabled = false ;
373
+ cboxControlType . Enabled = false ;
371
374
cboxTemplate . Enabled = false ;
372
375
cboxAdditionalPackages . Enabled = false ;
373
376
btnCreateComponent . Enabled = false ;
@@ -522,9 +525,11 @@ private void IdentifyControlDetails()
522
525
523
526
ControlDetails = ControlManifest . GetControlManifestDetails ( txtWorkingFolder . Text ) ;
524
527
525
- _mainPluginLocalWorker = new BackgroundWorker ( ) ;
526
- _mainPluginLocalWorker . DoWork += IdentifyAdditionalPackage ;
527
- _mainPluginLocalWorker . RunWorkerAsync ( ) ;
528
+ //_mainPluginLocalWorker = new BackgroundWorker();
529
+ //_mainPluginLocalWorker.DoWork += IdentifyAdditionalPackage;
530
+ //_mainPluginLocalWorker.RunWorkerAsync();
531
+
532
+ IdentifyAdditionalPackage_New ( ) ;
528
533
529
534
if ( ! string . IsNullOrEmpty ( ControlDetails . ControlName ) )
530
535
{
@@ -575,6 +580,23 @@ private void IdentifyAdditionalPackage(object worker, DoWorkEventArgs args)
575
580
}
576
581
}
577
582
583
+ private void IdentifyAdditionalPackage_New ( )
584
+ {
585
+ // Identify additional package installs - for now only check for Fluent UI
586
+ var packageName = Enum . AdditionalPackages ( ) . FirstOrDefault ( p => p . Value == "Fluent UI" ) . Key ;
587
+ string [ ] addPkgCommands = new string [ ] { Commands . Npm . CheckAdditionalPackage ( packageName ) } ;
588
+ var addPkgOutput = CommandLineHelper . RunCommand ( addPkgCommands ) ;
589
+
590
+ // scrub data
591
+ addPkgOutput = addPkgOutput . Substring ( addPkgOutput . IndexOf ( addPkgCommands [ 0 ] ) + addPkgCommands [ 0 ] . Length ) ;
592
+
593
+ if ( addPkgOutput . ToLower ( ) . Contains ( packageName . ToLower ( ) ) )
594
+ {
595
+ cboxAdditionalPackages . SelectedIndex = 1 ;
596
+ ControlDetails . AdditionalPackageIndex = 1 ;
597
+ }
598
+ }
599
+
578
600
private void IdentifySolutionDetails ( bool suppressErrors = false )
579
601
{
580
602
DataverseSolutionDetails = new SolutionDetails ( ) ;
@@ -714,6 +736,7 @@ private void PopulateControlDetails()
714
736
txtControlDescription . Text = ControlDetails . ControlDescription ;
715
737
txtComponentVersion . Text = ControlDetails . Version ;
716
738
739
+ cboxControlType . SelectedIndex = ControlDetails . IsVirtual ? 1 : 0 ;
717
740
cboxTemplate . SelectedIndex = ControlDetails . IsDatasetTemplate ? 1 : 0 ;
718
741
719
742
if ( ! string . IsNullOrEmpty ( ControlDetails . PreviewImagePath ) )
@@ -1983,14 +2006,24 @@ private void BtnCreateComponent_Click(object sender, EventArgs e)
1983
2006
}
1984
2007
1985
2008
ReloadDetails = true ;
1986
- if ( string . IsNullOrEmpty ( additionalPackage ) )
2009
+ if ( ( string ) cboxControlType . SelectedItem == "Virtual" )
1987
2010
{
1988
- RunCommandLine ( cdWorkingDir , pacCommand , npmCommand ) ;
2011
+ string pacCommandVirtual = Commands . Pac . PcfInitVirtual ( txtNamespace . Text , txtControlName . Text , cboxTemplate . SelectedItem . ToString ( ) ) ;
2012
+ RunCommandLine ( cdWorkingDir , pacCommandVirtual , npmCommand ) ;
2013
+
1989
2014
}
1990
2015
else
1991
2016
{
1992
- RunCommandLine ( cdWorkingDir , pacCommand , npmCommand , additionalPackage ) ;
2017
+ if ( string . IsNullOrEmpty ( additionalPackage ) )
2018
+ {
2019
+ RunCommandLine ( cdWorkingDir , pacCommand , npmCommand ) ;
2020
+ }
2021
+ else
2022
+ {
2023
+ RunCommandLine ( cdWorkingDir , pacCommand , npmCommand , additionalPackage ) ;
2024
+ }
1993
2025
}
2026
+
1994
2027
1995
2028
// Create VS Code Workspace file
1996
2029
@@ -2631,6 +2664,15 @@ private void btnManageFeatures_Click(object sender, EventArgs e)
2631
2664
}
2632
2665
}
2633
2666
2667
+ private void cboxControlType_SelectedIndexChanged ( object sender , EventArgs e )
2668
+ {
2669
+ if ( ( string ) cboxControlType . SelectedItem == "Virtual" )
2670
+ {
2671
+ cboxAdditionalPackages . SelectedIndex = 1 ;
2672
+ cboxAdditionalPackages . Enabled = false ;
2673
+ }
2674
+ }
2675
+
2634
2676
#endregion
2635
2677
2636
2678
0 commit comments