本文整理汇总了C#中Controller类的典型用法代码示例。如果您正苦于以下问题:C# Controller类的具体用法?C# Controller怎么用?C# Controller使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Controller类属于命名空间,在下文中一共展示了Controller类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: Configure
/// <inheritDocs/>
public void Configure(Control webFormsControl, Controller controller)
{
var formElementController = (IFormElementController<IFormElementModel>)controller;
var sectionControl = (FormSectionHeader)webFormsControl;
var sectionElementModel = (ISectionHeaderModel)formElementController.Model;
sectionElementModel.Text = sectionControl.Title;
}
开发者ID:pattymoore15,项目名称:feather-samples,代码行数:8,代码来源:SectionElementConfigurator.cs
示例2: Start
// Use this for initialization
void Start()
{
leap = new Controller();
for ( int i = 0; i < FingerObjects.Length; i++ ) {
FingerObjects[i].transform.localScale = new Vector3( 10, 10, 10 );
}
}
开发者ID:TMCN,项目名称:TechCafe-Vol-01,代码行数:8,代码来源:LeapBehaviourScript.cs
示例3: Start
void Start()
{
controller = new Controller();
_princessHasShot = false;
coolDownValue = 1.0f;
currCD = 0.0f;
}
开发者ID:Rominet,项目名称:MeshLegion,代码行数:7,代码来源:LeapContoller.cs
示例4: Start
void Start()
{
leap_controller_ = new Controller();
num_active_hands_ = 0;
hands_ = new List<HandData>();
physics_hands_ = new List<HandData>();
}
开发者ID:nomad512,项目名称:unity,代码行数:7,代码来源:HandController.cs
示例5: BasicIPC
public void BasicIPC()
{
using (var sp = new ServiceProvider(true))
using (var p = StartProcess("payloadtest_debug.exe", "0"))
using (var c = new Controller(p.Process, sp)) {
p.WaitForText("$0");
sp.Scheduler.WaitFor(c.InjectPayload());
sp.Scheduler.WaitFor(c.WaitForPayloadReady());
sp.Scheduler.WaitFor(c.SetLogging(true));
sp.Scheduler.WaitFor(c.SetEnabled("*", true));
p.Write(" ");
p.WaitForText("$1");
p.WaitForText("marker hit: 0 'function_with_marker::marker::hit'");
p.Write(" ");
p.WaitForText("$2");
p.WaitForText("marker hit: 0 'function_with_marker::marker::hit'");
sp.Scheduler.WaitFor(c.SetEnabled("*", false));
p.Write(" ");
p.WaitForText("$3");
p.Write(" ");
p.WaitForText("$4");
p.Succeeded();
}
}
开发者ID:kg,项目名称:xptrace,代码行数:29,代码来源:InteractivePayloadTests.cs
示例6: SetUp
public void SetUp()
{
ChangingHeights.Instance.eventDelegate += delegateReference;
controller = ChangingHeights.Instance.Controller;
shadowProjector.orthographicSize = ChangingHeights.Instance.size;
}
开发者ID:MichalObert,项目名称:RehabGame,代码行数:7,代码来源:FollowHand.cs
示例7: Test_View_Events_WiredUp
public void Test_View_Events_WiredUp()
{
MockRepository mocks = new MockRepository();
IView view = mocks.StrictMock<IView>();
// expect that the model is set on the view
// NOTE: if I move this Expect.Call above
// the above Expect.Call, Rhino mocks blows up on with an
// "This method has already been set to ArgsEqualExpectation."
// not sure why. Its a side issue.
Expect.Call(view.Model = Arg<Model>.Is.NotNull);
// expect the event ClickButton to be wired up
IEventRaiser clickButtonEvent =
Expect.Call(delegate
{
view.ClickButton += null;
}).IgnoreArguments().GetEventRaiser();
// Q: How do i set an expectation that checks that the controller
// correctly updates the model in the event handler.
// i.e. above we know that the controller executes
// _model.UserName = "Keith here :)"
// but how can I verify it?
// The following wont work, because Model is null:
// Expect.Call(view.Model.UserName = Arg<String>.Is.Anything);
mocks.ReplayAll();
Controller controller = new Controller(view);
clickButtonEvent.Raise(null, null);
mocks.VerifyAll();
}
开发者ID:nkmajeti,项目名称:rhino-tools,代码行数:35,代码来源:FieldProblem_Keith.cs
示例8: Get
/// <summary>
/// Retrieve the object from dictionary
/// </summary>
/// <param name="controller"></param>
/// <param name="id"></param>
/// <returns></returns>
internal Invoicedto Get(object controller, Int64 id)
{
invoiceController = controller as System.Web.Mvc.Controller;
Dictionary<Int64, Invoicedto> invoiceRepo = invoiceController.TempData["Invoice"] as Dictionary<Int64, Invoicedto>;
invoiceController.TempData.Keep();
return invoiceRepo[id];
}
开发者ID:ferharo1,项目名称:SampleApp-TimeTracking_Invoicing-DotNet,代码行数:13,代码来源:InvoiceRepository.cs
示例9: Main
public static void Main (string[] args)
{
Console.WriteLine ("Hello World!");
Model model = new Model(typeof(Demo));
model.Write<ExtModel,ExtModelField>();
Store store = new Store(typeof(Demo));
store.Write();
List list = new List(typeof(Demo));
list.Write();
Form form = new Form(typeof(Demo));
form.Write();
Controller controller = new Controller(typeof(Demo));
controller.Write();
Application app = new Application(typeof(Demo));
app.Write();
Console.WriteLine ("This is The End my friend!");
}
开发者ID:angelcolmenares,项目名称:Aicl.DotJs,代码行数:25,代码来源:Main.cs
示例10: InvokeAction
public IActionResult InvokeAction(Controller controller, ActionDescriptor actionDescriptor)
{
/*
* Child processes that use such C run-time functions as printf() and fprintf() can behave poorly when redirected.
* The C run-time functions maintain separate IO buffers. When redirected, these buffers might not be flushed immediately after each IO call.
* As a result, the output to the redirection pipe of a printf() call or the input from a getch() call is not flushed immediately and delays, sometimes-infinite delays occur.
* This problem is avoided if the child process flushes the IO buffers after each call to a C run-time IO function.
* Only the child process can flush its C run-time IO buffers. A process can flush its C run-time IO buffers by calling the fflush() function.
*/
var methodWithIntParameter = controller.GetType()
.GetMethods()
.FirstOrDefault(x => x.Name.ToLower() == actionDescriptor.ActionName.ToLower() &&
x.GetParameters().Length == 1 &&
x.GetParameters()[0].ParameterType == typeof(string) &&
x.ReturnType == typeof(IActionResult));
if (methodWithIntParameter == null)
{
throw new HttpNotFoundException(
string.Format(
"Expected method with signature IActionResult {0}(string) in class {1}Controller",
actionDescriptor.ActionName,
actionDescriptor.ControllerName));
}
try
{
var actionResult = (IActionResult)
methodWithIntParameter.Invoke(controller, new object[] { actionDescriptor.Parameter });
return actionResult;
}
catch (TargetInvocationException ex)
{
throw ex.InnerException;
}
}
开发者ID:MichaelaIvanova,项目名称:Telerik-Software-Academy,代码行数:35,代码来源:ActionInvoker.cs
示例11: Settings
/// <summary>
/// Construct a <code>Settings</code> form with no weapon list
/// </summary>
/// <param name="uic">Calling UIController</param>
/// <param name="configReader">A configuration reader</param>
public Settings(Controller.UIController uic, ConfigReader configReader)
: this(uic, configReader, new List<string>())
{
MessageBox.Show("This is the first time you have run SANTA. Please specify the paths for the report template, database, and log file.", "First run", MessageBoxButtons.OK, MessageBoxIcon.Information);
firstRun = true;
}
开发者ID:siegleal,项目名称:iSanta,代码行数:12,代码来源:Settings.cs
示例12: BuildMethodParameters
private static object[] BuildMethodParameters(PluginManifest Manifest, Type Handler, MethodInfo methodInfo, string ActionName, Controller HostController)
{
var methodParams = methodInfo.GetParameters();
var result = new object[methodParams.Length];
for (int i = 0; i < methodParams.Length; i++)
{
var methodParam = methodParams[i];
Type parameterType = methodParam.ParameterType;
IModelBinder modelBinder = ModelBinders.Binders.GetBinder(parameterType);
IValueProvider valueProvider = HostController.ValueProvider;
string parameterName = methodParam.Name;
ModelBindingContext bindingContext = new ModelBindingContext()
{
FallbackToEmptyPrefix = true,
ModelMetadata = ModelMetadataProviders.Current.GetMetadataForType(null, parameterType),
ModelName = parameterName,
ModelState = HostController.ViewData.ModelState,
PropertyFilter = (p) => true,
ValueProvider = valueProvider
};
var parameterValue = modelBinder.BindModel(HostController.ControllerContext, bindingContext);
if (parameterValue == null && methodParam.HasDefaultValue)
parameterValue = methodParam.DefaultValue;
result[i] = parameterValue;
}
return result;
}
开发者ID:garysharp,项目名称:Disco,代码行数:34,代码来源:PluginWebHandlerController.cs
示例13: RenderMailMessage
/// <summary>
/// Renders the mail message.
/// </summary>
/// <param name="templateName">Name of the template.</param>
/// <param name="engineContext">The engine context.</param>
/// <param name="controller">The controller.</param>
/// <param name="doNotApplyLayout">if set to <c>true</c> [do not apply layout].</param>
/// <returns></returns>
public Message RenderMailMessage(string templateName, IRailsEngineContext engineContext, Controller controller,
bool doNotApplyLayout)
{
context.AddMailTemplateRendered(templateName, controller.PropertyBag);
return new Message("from", "to", "subject", "body");
}
开发者ID:nats,项目名称:castle-1.0.3-mono,代码行数:15,代码来源:MockEmailTemplateService.cs
示例14: HomePageServer
public HomePageServer(Controller controller, int serverAccountId)
{
InitializeComponent();
_controller = controller;
ServerAccountId = serverAccountId;
var serverAccount = Model.ServerAccounts.Get(serverAccountId);
panelSecondDeviceNotLinked.Visible = !serverAccount.LinkedDeviceSetup;
SecondDeviceSetup = serverAccount.LinkedDeviceSetup;
if (serverAccount.LinkedDeviceSetup)
{
if (serverAccount.LinkedDeviceCryptoKeyId == 0)
{
panelVerifyDeviceKeys.Visible = true;
DeviceKeysVerified = false;
}
else
{
var linkedDeviceCryptoKey = Model.CryptoKeys.Get(serverAccount.LinkedDeviceCryptoKeyId);
if (!linkedDeviceCryptoKey.Trust)
{
panelVerifyDeviceKeys.Visible = true;
DeviceKeysVerified = false;
}
else
{
panelVerifyDeviceKeys.Visible = false;
DeviceKeysVerified = true;
}
}
}
}
开发者ID:bowmark,项目名称:allauth.desktop,代码行数:35,代码来源:HomePageServer.cs
示例15: MultiClampDevice
/// <summary>
/// Constructs a new MultiClampDevice
/// </summary>
/// <param name="commander">MultiClampCommander instance</param>
/// <param name="c">Symphony Controller instance</param>
/// <param name="background">Dictionary of background Measurements for each MultiClamp operating mode</param>
public MultiClampDevice(IMultiClampCommander commander, Controller c, IDictionary<MultiClampInterop.OperatingMode, IMeasurement> background)
: base("Multiclamp-" + commander.SerialNumber + "-" + commander.Channel, "Molecular Devices", c)
{
InputParameters = new ConcurrentDictionary<DateTimeOffset, MultiClampParametersChangedArgs>();
OutputParameters = new ConcurrentDictionary<DateTimeOffset, MultiClampParametersChangedArgs>();
Commander = commander;
Commander.ParametersChanged += (sender, mdArgs) =>
{
log.DebugFormat("MultiClamp parameters changed. Mode = {0}, External Command Sensistivity Units = {1} Timestamp = {2}",
mdArgs.Data.OperatingMode,
mdArgs.Data.ExternalCommandSensitivityUnits,
mdArgs.TimeStamp);
if (HasBoundInputStream)
InputParameters[mdArgs.TimeStamp.ToUniversalTime()] = mdArgs;
if (HasBoundOutputStream)
{
OutputParameters[mdArgs.TimeStamp.ToUniversalTime()] = mdArgs;
foreach (var outputStream in Streams.Values.OfType<IDAQOutputStream>().Where(s => s.DAQ != null && s.DAQ.Running == false))
{
log.DebugFormat("Setting new background for stream {0}", outputStream.Name);
outputStream.ApplyBackground();
}
}
};
Backgrounds = background;
}
开发者ID:physion,项目名称:symphony-core,代码行数:37,代码来源:MulticlampDevice.cs
示例16: Start
// Use this for initialization
void Start()
{
controller= new Controller();
_leapManager = GameObject.Find ("LeapManager").GetComponent<LeapManager> ();
_leapManager._mainCam = Camera.main;
cursor=GameObject.Find("Cursor");
}
开发者ID:RachSmith,项目名称:Marbles,代码行数:8,代码来源:StartScreen.cs
示例17: Start
// Use this for initialization
void Start () {
_Camera = Camera.main;
if (_PointerSettings.AutoStart) {
_isLeftsAppearing = true;
_isRightsAppearing = true;
} else {
_isLeftsAppearing = false;
_isRightsAppearing = false;
}
gameObject.transform.SetParent (_Camera.transform, false);
_controller = new Controller ();
pointersObj = new GameObject("Pointers");
pointersObj.transform.SetParent (gameObject.transform, false);
leftHandObj = new GameObject ("Left Hand");
leftHandObj.transform.SetParent (pointersObj.transform, false);
rightHandObj = new GameObject ("Right Hand");
rightHandObj.transform.SetParent (pointersObj.transform, false);
// 포인터의 중복설정을 확인한다.
for (int i=0; i<_PointerSettings.PointerUsed.Length-1; i++) {
for (int j=i+1; j<_PointerSettings.PointerUsed.Length;j++) {
if (_PointerSettings.PointerUsed[i] == _PointerSettings.PointerUsed[j]) {
print ("same pointers are detected");
return;
}
}
}
// 사용하기로 설정한 포인터타입에만 포인터를 생성한다.
foreach (PointerType type in _PointerSettings.PointerUsed) {
// 포인터 객체를 만들고 사전에 추가 후 빌드한다.
GameObject pointerObj = new GameObject ("Pointer_" + type);
if (type == PointerType.LeftThumb ||
type == PointerType.LeftIndex ||
type == PointerType.LeftMiddle ||
type == PointerType.LeftRing ||
type == PointerType.LeftPinky) {
pointerObj.transform.SetParent (leftHandObj.transform, false);
} else {
pointerObj.transform.SetParent (rightHandObj.transform, false);
}
_pointerDict.Add (type, pointerObj);
InteractionManager.SetPointerPos (type, Vector3.one*9999.0f);
Pointer pointer = pointerObj.AddComponent<Pointer> ();
pointer.Build (_PointerSettings, type);
}
}
开发者ID:honi90,项目名称:LeapMotionVRInterface,代码行数:61,代码来源:PointerController.cs
示例18: Start
// Use this for initialization
void Start()
{
controller = gameController.GetComponent<Controller>();
animator = this.GetComponent<Animator>();
animator.SetBool("floating", true);
}
开发者ID:CCOM-4997-s14,项目名称:animariopiedras,代码行数:8,代码来源:CitizenBehavior.cs
示例19: TimeController
bool simulationRunning = false; // whether or not the Business Day simulation is running
#endregion Fields
#region Constructors
// CONSTRUCTOR for the class
public TimeController(Controller c, Text lblTime)
{
// initialise the variables
mainController = c;
timeLabel = lblTime;
BeginDay();
}
开发者ID:andrewdavis1995,项目名称:Cinema-Game,代码行数:14,代码来源:TimeController.cs
示例20: OnFrame
public override void OnFrame(Controller controller)
{
// Get the most recent frame and report some basic information
Frame frame = controller.Frame();
if (!frame.Hands.IsEmpty)
{
if ((DateTime.Now - checkedTime) > new TimeSpan(0, 0, 0, 0, 500))
{
// 500ミリ秒ごとに前回位置との差分を求める
// 移動量がしきい値を超えていたらイベントとして認識するする
if (this.checkedFrame != null)
{
Vector diff = frame.Hands[0].Translation(this.checkedFrame);
//SafeWriteLine("X移動量: " + diff.x);
if (diff.x > 150)
{
SafeWriteLine("右フリックしました! :" + diff.x);
}
if (diff.x < -150)
{
SafeWriteLine("左フリックしました! :" + diff.x);
}
}
this.checkedTime = DateTime.Now;
this.checkedFrame = frame;
}
}
}
开发者ID:TMCN,项目名称:TechCafe-Vol-01,代码行数:29,代码来源:Program.cs
注:本文中的Controller类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论