本文整理汇总了C#中Controls类的典型用法代码示例。如果您正苦于以下问题:C# Controls类的具体用法?C# Controls怎么用?C# Controls使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Controls类属于命名空间,在下文中一共展示了Controls类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ResizeControlState
public ResizeControlState(Controls controls, StateManager stateManager, CommandManager commandManager, FlagPosition flagPosition)
{
m_flagPosition = flagPosition;
m_controls = controls;
m_stateManager = stateManager;
m_commandManager = commandManager;
}
示例2: OnMouseButton
public static bool OnMouseButton(Controls.Control hoveredControl, int x, int y, bool down)
{
if (!down)
{
m_LastPressedControl = null;
// Not carrying anything, allow normal actions
if (CurrentPackage == null)
return false;
// We were carrying something, drop it.
onDrop(x, y);
return true;
}
if (hoveredControl == null)
return false;
if (!hoveredControl.DragAndDrop_Draggable())
return false;
// Store the last clicked on control. Don't do anything yet,
// we'll check it in OnMouseMoved, and if it moves further than
// x pixels with the mouse down, we'll start to drag.
m_LastPressedPos = new Vector2i(x, y);
m_LastPressedControl = hoveredControl;
return false;
}
示例3: AddDirectoryControls
/// <summary>
/// Adds extended controls to a packet.
/// </summary>
/// <param name="packet">The packet to which the controls are added.</param>
/// <param name="controls">The controls.</param>
internal void AddDirectoryControls(AdtsLdapPacket packet, params MsLdap.DirectoryControl[] controls)
{
LDAPMessage message = packet.ldapMessagev3;
int existingControlCount = (message.controls != null) ? message.controls.Elements.Length : 0;
Control[] controlArray = new Control[existingControlCount + controls.Length];
// Add original existing controls
for (int i = 0; i < existingControlCount; i++)
{
controlArray[i] = message.controls.Elements[i];
}
// Add newly added controls
for (int i = 0; i < controls.Length; i++)
{
controlArray[existingControlCount + i] = new Control(
new LDAPOID(controls[i].Type),
new Asn1Boolean(controls[i].IsCritical),
new Asn1OctetString(controls[i].GetValue()));
}
Controls allControls = new Controls(controlArray);
message.controls = allControls;
}
示例4: MainWindow
public MainWindow()
: base(Gtk.WindowType.Toplevel)
{
oXbmc = new XBMC_Communicator();
oXbmc.SetIp("10.0.0.5");
oXbmc.SetConnectionTimeout(4000);
oXbmc.SetCredentials("", "");
oXbmc.Status.StartHeartBeat();
Build ();
this.AllowStaticAccess();
//Create objects used
oPlaylist = new Playlist(this);
oControls = new Controls(this);
oMenuItems = new MenuItems(this);
oContextMenu = new ContextMenu(this);
oShareBrowser = new ShareBrowser(this);
oTrayicon = new SysTrayIcon(this);
oStatusUpdate = new StatusUpdate(this);
oMediaInfo = new MediaInfo(this);
oNowPlaying = new NowPlaying(this);
oGuiConfig = new GuiConfig(this);
nbDataContainer.CurrentPage = 0;
}
示例5: Player
public Player(Arman game, PositionInGrid positionInGrid, Texture2D texture, Block[,] gameArray, int oneBlockSize, int timeForMove, List<Entity> movableObjects, GameArea gameArea, Controls controls)
: base(game, positionInGrid, texture, gameArray, oneBlockSize, timeForMove, movableObjects)
{
this.gameArea = gameArea;
this.controls = controls;
spawnPoint = positionInGrid;
}
示例6: TGPageLoadingEventArgs
public TGPageLoadingEventArgs(Controls.TabPage tp, XmlTextReader xmlIn)
{
// Definie initial state
_tp = tp;
_xmlIn = xmlIn;
_cancel = false;
}
示例7: RibbonTabGlyph
public RibbonTabGlyph(BehaviorService behaviorService, RibbonDesigner designer, Controls.Ribbon.Ribbon ribbon)
: base(new RibbonTabGlyphBehavior(designer, ribbon))
{
_behaviorService = behaviorService;
_ribbon = ribbon;
size = new Size(60, 16);
}
示例8: activate
public void activate(GameObject Player)
{
if (isOccupied) {
return;
}
if (erectOnEnter) {
transform.eulerAngles.Set(transform.eulerAngles.x, transform.eulerAngles.y, 0);
}
player = Player.transform.parent.gameObject;
isOccupied = true;
if (VControls != null) VControls.isCarActive = true;
controls = player.transform.FindChild("Camera").gameObject.GetComponent<Controls>();
isActive = true;
player.SetActive(false);
((Camera)gameObject.transform.Find("Camera").gameObject.GetComponent("Camera")).enabled = true;
((AudioListener)gameObject.transform.Find("Camera").gameObject.GetComponent("AudioListener")).enabled = true;
if (!Sleep.Day) {
foreach (GameObject go in Headlights) {
go.SetActive(true);
}
}
if (erectOnEnter && isActive) {
float z = transform.eulerAngles.z;
float x = transform.eulerAngles.x;
transform.Rotate(-x, 0, -z);
}
}
示例9: FillRibbon
public void FillRibbon( XmlDocument xmlDoc, Controls.Ribbon.RibbonControl ribbon )
{
Dictionary<string, Controls.Ribbon.Section> mapTagToSection = new Dictionary<string, Controls.Ribbon.Section>();
Dictionary<string, Controls.Ribbon.Item> mapTagToItem = new Dictionary<string, Controls.Ribbon.Item>();
FillRibbon( xmlDoc, ribbon, out mapTagToSection, out mapTagToItem );
}
示例10: Row_Clicked
private void Row_Clicked(Controls.Row row)
{
var data = new EventData(this);
data.Id = "OPEN_DEVICE_DETAILS";
data.Data01 = row.Device;
SendData?.Invoke(data);
}
示例11: CanDrop
public override bool CanDrop(Controls.DragDropState state)
{
var appointment = state.Appointment as SupportMeetingAppointment;
if (appointment == null)
{
// should be recurring Appointment
appointment = (state.Appointment as Occurrence).Appointment as SupportMeetingAppointment;
}
if (appointment.IsDraggedFromListBox && state.TargetedAppointment != null)
{
var targetedAppointment = state.TargetedAppointment as SupportMeetingAppointment;
var attendee = appointment.Attendees.First();
if (targetedAppointment.Attendees.Contains(attendee))
{
return false;
}
else
{
return true;
}
}
else if (appointment.IsDraggedFromListBox)
{
return false;
}
else
{
return base.CanDrop(state);
}
}
示例12: Awake
void Awake() {
Player.instance = this;
// attacher = GetComponent<Attacher>();
attacker = GetComponent<Attack> ();
// equipper = GetComponent<Equip>();
// focus = GetComponent<Focus>();
grabber = GetComponent<Grab>();
interactor = GetComponent<Interact>();
inventory = GetComponent<Inventory>();
mover = GetComponent<MovementController>();
cam = GetComponentInChildren<Camera>();
looker = GetComponentInChildren<MouseLook>();
/*heat = GetComponent<Heat>();
hunger = GetComponent<Hunger>();
mapViewer = GetComponent<MapViewer>();*/
controls = GetComponent<Controls>();
// coldStart = 80;
// coldExtra = 0.1f;
// coldColor = new Color(0.25f, 0.5f, 1);
// freezeTemp = -20;
whiteOutTime = 0;
breathingSource = gameObject.AddComponent<AudioSource>();
breathingSource.clip = heavyBreathingSound;
breathingSource.enabled = true;
breathingSource.loop = true;
whiteOutTexture = new Texture2D (1, 1, TextureFormat.RGB24, false);
whiteOutTexture.SetPixel (0, 0, Color.white);
}
示例13: DragDropCompleted
public override void DragDropCompleted(Controls.DragDropState state)
{
if (state.DestinationAppointmentsSource != null)
{
base.DragDropCompleted(state);
}
}
示例14: Resize
public static void Resize(FlagPosition flagPosition, TPoint offset , Controls controls)
{
foreach (ControlBase control in controls)
{
Rect controlRect = control.Rect;
if ((flagPosition & FlagPosition.Left) == FlagPosition.Left)
{
controlRect.Left = controlRect.Left + offset.X;
}
else if ((flagPosition & FlagPosition.Right) == FlagPosition.Right)
{
controlRect.Right = controlRect.Right + offset.X;
}
if ((flagPosition & FlagPosition.Top) == FlagPosition.Top)
{
controlRect.Top = controlRect.Top + offset.Y;
}
else if ((flagPosition & FlagPosition.Bottom) == FlagPosition.Bottom)
{
controlRect.Bottom = controlRect.Bottom + offset.Y;
}
control.Rect = controlRect;
}
}
示例15: fileExplorer1_FileDoubleClicked
void fileExplorer1_FileDoubleClicked(object sender, Controls.FileExplorerEventArgs e)
{
Debug.WriteLine("File double clicked.");
Debug.WriteLine("Files:");
string[] files = fileExplorer1.SelectedFiles();
foreach (string ptrFile in files) Debug.WriteLine(ptrFile);
}