I have an application running on a Janam XT2 handheld computer.
I have the scanner library piece for the Andriod project working fine. I wanted to be able to pass the scanned event to a viewmodel. I can't seem to figure out what I am doing wrong.
The setup is as follows
Using Prism, VS 2017, MVVM.
Shared Project containing barcode specific classes. Shared with Android project and an MVVM Module for my data.
I have a separate MVVM Module for my current UI.
In the android MainActivity I have a reference to the App instance which has a property of EventAggregator. When the scanner's Received event is fired in the Android application (MainActivity) I am Publishing a ScannerEvent.
This is working the way I think it should, but trying to Subscribe to that event in a ViewModel results in nothing.
Anyone have any ideas?
EDIT: in response to request in comment by Nkosi.
public ListViewBaseModel(IEventAggregator eventAggregator)
{
_eventAggregator = eventAggregator;
Warehouses = new ObservableCollectionFast<WarehouseListItem>(Client.GetAsync(new WarehouseListQuery() { CompanyID = "SPF", UseBins = 1 }).Result.Results);
_eventAggregator.GetEvent<BarcodeScannerEvent<ScanResults>>().Subscribe(BarcodeScanned);
}
public virtual void BarcodeScanned(ScanResults results)
{
}
If you create your event in a Shared Project, it will create a distinct type for each project referencing that (that's the nature of shared projects, they are like linked source files and will be added to the referencing assembly upon compilation).
This way, you create an event for the publisher and another event for the subscriber (even though they have the same name and look identical). Because the subscriber subscribes to a different event than the publisher publishes, the subscriber will not receive his event.
To resolve this, scrap the shared project and use a class library.
Related
Based on the documentation https://learn.microsoft.com/en-us/vsts/extend/overview?view=vsts#what-makes-up-an-extension, a VSTS extension can be used to extend the work item form.
However, I would like my extension to automatically create a new work item type once it is installed. Is this something that is possible? I can't find any documentation online that suggests how to do it.
Theoretically this is possible, the extension has a "first load" call which you can use to use the rest api to create a custom process or update the existing custom process. The REST Api to change processes isn't public yet, so you'll have to work from using fiddler to watch how the web ui does it.
Due to the way processes are linked to projects, all projects with that process will get the new work item type.
I could not find a lot of documentation online for this, but the VSS web extensions SDK(https://www.npmjs.com/package/vss-web-extension-sdk) has a REST client called 'ProcessDefinitionsRestClient' declared in the typings/tfs.d.ts file. This client has a createWorkItemType method available that looks like this:
createWorkItemType(workItemType: ProcessDefinitionsContracts.WorkItemTypeModel, processId: string): IPromise<ProcessDefinitionsContracts.WorkItemTypeModel>;.
The 'ProcessRestClient' client has methods to create a new/inherited process to which the new WIT can be added.
I have not tried it out yet, and these APIs are still in preview, but maybe they can get you started on the right path.
I am trying to build an app using flutter and I would like to know how to retrieve the proxy settings of the device through flutter.
It's probably safe to assume that the HttpClient doesn't pick this up automatically, but you might want to test that.
So, now you need to interact with native code using plugins. There is already a rich library of plugins providing everything from battery level to video player. I can't see proxy in there anywhere, so you need to write your own plugin (which is just one of the standard flutter project types: app, package (just Dart code allowed) and plugin). A plugin is a bit like a package (other projects can depend on it) but includes native code too. It also includes a mini-app so that you can test your plugin code while developing it.
Your plugin will end up being similar to the existing Connectivity plugin, so you may want to copy from there. In your Android method implementation you will replace
NetworkInfo info = manager.getActiveNetworkInfo();
with
ProxyInfo defaultProxy = manager.getDefaultProxy();
You have return two values, the host name and the port, so put these in a Map
Map<String, String> map = new HashMap<String, String>();
map.put("host", defaultProxy.getHost());
map.put("port", Integer.toString(defaultProxy.getPort()));
result.success(map);
Bonus points if you submit your changes to the Connectivity plugin.
I have read lots of differemt documentation about the launcher.openFile feature of eclipse. They contain information about how to add a listener for the SWT.OpenDocument event to react on files that were opened from outside. This always includes adding the listener inside the Application class of the eclipse product.
What i want to do is to add such a listener from within my plugin where i don't have an Application class at all. Is this possible?
When testing the SplitApp demo app provided with the 1.18.5 SAPUI5 SDK there seems to be a conflict between the routing and model binding. If you navigate to a detail page and then refresh the browser window the data binding fails. This would be the same as if you bookmarked the app on a specific view.
Just wondering if anyone knows why this is? Is it a conflict with routing and data binding? My debugging is not showing anything up yet only that the model is empty when the detail view loads.
This app uses the new Component-based router where you define your routes in the component metadata.
I've also written a small test app here js1972/test ยท GitHub (branch "routes") which does similar and has the same issue.
the following bookmark works with the fake service
../test-routes/#/detail/Categories(2)
../test-routes/#/detail/Categories(3)
doesnt
request.onSend in ODataModelFakeService.js doesnt cater for all scenarios
an alternative maybe to use sap.ui.core.util.MockServer with a cutdown metadata.xml and json files for the Category and Product entities
I've ran into the same issue and just want to share my findings and solution:
The detail view waits until the list in the master view is loaded. If the service you are using is quite slow the list has already finsihed loading, but the model has not finished loading and thus the detail view returns an error.
To fix this I've attached an "requestCompleted"-event to the model and created a jQuery.Deferred object for the model.
The master then waits for the resolve of the model.
oModel.attachEvent("requestCompleted",
function() {
this.oModelFinishedDeferred.resolve();
this.getEventBus().publish("Model",
"ModelFinished");}
, this);
I have tried
public sealed class WriteMessage : CodeActivity
{
protected override void Execute(CodeActivityContext context)
{
context.Track(new BuildInformationRecord<Foo>()
{
Value = FooInstance,
});
}
}
and
then found an overload on context.Track that accepts <T>
context.Track(FooInstance);
and neither one appears in the build viewer in visual studio.
context.TrackBuildMessage(string data) certainly does.
and I'm not getting any exception, is it being saved to the tfs data store, or a file? or is just silently failing entirely?
Reference to one of the resources implicating how this works or should work from the code side
it actually does make it its way to the datastore. Your instance is converted into a Dictionnary<String,String> by reflection on its properties (you may provide a type converter to Dictionnary<String,String> if you like) then stored as a build record into the database. Records are logically structured as a tree. You may retrieve this info through the TFS API.
You are using a new type for TFS which is "Foo". Thus, your info cannot yet be displayed on the build reports in Visual Studio because VS doesn't know how to represent it. You actually need to extend VS build reports with a custom addin that can convert this into WPF controls for rendering.
If you track a "BuildMessage", this is a well known type by VS, it will be displayed in the build log.
You may as well develop a Warehouse adapter to bring this data from the stored build reports to the TFS warehouse store (and also the TFS cube).
About adding custom info into the build :
http://blogs.msdn.com/b/patcarna/archive/2009/11/19/tfs-2010-customizing-build-information-part-2.aspx (and have a look at part 1)
My article on my blog in french (answers exactly your question, sorry, yeah... french) :
http://blogs.codes-sources.com/vlabz/archive/2011/09/24/tfs-2010-enrichir-les-donn-es-d-un-build.aspx
Hope this helps.
(I can't post more links at the moment since I'm a new user, contact me directly I'll send you nice URLs, or google for "Changing The Way Build Information IS Displayed")