本文整理汇总了C#中Binding类的典型用法代码示例。如果您正苦于以下问题:C# Binding类的具体用法?C# Binding怎么用?C# Binding使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Binding类属于命名空间,在下文中一共展示了Binding类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: CreateContext
public IBindingContext CreateContext()
{
var context = BindingContext.Create();
foreach(var binding in m_bindings)
{
List<IBindingRequirement> requirements = new List<IBindingRequirement>();
foreach(var req in binding.Dependencies)
{
var realReq = BindingRequirements.Instance.With(req.name,req.BindingType);
requirements.Add(realReq);
}
var args = new List<Type>(binding.Factory.GetParameters().Select(p => p.ParameterType));
args.Add(binding.Factory.ReturnType);
var delegateType = Expression.GetFuncType(args.ToArray());
var factory = System.Delegate.CreateDelegate(delegateType,binding.Factory);
IBinding realBinding = new Binding(factory,requirements.ToArray());
context.Unsafe.Bind(binding.Root.name,binding.Root.BindingType).To(realBinding);
}
return context;
}
开发者ID:ericknajjar,项目名称:taticsthegame,代码行数:29,代码来源:ReflectiveBindingContextFactory.cs
示例17: ExternalRequirements
internal ExternalRequirements(Binding context,
IEnumerable<Expression> links)
: base(context, null, null)
{
Guard.NotNull(links, "links");
Links = new ReadOnlyCollection<Expression>(new List<Expression>(links));
}
开发者ID:Aethon,项目名称:odo,代码行数:7,代码来源:ExternalRequirements.cs
示例18: e_28_Col3_ct_dtMethod
private static UIElement e_28_Col3_ct_dtMethod(UIElement parent)
{
// e_30 element
StackPanel e_30 = new StackPanel();
e_30.Parent = parent;
e_30.Name = "e_30";
// e_31 element
TextBlock e_31 = new TextBlock();
e_30.Children.Add(e_31);
e_31.Name = "e_31";
Binding binding_e_31_Text = new Binding("Text");
e_31.SetBinding(TextBlock.TextProperty, binding_e_31_Text);
// e_32 element
StackPanel e_32 = new StackPanel();
e_30.Children.Add(e_32);
e_32.Name = "e_32";
e_32.Orientation = Orientation.Horizontal;
// e_33 element
TextBlock e_33 = new TextBlock();
e_32.Children.Add(e_33);
e_33.Name = "e_33";
Binding binding_e_33_Text = new Binding("Boolean");
e_33.SetBinding(TextBlock.TextProperty, binding_e_33_Text);
// e_34 element
TextBlock e_34 = new TextBlock();
e_32.Children.Add(e_34);
e_34.Name = "e_34";
Binding binding_e_34_Text = new Binding("Number");
e_34.SetBinding(TextBlock.TextProperty, binding_e_34_Text);
return e_30;
}
开发者ID:EmptyKeys,项目名称:UI_Examples,代码行数:31,代码来源:BasicUI.xaml.cs
示例19: BindingSourceCodePage
public BindingSourceCodePage()
{
Label label = new Label
{
Text = "Binding Source Demo",
FontSize = Device.GetNamedSize(NamedSize.Large, typeof(Label)),
VerticalOptions = LayoutOptions.CenterAndExpand,
HorizontalOptions = LayoutOptions.Center
};
Slider slider = new Slider
{
VerticalOptions = LayoutOptions.CenterAndExpand
};
// Define Binding object with source object and property.
Binding binding = new Binding
{
Source = slider,
Path = "Value"
};
// Bind the Opacity property of the Label to the source.
label.SetBinding(Label.OpacityProperty, binding);
// Construct the page.
Padding = new Thickness(10, 0);
Content = new StackLayout
{
Children = { label, slider }
};
}
开发者ID:jenart,项目名称:xamarin-forms-book-preview-2,代码行数:32,代码来源:BindingSourceCodePage.cs
示例20: Init
protected override void Init ()
{
var entry = new Entry {
Text = "Setec Astronomy",
FontFamily = "Comic Sans MS",
HorizontalTextAlignment = TextAlignment.Center,
Keyboard = Keyboard.Chat
};
var label = new Label ();
var binding = new Binding ("Text") { Source = entry };
var otherEntry = new Entry ();
var otherBinding = new Binding ("Text") { Source = entry, Mode = BindingMode.TwoWay };
otherEntry.SetBinding (Entry.TextProperty, otherBinding);
label.SetBinding (Label.TextProperty, binding);
var explanation = new Label() {Text = @"The Text value of the entry at the top should appear in the label and entry below, regardless of whether 'IsPassword' is on.
Changes to the value in the entry below should be reflected in the entry at the top."};
var button = new Button { Text = "Toggle IsPassword" };
button.Clicked += (sender, args) => { entry.IsPassword = !entry.IsPassword; };
Content = new StackLayout {
Children = { entry, button, explanation, label, otherEntry }
};
}
开发者ID:Costo,项目名称:Xamarin.Forms,代码行数:28,代码来源:IsPasswordToggleTest.cs
注:本文中的Binding类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论