I have these data transfer objects objects:
public class Report
{
public int Id { get; set; }
public int ProjectId { get; set; }
//and so on for many, many properties.
}
I don't want to write
public bool areEqual(Report a, Report b)
{
if (a.Id != b.Id) return false;
if (a.ProjectId != b.ProjectId) return false;
...
When I do this in dragstart event:
e.dataTransfer.setData('text/plain', 'text');
e.dataTransfer.setData('text/html', 'html');
e.dataTransfer.setData('application/x-bookmark', 'bookmark');
and this in drop event:
for (var i = 0; i < e.dataTransfer.types.length; i++) {
var type = e.dataTransfer.types[i];
console.log(type + ":" + ...
Hey all.
First of all some context:
I have a form, where I post back some objects that are automatically materialized into objects by MVCs built-in ModelBinder:
<input type="hidden" name="myobj[0].Id" />
<input type="text" name="myobj[0].Hours" />
<input type="hidden" name="myobj[1].Id" />
<input type="text" name="myobj[1].Hours" />
...
Trying to detect if files property is supported in DataTransfer Object using Javascript. The following code causes an "Uncaught ReferenceError: DataTransfer is not defined" in Chrome, but IE, Firefox and Safari are all fine.
My code is:
if ("files" in DataTransfer.prototype) {
alert("supported");
}
Any idea why or an alternative ...