private bool QueryIsEnvSelected(CommandData data, ref CommandStatus status) { status.State = CommandState.Disabled; if (UIServices.KB != null && UIServices.KB.CurrentKB != null) { Artech.Common.Framework.Selection.Selection selection = data.Context as Artech.Common.Framework.Selection.Selection; if (selection == null) { return(true); } KBModel env = selection.SelectedObject as KBModel; if (env == null) { return(true); } if (env.Type != ModelType.Prototype) { status.State = CommandState.Invisible; return(true); } data.Context = env; status.State = CommandState.Enabled; } return(true); }
private bool QueryIsKBSelected(CommandData data, ref CommandStatus status) { status.State = CommandState.Disabled; if (UIServices.KB != null && UIServices.KB.CurrentKB != null) { Artech.Common.Framework.Selection.Selection selection = data.Context as Artech.Common.Framework.Selection.Selection; if (selection == null) { return(true); } Artech.Architecture.Common.Objects.KBProperties props = selection.SelectedObject as Artech.Architecture.Common.Objects.KBProperties; if (props == null) { return(true); } status.State = CommandState.Enabled; } return(true); }