Is it possible to display the plug-in that extended the WorkSpaceToolbarPlugin only in a specific view?
If possible, I would like to know the sample code.
Is it possible to display the plug-in that extended the WorkSpaceToolbarPlugin only in a specific view?
If possible, I would like to know the sample code.
Explore the SCTolbarplugin sample.
Try to find
class SetViewItemBackgroundColorWorkSpaceToolbarPlugin : WorkSpaceToolbarPlugin
..
public override void Init()
{
WorkSpaceToolbarPlaceDefinition.WorkSpaceIds = new List<Guid>() { ClientControl.LiveBuildInWorkSpaceId, ClientControl.PlaybackBuildInWorkSpaceId };
WorkSpaceToolbarPlaceDefinition.WorkSpaceStates = new List<WorkSpaceState>() { WorkSpaceState.Normal };
}
Try to add or remove “Ids” from the list WorkSpaceIds..
If I have understood what you seek correctly, you should see that the answer is yes.
Thanks Bo.
As advised, I added “ids” to the list workspaceId, but I could not.
I understand that the workspace is different from the view.
In the following coding, I got “ids” from “ClientCotrol.Instance.GetViewGroupItems()” and added it to the list.
Is my coding correct?
List<Item> groups = ClientCotrol.Instance.GetViewGroupItems();
............
List<Item> views = groupItem.GetChildren();
WorkSpaceToolbarPlaceDefinition.WorkSpaceIds = new List<Guid>() { views[0].FQID.ObjectId };
No. I do not think this is correct. You canot use view goups as work spaces. My suggestion was unclear try to do..
class SCDemoinatorWorkSpaceToolbarPluginInstance : WorkSpaceToolbarPluginInstance
..
WorkSpaceToolbarPlaceDefinition.WorkSpaceIds =
new List<Guid>()
{
ClientControl.LiveBuildInWorkSpaceId,
ClientControl.PlaybackBuildInWorkSpaceId,
ClientControl.SystemMonitorBuildInWorkSpaceId,
ClientControl.AccessControlBuildInWorkSpaceId,
ClientControl.AlarmManagementBuildInWorkSpaceId,
ClientControl.TransactBuildInWorkSpaceId,
ClientControl.SequenceExplorerBuildInWorkSpaceId
};
When you then see your button in all workspaces you can do the opposite and reduce it to the one you would like to see it in.
I might have misunderstood what you want, does the answer fit?
I have re-read your original question, and I think I have answered wrongly: You can make sure the WorkSpaceToolbarPlugin is only displayed when a certain workspace is used, you cannot make sure the WorkSpaceToolbarPlugin is only displayed when a certain view is shown. Sorry for the confusion caused.
I understood how to use WorkSpaceToolbarPlugin.
Can I display buttons on the toolbar only for specific views using other plugins?
The button should always be displayed on the screen.
Thanks for your support.
Yes. You can use
--
bool VideoOS.Platform.Client.WorkSpaceToolbarPluginInstance.Visible
[get, set]
Gets or sets the toolbar item visible state.
--
You will then have to control it setting it visible based on whether your specific view is displayed or not.
Perhaps you have something in your view that can do the property change. Alternatively perhaps you can use
--
const String VideoOS.Platform.Messaging.MessageId.SmartClient.SelectedViewChangedIndication = “SmartClient.SelectedViewChangedIndication”
Send by the Smart Client when a view has changed. The Data field contains the ViewAndLayoutItem for the new view, or null when a floating or secondary window is being closed. The sender FQID contains the id for the window, e.g. null for main window, otherwise a specific FQID.
--
to get the understanding of whether your view is displayed or not.