* Tidy up `VM` extension: use `var`
* Tidy up `VM` extension: remove redundant initialisers
* Tidy up `VM` extension: use type keywords when possible
* Tidy up `VM` extension: merge conditional expressions
* Tidy up `VM` extension: remove redundant qualifiers
* Tidy up `VM` extension: remove redundant type arguments
* Tidy up `VM` extension: remove redundant `else`s and parentheses
* Tidy up `VM` extension: fix naming
* Tidy up `VM` extension: misc changes
* Tidy up `VM` extension: use `null` propagation
* Tidy up `VM` extension: fix whitespace
* Tidy up `VM` extension: apply ReSharper Code Cleanup utility
* Tidy up `VM` extension: Fix naming of private string array
* CP-44767: Ignore VM restriction when fetching `MaxVCPUsAllowed`
Instead, fetch the highest available value in all templates for the host.
This means that VMs imported from vhd won't automatically default to `DEFAULT_NUM_VCPUS_ALLOWED`, and that VMs that have been kept across XenServer upgrades won't be limited to the number of vCPUs in their own (possibly outdated) restrictions
* CP-44766: Use value in template with a matching `reference_label` when checking VM restrictions
* Move restriction getters to own region
* CP-44766: Use matching templates to fetch VM restrictions
- Rewrite `GetRestrictions...` methods to perform simpler operations
- Add `GetIntRestrictionValue` and `GetBoolRestrictionValue` wrappers to `GetRestrictionValueFromMatchingTemplate`
- Now all calls to a restrictions first check the template value, with a fall-back to defaults
* CP-44765: Export `reference-label` when generating OVFs
---------
Signed-off-by: Danilo Del Busso <danilo.delbusso@cloud.com>
Also tidy up code
Also remove method in `SnapshotTreeView.cs` that wasn't used, which necessitated a null check
Signed-off-by: Danilo Del Busso <Danilo.Del.Busso@citrix.com>
Two objects will never have the same hash since base methods are based on direct object reference
Signed-off-by: Danilo Del Busso <Danilo.Del.Busso@citrix.com>
Removed unnecessary abstractions. Replaced named delegates with anonymous ones.
Use pattern matching and avoid multiple casts. Be consistent in the properties
we check.
Signed-off-by: Konstantina Chremmou <konstantina.chremmou@citrix.com>
This PR is aimimg to (1) fix a regression introduced by #2223 whereby the toolbar items did not have the correct state on first launch; (2) improve performance by removing some updates which I believe are not needed.
* Removed some duplicate calls to RefershTreeView and UpdateToolbars because
they are called within the action's Complete event handler.
Also, normalise the way the treeview refresh is requested by the various actions the
commands are launching.
Signed-off-by: Konstantina Chremmou <konstantina.chremmou@citrix.com>
* Removed some explicit calls to refresh the treeview since this is done by
the connection result handlers.
Signed-off-by: Konstantina Chremmou <konstantina.chremmou@citrix.com>
* The toolbars and tabs should be updated every time the treeview is refreshed.
This should happen when the refresh event is handled rather than calling
UpdateToolbars explicitly after a treeview refresh is requested; also, it is
the treeview refreshes that should be throttled and not the toolbar and
tab updates (the throttling mechanism may need correction).
Also, removed unnecessary Invoke as we are already on the UI thread.
Signed-off-by: Konstantina Chremmou <konstantina.chremmou@citrix.com>
* Simplified UpdateManager.Update event declaration.
Signed-off-by: Konstantina Chremmou <konstantina.chremmou@citrix.com>
- The new logic of adding/removing tabs in the ChangeToNewTabs method also fixes
tab-title flickering when we move from the Home node to a disconnected host.
- Renamed enum members Tab.Overview to Tab.Search and Tab.Settings to Tab.General
since the pages mapped to them are TabPageSearch and TabPageGeneral respectively.
- Do not call directly UpdateToolbarsCore but rather UpdateToolbars since the
latter takes account of the queued requested updates.
Signed-off-by: Konstantina Chremmou <konstantina.chremmou@citrix.com>
* CA-235459 - G11n:SC: The numeric tag for “Disks” and “Network” is overlap on the search window.
* CA-235459 - G11n:SC: The numeric tag for “Disks” and “Network” is overlap on the search window.
- use col widths from resource file instead of hardcoded values
* CA-235459 - G11n:SC: The numeric tag for “Disks” and “Network” is overlap on the search window.
- safer implementation
Signed-off-by: Letsibogo Ramadi <letsibogo.ramadi@citrix.com>
The truncating of the custom field name by space (instead of ellipsising) seems to be a Windows default, but it's not ideal. This change edits the text displayed in the dropdown when an item is selected so that if a custom field is selected it is ellipsised to an appropriate length. It doesn't affect the dropdown itself, which continues to display the full custom field name.
We observed that some threads can reach deadlock-ish state after they have Invoked into a control's UI thread. When it happens they are all in a waiting for join or in sleep state for very long time, although there should not be any deadlock situations.
It seems this has something to do with multiple parent controls and with which control we invoked on. This should not make a difference, because we have got one UI thread (for MainWindow) they should wait for, but we have seen it does.
The solution that fixed this issue was to invoke on the MainWindow instead of various controls (see a4fe507adf ).
This changeset is changing all our Invokes to invoke into MainWindow
instead of a control itself. (MainWindow's UI thread is the only UI thread
all Control is using in XenCenter)
This changeset should be in place until we have found the root cause or the exact reason for the above.