本文整理汇总了C#中UIViewController.GetType方法的典型用法代码示例。如果您正苦于以下问题:C# UIViewController.GetType方法的具体用法?C# UIViewController.GetType怎么用?C# UIViewController.GetType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UIViewController
的用法示例。
在下文中一共展示了UIViewController.GetType方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CollapseSecondViewController
public bool CollapseSecondViewController(UISplitViewController splitViewController, UIViewController secondaryViewController, UIViewController primaryViewController)
{
if (secondaryViewController.GetType () == typeof(UINavigationController) &&
((UINavigationController)secondaryViewController).TopViewController.GetType () == typeof(DetailViewController) &&
((DetailViewController)((UINavigationController)secondaryViewController).TopViewController).DetailItem == null) {
// Return YES to indicate that we have handled the collapse by doing nothing; the secondary controller will be discarded.
return true;
}
return false;
}
示例2: GetAnimationControllerForOperation
public override IUIViewControllerAnimatedTransitioning GetAnimationControllerForOperation (UINavigationController navigationController, UINavigationControllerOperation operation, UIViewController fromViewController, UIViewController toViewController)
{
if (!fromViewController.GetType ().IsSubclassOf (typeof(UICollectionViewController)))
return null;
if (!toViewController.GetType ().IsSubclassOf (typeof (UICollectionViewController)))
return null;
if (!transitionController.HasActiveInteraction)
return null;
transitionController.NavigationOperation = operation;
return transitionController;
}
示例3: SeparateSecondaryViewController
public override UIViewController SeparateSecondaryViewController (UISplitViewController splitViewController,
UIViewController primaryViewController)
{
if (primaryViewController.GetType () == typeof(CustomNavigationController)) {
foreach (var controller in ((CustomNavigationController)primaryViewController).ViewControllers) {
var type = controller.GetType ();
MethodInfo method = type.GetMethod ("ContainedPhoto");
if (method.Invoke (controller, new object[] { null }) != null) {
return null;
}
}
}
return new EmptyViewController ();
}
示例4: CommandsController
public CommandsController (Demo demo, UIViewController vc)
{
this.vc = vc;
var type = vc.GetType ();
Title = demo.Name;
var q = from m in type.GetMethods (BindingFlags.Instance | BindingFlags.Public)
where m.DeclaringType == type &&
m.GetParameters ().Length == 0
orderby m.Name
select new Command { Method = m };
commands = q.ToList ();
TableView.Delegate = new CommandsDelegate (this);
TableView.DataSource = new CommandsDataSource (this);
}
示例5: CollapseSecondViewController
public override bool CollapseSecondViewController (UISplitViewController splitViewController,
UIViewController secondaryViewController, UIViewController primaryViewController)
{
Photo photo = ((CustomViewController)secondaryViewController).ContainedPhoto (null);
if (photo == null) {
return true;
}
if (primaryViewController.GetType () == typeof(CustomNavigationController)) {
var viewControllers = new List<UIViewController> ();
foreach (var controller in ((UINavigationController)primaryViewController).ViewControllers) {
var type = controller.GetType ();
MethodInfo method = type.GetMethod ("ContainsPhoto");
if ((bool)method.Invoke (controller, new object[] { null })) {
viewControllers.Add (controller);
}
}
((UINavigationController)primaryViewController).ViewControllers = viewControllers.ToArray<UIViewController> ();
}
return false;
}
示例6: GetMvxTabPresentationAttribute
private MvxTabPresentationAttribute GetMvxTabPresentationAttribute(UIViewController viewController)
{
var attributes = viewController.GetType().GetCustomAttributes(typeof(MvxTabPresentationAttribute), true).FirstOrDefault() as MvxTabPresentationAttribute;
if (attributes == null)
throw new MvxException("Please remember to set PresentationAttributes!");
return attributes;
}
示例7: ActivateController
/// <summary>
/// Activates a nested view controller from the DialogViewController.
/// If the view controller is hosted in a UINavigationController it
/// will push the result. Otherwise it will show it as a modal
/// dialog
/// </summary>
public void ActivateController(UIViewController controller, DialogViewController oldController)
{
_Dirty = true;
var parent = ParentViewController;
var nav = parent as UINavigationController;
if (typeof(DialogViewController) == controller.GetType())
{
var dialog = (DialogViewController)controller;
dialog.TableView.Opaque = false;
if (dialog.BackgroundImage == null)
dialog.TableView.BackgroundColor = oldController.TableView.BackgroundColor;
}
// We can not push a nav controller into a nav controller
if (nav != null && !(controller is UINavigationController))
nav.PushViewController(controller, true);
else
PresentModalViewController(controller, true);
}
示例8: PushViewController
public override void PushViewController(UIViewController viewController, bool animated)
{
FA.FlurryAnalytics.LogEvent(string.Format("Pushed ViewController with Name: {0}", viewController.GetType().Name));
base.PushViewController(viewController, animated);
}
示例9: PushDialogView
public void PushDialogView(MobileDialogPresentationType presentationType, string viewTitle, UIViewController viewController)
{
Console.WriteLine("AppDelegate - PushDialogView - presentationType: {0} viewTitle: {1} viewController: {2}", presentationType, viewTitle, viewController.GetType().FullName);
InvokeOnMainThread(() => {
switch (presentationType)
{
case MobileDialogPresentationType.Standard:
var navCtrl = new SessionsNavigationController(MobileNavigationTabType.More); // TODO: Remove tab type
navCtrl.SetTitle(viewTitle);
if (UIDevice.CurrentDevice.CheckSystemVersion(7, 0))
navCtrl.NavigationBar.TintColor = UIColor.FromRGBA(0.2f, 0.2f, 0.2f, 1);
navCtrl.ModalPresentationStyle = UIModalPresentationStyle.FullScreen;
navCtrl.ModalInPopover = true;
navCtrl.ModalTransitionStyle = UIModalTransitionStyle.CrossDissolve;
navCtrl.ViewDismissedEvent += (sender, e) => {
_dialogNavigationControllers.Remove(new KeyValuePair<string, SessionsNavigationController>(viewTitle, navCtrl));
};
navCtrl.PushViewController(viewController, false);
_dialogNavigationControllers.Add(new KeyValuePair<string, SessionsNavigationController>(viewTitle, navCtrl));
_mainViewController.PresentViewController(navCtrl, true, null);
// TODO: Remove navCtrl from list when dialog is closed.
break;
default:
_mainViewController.AddViewController(viewController, presentationType);
break;
}
});
}
示例10: SetCenterController
/// <summary>
/// Set the center controller
/// </summary>
private void SetCenterController(UIViewController centerController)
{
if (this.CenterController == centerController)
{
return;
}
Action<UIViewController> beforeBlock = (x) => {};
Action<UIViewController> afterBlock = (x) => {};
var currentFrame = this.ReferenceBounds;
if (this.viewAppeared)
{
beforeBlock = (controller) =>
{
this.RestoreShadowToSlidingView();
this.RemovePanners();
controller.View.RemoveFromSuperview();
this.centerView.RemoveFromSuperview();
};
afterBlock = (controller) =>
{
this.View.AddSubview(this.centerView);
UINavigationController navController = centerController.GetType().IsSubclassOf(typeof(UINavigationController))
? (UINavigationController)centerController
: null;
bool barHidden = false;
if (navController != null && !navController.NavigationBarHidden)
{
barHidden = true;
navController.NavigationBarHidden = true;
}
this.SetSlidingAndReferenceViews();
controller.View.Frame = currentFrame;
controller.View.AutoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight;
controller.View.Hidden = false;
this.centerView.AddSubview(controller.View);
if (barHidden)
navController.NavigationBarHidden = false;
this.AddPanners();
this.ApplyShadowToSlidingView();
};
}
// start the transition
if (this.CenterController != null)
{
currentFrame = this.CenterController.View.Frame;
this.CenterController.WillMoveToParentViewController(null);
if (centerController == this.LeftController) this.LeftController = null;
if (centerController == this.RightController) this.RightController = null;
beforeBlock(this.CenterController);
this.TryRemoveObserver(this.CenterController, new NSString("title"));
if (this.AutomaticallyUpdateTabBarItems)
{
this.TryRemoveObserver(this.CenterController, new NSString("tabBarItem.title"));
this.TryRemoveObserver(this.CenterController, new NSString("tabBarItem.image"));
this.TryRemoveObserver(this.CenterController, new NSString("hidesBottomBarWhenPushed"));
}
// todo: this.centerController.setViewDeckController(null);
this.CenterController.RemoveFromParentViewController();
this.CenterController.DidMoveToParentViewController(null);
// todo: dispose ? II_RELEASE(_centerController);
}
// make the switch
this._centerController = centerController;
if (this.CenterController != null)
{
// and finish the transition
this.AddChildViewController(this.CenterController);
// todo: this.centerController.setViewDeckController(this);
this.CenterController.AddObserver(this, new NSString("title"), 0, IntPtr.Zero);
this.Title = this.CenterController.Title ?? string.Empty;
if (this.AutomaticallyUpdateTabBarItems)
{
this.CenterController.AddObserver(this, new NSString("tabBarItem.title"), 0, IntPtr.Zero);
this.CenterController.AddObserver(this, new NSString("tabBarItem.image"), 0, IntPtr.Zero);
this.CenterController.AddObserver(this, new NSString("hidesBottomBarWhenPushed"), 0, IntPtr.Zero);
this.TabBarItem.Title = this.CenterController.TabBarItem.Title;
//.........这里部分代码省略.........
示例11: generateKeyPastBooking
// Generate key past booking
public static string generateKeyPastBooking (UIViewController vc)
{
return vc.GetType ().ToString () + "_KeyActionAboutPastBooking";
}
示例12: generateKeySearchSpecialist
// Generate key favorite
public static string generateKeySearchSpecialist (UIViewController vc)
{
return vc.GetType ().ToString () + "_KeyActionAboutSearchSpecialist";
}
示例13: generateKeyFavorite
// Generate key favorite
public static string generateKeyFavorite (UIViewController vc)
{
return vc.GetType ().ToString () + "_KeyActionAboutFavorite";
}
示例14: generateKeyRefreshTable
// Generate key refresh table finished
public static string generateKeyRefreshTable (UIViewController vc)
{
return vc.GetType ().ToString () + "_KeyRefreshFinishedNotify";
}
示例15: RemoveChildFromMainViewController
public void RemoveChildFromMainViewController(UIViewController viewController)
{
Console.WriteLine("AppDelegate - RemoveChildFromMainViewController - viewController: {0}", viewController.GetType().FullName);
_mainViewController.RemoveViewController(viewController);
}