diff --git a/.github/workflows/test-builds.yml b/.github/workflows/test-builds.yml index ec489abbbd..7c6603c92a 100644 --- a/.github/workflows/test-builds.yml +++ b/.github/workflows/test-builds.yml @@ -8,11 +8,24 @@ on: jobs: build: - runs-on: windows-latest + strategy: + matrix: + os: [ubuntu-latest, windows-latest] + runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 - name: Setup MSBuild uses: microsoft/setup-msbuild@v2 + if: matrix.os == 'windows-latest' + - name: Setup Mono repository + if: matrix.os == 'ubuntu-latest' + run: > + gpg --homedir /tmp --no-default-keyring --keyring /usr/share/keyrings/mono-official-archive-keyring.gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF + && echo "deb [signed-by=/usr/share/keyrings/mono-official-archive-keyring.gpg] https://download.mono-project.com/repo/ubuntu stable-focal main" | sudo tee /etc/apt/sources.list.d/mono-official-stable.list + && sudo apt-get update + - name: Setup Mono + run: sudo apt-get install -y mono-devel + if: matrix.os == 'ubuntu-latest' - name: Restore Packages run: msbuild XenAdmin.sln -t:restore - name: Build Release solution @@ -22,10 +35,10 @@ jobs: - name: Upload Release Artifacts uses: actions/upload-artifact@v4 with: - name: drop-release - path: XenAdmin/bin/Release/net481 + name: drop-release-${{ matrix.os }} + path: XenAdmin/bin/Release/net48 - name: Upload Debug Artifacts uses: actions/upload-artifact@v4 with: - name: drop-debug - path: XenAdmin/bin/Debug/net481 \ No newline at end of file + name: drop-debug-${{ matrix.os }} + path: XenAdmin/bin/Debug/net48 diff --git a/CommandLib/CommandLib.csproj b/CommandLib/CommandLib.csproj index 1ebb88f14b..42bdac5e30 100644 --- a/CommandLib/CommandLib.csproj +++ b/CommandLib/CommandLib.csproj @@ -1,6 +1,6 @@  - net481 + net48 CommandLib XCP-ng Center library diff --git a/XenAdmin/Commands/ImPortCommand.cs b/XenAdmin/Commands/ImportCommand.cs similarity index 100% rename from XenAdmin/Commands/ImPortCommand.cs rename to XenAdmin/Commands/ImportCommand.cs diff --git a/XenAdmin/ConsoleView/VNCGraphicsClient.cs b/XenAdmin/ConsoleView/VNCGraphicsClient.cs index 01fa9d4543..14a3ee55a7 100644 --- a/XenAdmin/ConsoleView/VNCGraphicsClient.cs +++ b/XenAdmin/ConsoleView/VNCGraphicsClient.cs @@ -438,8 +438,14 @@ internal CustomCursor(Bitmap bitmap, int x, int y) hbmColor = bitmap.GetHbitmap() }; - _handle = CreateIconIndirect(ref iconInfo); - Cursor = new Cursor(_handle); + if (Type.GetType("Mono.Runtime") == null){ + _handle = CreateIconIndirect(ref iconInfo); + Cursor = new Cursor(_handle); + } + else + { + // Doesn't work under Mono + } } ~CustomCursor() @@ -866,7 +872,15 @@ protected override void OnGotFocus(EventArgs e) if (_sendScanCodes) { - InterceptKeys.grabKeys(KeyScan, false); + if (Type.GetType("Mono.Runtime") == null) + { + InterceptKeys.grabKeys(KeyScan, false); + } + else + { + // TODO: The code in `XenAdmin/VNC/KeyMap.cs` + // must be crossplatform to enable this feature + } } if (_updateClipboardOnFocus) @@ -880,7 +894,15 @@ protected override void OnLostFocus(EventArgs e) EnableMenuShortcuts(); - InterceptKeys.releaseKeys(); + if (Type.GetType("Mono.Runtime") == null) + { + InterceptKeys.releaseKeys(); + } + else + { + // TODO: The code in `XenAdmin/VNC/KeyMap.cs` + // must be crossplatform to enable this feature + } _cursorOver = false; @@ -1259,11 +1281,27 @@ public bool SendScanCodes if (!value) { - InterceptKeys.releaseKeys(); + if (Type.GetType("Mono.Runtime") == null) + { + InterceptKeys.releaseKeys(); + } + else + { + // TODO: The code in `XenAdmin/VNC/KeyMap.cs` + // must be crossplatform to enable this feature + } } else if (Focused) { - InterceptKeys.grabKeys(KeyScan, false); + if (Type.GetType("Mono.Runtime") == null) + { + InterceptKeys.grabKeys(KeyScan, false); + } + else + { + // TODO: The code in `XenAdmin/VNC/KeyMap.cs` + // must be crossplatform to enable this feature + } } _sendScanCodes = value; diff --git a/XenAdmin/ConsoleView/XSVNCScreen.cs b/XenAdmin/ConsoleView/XSVNCScreen.cs index aee968e872..09921ff797 100644 --- a/XenAdmin/ConsoleView/XSVNCScreen.cs +++ b/XenAdmin/ConsoleView/XSVNCScreen.cs @@ -1258,7 +1258,14 @@ protected override void OnEnter(EventArgs e) Program.AssertOnEventThread(); base.OnEnter(e); - CaptureKeyboardAndMouse(); + if (Type.GetType("Mono.Runtime") == null) + { + CaptureKeyboardAndMouse(); + } + else + { + // TODO: It is a cause of a call loop under Mono + } RefreshScreen(); } diff --git a/XenAdmin/Controls/CustomDataGraph/DataEventList.designer.cs b/XenAdmin/Controls/CustomDataGraph/DataEventList.Designer.cs similarity index 100% rename from XenAdmin/Controls/CustomDataGraph/DataEventList.designer.cs rename to XenAdmin/Controls/CustomDataGraph/DataEventList.Designer.cs diff --git a/XenAdmin/Controls/CustomDataGraph/DataPlot.designer.cs b/XenAdmin/Controls/CustomDataGraph/DataPlot.Designer.cs similarity index 100% rename from XenAdmin/Controls/CustomDataGraph/DataPlot.designer.cs rename to XenAdmin/Controls/CustomDataGraph/DataPlot.Designer.cs diff --git a/XenAdmin/Controls/CustomDataGraph/DataPlotNav.designer.cs b/XenAdmin/Controls/CustomDataGraph/DataPlotNav.Designer.cs similarity index 100% rename from XenAdmin/Controls/CustomDataGraph/DataPlotNav.designer.cs rename to XenAdmin/Controls/CustomDataGraph/DataPlotNav.Designer.cs diff --git a/XenAdmin/Controls/DataGridViewEx/DataGridViewEx.cs b/XenAdmin/Controls/DataGridViewEx/DataGridViewEx.cs index 7f8017e765..7a66ef671e 100644 --- a/XenAdmin/Controls/DataGridViewEx/DataGridViewEx.cs +++ b/XenAdmin/Controls/DataGridViewEx/DataGridViewEx.cs @@ -77,6 +77,22 @@ private void SetUpDataGridViewExCellStyles() DisabledHiddenStyle = new DataGridViewCellStyle(); DisabledRowStyle = new DataGridViewCellStyle(); + if (Type.GetType("Mono.Runtime") != null) + { + // These fonts are null by default + // Under Mono some functions produce exceptions due to that + // So set them to some value + + var CellFont = new Font(Program.DefaultFont.FontFamily, Program.DefaultFont.Size - 1f); + + EnabledStyle.Font = CellFont; + EnabledHiddenStyle.Font = CellFont; + DisabledStyle.Font = CellFont; + DisabledHiddenStyle.Font = CellFont; + DisabledRowStyle.Font = CellFont; + EnabledUnfocusedStyle.Font = CellFont; + } + EnabledStyle.BackColor = ThemeBackgroundColor; EnabledStyle.ForeColor = SystemColors.ControlText; EnabledStyle.SelectionBackColor = SystemColors.Highlight; diff --git a/XenAdmin/Controls/FlickerFreeListBox.cs b/XenAdmin/Controls/FlickerFreeListBox.cs index 485051fbee..2861384528 100644 --- a/XenAdmin/Controls/FlickerFreeListBox.cs +++ b/XenAdmin/Controls/FlickerFreeListBox.cs @@ -73,7 +73,21 @@ protected override void WndProc(ref Message msg) Win32.ScrollInfo si = new Win32.ScrollInfo(); si.fMask = (int)Win32.ScrollInfoMask.SIF_ALL; si.cbSize = (uint)Marshal.SizeOf(si); - Win32.GetScrollInfo(msg.HWnd, 0, ref si); + + if (Type.GetType("Mono.Runtime") == null) + { + Win32.GetScrollInfo(msg.HWnd, 0, ref si); + } + else + { + // + // TODO: Exception under Mono + // + + // System.DllNotFoundException: user32.dll assembly: type: member:(null) + // at (wrapper managed-to-native) XenCenterLib.Win32.GetScrollInfo(intptr,int,XenCenterLib.Win32/ScrollInfo&) + // at XenAdmin.Controls.FlickerFreeListBox.WndProc (System.Windows.Forms.Message& msg) + } if ((msg.WParam.ToInt32() & 0xFF) == Win32.SB_THUMBTRACK) { diff --git a/XenAdmin/Controls/SnapshotTreeView.designer.cs b/XenAdmin/Controls/SnapshotTreeView.Designer.cs similarity index 100% rename from XenAdmin/Controls/SnapshotTreeView.designer.cs rename to XenAdmin/Controls/SnapshotTreeView.Designer.cs diff --git a/XenAdmin/Controls/SnapshotTreeView.cs b/XenAdmin/Controls/SnapshotTreeView.cs index 52cfe9ef64..a3a72ae29b 100644 --- a/XenAdmin/Controls/SnapshotTreeView.cs +++ b/XenAdmin/Controls/SnapshotTreeView.cs @@ -288,7 +288,19 @@ protected override void OnLayout(LayoutEventArgs levent) { //This is needed to maximize and minimize properly, there is some issue in the ListView Control Win32.POINT pt = new Win32.POINT(); - IntPtr hResult = SendMessage(Handle, LVM_GETORIGIN, IntPtr.Zero, ref pt); + + if (Type.GetType("Mono.Runtime") == null) + { + IntPtr hResult = SendMessage(Handle, LVM_GETORIGIN, IntPtr.Zero, ref pt); + } + else + { + // TODO: There is an exception under Mono + + // System.DllNotFoundException: user32.dll assembly: type: member:(null) + // at (wrapper managed-to-native) XenAdmin.Controls.SnapshotTreeView.SendMessage(intptr,int,intptr,XenCenterLib.Win32/POINT&) + // at XenAdmin.Controls.SnapshotTreeView.OnLayout (System.Windows.Forms.LayoutEventArgs levent) + } origin = pt; root.InvalidateAll(); diff --git a/XenAdmin/Controls/TreeViews/MultiSelectTreeView.cs b/XenAdmin/Controls/TreeViews/MultiSelectTreeView.cs index b81c7a3cc0..3cc026fabb 100644 --- a/XenAdmin/Controls/TreeViews/MultiSelectTreeView.cs +++ b/XenAdmin/Controls/TreeViews/MultiSelectTreeView.cs @@ -1088,11 +1088,21 @@ public int HScrollPos { get { - return ScrollInfo(Win32.ScrollBarConstants.SB_HORZ); + if (System.Type.GetType("Mono.Runtime") == null) + { + return ScrollInfo(Win32.ScrollBarConstants.SB_HORZ); + } + else + { + return 0; + } } set { - Win32.SendMessage(Handle, Win32.WM_HSCROLL, (IntPtr)(((int)Win32.ScrollBarCommands.SB_THUMBPOSITION) | (value << 16)), (IntPtr)0); + if (System.Type.GetType("Mono.Runtime") == null) + { + Win32.SendMessage(Handle, Win32.WM_HSCROLL, (IntPtr)(((int)Win32.ScrollBarCommands.SB_THUMBPOSITION) | (value << 16)), (IntPtr)0); + } } } diff --git a/XenAdmin/Core/Drawing.cs b/XenAdmin/Core/Drawing.cs index 6acf0b860d..15d939f142 100644 --- a/XenAdmin/Core/Drawing.cs +++ b/XenAdmin/Core/Drawing.cs @@ -70,7 +70,7 @@ static Drawing() /// public static void QuickDraw(Graphics gTarget, Bitmap buffer) { - QuickDraw(gTarget, buffer, new Point(0, 0), new Rectangle(0, 0, buffer.Width, buffer.Height)); + gTarget.DrawImage(buffer, new Rectangle(0, 0, buffer.Width, buffer.Height)); } /// diff --git a/XenAdmin/Dialogs/AddServerDialog.cs b/XenAdmin/Dialogs/AddServerDialog.cs index d1bf28e6a6..285f8899c5 100644 --- a/XenAdmin/Dialogs/AddServerDialog.cs +++ b/XenAdmin/Dialogs/AddServerDialog.cs @@ -89,7 +89,21 @@ private void AddServerDialog_Shown(object sender, EventArgs e) if (!ServerNameComboBox.Enabled && connection != null && !string.IsNullOrEmpty(connection.Username)) { - Win32.SetFocus(PasswordTextBox.Handle); + if (Type.GetType("Mono.Runtime") == null) + { + Win32.SetFocus(PasswordTextBox.Handle); + } + else + { + // + // TODO: The app crashes under Mono if password is wrong + // + + // System.DllNotFoundException: user32.dll assembly: type: member:(null) + // at (wrapper managed-to-native) XenCenterLib.Win32.SetFocus(intptr) + + // So just skip setting focus + } } } diff --git a/XenAdmin/Dialogs/AddServerDialog.resx b/XenAdmin/Dialogs/AddServerDialog.resx index 4607dd0cc6..06f31fca02 100644 --- a/XenAdmin/Dialogs/AddServerDialog.resx +++ b/XenAdmin/Dialogs/AddServerDialog.resx @@ -358,7 +358,7 @@ 3 - True + False GrowAndShrink diff --git a/XenAdmin/Dialogs/ConnectingToServerDialog.designer.cs b/XenAdmin/Dialogs/ConnectingToServerDialog.Designer.cs similarity index 100% rename from XenAdmin/Dialogs/ConnectingToServerDialog.designer.cs rename to XenAdmin/Dialogs/ConnectingToServerDialog.Designer.cs diff --git a/XenAdmin/Dialogs/WarningDialogs/LVMoHBAWarningDialog.designer.cs b/XenAdmin/Dialogs/WarningDialogs/LVMoHBAWarningDialog.Designer.cs similarity index 100% rename from XenAdmin/Dialogs/WarningDialogs/LVMoHBAWarningDialog.designer.cs rename to XenAdmin/Dialogs/WarningDialogs/LVMoHBAWarningDialog.Designer.cs diff --git a/XenAdmin/Dialogs/Wlb/WlbReportSubscriptionDialog.designer.cs b/XenAdmin/Dialogs/Wlb/WlbReportSubscriptionDialog.Designer.cs similarity index 100% rename from XenAdmin/Dialogs/Wlb/WlbReportSubscriptionDialog.designer.cs rename to XenAdmin/Dialogs/Wlb/WlbReportSubscriptionDialog.Designer.cs diff --git a/XenAdmin/MainWindow.cs b/XenAdmin/MainWindow.cs index 2e0392093f..85ef7388ab 100644 --- a/XenAdmin/MainWindow.cs +++ b/XenAdmin/MainWindow.cs @@ -153,7 +153,9 @@ public MainWindow(string[] args) Icon = Properties.Resources.AppIcon; //CA-270999: Add registration to RestartManager - RegisterApplicationRestart(null, 0); + if (Type.GetType("Mono.Runtime") == null) { + RegisterApplicationRestart(null, 0); + } #region Add Tab pages @@ -187,7 +189,13 @@ public MainWindow(string[] args) AddTabContents(CvmConsolePanel, TabPageCvmConsole); AddTabContents(NetworkPage, TabPageNetwork); AddTabContents(HAPage, TabPageHA); - AddTabContents(HomePage, TabPageHome); + if (Type.GetType("Mono.Runtime") == null) { + AddTabContents(HomePage, TabPageHome); + } + else + { + // TODO: Cause of connection lost + } AddTabContents(WlbPage, TabPageWLB); AddTabContents(PhysicalStoragePage, TabPagePhysicalStorage); AddTabContents(AdPage, TabPageAD); @@ -385,7 +393,13 @@ protected override void OnShown(EventArgs e) protected override void OnHandleCreated(EventArgs e) { base.OnHandleCreated(e); - Clip.RegisterClipboardViewer(); + if (Type.GetType("Mono.Runtime") == null) { + Clip.RegisterClipboardViewer(); + } + else + { + // TODO: Clipboard doesn't work under Mono + } } protected override void WndProc(ref System.Windows.Forms.Message e) diff --git a/XenAdmin/Program.cs b/XenAdmin/Program.cs index 2d703cc295..3d63a547c7 100644 --- a/XenAdmin/Program.cs +++ b/XenAdmin/Program.cs @@ -153,10 +153,16 @@ public static void Main(string[] args) Environment.UserName, Assembly.GetExecutingAssembly().Location.Replace('\\', '-')); - if (NamedPipes.Pipe.ExistsPipe(_pipePath)) - { - NamedPipes.Pipe.SendMessageToPipe(_pipePath, string.Join(" ", args)); - return; + try { + if (NamedPipes.Pipe.ExistsPipe(_pipePath)) + { + NamedPipes.Pipe.SendMessageToPipe(_pipePath, string.Join(" ", args)); + return; + } + } + catch (System.IO.IOException) { + // For example, Mono throws the exception on calling ExistsPipe + // Since if the pipe doesn't exist the code does nothing too. } log.Info("Application started"); @@ -200,7 +206,10 @@ public static void Main(string[] args) /// private static void ConnectPipe() { - _pipe = new NamedPipes.Pipe(_pipePath); + if (System.Type.GetType("Mono.Runtime") == null) + { + _pipe = new NamedPipes.Pipe(_pipePath); + } if (_pipe != null) { @@ -251,8 +260,11 @@ private static void LogApplicationStats() log.InfoFormat("Time since process started: {0}", (DateTime.Now - Process.GetCurrentProcess().StartTime).ToString()); log.InfoFormat("Handles open: {0}", p.HandleCount.ToString()); - log.InfoFormat("USER handles open: {0}", Win32.GetGuiResourcesUserCount(p.Handle)); - log.InfoFormat("GDI handles open: {0}", Win32.GetGuiResourcesGDICount(p.Handle)); + if (System.Type.GetType("Mono.Runtime") == null) + { + log.InfoFormat("USER handles open: {0}", Win32.GetGuiResourcesUserCount(p.Handle)); + log.InfoFormat("GDI handles open: {0}", Win32.GetGuiResourcesGDICount(p.Handle)); + } log.InfoFormat("Thread count: {0}", p.Threads.Count); log.InfoFormat("Virtual memory size: {0} B({1})", p.VirtualMemorySize64, Util.MemorySizeStringSuitableUnits(p.VirtualMemorySize64, false)); diff --git a/XenAdmin/Properties/Resources.resx b/XenAdmin/Properties/Resources.resx index 35b07da373..d5949bbdf5 100755 --- a/XenAdmin/Properties/Resources.resx +++ b/XenAdmin/Properties/Resources.resx @@ -1118,13 +1118,13 @@ ..\Images\000_VMPausedDisabled_h32bit_16_green.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - ..\images\000_userandgroup_h32bit_16.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + ..\Images\000_UserAndGroup_h32bit_16.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - ..\images\000_user_h32bit_32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + ..\Images\000_User_h32bit_32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - ..\images\queued.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + ..\Images\queued.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a ..\Images\gooroom_16x.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a @@ -1163,6 +1163,6 @@ ..\Images\rpm_package.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - ..\Resources\splash.bmp;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + ..\Resources\splash.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a \ No newline at end of file diff --git a/XenAdmin/Resources/splash.png b/XenAdmin/Resources/splash.png index 3e9d6ed41b..a8212596c0 100644 Binary files a/XenAdmin/Resources/splash.png and b/XenAdmin/Resources/splash.png differ diff --git a/XenAdmin/SettingsPanels/CustomFieldsDisplayPage.designer.cs b/XenAdmin/SettingsPanels/CustomFieldsDisplayPage.Designer.cs similarity index 100% rename from XenAdmin/SettingsPanels/CustomFieldsDisplayPage.designer.cs rename to XenAdmin/SettingsPanels/CustomFieldsDisplayPage.Designer.cs diff --git a/XenAdmin/TabPages/SnapshotsPage.designer.cs b/XenAdmin/TabPages/SnapshotsPage.Designer.cs similarity index 100% rename from XenAdmin/TabPages/SnapshotsPage.designer.cs rename to XenAdmin/TabPages/SnapshotsPage.Designer.cs diff --git a/XenAdmin/TabPages/SnapshotsPage.cs b/XenAdmin/TabPages/SnapshotsPage.cs index bbbcfd28e1..ff1edd5263 100644 --- a/XenAdmin/TabPages/SnapshotsPage.cs +++ b/XenAdmin/TabPages/SnapshotsPage.cs @@ -1478,15 +1478,29 @@ private void snapshotTreeView_DragDrop(object sender, DragEventArgs e) private void snapshotTreeView_MouseMove(object sender, MouseEventArgs e) { - - SnapshotIcon icon = snapshotTreeView.HitTest(e.X, e.Y).Item as SnapshotIcon; - if (icon != null && icon.ImageIndex == SnapshotIcon.VMImageIndex) + if (Type.GetType("Mono.Runtime") == null) { - this.Cursor = Cursors.Hand; + SnapshotIcon icon = snapshotTreeView.HitTest(e.X, e.Y).Item as SnapshotIcon; + if (icon != null && icon.ImageIndex == SnapshotIcon.VMImageIndex) + { + this.Cursor = Cursors.Hand; + } + else + { + this.Cursor = Cursors.Default; + } } else { - this.Cursor = Cursors.Default; + // + // TODO: Under Mono there is an exception + // + + // System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values. + // Parameter name: index + // at System.Windows.Forms.ListView+ListViewItemCollection.get_Item (System.Int32 index) + // at System.Windows.Forms.ListView+ItemControl.ItemsMouseMove (System.Object sender, System.Windows.Forms.MouseEventArgs me) + // at System.Windows.Forms.Control.OnMouseMove (System.Windows.Forms.MouseEventArgs e) } } diff --git a/XenAdmin/VNC/VNCStream.cs b/XenAdmin/VNC/VNCStream.cs index 34aebcba34..721fe789b6 100644 --- a/XenAdmin/VNC/VNCStream.cs +++ b/XenAdmin/VNC/VNCStream.cs @@ -158,17 +158,28 @@ public class VNCStream Mode = CipherMode.ECB }; + private System.Diagnostics.Stopwatch stopwatch; + public VNCStream(IVNCGraphicsClient client, Stream stream, bool startPaused) { this.client = client; this.stream = new MyStream(stream); paused = startPaused; - if (!Win32.QueryPerformanceFrequency(out var freq)) + if (Type.GetType("Mono.Runtime") == null) { + if (!Win32.QueryPerformanceFrequency(out var freq)) + { + System.Diagnostics.Trace.Assert(false); + } + + imageUpdateThreshold = freq / 3; + } + else { - System.Diagnostics.Trace.Assert(false); + this.stopwatch = new System.Diagnostics.Stopwatch(); + this.stopwatch.Start(); + imageUpdateThreshold = System.Diagnostics.Stopwatch.Frequency / 3; } - imageUpdateThreshold = freq / 3; } public void Connect(char[] password) @@ -1241,7 +1252,13 @@ private void ReadFrameBufferUpdate() Log.Debug("reading " + n + " rectangles"); bool fb_updated = false; - Win32.QueryPerformanceCounter(out var start); + long start; + if (Type.GetType("Mono.Runtime") == null) { + Win32.QueryPerformanceCounter(out start); + } + else { + start = System.Diagnostics.Stopwatch.GetTimestamp(); + } for (int i = 0; i < n; ++i) { int x = stream.readCard16(); @@ -1286,7 +1303,16 @@ private void ReadFrameBufferUpdate() throw new VNCException("unimplemented encoding: " + encoding); } - Win32.QueryPerformanceCounter(out var end); + long end; + if (Type.GetType("Mono.Runtime") == null) + { + Win32.QueryPerformanceCounter(out end); + } + else + { + end = System.Diagnostics.Stopwatch.GetTimestamp(); + } + if (end - start > imageUpdateThreshold) { client.ClientFrameBufferUpdate(); diff --git a/XenAdmin/Wizards/HAWizard_Pages/AssignPriorities.designer.cs b/XenAdmin/Wizards/HAWizard_Pages/AssignPriorities.Designer.cs similarity index 100% rename from XenAdmin/Wizards/HAWizard_Pages/AssignPriorities.designer.cs rename to XenAdmin/Wizards/HAWizard_Pages/AssignPriorities.Designer.cs diff --git a/XenAdmin/Wizards/NewSRWizard_Pages/Frontends/LVMoHBA.designer.cs b/XenAdmin/Wizards/NewSRWizard_Pages/Frontends/LVMoHBA.Designer.cs similarity index 100% rename from XenAdmin/Wizards/NewSRWizard_Pages/Frontends/LVMoHBA.designer.cs rename to XenAdmin/Wizards/NewSRWizard_Pages/Frontends/LVMoHBA.Designer.cs diff --git a/XenAdmin/Wizards/NewVMWizard/Page_HomeServer.cs b/XenAdmin/Wizards/NewVMWizard/Page_HomeServer.cs index 586b728fdb..e5fb7fabbc 100644 --- a/XenAdmin/Wizards/NewVMWizard/Page_HomeServer.cs +++ b/XenAdmin/Wizards/NewVMWizard/Page_HomeServer.cs @@ -101,7 +101,14 @@ protected override void PageLoadedCore(PageLoadedDirection direction) public override void SelectDefaultControl() { - affinityPicker1.Select(); + if (System.Type.GetType("Mono.Runtime") == null) + { + affinityPicker1.Select(); + } + else + { + // TODO: Call loop under Mono + } } #endregion diff --git a/XenAdmin/Wizards/XenWizardBase.designer.cs b/XenAdmin/Wizards/XenWizardBase.Designer.cs similarity index 100% rename from XenAdmin/Wizards/XenWizardBase.designer.cs rename to XenAdmin/Wizards/XenWizardBase.Designer.cs diff --git a/XenAdmin/XenAdmin.csproj b/XenAdmin/XenAdmin.csproj index b30eb87ce0..fe04e3ca4d 100755 --- a/XenAdmin/XenAdmin.csproj +++ b/XenAdmin/XenAdmin.csproj @@ -1,6 +1,6 @@  - net481 + net48 true true WinExe @@ -23,6 +23,7 @@ + diff --git a/XenCenterLib/XenCenterLib.csproj b/XenCenterLib/XenCenterLib.csproj index 13f16c21b5..d9d0ff0b72 100644 --- a/XenCenterLib/XenCenterLib.csproj +++ b/XenCenterLib/XenCenterLib.csproj @@ -1,6 +1,6 @@  - net481 + net48 XenCenterLib XCP-ng Center library diff --git a/XenModel/XenModel.csproj b/XenModel/XenModel.csproj index b28f3965a6..eaff4ad3ab 100755 --- a/XenModel/XenModel.csproj +++ b/XenModel/XenModel.csproj @@ -1,6 +1,6 @@  - net481 + net48 XenModel XCP-ng Center library XenAdmin diff --git a/XenOvfApi/XenOvfApi.csproj b/XenOvfApi/XenOvfApi.csproj index 1c605eb2e5..6a0627b693 100644 --- a/XenOvfApi/XenOvfApi.csproj +++ b/XenOvfApi/XenOvfApi.csproj @@ -1,6 +1,6 @@  - net481 + net48 XenCenterOVF XCP-ng Center library XenOvf