當前位置: 首頁>>代碼示例>>C#>>正文


C# Binding類代碼示例

本文整理匯總了C#中Binding的典型用法代碼示例。如果您正苦於以下問題:C# Binding類的具體用法?C# Binding怎麽用?C# Binding使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


Binding類屬於命名空間,在下文中一共展示了Binding類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: PreConfiguration

		protected override bool PreConfiguration(Binding.IBuild build)
		{
			Platform.Application application = build.Application;
			if (application.NotNull())
			{
				Platform.Module module = application["License"];
				if (module is Icop.Client.Module)
				{
					string value = (module as Icop.Client.Module)["media.directshow.elecard." + this.identifier] as string;
					if (value.NotEmpty())
						this.OnPreConfigure += configurator =>
					{
						byte[] key = Convert.FromBase64String(value.Replace('-', '/'));
						byte[] correct = new byte[16];
						byte[] secret = new byte[] { 89, 254, 202, 212, 234, 216, 54, 120, 194, 196, 150, 207, 127, 96, 54, 189 };
						for (int i = 0; i < 16; i++)
							correct[i] = (byte)(secret[i] ^ key[i]);
						Guid activationKey = new Guid(correct);
						//Console.WriteLine(activationKey);
						configurator.SetParamValue(ref activationKey, null);
					};
				}
			}
			if (this.OnPreConfigure.NotNull())
			{
				global::Elecard.Utilities.ModuleConfig moduleConfigurator = this.backend.GetConfigInterface();
				if (moduleConfigurator.NotNull())
				{
					this.OnPreConfigure(moduleConfigurator);
					moduleConfigurator.Dispose();
				}
			}
			return base.PreConfiguration(build);
		}
開發者ID:davinx,項目名稱:Imint.Media.DirectShow,代碼行數:34,代碼來源:Abstract.cs

示例2: AddKeybind

 /// <summary>
 /// Adds the specified keybind to the specified action.
 /// </summary>
 public static void AddKeybind(PlayerAction action, Binding bind)
 {
     if (binds.ContainsKey(action))
         binds[action] = bind;
     else
         binds.Add(action, bind);
 }
開發者ID:Garfounkel,項目名稱:Simple-Unity3D-Keybinder,代碼行數:10,代碼來源:InputBinder.cs

示例3: BindingExpression

 public BindingExpression(BindingMode mode, Binding.Parsing.Expressions.BindingPathExpression path, RedwoodProperty sourceProperty = null, RedwoodBindable source = null)
 {
     Path = path;
     Mode = mode;
     SourceProperty = sourceProperty ?? Controls.RedwoodControl.DataContextProperty;
     Source = source;
 }
開發者ID:jechtom,項目名稱:Redwood,代碼行數:7,代碼來源:BindingExpression.cs

示例4: Setup

		public void Setup()
		{
			b = new Binding ();
			b.ToPool ();

			binding = (b as IPool);
		}
開發者ID:KMY520,項目名稱:strangeioc,代碼行數:7,代碼來源:TestBindingAsPoolFacade.cs

示例5: r_2_ctMethod

 private static UIElement r_2_ctMethod(UIElement parent)
 {
     // e_0 element
     Grid e_0 = new Grid();
     e_0.Parent = parent;
     e_0.Name = "e_0";
     RowDefinition row_e_0_0 = new RowDefinition();
     row_e_0_0.Height = new GridLength(20F, GridUnitType.Pixel);
     e_0.RowDefinitions.Add(row_e_0_0);
     RowDefinition row_e_0_1 = new RowDefinition();
     e_0.RowDefinitions.Add(row_e_0_1);
     // PART_WindowTitleBorder element
     Border PART_WindowTitleBorder = new Border();
     e_0.Children.Add(PART_WindowTitleBorder);
     PART_WindowTitleBorder.Name = "PART_WindowTitleBorder";
     PART_WindowTitleBorder.Background = new SolidColorBrush(new ColorW(255, 255, 255, 255));
     // e_1 element
     ContentPresenter e_1 = new ContentPresenter();
     e_0.Children.Add(e_1);
     e_1.Name = "e_1";
     Grid.SetRow(e_1, 1);
     Binding binding_e_1_Content = new Binding();
     e_1.SetBinding(ContentPresenter.ContentProperty, binding_e_1_Content);
     return e_0;
 }
開發者ID:EmptyKeys,項目名稱:UI_Examples,代碼行數:25,代碼來源:Dictionary.xaml.cs

示例6: FlowListView

		/// <summary>
		/// Initializes a new instance of the <see cref="DLToolkit.Forms.Controls.FlowListView"/> class.
		/// </summary>
		public FlowListView()
		{
			RefreshDesiredColumnCount();
			SizeChanged += FlowListSizeChanged;
			PropertyChanged += FlowListViewPropertyChanged;
			PropertyChanging += FlowListViewPropertyChanging;

			FlowGroupKeySorting = FlowSorting.Ascending;
			FlowGroupItemSorting = FlowSorting.Ascending;
			FlowColumnExpand = FlowColumnExpand.None;
			FlowColumnsTemplates = new List<FlowColumnTemplateSelector>();
			GroupDisplayBinding = new Binding("Key");
			FlowAutoColumnCount = false;
			FlowColumnDefaultMinimumWidth = 50d;
			FlowRowBackgroundColor = Color.Transparent;
			FlowTappedBackgroundColor = Color.Transparent;
			FlowTappedBackgroundDelay = 0;

			var flowListViewRef = new WeakReference<FlowListView>(this);
			ItemTemplate = new DataTemplate(() => new FlowListViewInternalCell(flowListViewRef));
			SeparatorVisibility = SeparatorVisibility.None;
			SeparatorColor = Color.Transparent;

			ItemSelected += FlowListViewItemSelected;
			ItemAppearing += FlowListViewItemAppearing;
			ItemDisappearing += FlowListViewItemDisappearing;
		}
開發者ID:realex82,項目名稱:DLToolkit.Forms.Controls,代碼行數:30,代碼來源:FlowListView.cs

示例7: bind

 void bind()
 {
     binding = Binding.Create(()=>
         TextLabel.Text == Payment.PaymentType.Description &&
         input.Text == payment.AmountString
     );
 }
開發者ID:nagyist,項目名稱:iPadPos,代碼行數:7,代碼來源:PaymentCell.cs

示例8: ContextBufferBindings

        public ContextBufferBindings(IContext context, IContextCaps caps)
        {
            Array = new BufferBinding(context, BufferTarget.Array);
            CopyRead = new BufferBinding(context, BufferTarget.CopyRead);
            CopyWrite = new BufferBinding(context, BufferTarget.CopyWrite);
            ElementArray = new Binding<IBuffer>(context, (c, o) =>
            {
                c.Bindings.VertexArray.Set(null);
                c.GL.BindBuffer((int)All.ElementArrayBuffer, o.SafeGetHandle());
            });
            PixelPack = new BufferBinding(context, BufferTarget.PixelPack);
            PixelUnpack = new BufferBinding(context, BufferTarget.PixelUnpack);
            Texture = new BufferBinding(context, BufferTarget.Texture);
            DrawIndirect = new BufferBinding(context, BufferTarget.DrawIndirect);
            TransformFeedback = new Binding<IBuffer>(context, (c, o) =>
            {
                c.Bindings.TransformFeedback.Set(null);
                c.GL.BindBuffer((int)All.TransformFeedbackBuffer, o.SafeGetHandle());
            });
            Uniform = new BufferBinding(context, BufferTarget.Uniform);
            ShaderStorage = new BufferBinding(context, BufferTarget.ShaderStorage);
            DispatchIndirect = new BufferBinding(context, BufferTarget.DispatchIndirect);
            Query = new BufferBinding(context, BufferTarget.Query);
            AtomicCounter = new BufferBinding(context, BufferTarget.AtomicCounter);

            UniformIndexed = Enumerable.Range(0, caps.MaxUniformBufferBindings)
                .Select(i => new Binding<BufferRange>(context, (c, o) =>
                {
                    if (o.Buffer == null || o.Offset == 0 && o.Size == o.Buffer.SizeInBytes)
                        c.GL.BindBufferBase((int)BufferTarget.Uniform, (uint)i, o.Buffer.SafeGetHandle());
                    else
                        c.GL.BindBufferRange((int)BufferTarget.Uniform, (uint)i, o.Buffer.SafeGetHandle(), (IntPtr)o.Offset, (IntPtr)o.Size);
                }))
                .ToArray();
        }
開發者ID:Zulkir,項目名稱:ObjectGL,代碼行數:35,代碼來源:ContextBufferBindings.cs

示例9: TestBindingQuery

        public void TestBindingQuery()
        {
            var q = new Binding();
            q.Query.Parse("{[chILdReN]}");

            Assert.IsTrue(q.Query.Children);
        }
開發者ID:SchwarzerLoewe,項目名稱:XmlComponent,代碼行數:7,代碼來源:UnitTest1.cs

示例10: BuildBindings

        public static void BuildBindings()
        {
            var bindingOneWayToTarget = new Binding
            {
                SourceObject = Source,
                SourcePath = "OneWayToTarget",
                TargetObject = Target,
                TargetPath = "OneWayToTarget",
                Mode = BindingMode.OneWayToTarget
            };
            BindingManager.Bindings.Add(bindingOneWayToTarget);

            var bindingOneWayToSource = new Binding
            {
                SourceObject = Source,
                SourcePath = "OneWayToSource",
                TargetObject = Target,
                TargetPath = "OneWayToSource",
                Mode = BindingMode.OneWayToSource
            };
            BindingManager.Bindings.Add(bindingOneWayToSource);

            var bindingTwoWay = new Binding
            {
                SourceObject = Source,
                SourcePath = "TwoWay",
                TargetObject = Target,
                TargetPath = "TwoWay",
                Mode = BindingMode.TwoWay
            };
            BindingManager.Bindings.Add(bindingTwoWay);
        }
開發者ID:tfreitasleal,項目名稱:MvvmFx,代碼行數:32,代碼來源:Tests.cs

示例11: Resolve

        /// <summary>
        /// Returns any bindings from the specified collection that match the specified request.
        /// </summary>
        /// <param name="bindings">The <see cref="Multimap{T1,T2}"/> of all registered bindings.</param>
        /// <param name="request">The request in question.</param>
        /// <returns>The series of matching bindings.</returns>
        public IEnumerable<IBinding> Resolve(Multimap<Type, IBinding> bindings, IRequest request)
        {
            if (typeof(DbContext).IsAssignableFrom(request.Service))
            {
                return new[]
                {
                    new Binding(request.Service)
                    {
                        ProviderCallback = this.mockProviderCallbackProvider.GetCreationCallback(),
                        ScopeCallback = ctx => StandardScopeCallbacks.Singleton,
                        IsImplicit = true
                    }
                };
            }

            if (request.Service.IsGenericType() && request.Service.GetGenericTypeDefinition() == typeof(DbSet<>))
            {
                var binding = new Binding(request.Service)
                {
                    ProviderCallback = this.mockProviderCallbackProvider.GetCreationCallback(),
                    ScopeCallback = ctx => StandardScopeCallbacks.Singleton,
                    IsImplicit = true
                };

                binding.Parameters.Add(new AdditionalInterfaceParameter(typeof(IQueryable<>).MakeGenericType(request.Service.GetGenericArguments())));
#if !NET40
                binding.Parameters.Add(new AdditionalInterfaceParameter(typeof(IDbAsyncEnumerable<>).MakeGenericType(request.Service.GetGenericArguments())));
#endif
                return new[] { binding };
            }

            return Enumerable.Empty<IBinding>();
        }
開發者ID:EnableSoftware,項目名稱:EntityFramework.Testing,代碼行數:39,代碼來源:MockEntityFrameworkBindingResolver.cs

示例12: r_11_dtMethod

 private static UIElement r_11_dtMethod(UIElement parent)
 {
     // e_69 element
     Border e_69 = new Border();
     e_69.Parent = parent;
     e_69.Name = "e_69";
     e_69.Background = new SolidColorBrush(new ColorW(0, 0, 255, 255));
     // e_70 element
     StackPanel e_70 = new StackPanel();
     e_69.Child = e_70;
     e_70.Name = "e_70";
     // e_71 element
     TextBlock e_71 = new TextBlock();
     e_70.Children.Add(e_71);
     e_71.Name = "e_71";
     e_71.HorizontalAlignment = HorizontalAlignment.Center;
     e_71.VerticalAlignment = VerticalAlignment.Center;
     Binding binding_e_71_Text = new Binding("TextData");
     e_71.SetBinding(TextBlock.TextProperty, binding_e_71_Text);
     // e_72 element
     Button e_72 = new Button();
     e_70.Children.Add(e_72);
     e_72.Name = "e_72";
     e_72.Content = "Hide Window";
     Binding binding_e_72_Command = new Binding("HideCommand");
     e_72.SetBinding(Button.CommandProperty, binding_e_72_Command);
     return e_69;
 }
開發者ID:Mike-EEE,項目名稱:UI_Examples,代碼行數:28,代碼來源:Dictionary.xaml.cs

示例13: ApplyNull

		public void ApplyNull()
		{
			const string path = "Foo.Bar";
			var binding = new Binding (path);
			var be = new BindingExpression (binding, path);
			Assert.DoesNotThrow (() => be.Apply (null, new MockBindable(), TextCell.TextProperty));
		}
開發者ID:Costo,項目名稱:Xamarin.Forms,代碼行數:7,代碼來源:BindingExpressionTests.cs

示例14: AbstractChannel

 protected AbstractChannel(SocketOptions options, Binding binding, LetterDeserializer letterDeserializer, HyperletterFactory factory)
 {
     _options = options;
     _letterDeserializer = letterDeserializer;
     _factory = factory;
     Binding = binding;
 }
開發者ID:riax,項目名稱:Clr,代碼行數:7,代碼來源:AbstractChannel.cs

示例15: PFDictionaryView

        public PFDictionaryView()
        {
            viewModel = new PFDictionaresViewModel();
            ItemsSource = viewModel.PFDictionariesGrouped;
            IsGroupingEnabled = true;
            GroupDisplayBinding = new Binding("Key");
            GroupShortNameBinding = new Binding("Key");

            if(Device.OS != TargetPlatform.WinPhone)
                GroupHeaderTemplate = new DataTemplate(typeof(HeaderCell));

             var cell = new DataTemplate(typeof(PFDictCell));

             ItemTemplate = cell;
             //SeparatorVisibility = SeparatorVisibility.None;
             RowHeight = 60;
             ItemTapped += (sender, args) =>
             {
                var pfdic = args.Item as  PFDictionary;
                if (pfdic == null)
                    return;

                //Navigation.PushAsync(new DetailsPage(pfdic));
                // Reset the selected item
                 SelectedItem = null;
            };
        }
開發者ID:henrytranvan,項目名稱:HSFFinance,代碼行數:27,代碼來源:PFDictionaryView.cs


注:本文中的Binding類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。