Show / Hide Table of Contents

Class MutiMonitorUtil

マルチモニターへの表示に関するユーティリティです。

Inheritance
System.Object
MutiMonitorUtil
Implements
IMutiMonitorUtil
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: MakCraft.Utils
Assembly: MakViewModelBaseCore.dll
Syntax
public class MutiMonitorUtil : IMutiMonitorUtil

Properties

| Improve this Doc View Source

Instance

MutiMonitorUtil のインスタンスを取得します。

Declaration
public static IMutiMonitorUtil Instance { get; }
Property Value
Type Description
IMutiMonitorUtil
| Improve this Doc View Source

Margin

表示可能座標の確認で利用するマージン値を取得・設定します。 値の設定は初回のみ可能です。

Declaration
public double Margin { get; set; }
Property Value
Type Description
System.Double

Methods

| Improve this Doc View Source

GetDisplayPosition(Rect, String)

モニター名とモニター上の相対座標から表示座標を得ます。 モニター名が存在しない場合は、プライマリモニター上の座標を返します。 得られた座標が表示可能域を外れていた場合は、画面中央の座標を返します。

Declaration
public Point GetDisplayPosition(Rect target, string monitorName)
Parameters
Type Name Description
System.Windows.Rect target

モニター上の相対座標と大きさを保持する Rect 構造体

System.String monitorName

表示するモニター名

Returns
Type Description
System.Windows.Point

ウィンドウを表示する座標

| Improve this Doc View Source

GetInRangeMonitorName(Rect)

与えられた Rect 構造体の座標が表示範囲内に収まっているモニター名を返します。

Declaration
public string GetInRangeMonitorName(Rect target)
Parameters
Type Name Description
System.Windows.Rect target

判別する表示座標を格納したRect 構造体

Returns
Type Description
System.String

モニター名(座標がすべてのモニターの表示範囲から外れている場合は null)

| Improve this Doc View Source

GetInRangeMonitorNameExcludingMargin(Rect)

与えられた Rect 構造体の座標が表示範囲内に収まっているモニター名を返します。 このメソッドはマージン値を考慮せずに判定します。

Declaration
public string GetInRangeMonitorNameExcludingMargin(Rect target)
Parameters
Type Name Description
System.Windows.Rect target

判別する表示座標を格納したRect 構造体

Returns
Type Description
System.String

モニター名(座標がすべてのモニターの表示範囲から外れている場合は null)

| Improve this Doc View Source

GetMoniterNameCenterPosition(Rect)

与えられた Rect 構造体の座標の中心が位置するモニター名を返します。

Declaration
public string GetMoniterNameCenterPosition(Rect target)
Parameters
Type Name Description
System.Windows.Rect target

判別する表示座標を格納したRect 構造体

Returns
Type Description
System.String

モニター名(座標の中心がすべてのモニターの表示範囲から外れている場合は null)

| Improve this Doc View Source

GetPrimaryMonitorName()

プライマリモニターとなっているモニターの名前(デバイス名)を返します。

Declaration
public string GetPrimaryMonitorName()
Returns
Type Description
System.String

モニターの名前(デバイス名)

| Improve this Doc View Source

GetRelativePoint(Rect, String)

与えられた Rect 構造体の座標とモニター名から相対座標情報を得ます。

Declaration
public Point GetRelativePoint(Rect target, string monitorName)
Parameters
Type Name Description
System.Windows.Rect target

Window の座標を格納した Rect 構造体

System.String monitorName

相対座標を得るモニターの名前

Returns
Type Description
System.Windows.Point

相対座標を格納した Point 構造体

| Improve this Doc View Source

GetRelativePointInfo(Rect)

与えられた Rect 構造体の座標から相対座標情報を得ます。

Declaration
public RelativePointInfo GetRelativePointInfo(Rect target)
Parameters
Type Name Description
System.Windows.Rect target

Window の座標を格納した Rect 構造体

Returns
Type Description
RelativePointInfo

相対座標情報を格納した RelativePointInfo クラスのインスタンス

| Improve this Doc View Source

GetWorkingArea(String)

モニター名(デバイス名)の一致するモニターの表示エリアを返します。

Declaration
public Rect GetWorkingArea(string monitorName)
Parameters
Type Name Description
System.String monitorName

モニター名(デバイス名)

Returns
Type Description
System.Windows.Rect

表示エリアを示す Rect 構造体

Exceptions
Type Condition
System.ArgumentException

モニター名(デバイス名)が存在しない場合に発生します。

| Improve this Doc View Source

IsInRange(Rect)

与えられた Rect 構造体の座標がマルチモニターの表示範囲内に収まっているかの真偽値を返します。

Declaration
public bool IsInRange(Rect target)
Parameters
Type Name Description
System.Windows.Rect target

判別する表示座標を格納したRect 構造体

Returns
Type Description
System.Boolean

真偽値(真であれば表示範囲内)

| Improve this Doc View Source

Refresh()

スクリーン情報をリフレッシュします。

Declaration
public bool Refresh()
Returns
Type Description
System.Boolean

情報の更新があった場合は true を返します。

Implements

IMutiMonitorUtil
  • Improve this Doc
  • View Source
Back to top Generated by DocFX