本文整理汇总了C#中ViewMode类的典型用法代码示例。如果您正苦于以下问题:C# ViewMode类的具体用法?C# ViewMode怎么用?C# ViewMode使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ViewMode类属于命名空间,在下文中一共展示了ViewMode类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RoomDlg
public RoomDlg(Room room, AdvData data, ViewMode mode, MainForm parent, Form mdiParent)
{
InitializeComponent();
mRoom = room;
mData = data;
mMode = mode;
updateRoom();
this.ClientSize = new Size(data.WindowXRes, data.Settings.Resolution.y);
this.Paint += new PaintEventHandler(RoomDlg_Paint);
this.MouseDown += new MouseEventHandler(RoomDlg_MouseDown);
this.MouseMove += new MouseEventHandler(RoomDlg_MouseMove);
this.MouseUp += new MouseEventHandler(RoomDlg_MouseUp);
this.DoubleClick += new EventHandler(RoomDlg_DoubleClick);
this.KeyPress += new KeyPressEventHandler(RoomDlg_KeyPress);
this.FormClosed += new FormClosedEventHandler(RoomDlg_FormClosed);
this.DragOver += new DragEventHandler(RoomDlg_DragOver);
this.DragDrop += new DragEventHandler(RoomDlg_DragDrop);
mControl = new RoomCtrlDlg(room, data, parent);
mControl.MdiParent = mdiParent;
mControl.Location = new Point(Screen.GetWorkingArea(this).Width-mControl.Width, 0);
mControl.StartPosition = FormStartPosition.Manual;
mControl.Show();
mControl.RedrawRoom += new RoomCtrlDlg.RedrawEventHandler(mControl_RedrawRoom);
mTimer = new Timer();
mTimer.Tick += new EventHandler(mTimer_Tick);
mTimer.Interval = 50;
mTimer.Start();
mOwner = parent;
}
示例2: TextViewForm
public TextViewForm(string text, ViewMode mode)
{
InitializeComponent();
_text = text;
_mode = mode;
}
示例3: UserFormViewModel
public UserFormViewModel(string[] allRoles, string[] userRoles, MembershipUser user, ViewMode mode)
{
AllRoles = allRoles;
UserRoles = userRoles;
User = user;
Mode = mode;
}
示例4: Viewer
public Viewer(Workspace workspace)
{
if (workspace == null) throw new ArgumentNullException("workspace");
this.workspace = workspace;
graphicsDevice = workspace.GraphicsDevice;
CameraView = new ChaseView
{
Distance = 3.5f,
Angle = new Vector2(-MathHelper.PiOver4 * 0.5f, MathHelper.PiOver4)
};
CurrentView = CameraView;
viewMode = ViewMode.Camera;
Projection = new PerspectiveFov
{
NearPlaneDistance = 0.01f,
FarPlaneDistance = 10
};
DirectionalLightModel0 = new DirectionalLightModel
{
Enabled = true,
DiffuseColor = Vector3.One
};
DirectionalLightModel1 = new DirectionalLightModel { Enabled = false };
DirectionalLightModel2 = new DirectionalLightModel { Enabled = false };
AmbientLightColor = new Vector3(0.05333332f, 0.09882354f, 0.1819608f);
CameraMoveScale = 0.05f;
}
示例5: EditPerson
public void EditPerson(Person person)
{
_mode = ViewMode.Edit;
_view.Title = "Edit Person";
_person = person;
DisplayPerson();
}
示例6: ShowPerson
public void ShowPerson(Person person)
{
_mode = ViewMode.View;
_view.Title = "View Person";
_person = person;
DisplayPerson();
}
示例7: DetermineFocus
public void DetermineFocus() {
if (Input.GetKey(KeyCode.F)) {
//Selection.GetCurrentSelectionTransform();
if (focus) {
viewMode = ViewMode.Locked;
}
}
}
示例8: ListSet
public ListSet()
{
InitializeComponent();
currentViewMode = ViewMode.Cat;
updateButtons();
}
示例9: ReloadFromDisk
/// <summary>Discard all changes and reload the the current hosts file.</summary>
/// <param name="currentView">The current view.</param>
public void ReloadFromDisk(ViewMode currentView)
{
if (this.Reload == null)
{
return;
}
ViewModeEventArgs e = new ViewModeEventArgs(currentView, null);
this.Reload(this, e);
}
示例10: CopyToClipboard
/// <summary>
/// Copy the current application state to the user's clipboard.
/// </summary>
/// <param name="currentView">The current <see cref="ViewMode"/>.</param>
public void CopyToClipboard(ViewMode currentView)
{
if (this.Copy == null)
{
return;
}
ViewModeEventArgs e = new ViewModeEventArgs(currentView, null);
this.Copy(this, e);
}
示例11: Window_Loaded
private void Window_Loaded(object sender, RoutedEventArgs e)
{
// Подписываемся на глобальные события
Global.CurrentArticleOpened += CurrentArticleOpenedHandler;
Global.AfterCurrentWorkspaceSet += CurrentWorkspaceSetHandler;
Global.UILanguageChanged += UILanguageChangedHandler;
// При первом показе окна переходим в вид незагруженной рабочей области
CurrentViewMode = ViewMode.WorkspaceIsNotLoaded;
}
示例12: has_valid_form_values
private bool has_valid_form_values(FormCollection formCollection, ViewMode mode)
{
if (mode == ViewMode.Create)
{
if(!Extensions.StringHasValue(formCollection["Role"]))
{
ModelState.AddModelError("_FORM", "Role is a required field");
}
else if (Roles.RoleExists(formCollection["Role"]))
{
ModelState.AddModelError("_FORM", "The role already exists");
}
}
return ModelState.IsValid;
}
示例13: WithMode
private void WithMode(ViewMode mode)
{
this.ImagesListView1.Visibility = this.ImagesListView2.Visibility = Visibility.Collapsed;
switch (mode)
{
case ViewMode.Mode1:
this.ImagesListView1.Visibility = Visibility.Visible;
break;
case ViewMode.Mode2:
this.ImagesListView2.Visibility = Visibility.Visible;
break;
default:
throw new ArgumentOutOfRangeException(nameof(mode), mode, null);
}
}
示例14: View
/// <summary>
/// Initializes a new instance of the <c>View</c> class.
/// </summary>
public View(string name)
: base(name, DxfObjectCode.View, true)
{
if (string.IsNullOrEmpty(name))
throw new ArgumentNullException("name", "The view name should be at least one character long.");
this.reserved = false;
this.target = Vector3.Zero;
this.camera = Vector3.UnitZ;
this.height = 1.0;
this.width = 1.0;
this.rotation = 0.0;
this.viewmode = ViewMode.Off;
this.fov = 40.0;
this.frontClippingPlane = 0.0;
this.backClippingPlane = 0.0;
}
示例15: CalculateTranslation
private void CalculateTranslation() {
if (viewMode == ViewMode.Locked) {
if (focus == null) {
viewMode = ViewMode.Free;
}
else {
transform.position = focus.transform.position;
}
}
float xChange = 0;
float yChange = 0;
float zChange = 0;
if (Input.GetKey(KeyCode.W)) {
zChange = zSpeed;
}
else if (Input.GetKey(KeyCode.S)) {
zChange = -zSpeed;
}
if (Input.GetKey(KeyCode.D)) {
xChange = xSpeed;
}
else if (Input.GetKey(KeyCode.A)) {
xChange = -xSpeed;
}
if (Input.GetKey(KeyCode.E)) {
yChange = ySpeed;
}
else if (Input.GetKey(KeyCode.Q)) {
yChange = -ySpeed;
}
if (zChange != 0 || xChange != 0 || yChange != 0) {
viewMode = ViewMode.Free;
}
transform.Translate(new Vector3(xChange, yChange, zChange) * Time.deltaTime);
}