当前位置: 首页>>代码示例>>C#>>正文


C# Fragment类代码示例

本文整理汇总了C#中Fragment的典型用法代码示例。如果您正苦于以下问题:C# Fragment类的具体用法?C# Fragment怎么用?C# Fragment使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Fragment类属于命名空间,在下文中一共展示了Fragment类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: DrawingImageView

	public DrawingImageView(Context context, Fragment fragment): base(context) {
		mPaint = new Paint();
		mPaint.AntiAlias = true;
		mPaint.Dither = true;
		mPaint.Color = Color.Yellow;
		mPaint.SetStyle (Paint.Style.Stroke);
		mPaint.StrokeJoin = Paint.Join.Round;
		mPaint.StrokeCap = Paint.Cap.Round;
		mPaint.StrokeWidth = 10;

		cPaint = new Paint ();
		cPaint.Color = Color.Yellow;
		cPaint.StrokeJoin = Paint.Join.Round;
		cPaint.StrokeCap = Paint.Cap.Round;
		cPaint.SetTypeface(Typeface.Default);
		cPaint.TextSize = 40;

		mPath = new Android.Graphics.Path();
		mBitmapPaint = new Paint();
		mBitmapPaint.Color = Color.Yellow;

		DrawingStatus = DrawingType.None;

		_fragment = fragment;
	}
开发者ID:ehill8624,项目名称:ValkreRender,代码行数:25,代码来源:DrawingImageView.cs

示例2: OnCreate

        protected override void OnCreate(Bundle savedInstanceState) {
            base.OnCreate(savedInstanceState);
            SetContentView(R.Layouts.fragment_menu);

            // Make sure the two menu fragments are created.
            FragmentManager fm = GetSupportFragmentManager();
            FragmentTransaction ft = fm.BeginTransaction();
            mFragment1 = fm.FindFragmentByTag("f1");
            if (mFragment1 == null) {
                mFragment1 = new MenuFragment();
                ft.Add(mFragment1, "f1");
            }
            mFragment2 = fm.FindFragmentByTag("f2");
            if (mFragment2 == null) {
                mFragment2 = new Menu2Fragment();
                ft.Add(mFragment2, "f2");
            }
            ft.Commit();

            // Watch check box clicks.
            mCheckBox1 = (CheckBox)FindViewById(R.Ids.menu1);
            mCheckBox1.Click += (o,a) => UpdateFragmentVisibility();
            mCheckBox2 = (CheckBox)FindViewById(R.Ids.menu2);
            mCheckBox2.Click += (o,a) => UpdateFragmentVisibility();

            // Make sure fragments start out with correct visibility.
            UpdateFragmentVisibility();
        }
开发者ID:MahendrenGanesan,项目名称:samples,代码行数:28,代码来源:FragmentMenuSupport.cs

示例3: OnCreate

		protected override void OnCreate (Bundle bundle)
		{
			RequestWindowFeature(WindowFeatures.NoTitle);
			base.OnCreate (bundle); 
			this.SetContentView(Resource.Layout.Home);

			String package = PackageName;


			Glistener = new GestureListener();
			Gdetector = new GestureDetector (this, Glistener);
			var trans = FragmentManager.BeginTransaction ();
			trans.Add (Resource.Id.frame_home,mHomeFragment3,"HomeFragment3");
			trans.Hide (mHomeFragment3);
			trans.Add (Resource.Id.frame_home,mHomeFragment2,"HomeFragment2");
			trans.Hide (mHomeFragment2);
			trans.Add (Resource.Id.frame_home,mHomeFragment1,"HomeFragment1");
			trans.Commit();
			currentFragment = mHomeFragment1;

			Button haz_plif = FindViewById <Button> (Resource.Id.haz_plif);
			FrameLayout fcontainer = FindViewById<FrameLayout> (Resource.Id.frame_home);

			haz_plif.Click += (object sender, EventArgs e) => {
					StartActivity(typeof(login));
					Finish ();
			};
			fcontainer.Touch += Fcontainer_Touch;

			RemoteViews rmv = new RemoteViews(package, Resource.Layout.Home);
			rmv.SetTextViewText(Resource.Id.haz_plif,"Elias was here");
		}
开发者ID:scrafty614,项目名称:XamarinStudio_Example,代码行数:32,代码来源:HomeActivity.cs

示例4: AddTab

        public static void AddTab(this Activity context, string tabText, int? iconResourceId, int containerId, Fragment view)
        {
            var tab = context.ActionBar.NewTab();
            tab.SetText(tabText);

            if (iconResourceId != null)
            {
                tab.SetIcon(iconResourceId.Value);
            }

            // must set event handler before adding tab
            tab.TabSelected += delegate (object sender, ActionBar.TabEventArgs e)
            {
                var fragment = context.FragmentManager.FindFragmentById(Resource.Id.settingsContainer);
                if (fragment != null)
                    e.FragmentTransaction.Remove(fragment);
                e.FragmentTransaction.Add(containerId, view);
            };

            tab.TabUnselected += delegate (object sender, ActionBar.TabEventArgs e) {
                e.FragmentTransaction.Remove(view);
            };

            context.ActionBar.AddTab(tab);
        }
开发者ID:tacerra,项目名称:HomeAutomationServer,代码行数:25,代码来源:Extensions.cs

示例5: TryCreateFragment

        public bool TryCreateFragment(StringCursor text, out Fragment fragment)
        {
            ITextSplitter textSplitter = new SeparatorTextSplitter(text, new[] {'\r', '\n'});

            fragment = new DelimitedFragment(textSplitter, _fragmentFactory);
            return true;
        }
开发者ID:phatboyg,项目名称:Recognized,代码行数:7,代码来源:DelimitedFragmentFactory.cs

示例6: InstanceReference

        public InstanceReference(Fragment fragment, string instanceId)
        {
            if (fragment == null) throw new ArgumentNullException("fragment");

            Instance = fragment;
            InstanceId = instanceId ?? string.Empty;
        }
开发者ID:nguyenkien,项目名称:api,代码行数:7,代码来源:InstanceReference.cs

示例7: OnCreateView

        public override View OnCreateView(LayoutInflater Inflater, ViewGroup container,
                Bundle savedInstanceState) {
            View v = Inflater.Inflate(R.Layout.fragment_menu, container, false);

            // Make sure the two menu fragments are created.
            FragmentManager fm = GetChildFragmentManager();
            FragmentTransaction ft = fm.BeginTransaction();
            mFragment1 = fm.FindFragmentByTag("f1");
            if (mFragment1 == null) {
                mFragment1 = new FragmentMenuSupport.MenuFragment();
                ft.Add(mFragment1, "f1");
            }
            mFragment2 = fm.FindFragmentByTag("f2");
            if (mFragment2 == null) {
                mFragment2 = new FragmentMenuSupport.Menu2Fragment();
                ft.Add(mFragment2, "f2");
            }
            ft.Commit();
        
            // Watch check box clicks.
            mCheckBox1 = (CheckBox)v.FindViewById(R.Id.menu1);
            mCheckBox1.Click += (o, a) => UpdateFragmentVisibility();
            mCheckBox2 = (CheckBox)v.FindViewById(R.Id.menu2);
            mCheckBox2.Click += (o, a) => UpdateFragmentVisibility();
        
            // Make sure fragments start out with correct visibility.
            UpdateFragmentVisibility();

            return v;
        }
开发者ID:Xtremrules,项目名称:dot42,代码行数:30,代码来源:FragmentMenuFragmentSupport.cs

示例8: Add

        public override void Add(Fragment fragment, IList<Fragment> fragments)
        {
            if (fragments.Count > 0)
            {
                Fragment prev = fragments[fragments.Count - 1];
                if (prev.Name == fragment.Name)
                {
                    if (prev.Value.Length < fragment.Value.Length)
                    {
                        Add(fragment, prev.ChildFragments);
                        return;
                    }
                    else if (prev.Value.Length > fragment.Value.Length)
                    {
                        for (int i = fragments.Count - 1; i >= 0; i--)
                        {
                            if (fragments[i].Name != fragment.Name)
                                break;
                            if (fragments[i].Value.Length < fragment.Value.Length)
                            {
                                base.Add(fragment, fragments[i].ChildFragments);
                            }
                        }
                    }
                }
            }

            base.Add(fragment, fragments);
        }
开发者ID:joaohortencio,项目名称:n2cms,代码行数:29,代码来源:ListFragmenter.cs

示例9: UINavigationController

 public UINavigationController(Fragment root)
 {
     ControllerStack.Add (root);
     if (root is IViewController) {
         ((IViewController)root).NavigationController = this;
     }
 }
开发者ID:Clancey,项目名称:SimpleTables,代码行数:7,代码来源:UINavigationController.cs

示例10: OnAddingFragment

    // méthode à appeler quand on déponse un fragment sur le musicien
    public void OnAddingFragment(Fragment fragment)
    {
        print("NPC:OnAddingFragment");

        SetJustReceivedFragmentComplete(true); // setting de la variable RAIN
        Material addedMaterial;
        switch(fragment.family){ // récupération du matérial correspondant au fragment qui vient d'être ajouté au musicien
            case FragmentType.electricity:
                addedMaterial = elecMaterial;
                break;
            case FragmentType.liquid:
                addedMaterial = liquidMaterial;
                break;
            case FragmentType.metal:
                addedMaterial = metalMaterial;
                break;
            case FragmentType.urban:
                addedMaterial = urbanMaterial;
                break;
            case FragmentType.wood:
                addedMaterial = woodMaterial;
                break;
            default:
                addedMaterial = defaultMaterial;
                break;
        }
        this.transform.FindChild("mesh").GetChild(1).renderer.material = addedMaterial;// affectation du material
    }
开发者ID:NunezG,项目名称:villeEmergente,代码行数:29,代码来源:Musicien.cs

示例11: BlockParserContext

 public BlockParserContext(IProblemPipe problemPipe, Fragment returnFragmentType, List<ReturnCondition> returnConditions, IBlacklistManager blacklistManager, BlockParser.InspectCallback inspect)
 {
     _problemPipe = problemPipe;
       _returnFragmentType = returnFragmentType;
       _returnConditions = returnConditions;
       _blacklistManager = blacklistManager;
       _inspect = inspect;
 }
开发者ID:rubicon-oss,项目名称:InjectionCop,代码行数:8,代码来源:BlockParserContext.cs

示例12: OnAttachFragment

        public override void OnAttachFragment(Fragment fragment)
        {
            base.OnAttachFragment (fragment);
            if (fragment is HeaderFragment) {
                headerfragment = fragment;

            }
        }
开发者ID:MADMUC,项目名称:TAP5050,代码行数:8,代码来源:TermsScreen.cs

示例13: OnCreateDialog

 public override Dialog OnCreateDialog(Bundle savedInstanceState)
 {
     mParent = ParentFragment;
     return new AlertDialog.Builder(Activity)
         .SetMessage(Resource.String.request_permission)
         .SetPositiveButton(Android.Resource.String.Ok, new PositiveListener())
         .SetNegativeButton(Android.Resource.String.Cancel, new NegativeListener())
         .Create();
 }
开发者ID:xamarin,项目名称:monodroid-samples,代码行数:9,代码来源:ConfirmationDialog.cs

示例14: PreConditionBase

        protected PreConditionBase(string symbol, Fragment fragment)
        {
            ArgumentUtility.CheckNotNullOrEmpty ("symbol", symbol);
              ArgumentUtility.CheckNotNull ("fragment", fragment);

              _symbol = symbol;
              _fragment =  fragment;
              _problemMetadata = null;
        }
开发者ID:rubicon-oss,项目名称:InjectionCop,代码行数:9,代码来源:PreConditionBase.cs

示例15: SwitchFragment

 private void SwitchFragment(Fragment newContent)
 {
     // todo change this to use an interface
       var baseActivity = Activity as Activity1;
       if (baseActivity != null)
       {
     baseActivity.SwitchContent(newContent);
       }
 }
开发者ID:johnglow,项目名称:SlidingMenuMonodroid,代码行数:9,代码来源:MenuFragment.cs


注:本文中的Fragment类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。