public void Create(IntPtr hwnd, CompositionType compositionType) { CompositionType = compositionType; Device = CompositionType.HasFlag(CompositionType.Native) ? new DesktopDevice(Dxgi().Device) : (ComObject) new Device(Dxgi().Device); if (CompositionType.HasFlag(CompositionType.Native)) { var device = (DesktopDevice)Device; Target = Target.FromHwnd(device, hwnd, false); Visual = new Visual2(device); } else { var device = (Device)Device; Target = Target.FromHwnd(device, hwnd, false); Visual = new Visual(device); } Visual.Content = Dxgi().SwapChain; Target.Root = Visual; Commit(); }
public void Initialize(Device2 device, IntPtr hwnd, CompositionType compositionType, Size2 size) { if (Device != null) { Dispose(); } Device = device; Adapter = Device.GetParent <Adapter>(); Factory = Adapter.GetParent <Factory2>(); var swapChainDescription = new SwapChainDescription1 { SampleDescription = new SampleDescription(1, 0), Usage = Usage.RenderTargetOutput, BufferCount = 2, SwapEffect = GetBestSwapEffectForPlatform(), Scaling = Scaling.Stretch, Format = Format.B8G8R8A8_UNorm, AlphaMode = compositionType.HasFlag(CompositionType.Composited) ? AlphaMode.Premultiplied : AlphaMode.Ignore, Width = size.Width, Height = size.Height }; SwapChain = compositionType.HasFlag(CompositionType.Composited) ? new SwapChain1(Factory, Device, ref swapChainDescription) : new SwapChain1(Factory, Device, hwnd, ref swapChainDescription); }
public Compositor(Ref <Dxgi> dxgi) { Dxgi = dxgi; CompositionType = default; Device = default; Target = default; Visual = default; }
public CompositionItem(CompositionType type, CompositionDiagramElement element) { if (element == null) { throw new ArgumentNullException(nameof(element)); } Type = type; Element = element; }
protected virtual Expression Binary(CompositionType type, Expression left, Expression right) { if (type == CompositionType.And) { return(Expression.And(left, right)); } else { return(Expression.Or(left, right)); } }
public IDimensionAggregationVisitor Create(CompositionType compositionType) { switch (compositionType) { case CompositionType.Part: return(new PartDimensionAggregationVisitor <T1, T2>(SegmentID, Data, aggregation, MemberAncestors)); case CompositionType.Composite: return(new CompositeDimensionAggregationVisitor <T1, T2>(SegmentID, Data, aggregation, MemberAncestors)); default: return(null); } }
public MockValidatedElement(bool ignoreNulls, string ignoreNullsMessageTemplate, string ignoreNullsTag, CompositionType compositionType, string compositionMessageTemplate, string compositionTag) { this.ignoreNulls = ignoreNulls; this.ignoreNullsMessageTemplate = ignoreNullsMessageTemplate; this.ignoreNullsTag = ignoreNullsTag; this.compositionType = compositionType; this.compositionMessageTemplate = compositionMessageTemplate; this.compositionTag = compositionTag; }
public MockValidatedElement(bool ignoreNulls, string ignoreNullsMessageTemplate, string ignoreNullsTag, CompositionType compositionType, string compositionMessageTemplate, string compositionTag) { this.ignoreNulls = ignoreNulls; this.ignoreNullsMessageTemplate = ignoreNullsMessageTemplate; this.ignoreNullsTag = ignoreNullsTag; this.compositionType = compositionType; this.compositionMessageTemplate = compositionMessageTemplate; this.compositionTag = compositionTag; }
public void Create( IntPtr hwnd, Size2 size, CompositionType compositionType) { DebugSelect(DeviceCreationFlags.Debug, DeviceCreationFlags.None, out DeviceCreationFlags creationFlags); creationFlags |= DeviceCreationFlags.BgraSupport | DeviceCreationFlags.SingleThreaded; Device = CreateDevice(creationFlags); Context = Device.ImmediateContext1; Dxgi().Initialize(Device.QueryInterface <DXGI.Device2>(), hwnd, compositionType, size); Connect(); }
void Composite(CompositionType compositionType, List <JsonSchema> composition) { switch (compositionType) { case CompositionType.AllOf: if (composition.Count == 1) { // inheritance if (Validator == null) { //Validator = JsonSchemaValidatorFactory.Create(composition[0].Validator.JsonValueType); Validator = composition[0].Validator; } else { Validator.Assign(composition[0].Validator); } } else { throw new NotImplementedException(); } break; case CompositionType.AnyOf: if (Validator == null) { if (composition.Count == 1) { throw new NotImplementedException(); //Validator = composition[0].Validator; } else { // extend enum // enum, enum..., type Validator = JsonEnumValidator.Create(composition); } } //throw new NotImplementedException(); break; default: throw new NotImplementedException(); } }
public override string GetStepParameters() { var parameters = new List <string>(); parameters.Add(GlobalId != null ? GlobalId.ToStepValue() : "$"); parameters.Add(OwnerHistory != null ? OwnerHistory.ToStepValue() : "$"); parameters.Add(Name != null ? Name.ToStepValue() : "$"); parameters.Add(Description != null ? Description.ToStepValue() : "$"); parameters.Add(ObjectType != null ? ObjectType.ToStepValue() : "$"); parameters.Add(ObjectPlacement != null ? ObjectPlacement.ToStepValue() : "$"); parameters.Add(Representation != null ? Representation.ToStepValue() : "$"); parameters.Add(LongName != null ? LongName.ToStepValue() : "$"); parameters.Add(CompositionType.ToStepValue()); parameters.Add(Elevation != null ? Elevation.ToStepValue() : "$"); return(string.Join(", ", parameters.ToArray())); }
private static Expression <T> Binary <T>(CompositionType type, Expression <T> left, Expression <T> right) { if (left == null) { return(right); } if (right == null) { return(left); } right = ReplaceParameters(left, right); var newBody = Binary(type, left.Body, right.Body); return(Expression.Lambda <T>(newBody, left.Parameters)); }
protected virtual Expression <T> Binary <T>(CompositionType type, Expression <T> left, Expression <T> right) { if (left == null) { return(right); } if (right == null) { return(left); } right = ReplaceParameters(left, right); Expression newBody = Binary(type, left.Body, right.Body); return(Expression.Lambda <T>(newBody, left.Parameters)); }
private void Composite(CompositionType compositionType, List <JsonSchema> composition) { switch (compositionType) { case CompositionType.AllOf: if (composition.Count == 1) { // inheritance if (Validator == null) { Validator = composition[0].Validator; } else { Validator.Merge(composition[0].Validator); } } else { throw new NotImplementedException(); } break; case CompositionType.AnyOf: if (Validator == null) { if (composition.Count == 1) { throw new NotImplementedException(); } else { Validator = JsonEnumValidator.Create(composition, EnumSerializationType.AsString); } } //throw new NotImplementedException(); break; default: throw new NotImplementedException(); } }
private static Expression Binary(CompositionType type, Expression left, Expression right) { return(type == CompositionType.And ? Expression.And(left, right) : Expression.Or(left, right)); }
public SolutionExplorerItem(CompositionType type) : this(Guid.NewGuid(), type.GetDisplayName(), null) { Type = type; }
public CompositeValidatorBuilder(CompositionType compositionType, string messageTemplate) { this.validatorList = new List<Validator>(); this.compositionType = compositionType; this.messageTemplate = messageTemplate; }
public CompositeValidatorBuilder(CompositionType compositionType) : this(compositionType, string.Empty) { }
/////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////// /// <summary> /// Create composition /// </summary> /// <remarks>Used only for Deserialize</remarks> public Composition() { _type = CompositionType.Terminal; _isInited = false; }
/// <summary> /// Remove pane /// </summary> public bool Remove(DockablePane pane) { if (!_isInited) return false; Debug.Assert(CompositionType.Terminal != _type); _CalculateSpaceFactors(); bool isRemoved = false; // find terminal element to deleting Composition terminalComposition2Delete = null; for (int index = 0; index < _children.Count; ++index) { Composition currentComposition = _children[index]; if (CompositionType.Terminal == currentComposition.Type) { if (currentComposition.AttachedPane.Equals(pane)) { terminalComposition2Delete = currentComposition; break; // NOTE: founded } } else { // remove from child composition if (currentComposition.Remove(pane)) { isRemoved = true; break; } } } // remove terminal element if (null != terminalComposition2Delete) { _children.Remove(terminalComposition2Delete); isRemoved = true; if (1 == _children.Count) { // change state to terminal Composition lastChield = _children[0]; _children.Clear(); if (CompositionType.Terminal == lastChield.Type) { _type = CompositionType.Terminal; _attachedPane = lastChield.AttachedPane; } else { _type = lastChield.Type; ICollection<Composition> children = lastChield.Children; foreach (Composition child in children) _children.Add(child); } } else { // recalculate new space factors Size sz = _CalculateSpaceSize(); double fullSize = (_type == CompositionType.Horizontal) ? sz.Height : sz.Width; fullSize += SPLITTER_SIZE; double splitterFree = SPLITTER_SIZE / _children.Count; Size freeSize = terminalComposition2Delete._CalculateSpaceSize(); for (int index = 0; index < _children.Count; ++index) { Composition child = _children[index]; Size childSize = child._CalculateSpaceSize(); child.SpaceFactor = (_type == CompositionType.Horizontal) ? ((childSize.Height + freeSize.Height * child.SpaceFactor + splitterFree) / Math.Max(fullSize, 1)) : ((childSize.Width + freeSize.Width * child.SpaceFactor + splitterFree) / Math.Max(fullSize, 1)); } } } else if (isRemoved) { // normalize composition - if child presented as one line for (int index = 0; index < _children.Count; ++index) { Composition currentChild = _children[index]; if (currentChild.Type == _type) { ICollection<Composition> children = currentChild.Children; Debug.Assert(currentChild.Type != CompositionType.Terminal); Debug.Assert(1 < currentChild.Children.Count); Collection<Composition> fromRemoved = new Collection<Composition> (); foreach (Composition child in children) fromRemoved.Add(child); _children.Remove(currentChild); _children.InsertRange(index, fromRemoved); } } _CalculateSpaceFactors(); } Debug.Assert(_IsNormalized()); return isRemoved; }
public Behavior(Character character, List<BehaviorNode> nodes, CompositionType composition, List<Constraint.Constraint> constraints) : this("UnspecifiedBehavior" + Counter++, character, nodes, composition, constraints) { }
public Behavior(string id, List<BehaviorNode> nodes, CompositionType composition, List<Constraint.Constraint> constraints) : this(id, new Character(), nodes, composition, constraints) { }
public Behavior(string id, List<BehaviorNode> nodes, CompositionType composition) : this(id, new Character(), nodes, composition) { }
public Behavior(List<BehaviorNode> nodes, CompositionType composition) : this("UnspecifiedBehavior" + Counter++, new Character(), nodes, composition) { }
/// <summary> /// Create line composition /// </summary> private void _CreateLineComposition(Composition first, Composition second, Dock dockType) { _attachedPane = null; _type = _GetCompositionTypeByDock(dockType); _children.Add(first); _InsertElement2Line(second , dockType); }
public Composition(CompositionType type) { this.Type = type; }
/// <summary> /// Deserialize layout /// </summary> /// <param name="manager">Dock manager for initing objects</param> /// <param name="node">Node to parse</param> /// <param name="handlerObject">Delegate used to get user defined dockable contents</param> public void Deserialize(DockManager manager, XmlNode node, GetContentFromTypeString handlerObject) { _type = (CompositionType)Enum.Parse(typeof(CompositionType), node.Attributes[ATTRIBUTE_NAME_TYPE].Value); _spaceFactor = double.Parse(node.Attributes[ATTRIBUTE_NAME_SFACTOR].Value, CultureInfo.GetCultureInfo(STORAGE_CULTURE)); if (_type == CompositionType.Terminal) { Debug.Assert(node.ChildNodes[0].Name == ELEMENT_NAME_DOCKPANE); DockablePane pane = new DockablePane(); pane.Deserialize(manager, node.ChildNodes[0], handlerObject); _attachedPane = pane; if (pane.IsDragSupported) manager.DragPaneServices.Register(pane); } else { Debug.Assert(node.ChildNodes[0].Name == ELEMENT_NAME_CHILDGROUPS); foreach (XmlNode nodeChild in node.ChildNodes[0].ChildNodes) { Composition composition = new Composition(); composition.Deserialize(manager, nodeChild, handlerObject); _children.Add(composition); } } _isInited = true; }
public Composition(CompositionType type) { this.Type = type; }
public Composition(Composition parent, DockablePane pane) { _attachedPane = pane; _type = CompositionType.Terminal; _isInited = true; }
public ComposableAttribute(Type type, CompositionType compositionType, uint version);
public CompositeValidatorBuilder(CompositionType compositionType, string messageTemplate) { this.validatorList = new List <Validator>(); this.compositionType = compositionType; this.messageTemplate = messageTemplate; }
/// <summary> /// Initializes a new instance of the <see cref="ValidatorCompositionAttribute"/> class. /// </summary> /// <param name="compositionType">The <see cref="CompositionType"/> to be used.</param> public ValidatorCompositionAttribute(CompositionType compositionType) { this.compositionType = compositionType; }
public Behavior(string id, Character character, List<BehaviorNode> nodes, CompositionType composition) : this(id, character, nodes, composition, new List<Constraint.Constraint>()) { }
public CompositeValidatorBuilder(CompositionType compositionType) : this(compositionType, string.Empty) { }
/// <summary> /// Initializes a new instance of the <see cref="ValidatorCompositionAttribute"/> class. /// </summary> /// <param name="compositionType">The <see cref="CompositionType"/> to be used.</param> public ValidatorCompositionAttribute(CompositionType compositionType) { this.compositionType = compositionType; }
public Behavior(string id, Character character, List<BehaviorNode> nodes, CompositionType composition, List<Constraint.Constraint> constraints) { this.id = id; this.character = character; this.nodes = nodes; this.Composition = composition; this.constraints = constraints; foreach (BehaviorNode bn in nodes) { bn.ParentBehavior = this; if (bn is BehaviorNodes.Action) { (bn as BehaviorNodes.Action).RequiredAction = false; (bn as BehaviorNodes.Action).ParentNode = bn; } else if (bn is BehaviorNodes.Required) { foreach (BehaviorNodes.Action a in (bn as BehaviorNodes.Required).Actions) { a.ParentNode = bn; a.RequiredAction = true; a.ParentBehavior = this; } } } }
public Task SetGlobalCompositeOperation(CompositionType value) => _jsRuntime.InvokeAsync<Task>("canvasOperator.setCanvasProperty", Canvas, ContextProperties.GlobalCompositeOperation, value);
private CompositionKind(String name, CompositionType type = CompositionType.None, CompositionEnd end = CompositionEnd.None) : base(name) { Type = type; End = end; }