/// <summary> /// Initializes a new instance of the <see cref="SelectedItem"/> class. /// </summary> /// <param name="xenObject">The xen object that is selected.</param> /// <param name="connection">The connection of the xen object.</param> /// <param name="hostAncestor">The host ancestor of the xen object in the tree.</param> /// <param name="poolAncestor">The pool ancestor of the xen object in the tree.</param> public SelectedItem(IXenObject xenObject, IXenConnection connection, Host hostAncestor, Pool poolAncestor) { _xenObject = xenObject; _hostAncestor = hostAncestor; _poolAncestor = poolAncestor; _connection = connection; }
public MessageAlert(XenAPI.Message m) { Message = m; uuid = m.uuid; _timestamp = m.timestamp; try { _priority = (int)m.priority; } catch (OverflowException) { _priority = DEFAULT_PRIORITY; } Connection = m.Connection; XenObject = Helpers.XenObjectFromMessage(m); // TODO: This would be better if there was some way of getting the actual host that the XenObject belongs to // Currently if the applies to object is not a host or pool and belongs to a slave it is filtered under the master. Host h = XenObject as Host; if (h == null) h = Helpers.GetMaster(m.Connection); if (h != null) HostUuid = h.uuid; }
public ResidentHostIsSameAsSelectionFilter(IXenObject item, List<VM> preSelectedVMs) : base(item) { if (preSelectedVMs == null) throw new ArgumentNullException("Pre-selected VMs are null"); this.preSelectedVMs = preSelectedVMs; }
public SaveDataSourceStateAction(IXenConnection connection, IXenObject xmo, List<DataSourceItem> items, List<DesignedGraph> graphs) : base(connection, Messages.ACTION_SAVE_DATASOURCES, Messages.ACTION_SAVING_DATASOURCES, true) { DataSourceItems = items; XenObject = xmo; Graphs = graphs; }
public WlbEnabledFilter(IXenObject item, List<VM> preSelectedVMs) : base(item) { if (preSelectedVMs == null) throw new ArgumentNullException("Pre-selected VMs are null"); this.preSelectedVMs = preSelectedVMs; }
public void CopyFrom(DelayLoadingOptionComboBoxItem toCopy) { xenObject = toCopy.xenObject; failureReason = toCopy.FailureReason; Enabled = toCopy.Enabled; PreferAsSelectedItem = toCopy.PreferAsSelectedItem; }
public SaveDataSourceStateAction(IXenConnection connection, IXenObject xmo, List<DataSourceItem> items, List<DesignedGraph> graphs) : base(connection, "Saving DataSources", "Saving DataSources", true) { DataSourceItems = items; XenObject = xmo; Graphs = graphs; }
public ExportApplianceWizard(IXenConnection con, SelectedItemCollection selection) : base(con) { InitializeComponent(); m_pageExportAppliance = new ExportAppliancePage(); m_pageRbac = new RBACWarningPage(); m_pageExportSelectVMs = new ExportSelectVMsPage(); m_pageExportEula = new ExportEulaPage(); m_pageExportOptions = new ExportOptionsPage(); m_pageTvmIp = new TvmIpPage(); m_pageFinish = new ExportFinishPage(); m_selectedObject = selection.FirstAsXenObject; if (selection.Count == 1 && (m_selectedObject is VM || m_selectedObject is VM_appliance)) m_pageExportAppliance.ApplianceFileName = m_selectedObject.Name; m_pageExportAppliance.OvfModeOnly = m_selectedObject is VM_appliance; m_pageTvmIp.IsExportMode = true; m_pageFinish.SummaryRetreiver = GetSummary; m_pageExportSelectVMs.SelectedItems = selection; AddPages(m_pageExportAppliance, m_pageExportSelectVMs, m_pageFinish); }
protected ReasoningFilter(IXenObject itemToFilterOn) { if (!(itemToFilterOn is Host) && !(itemToFilterOn is Pool)) throw new ArgumentException("Target should be host or pool"); ItemToFilterOn = itemToFilterOn; }
protected SaveChangesAction(IXenObject obj, bool suppressHistory) : base(obj.Connection, Messages.ACTION_SAVE_CHANGES_TITLE, Messages.ACTION_SAVE_CHANGES_IN_PROGRESS, suppressHistory) { // This is lovely. We need to lock the server object (not the copy we have taken) before calling save changes. // We don't know the type so we use the MethodInfo object and MakeGenericMethod to do a resolve against the type // we have extracted from GetType(). The Resolve() call itself needs a XenRef which we make by calling the XenRef constructor that takes the // opaque ref as an argument and using the MakeGenericType call to give it the same type as the object... // ... _then_ we lock it. SetObject(obj); _xenObject = obj; if (obj.opaque_ref != null) // creating a new object comes through here, but with obj.opaque_ref == null { System.Reflection.MethodInfo mi = typeof(IXenConnection).GetMethod("Resolve", BindingFlags.Public | BindingFlags.Instance); Type type = obj.GetType(); object[] xenRefParam = new object[] { typeof(XenRef<>).MakeGenericType(type).GetConstructor(new Type[] {typeof(string)}).Invoke(new Object[] {obj.opaque_ref}) }; _serverXenObject = (IXenObject)mi.MakeGenericMethod(type).Invoke(obj.Connection, xenRefParam); if (_serverXenObject != null) { // CA-35210: Removed this exception pending locking overhaul post MR in CA-38966 //if (_serverXenObject.Locked) // lockViolation = true; _serverXenObject.Locked = true; } } }
public ImportWizard(IXenConnection con, IXenObject xenObject, string filename, bool ovfModeOnly) : base(con) { InitializeComponent(); m_pageStorage = new ImportSelectStoragePage(); m_pageNetwork = new ImportSelectNetworkPage(); m_pageHost = new ImportSelectHostPage(); m_pageSecurity = new ImportSecurityPage(); m_pageEula = new ImportEulaPage(); m_pageOptions = new ImportOptionsPage(); m_pageFinish = new ImportFinishPage(); m_pageRbac = new RBACWarningPage(); m_pageTvmIp = new TvmIpPage(); m_pageVMconfig = new ImageVMConfigPage(); m_pageImportSource = new ImportSourcePage(); m_pageXvaStorage = new StoragePickerPage(); m_pageXvaNetwork = new NetworkPickerPage(); m_pageXvaHost = new GlobalSelectHost(); lunPerVdiMappingPage = new LunPerVdiImportPage { Connection = con }; m_selectedObject = xenObject; m_pageTvmIp.IsExportMode = false; m_pageFinish.SummaryRetreiver = GetSummary; m_pageXvaStorage.ImportVmCompleted += m_pageXvaStorage_ImportVmCompleted; if (!string.IsNullOrEmpty(filename)) m_pageImportSource.SetFileName(filename); m_pageImportSource.OvfModeOnly = ovfModeOnly; AddPages(m_pageImportSource, m_pageHost, m_pageStorage, m_pageNetwork, m_pageFinish); }
public void SetXenObjects(IXenObject orig, IXenObject clone) { if (!(clone is VDI)) return; vdi = clone as VDI; Repopulate(); }
protected override void Execute(IXenObject xenObject) { using (PropertiesDialog dialog = new PropertiesDialog(xenObject)) { dialog.EditDescription(); dialog.ShowDialog(Parent); } }
public SaveCustomFieldsAction(IXenObject xenObject, List<CustomField> customFields, bool suppressHistory) : base(xenObject.Connection, Messages.ACTION_SAVE_CUSTOM_FIELDS, string.Format(Messages.ACTION_SAVING_CUSTOM_FIELDS_FOR, xenObject), suppressHistory) { this.xenObject = xenObject; this.customFields = customFields; string type = xenObject.GetType().Name.ToLowerInvariant(); }
protected virtual void Execute(IXenObject xenObject) { using (PropertiesDialog dialog = new PropertiesDialog(xenObject)) { dialog.EditName(); dialog.ShowDialog(Parent); } }
public LiveMigrateOptionsVmMapping(VmMapping vmMapping, IXenObject vm) { this.vmMapping = vmMapping; this.vm = vm as VM; if(vm==null) throw new NullReferenceException("VM passed to ctor was null"); }
public CreateDiskAction(IXenObject obj) : base(obj) { VDI disk = obj as VDI; if (disk != null) Title = string.Format(Messages.ACTION_VDI_CREATING_TITLE, disk.Name, disk.Connection.Resolve<SR>(disk.SR).NameWithoutHost); Description = Messages.ACTION_VDI_CREATING; }
public GpuRow(IXenObject xenObject, List<PGPU> pGpuList) : this() { this.xenObject = xenObject; pGpuLabel.Text = pGpuList[0].Name; RepopulateAllowedTypes(pGpuList[0]); Rebuild(pGpuList); SetupPage(); }
public CrossPoolMigrateCanMigrateFilter(IXenObject itemAddedToComboBox, List<VM> preSelectedVMs, WizardMode wizardMode) : base(itemAddedToComboBox) { _wizardMode = wizardMode; if (preSelectedVMs == null) throw new ArgumentNullException("Pre-selected VMs are null"); this.preSelectedVMs = preSelectedVMs; }
/// <summary> /// Calculates the nodes that should be visible in the main window tree view when the specified xen object is hidden. /// </summary> /// <param name="hiddenObject">The hidden object.</param> private ComparableList<IXenObject> CalculatePopulateWithHiddenObject(IXenObject hiddenObject) { VirtualTreeNode rootNode = MW(() => new MainWindowTreeBuilder(new FlickerFreeTreeView()).CreateNewRootNode(new NavigationPane().Search, NavigationPane.NavigationMode.Infrastructure)); List<VirtualTreeNode> nodes = new List<VirtualTreeNode>(rootNode.Descendants); nodes.RemoveAll(n => hiddenObject.Equals(n.Tag)); nodes.RemoveAll(n => new List<VirtualTreeNode>(n.Ancestors).Find(nn => hiddenObject.Equals(nn.Tag)) != null); return new ComparableList<IXenObject>(nodes.ConvertAll(n => (IXenObject)n.Tag)); }
public GpuRow(IXenObject xenObject, List<PGPU> pGpuList) : this() { this.xenObject = xenObject; pGpuLabel.Text = pGpuList[0].Name; RepopulateAllowedTypes(pGpuList[0]); vGpuCapability = !Helpers.FeatureForbidden(xenObject, Host.RestrictVgpu) && pGpuList[0].HasVGpu; Rebuild(pGpuList); SetupPage(); }
public ScriptingObject(WebBrowser2 Browser, IXenObject XenObject) { browser = Browser; connection = XenObject.Connection; if (connection != null) { connection.ConnectionResult += new EventHandler<ConnectionResultEventArgs>(connection_ConnectionResult); } SetObject(XenObject); }
public static void AddTag(Session session, IXenObject o, String tag) { //Program.AssertOffEventThread(); String[] tags = GetTags(o); if (tags != null && Array.IndexOf<String>(tags, tag) > -1) return; o.Do("add_tags", session, o.opaque_ref, tag); }
public PerfmonDefinitionAction(IXenObject xo, List<PerfmonDefinition> perfmonDefinitions) : base(xo.Connection, Messages.ACTION_SAVE_ALERTS, string.Format(Messages.ACTION_SAVING_ALERTS_FOR, xo)) { this.xo = xo; this.perfmonDefinitions = perfmonDefinitions; string type = xo.GetType().Name.ToLowerInvariant(); ApiMethodsToRoleCheck.Add(type + ".remove_from_other_config", PerfmonDefinition.PERFMON_KEY_NAME); if (perfmonDefinitions != null && perfmonDefinitions.Count != 0) ApiMethodsToRoleCheck.Add(type + ".add_to_other_config", PerfmonDefinition.PERFMON_KEY_NAME); }
public void SetXenObjects(IXenObject orig, IXenObject clone) { Trace.Assert(clone is VM); // only VMs should show this page Trace.Assert(Helpers.ContainerCapability(clone.Connection)); // If no container capability, we shouldn't see this page vm = (VM)clone; Trace.Assert(vm.CanBeEnlightened); // If the VM cannot be enlightened, we shouldn't see this page PopulatePage(); }
public void SetXenObjects(IXenObject orig, IXenObject clone) { CustomFieldsManager.CustomFieldsChanged -= CustomFields_CustomFieldsChanged; xenObject = clone; if (xenObject != null) { CustomFieldsManager.CustomFieldsChanged += CustomFields_CustomFieldsChanged; Rebuild(true); } }
public HomeServerItem(IXenObject host, List<ReasoningFilter> filters) : base(host) { if(!(host is Host)) { throw new ArgumentException("This class expects as IXenObject of type host"); } this.filters = filters; LoadAndWait(); }
public void SetXenObjects(IXenObject orig, IXenObject clone) { network = clone as XenAPI.Network; if (network == null) return; // use the pif of the master to populate the controls. We use it later in the create_VLAN_from_PIF call in Network Action host = Helpers.GetMaster(network.Connection); Repopulate(); EnableDisable(); }
public void SetXenObjects(IXenObject orig, IXenObject clone) { vm = clone as VM; if (vm == null) return; Host currentAffinity = vm.Connection.Resolve(vm.affinity); picker.SetAffinity(vm.Connection, currentAffinity, vm.HasNoDisksAndNoLocalCD ? null : vm.GetStorageHost(false)); }
public void SetXenObjects(IXenObject orig, IXenObject clone) { pool = Helpers.GetPoolOfOne(clone.Connection); // clone could be a pool or a host if (clone is Host) labelRubric.Text = Messages.SECURITYEDITPAGE_RUBRIC_HOST; // the pool version is built into the page: this overrides it in the case of a host if (pool.ssl_legacy) radioButtonSSL.Checked = true; else radioButtonTLS.Checked = true; ShowHideWarning(); }
public void SetXenObjects(IXenObject orig, IXenObject clone) { throw new Exception("The method or operation is not implemented."); }
public void SetXenObjects(IXenObject orig, IXenObject clone) { _clone = (VM_appliance)clone; Pool = Helpers.GetPoolOfOne(_clone.Connection); //RefreshTab(null); }
public CrossPoolMigrateVersionFilter(IXenObject itemAddedToComboBox) : base(itemAddedToComboBox) { }
public static void Move(IXenObject ixmo, Folder target) { Move(null, ixmo, target); }
public static void Unfolder(IXenObject ixmo) { Unfolder(null, ixmo); }
public LicenseDataGridViewRow(IXenObject xenObject, ILicenseStatus status) : base(xenObject) { licenseStatus = status; licenseStatus.ItemUpdated += licenseStatus_ItemUpdated; }
/// <summary> /// Initializes a new instance of the <see cref="Command"/> class. /// </summary> /// <param name="mainWindow">The application main window.</param> /// <param name="xenObject">The selection context for the Command.</param> protected Command(IMainWindow mainWindow, IXenObject xenObject) : this(mainWindow, new SelectedItem(xenObject)) { }
public bool FailureFoundFor(IXenObject xenObject) { ItemToFilterOn = xenObject; return(FailureFound); }
public DRFailoverCommand(IMainWindow mainWindow, IXenObject selection) : base(mainWindow, selection) { }
/// <summary> /// Call me, async update graph data set /// UpdaterThread Thread /// </summary> public void Update() { while (RunThread) { IXenObject xenObject = XenObject; Host Host = GetHost(xenObject); DateTime ServerWas = ServerNow(); // get time before updating so we dont miss any 5 second updates if getting the past data if (FirstTime) { LoadingInitialData = true; OnArchivesUpdated(); Get(ArchiveInterval.None, RrdsUri, RRD_Full_InspectCurrentNode, Host, xenObject); LoadingInitialData = false; OnArchivesUpdated(); LastFiveSecondCollection = ServerWas; LastOneMinuteCollection = ServerWas; LastOneHourCollection = ServerWas; LastOneDayCollection = ServerWas; FirstTime = false; } if (ServerWas - LastFiveSecondCollection > FiveSeconds) { GetUpdate(ArchiveInterval.FiveSecond, Host, xenObject); LastFiveSecondCollection = ServerWas; Archives[ArchiveInterval.FiveSecond].Load(SetsAdded); } if (ServerWas - LastOneMinuteCollection > OneMinute) { GetUpdate(ArchiveInterval.OneMinute, Host, xenObject); LastOneMinuteCollection = ServerWas; Archives[ArchiveInterval.OneMinute].Load(SetsAdded); } if (ServerWas - LastOneHourCollection > OneHour) { GetUpdate(ArchiveInterval.OneHour, Host, xenObject); LastOneHourCollection = ServerWas; Archives[ArchiveInterval.OneHour].Load(SetsAdded); } if (ServerWas - LastOneDayCollection > OneDay) { GetUpdate(ArchiveInterval.OneDay, Host, xenObject); LastOneDayCollection = ServerWas; Archives[ArchiveInterval.OneDay].Load(SetsAdded); } lock (WaitUpdates) { Monitor.Wait(WaitUpdates, SleepTime); } lock (UpdateMonitor) { if (!ThreadRunning) { Monitor.Wait(UpdateMonitor); } } } }
/// <summary> /// UpdaterThread Thread /// </summary> private void GetUpdate(ArchiveInterval interval, Host host, IXenObject xo) { Get(interval, UpdateUri, RRD_Update_InspectCurrentNode, host, xo); }
public TestCase(IXenObject ixo, List <VM> vms, bool failureExpected) { this.ixo = ixo; this.vms = vms; this.failureExpected = failureExpected; }
/// <summary> /// UpdaterThread Thread /// </summary> private void RRD_Full_InspectCurrentNode(XmlReader reader, IXenObject xmo) { if (reader.NodeType == XmlNodeType.Element) { LastNode = reader.Name; if (LastNode == "row") { CurrentTime += CurrentInterval * StepSize * TicksInOneSecond; ValueCount = 0; } } if (reader.NodeType == XmlNodeType.EndElement) { LastNode = reader.Name; if (LastNode == "rra") { if (BailOut) { BailOut = false; return; } ArchiveInterval i = GetArchiveIntervalFromFiveSecs(CurrentInterval); if (i != ArchiveInterval.None) { Archives[i].CopyLoad(SetsAdded); } foreach (DataSet set in SetsAdded) { set.Points.Clear(); } BailOut = false; } } if (reader.NodeType != XmlNodeType.Text) { return; } if (LastNode == "name") { string str = reader.ReadContentAsString(); string id = string.Format("{0}:{1}:{2}", xmo is Host ? "host" : "vm", Helpers.GetUuid(xmo), str); SetsAdded.Add(DataSet.Create(id, xmo, true, str)); } else if (LastNode == "step") { string str = reader.ReadContentAsString(); StepSize = long.Parse(str, CultureInfo.InvariantCulture); } else if (LastNode == "lastupdate") { string str = reader.ReadContentAsString(); EndTime = long.Parse(str, CultureInfo.InvariantCulture); } else if (LastNode == "pdp_per_row") { string str = reader.ReadContentAsString(); CurrentInterval = long.Parse(str, CultureInfo.InvariantCulture); long modInterval = EndTime % (StepSize * CurrentInterval); long stepCount = CurrentInterval == 1 ? FiveSecondsInTenMinutes // 120 * 5 seconds in 10 minutes : CurrentInterval == 12 ? MinutesInTwoHours // 120 minutes in 2 hours : CurrentInterval == 720 ? HoursInOneWeek // 168 hours in a week : DaysInOneYear; // 366 days in a year CurrentTime = new DateTime((((EndTime - modInterval) - (StepSize * CurrentInterval * stepCount)) * TimeSpan.TicksPerSecond) + TimeUtil.TicksBefore1970).ToLocalTime().Ticks; } else if (LastNode == "cf") { string str = reader.ReadContentAsString(); if (str != RrdCFAverage) { BailOut = true; } } else if (LastNode == "v") { if (BailOut || SetsAdded.Count <= ValueCount) { return; } DataSet set = SetsAdded[ValueCount]; string str = reader.ReadContentAsString(); set.AddPoint(str, CurrentTime, SetsAdded); ValueCount++; } }
private static Uri RrdsUri(Session session, Host host, ArchiveInterval interval, IXenObject xo) { string query = xo is Host? string.Format(RrdHostQuery, Uri.EscapeDataString(session.uuid)) : xo is VM? string.Format(RrdVmQuery, Uri.EscapeDataString(session.uuid), Helpers.GetUuid(xo)) : ""; return(BuildUri(host, xo is Host ? RrdHostPath : RrdVmPath, query)); }
/// <summary> /// Call me, async update graph data set /// UpdaterThread Thread /// </summary> private void Update() { while (RunThread) { IXenObject xenObject = XenObject; Host Host = GetHost(xenObject); DateTime ServerWas = ServerNow(); // get time before updating so we don't miss any 5 second updates if getting the past data if (FirstTime) { // Restrict to at most 24 hours data if necessary if (Helpers.FeatureForbidden(_xenObject, XenAPI.Host.RestrictPerformanceGraphs)) { Archives[ArchiveInterval.OneHour].MaxPoints = 24; Archives[ArchiveInterval.OneDay].MaxPoints = 0; } else { Archives[ArchiveInterval.OneHour].MaxPoints = HoursInOneWeek; Archives[ArchiveInterval.OneDay].MaxPoints = DaysInOneYear; } foreach (DataArchive a in Archives.Values) { a.Sets.Clear(); } LoadingInitialData = true; OnArchivesUpdated(); Get(ArchiveInterval.None, RrdsUri, RRD_Full_InspectCurrentNode, Host, xenObject); LoadingInitialData = false; OnArchivesUpdated(); LastFiveSecondCollection = ServerWas; LastOneMinuteCollection = ServerWas; LastOneHourCollection = ServerWas; LastOneDayCollection = ServerWas; FirstTime = false; } if (ServerWas - LastFiveSecondCollection > FiveSeconds) { GetUpdate(ArchiveInterval.FiveSecond, Host, xenObject); LastFiveSecondCollection = ServerWas; Archives[ArchiveInterval.FiveSecond].Load(SetsAdded); } if (ServerWas - LastOneMinuteCollection > OneMinute) { GetUpdate(ArchiveInterval.OneMinute, Host, xenObject); LastOneMinuteCollection = ServerWas; Archives[ArchiveInterval.OneMinute].Load(SetsAdded); } if (ServerWas - LastOneHourCollection > OneHour) { GetUpdate(ArchiveInterval.OneHour, Host, xenObject); LastOneHourCollection = ServerWas; Archives[ArchiveInterval.OneHour].Load(SetsAdded); } if (ServerWas - LastOneDayCollection > OneDay) { GetUpdate(ArchiveInterval.OneDay, Host, xenObject); LastOneDayCollection = ServerWas; Archives[ArchiveInterval.OneDay].Load(SetsAdded); } lock (WaitUpdates) { Monitor.Wait(WaitUpdates, SleepTime); } lock (UpdateMonitor) { if (!ThreadRunning) { Monitor.Wait(UpdateMonitor); } } } }
public void SetXenObjects(IXenObject orig, IXenObject clone) { host = clone as Host; UpdateMaintenanceWarning(); Repopulate(); }
public void SetXenObjects(IXenObject orig, IXenObject clone) { throw new NotImplementedException(); }
/// <remarks> /// For Non-Windows VMs and for Windows VMs pre-Dundee: /// - Memory, Disk and Network values are not available if XenServer Tools are not installed /// /// For Windows VMs on Dundee or higher: /// - Memory value is not available if the Management agent is not installed; /// - Disk and Network vlaues are not available if I/O drivers are not installed /// </remarks> protected bool CheckVMTools(IXenObject o, out GridItemBase item) { item = null; if (!checkTools) { return(false); } VM vm = o as VM; if (vm != null) { VM.VirtualisationStatus status = vm.virtualisation_status; if (vm.power_state != vm_power_state.Running || status.HasFlag(VM.VirtualisationStatus.IO_DRIVERS_INSTALLED | VM.VirtualisationStatus.MANAGEMENT_INSTALLED) || status.HasFlag(VM.VirtualisationStatus.UNKNOWN)) { return(false); } if (property == PropertyNames.memoryValue && status.HasFlag(VM.VirtualisationStatus.MANAGEMENT_INSTALLED)) { return(false); } if ((property == PropertyNames.diskText || property == PropertyNames.networkText) && status.HasFlag(VM.VirtualisationStatus.IO_DRIVERS_INSTALLED)) { return(false); } string warningMessage; int colSpan; /** * if (property == PropertyNames.memoryValue && !status.HasFlag(VM.VirtualisationStatus.MANAGEMENT_INSTALLED)) * { * if (vm.HasNewVirtualisationStates) * { * warningMessage = Messages.VIRTUALIZATION_STATE_VM_MANAGEMENT_AGENT_NOT_INSTALLED; * colSpan = 1; * } * else * { * warningMessage = vm.GetVirtualisationWarningMessages(); * colSpan = 3; * } * * if (InstallToolsCommand.CanExecute(vm)) * { * item = new GridStringItem(warningMessage, * HorizontalAlignment.Center, * VerticalAlignment.Middle, * false, * false, * QueryPanel.LinkBrush, * Program.DefaultFontUnderline, * QueryPanel.LinkBrush, * Program.DefaultFontUnderline, * colSpan, * (sender, args) => new InstallToolsCommand(Program.MainWindow, vm).Execute(), null); * } * else * { * item = new GridStringItem(warningMessage, * HorizontalAlignment.Center, * VerticalAlignment.Middle, * false, * false, * QueryPanel.TextBrush, * Program.DefaultFont, * colSpan); * } * } **/ if (property == PropertyNames.diskText && vm.HasNewVirtualisationStates && !status.HasFlag(VM.VirtualisationStatus.IO_DRIVERS_INSTALLED)) { warningMessage = Messages.VIRTUALIZATION_STATE_VM_IO_NOT_OPTIMIZED; colSpan = 2; if (InstallToolsCommand.CanExecute(vm)) { item = new GridStringItem(warningMessage, HorizontalAlignment.Center, VerticalAlignment.Middle, false, false, QueryPanel.LinkBrush, Program.DefaultFontUnderline, QueryPanel.LinkBrush, Program.DefaultFontUnderline, colSpan, (sender, args) => new InstallToolsCommand(Program.MainWindow, vm).Execute(), null); } else { item = new GridStringItem(warningMessage, HorizontalAlignment.Center, VerticalAlignment.Middle, false, false, QueryPanel.TextBrush, Program.DefaultFont, colSpan); } } return(true); } Pool pool = o as Pool; if (pool != null && !pool.IsPoolFullyUpgraded) { if (property == PropertyNames.memoryValue) { var master = pool.Connection.Resolve(pool.master); item = new GridStringItem(string.Format(Messages.POOL_VERSIONS_LINK_TEXT, master.ProductVersionText), HorizontalAlignment.Center, VerticalAlignment.Middle, false, false, QueryPanel.LinkBrush, Program.DefaultFontUnderline, QueryPanel.LinkBrush, Program.DefaultFontUnderline, 3, (sender, args) => new RollingUpgradeCommand(Program.MainWindow).Execute(), null); } return(true); } return(false); }
public static bool RowShouldBeExpanded(IXenObject xenObject) { return(xenObject is Pool && xenObject.Connection.Cache.Hosts.Length > 1 && LicenseActivationRequest.CanActivate(xenObject as Pool)); }
public abstract GridItemBase GetGridItem(IXenObject o);
public LicenseDataGridViewRow(IXenObject xenObject) : this(xenObject, new LicenseStatus(xenObject)) { }
public override object GetGroup(IXenObject o) { throw new NotImplementedException(); }
public static void Move(Session session, IXenObject ixmo, string target) { Folder folder = GetOrCreateFolder(ixmo.Connection, target); Move(session, ixmo, folder); }
protected abstract DelayLoadingOptionComboBoxItem CreateDelayLoadingOptionComboBoxItem(IXenObject xenItem);
private static String GetPathFromOtherConfig(IXenObject o) { return(GetFolderString(o) ?? ""); }
public void SetDefaultTarget(IXenObject xenObject) { m_selectedObject = xenObject; }
public override void SetXenObjects(IXenObject orig, IXenObject clone) { _clone = (T)clone; Pool = Helpers.GetPoolOfOne(_clone.Connection); RefreshTab(_clone); }
protected override DelayLoadingOptionComboBoxItem CreateDelayLoadingOptionComboBoxItem(IXenObject xenItem) { var filters = new List <ReasoningFilter> { new ResidentHostIsSameAsSelectionFilter(xenItem, selectedVMs), new CrossPoolMigrateCanMigrateFilter(xenItem, selectedVMs, wizardMode), new WlbEnabledFilter(xenItem, selectedVMs) }; return(new DelayLoadingOptionComboBoxItem(xenItem, filters)); }
/// <summary> /// Builds the context menu for the specified XenObject. /// </summary> /// <param name="xenObject">The xen object for which the context menu items are required.</param> /// <returns>The context menu items.</returns> public ToolStripItem[] Build(IXenObject xenObject) { return(Build(new SelectedItem(xenObject))); }
public void SetXenObjects(IXenObject orig, IXenObject clone) { vm = clone as VM; Repopulate(); }