11using Cinteros . Xrm . FetchXmlBuilder . Properties ;
22using McTools . Xrm . Connection ;
3+ using Microsoft . Toolkit . Uwp . Notifications ;
34using Rappen . XRM . Helpers . Extensions ;
45using Rappen . XRM . Helpers . FetchXML ;
56using Rappen . XTB . FetchXmlBuilder . Builder ;
@@ -256,6 +257,15 @@ public override void ClosingPlugin(PluginCloseInfo info)
256257 LogUse ( "Close" , ai2 : true ) ;
257258 }
258259
260+ public override void HandleToastActivation ( ToastNotificationActivatedEventArgsCompat args )
261+ {
262+ if ( Supporting . HandleToastActivation ( this , args , ai2 ) )
263+ {
264+ return ;
265+ }
266+ base . HandleToastActivation ( args ) ;
267+ }
268+
259269 public void ApplyState ( object state )
260270 {
261271 if ( state is string fetch && fetch . ToLowerInvariant ( ) . StartsWith ( "<fetch" ) )
@@ -592,7 +602,7 @@ private void FetchXmlBuilder_Load(object sender, EventArgs e)
592602 }
593603 else
594604 {
595- Supporting . ShowIf ( this , false , true , ai2 ) ;
605+ Supporting . ShowIf ( this , ShowItFrom . Open , false , true , ai2 ) ;
596606 }
597607 if ( Supporting . IsEnabled ( this ) )
598608 {
@@ -894,7 +904,7 @@ private void tsmiRepoExport_Click(object sender, EventArgs e)
894904 } ;
895905 if ( sfd . ShowDialog ( ) == DialogResult . OK )
896906 {
897- XmlSerializerHelper . SerializeToFile ( repository , sfd . FileName ) ;
907+ XmlAtomicStore . Serialize ( repository , sfd . FileName ) ;
898908 MessageBox . Show ( $ "The entire repository has been saved to file\n { sfd . FileName } ", "Export repository" , MessageBoxButtons . OK , MessageBoxIcon . Information ) ;
899909 }
900910 }
@@ -911,9 +921,7 @@ private void tsmiRepoImport_Click(object sender, EventArgs e)
911921 {
912922 try
913923 {
914- var document = new XmlDocument ( ) ;
915- document . Load ( ofd . FileName ) ;
916- var repo = ( QueryRepository ) XmlSerializerHelper . Deserialize ( document . OuterXml , typeof ( QueryRepository ) ) ;
924+ var repo = XmlAtomicStore . Deserialize < QueryRepository > ( ofd . FileName ) ;
917925 var reponame = Path . ChangeExtension ( Path . GetFileName ( ofd . FileName ) , "" ) . Trim ( '.' ) ;
918926 if ( MessageBox . Show ( $ "Confirm importing { repo . Queries . Count } queries into repository folder \" { reponame } \" .", "Confirm" , MessageBoxButtons . OKCancel , MessageBoxIcon . Question ) != DialogResult . OK )
919927 {
@@ -969,7 +977,7 @@ private void tsbShare_Click(object sender, EventArgs e)
969977
970978 private void tsbSupporting_Click ( object sender , EventArgs e )
971979 {
972- Supporting . ShowIf ( this , true , false , ai2 ) ;
980+ Supporting . ShowIf ( this , ShowItFrom . Button , true , false , ai2 , sync : true ) ;
973981 }
974982
975983 private void reloadBySolutionToolStripMenuItem_Click ( object sender , EventArgs e )
0 commit comments