本文整理汇总了C#中Property.Get方法的典型用法代码示例。如果您正苦于以下问题:C# Property.Get方法的具体用法?C# Property.Get怎么用?C# Property.Get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Property
的用法示例。
在下文中一共展示了Property.Get方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: StudioUI
public StudioUI(Studio studio, Sequence sequence, Gui gui, Layer gridLayer, Layer uiLayer)
{
_gui = gui;
// create layers
var studioLayer = Add(new Layer());
var annotationLayer = studioLayer.Add(new Layer());
// fullscreen switch
Add(new KeyBinding(Keys.F1, () => Render.Viewport.IsFullScreen = !Render.Viewport.IsFullScreen));
// tool bars setup
var panel = uiLayer.Add(new StackPanel(5) { Padding = new Margin() });
var horizontalBar = panel.Add(new StackPanel(5) { Padding = new Margin(), Orientation = Orientation.Horizontal });
//var verticalBar = panel.Add(new StackPanel(5));
//uiLayer.Add(new BackgroundView(verticalBar));
// time controls
var timePanel = horizontalBar.Add(new StackPanel(5) { Orientation = Orientation.Horizontal });
uiLayer.Add(new BackgroundView(timePanel));
// camera
var cameraMode = Add(new ToolUI());
cameraMode.Add(new EditorCameraController());
// editor mode / game mode switch
var toolMode = new ToggleComponent(v =>
{
UI.ToolMode.Set(v);
Hgl.Time.IsPaused = v;
gui.Scene.IsFocusable = v;
uiLayer.IsEnabled = v;
});
var pauseButton = timePanel.Add(new ToggleButton(toolMode) { Size = _buttonSize });
uiLayer.Add(new ToggleButonView(pauseButton, DataPack.Textures.Studio.Pause, DataPack.Textures.Studio.Play));
//Add(new PropertyRecorder<bool>("toolMode", toolMode));
Add(new KeyBinding(Keys.Tab, toolMode.Toggle));
Add(new KeyBinding(Keys.Q, Hgl.Time.TogglePause));
// next frame
var nextFrameButton = timePanel.Add(new Button(() => NextFrame(pauseButton)) { Size = _buttonSize });
uiLayer.Add(new PressButtonView(nextFrameButton, DataPack.Textures.Studio.NextFrame));
Add(new KeyBinding(Keys.E, nextFrameButton));
// slow motion
var slowMo = Add(new SlowMotion(pauseButton));
var slowMoButton = timePanel.Add(new Button(slowMo.Start, slowMo.Stop) { Size = _buttonSize });
uiLayer.Add(new PressButtonView(slowMoButton, DataPack.Textures.Studio.SlowMotion));
Add(new KeyBinding(Keys.R, slowMoButton));
// sequence
var seqPanel = horizontalBar.Add(new StackPanel(5) { Orientation = Orientation.Horizontal });
uiLayer.Add(new BackgroundView(seqPanel));
var previousButton = seqPanel.Add(new Button(sequence.Previous) { Size = _buttonSize });
uiLayer.Add(new PressButtonView(previousButton, DataPack.Textures.Studio.Previous));
Add(new KeyBinding(Keys.OemMinus, previousButton));
var nextButton = seqPanel.Add(new Button(sequence.Next) { Size = _buttonSize });
uiLayer.Add(new PressButtonView(nextButton, DataPack.Textures.Studio.Next));
Add(new KeyBinding(Keys.OemPlus, nextButton));
var reloadButton = seqPanel.Add(new Button(() => ReloadCurrentScene(sequence)) { Size = _buttonSize });
uiLayer.Add(new PressButtonView(reloadButton, DataPack.Textures.Studio.Reload));
Add(new KeyBinding(Keys.Back, reloadButton));
// tool bar
var toolBar = horizontalBar.Add(new StackPanel(5) { Orientation = Orientation.Horizontal });
uiLayer.Add(new BackgroundView(toolBar));
// camera home position
var homePosition = new Property<Vector2>();
uiLayer.Add(new PropertyRecorder<Vector2>("homePosition", homePosition));
uiLayer.Add(new KeyBinding(Keys.End, () => homePosition.Set(Render.Camera.Position)));
uiLayer.Add(new KeyBinding(Keys.Home, () => Render.Camera.Position = homePosition.Get()));
// grid
var grid = new Node
{
new Grid(Color.White, size: .1f, minZoomLevel: .02f, fullZoomLevel: 9f),
new Grid(Color.White, size: 1, minZoomLevel: .008f, fullZoomLevel: .8f),
new Grid(Color.White, size: 10, minZoomLevel: .005f, fullZoomLevel: .1f),
new Grid(Color.White, size: 100, minZoomLevel: .001f, fullZoomLevel: .01f),
new Grid(Color.White, size: 1000, minZoomLevel: .0001f, fullZoomLevel: .001f),
};
var gridSwitch = new ToggleComponent(() => gridLayer.Add(grid), () => gridLayer.Remove(grid));
var gridControl = toolBar.Add(new ToggleButton(gridSwitch) { Size = _buttonSize });
Add(gridControl);
//.........这里部分代码省略.........