ApprovalUtilities.Utilities.OsUtils.IsWindowsOs C# (CSharp) Method

IsWindowsOs() public static method

public static IsWindowsOs ( ) : bool
return bool
        public static bool IsWindowsOs()
        {
            return Path.DirectorySeparatorChar == '\\';
        }

Usage Example

コード例 #1
0
        public static void CopyToClipboard(string text)
        {
            Exception caught = null;
            var       t      = new Thread(() =>
            {
                try
                {
                    if (OsUtils.IsWindowsOs())
                    {
                        // #warning Look into using Gtk.Clipboard?
                        Clipboard.SetData(DataFormats.Text, text);
                    }
                }
                catch (Exception e)
                {
                    caught = e;
                }
            });

            t.SetApartmentState(ApartmentState.STA);
            t.Start();
            t.Join();

            if (caught != null)
            {
                throw new Exception("Creating window failed.", caught);
            }
        }