How to change property without exposing the property sheet - directshow

I have the CLSID of the property pages of an encoder. I retrieved this by querying the filter for IID_ISpecifyPropertyPages.
hr = pHauppaugeSienaEncoder->QueryInterface(IID_ISpecifyPropertyPages, (void **)&pProp);
I also have the array of IUnknown.
But how do I get access to the properties to be able to change the values? How can use these CLSIDs?

Related

Where is the documentation for BizTalk SendPort filters?

I'm talking about this list. I can't find the documentation online. Is it available anywhere?
Here's a fine example, how would I fill this out if I wanted to use it? That's why I need documentation.
Short answer
Each item in that list is defined in a Property Schema that defines the type and hence what the value type in the filter should be. By adding new property schemas, there will be more items in the list. So there won't be any definitive documentation for all of them.
Filters will mostly only work on Message Context Properties that are Promoted.
Long explanation:
This is the documentation Setting Filter Expressions on Send Ports, but it is very bare bones and just tells you how to set a filter. What you need refer to for out of the box is Message Context Properties e.g. File Adapter Property Schema and Properties
But what you need to know is that each item in that list is associated with a Property Schema. If you add more property schemas, those properties will also show in that list, so it is not a static list, but a dynamically generated one. Adding some adapters will add more context properties.
If you look at the context properties for a message from a file receive location you can see the FileCreationTime property there and the value, if it is promoted or not (Type), and the Namespace of the Property Schema it is associated with.
e.g.
Name: FileCreationTime
Value: 19/05/2022 9:59:23 p.m.
Type: Not Promoted
Namespace: http://schemas.microsoft.com/BizTalk/2003/file-properties
Also if you set a value to that filter and try and Enlist it and it is not the right type you get the following error.
You can see the type in the Property Schema
The FileCreationTime is not a Promoted Property, which generally means you generally can't subscribe to it, however there are some exceptions to this, but this is not one of them.
When I changed the rule to > and the value to 19/05/2022 9:59:23 p.m., the send port Enlisted, but did not subscribe to a message.
Below are the properties that are Promoted from a file receive by default
InboundTransportLocation http://schemas.microsoft.com/BizTalk/2003/system-properties
ReceivePortID http://schemas.microsoft.com/BizTalk/2003/system-properties
ReceivePortName http://schemas.microsoft.com/BizTalk/2003/system-properties
InboundTransportType FILE Promoted http://schemas.microsoft.com/BizTalk/2003/system-properties
MessageType Transaction Promoted http://schemas.microsoft.com/BizTalk/2003/system-properties
Note: MessageType will only be present if you've disassembled a message.
You either need to use the properties that are promoted, or to promote the property you do want, or have logic in either an Orchestration or Pipeline Component that inspects that context properties and then sets promoted properties so that you can route the message.
For example I used the BRE Pipeline Framework to Promote the FileCreationTime property, and then the Filter does work.

Using Newtonsoft Jschema, how can I validate derived class properties based on an abstract class?

An example would be I have an array of the abstract class Production which has derived classes of Movie and Series. I have an array in the schema that is a Production[] which can hold either a Movie or Series. I'm validating schema that is being provided to us by a third party. I am only validating, not deserializing so I am validating it with the validation stream.
When I validate that array, it only validates against the properties within Production. It skips any properties that are within the derived classes. How can I get it to validate against the correct derived class properties? I have a ProductionType property on Production which is a one to one match to the derived class.
I have tried adding the derived class schemas to the "AdditionalItems" in the ProductionGenerationProvider and manually validate against it in the ProductionValidationProvider. Did this by value.Validate(matchedSchemaItem). This causes a whole new validation to be spawned off instead of validate it within the context of the current validation.
I also tried using the OneOf property on the schema by passing in the references to all the derived types but it just tells me that it didn't validate against any of the items in OneOf.
Is there a way another way to do this? I assume this is a solved issue and I just haven't come across the solution.

Why does [Serializable] cause Newtonsoft.Json serializer to include backing fields?

If I have [Serializable] attribute on a class then it causes the resulting serialised Json string to include backing members created by the framework.
For example I get below for my Id field:
<Id>k__BackingField=20001
I could find many resources on SOF and elsewhere to get around this problem but I couldn't find why Json serializer is behaving differently when it sees [Serializable] attribute.
If the Jason serializer doesn't serialise members and only serialise properties then why does it behave differently when a class is decorated with [Serializable] attribute?
Please note I'm not looking for a way to fix this issue as I have already found that. I would like to know why Newtonsoft.Jsonserialiser behaves differently here.
In case someone wants to find the reason in the future, following explains how objects are serialised by Json.Net:
Breakdown of Type Serialization > Objects
By default a type's properties are serialized in opt-out mode. What
that means is that all public fields and properties with getters are
automatically serialized to JSON, and fields and properties that
shouldn't be serialized are opted-out by placing JsonIgnoreAttribute
on them. To serialize private members, the JsonPropertyAttribute can
be placed on private fields and properties.
Types can also be serialized using opt-in mode. Only properties and
fields that have a JsonPropertyAttribute or DataMemberAttribute on
them will be serialized. Opt-in mode for an object is specified by
placing the JsonObjectAttribute or DataContractAttribute on the type.
Finally, types can be serialized using a fields mode. All fields, both
public and private, are serialized and properties are ignored. This
can be specified by setting MemberSerialization.Fields on a type with
the JsonObjectAttribute or by using the .NET SerializableAttribute and
setting IgnoreSerializableAttribute on DefaultContractResolver to
false.

Does entry to DynamoDB depends on the model class of you application?

I have a model class which has four member variables like this:
A.java
1.Attribute-1
2.Attribute-2
3.Attribute-3
4.Attribute-4
Now I make entries to the DynamoDB and the entries go successful and I can see the entries going.
Now I make few changes in the model and add 2 more attributes.
5.Attribute-5
6.Attribute-6
And in the application I am setting the values of these 2 attributes there.
Now when I try to insert some entry into the application then I am getting this error.
com.amazonaws.services.dynamodbv2.model.AmazonDynamoDBException: The provided key element does not match the schema (Service: AmazonDynamoDBv2; Status Code: 400; Error Code: ValidationException;
What is the error
I believe you are using DynamoDBMapper class in AWS SDK JAVA with save() method.
1) Firstly, yes, you need to set the key values in the model object when you perform the update on existing item. save() performs either create or update the item
2) Secondly, save method has a save behavior config. You need to set the behavior accordingly based on your use case
public void save(T object,
DynamoDBSaveExpression saveExpression,
DynamoDBMapperConfig config)
UPDATE (default) : UPDATE will not affect unmodeled attributes on a
save operation and a null value for the modeled attribute will remove
it from that item in DynamoDB. Because of the limitation of updateItem
request, the implementation of UPDATE will send a putItem request when
a key-only object is being saved, and it will send another updateItem
request if the given key(s) already exists in the table.
UPDATE_SKIP_NULL_ATTRIBUTES : Similar to UPDATE except that it ignores
any null value attribute(s) and will NOT remove them from that item in
DynamoDB. It also guarantees to send only one single updateItem
request, no matter the object is key-only or not.
CLOBBER : CLOBBER
will clear and replace all attributes, included unmodeled ones,
(delete and recreate) on save. Versioned field constraints will also
be disregarded. Any options specified in the saveExpression parameter
will be overlaid on any constraints due to versioned attributes.
Reference link
Sample Code:-
Movies movies = new Movies();
//setting the partition and sort key
movies.setYearKey(1999);
movies.setTitle("MyMovie BOOL");
//New attribute added
movies.setProducts(Stream.of("prod1").collect(Collectors.toSet()));
DynamoDBMapper dynamoDBMapper = new DynamoDBMapper(dynamoDBClient);
//Set the save behavior, so that it wouldn't impact the existing attributes. Refer the full definition above
dynamoDBMapper.save(movies, SaveBehavior.UPDATE_SKIP_NULL_ATTRIBUTES.config());

How to taken push view object into next view in flex

My problem is that when I try to pass an object from the navigator.pushView(view, dataobject), I can't figure out how to access the dataobject from actionscript. I can access {dataobject.property} from MXML easily, but I want to set a variable in the new view to the passed dataobjects property.
You have the passed object available in 'data' property. You can easily set your new local variable in activateHandler as:
var myVar:String = data.myPassedVar;

Resources