当前位置: 首页>>代码示例>>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;未经允许,请勿转载。