hongji.li
2023-11-07 1a1ba3ad5ed9e4380185aa1ccad20204a0e5f115
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
Quintiq file version 2.0
#parent: #root
Method DeselectScenario (
  internal[GUIComponent] component,
  MacroPlan activedatasetkind
) id:Method_ApplicationLibMacroPlanner_DeselectScenario
{
  #keys: '[11660.0.765423489]'
  Body:
  [*
    // Deselect a scenario in component level
    
    componentmds := null( ComponentMDS );
    if ( not isnull( component ) )
    {
      componentmds := ComponentMDS::CreateForLoadedMDSsOnly( component );
    }
    else
    {
      componentmds := ComponentMDS::CreateForLoadedMDSsOnly( Application );
    }
    
    mdsinstance := select( componentmds,
                           ComponentMDSKinds.ComponentMDSInstances,
                           m,
                           m.IsLoaded()
                           and m.MDSID().Equals( guard( activedatasetkind.MDSID(), Key::ZeroKey() ) ) );
    
    
    
    if ( not isnull( mdsinstance ) and not isnull( componentmds ) )
    {
      mdsinstance.ComponentMDSKind().DeselectAll();
      componentmds.Apply();
    }
  *]
}