Exchange Web Service Managed API: How to get Task from E-Mail? - c#

I am using EWS to get some E-Mails, everything works fine but now i have to implement the "CompleteDate" which is set when someone uses this Red Flag in Outlook to set it to a Task.
I searched everything but i dont find a way to get the task from the E-Mail.. i tried to bind the Mail as a Task but id didnt work:
Task task = Task.Bind(service, item.Id);
Could anyone help me out here?

What can help is make use of IlSpy for viewing the DLL.
A other great tool is EWSEditor. Its free and you can use it to read items based on EWS.
A e-mail cant be a task, you dont have the properties for the task.
To get the task you need to search by subject.
See example: http://code.msdn.microsoft.com/Exchange-2013-Find-tasks-0d2633ec
(With coding example)

Related

Generating text from scheduled task

I currently write a PowerShell script for monitoring the scheduled tasks from the Windows task scheduler. I got everything to work except the description message for the triggers. I need the Windows generated text that is displayed in the task Scheduler. I can use C# or PowerShell to do this, but I haven't found a way to get this message and I have not enough time to write a generator myself.
Do you guys know a way to do this?
Thank you!
You are looking for Get-ScheduledTaskInfo: link
Syntax:
Get-ScheduledTaskInfo
[-TaskName] <String>
[[-TaskPath] <String>]
[-CimSession <CimSession[]>]
[-ThrottleLimit <Int32>]
[-AsJob]
[<CommonParameters>]
Using the cmdlet without parameters will show all running scheduled task and their information.

Plugin.InAppBilling.PurchaseAsync never returns

I am attempting to use the InAppBilling plugin to make purchases on Android and I am using the code described here: https://jamesmontemagno.github.io/InAppBillingPlugin/PurchaseNonConsumable.html
Everything seems to work correctly and I am able to complete the purchase. However the await PurchaseAsync call never returns after the purchase is complete. The purchase does go through, however, and if I later call the GetPurchasesAsync function, it shows that I do own the item.
Any ideas as to what I might be doing wrong would be appreciated.
Thanks.
I apparently did not read the documentation properly and was missing the OnActivityResult override in the MainActivity.

How do I cancel recent prints with printDocument.print() in C#?

I have a C# application that prints simple texts correctly with printDocument Class.
The problem is that I want to cancel recent print jobs or Remove them or Purge print queue, before call a new .print() function!
I don't know what I have to do that, it seems PrintDocument doesn't push print jobs onto printer queue! because I dont see any job there.
thanks for help to "clear recent print jobs created with printDocumnet.print()"
Ali.
You should be able to with WMI as long as you have the rights
http://sandit27.wordpress.com/2008/05/12/how-to-cancel-printing-in-c/
I did a lot of work with printers a while back and the way that I achieved most of the functionality I wanted was through PInvoke.
As the answer from #Tsukasa states you "can" use WMI but that's another nightmare that's very difficult to deal with if you plan on actually deploying your solution anywhere other than your own machine.
As I'd mentioned: my suggestion would be to look into PInvoke. Keep in mind though that it has been a number of years/.NET Framework versions since I've worked in the print industry so Microsoft may have released a more elegant, easy-to-use solution that is native to .NET.
Here is a list of Print Spooler functions from the MSDN
Basically what you're going to want to do if you go this route is this:
Find the named handle to the print device in the Registry. This can be done with the registry classes available in the .NET framework. The name of the printer to windows will start with a "#" (or two) followed by some garbled junk and then a GUID. The key where all your printers are installed in the registry is here:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Print\Printers
Call OpenPrinter with the printer name.
Call EnumJobs with the handle retrieved from OpenPrinter.
Call SetJob passing the Job Id retrieved from EnumJobs for the job you want to cancel. Be sure to pass the JOB_CONTROL_DELETE Flag to cancel the job.
Call ClosePrinter, passing the handle retrieved from OpenPrinter. Don't forget this step. Windows/The print spooler gets very cranky if you do.
Again I can't stress enough that there is most-likely a better, more .NET way to do this. I suggest exhausting your options there first.
Good luck.

C# progress bar and EdtFTPnet Bytestransferred event

Hello peeps at Stack Overflow, I have a problem that I've been trying to solve since a couple of days. I have a problem in which I want to display via a progress bar, the bytes transferred from the bytes total of a remote file over FTP.
On the documentation it has been written how to use the ftp events from the library using FTPConnection as an exemple, but i cant get it to work with the BytesTransferred event. I define the method into my code but where exactly or how exactly am i suppose to use it with the progressbar, or with the backgroundworker.reportProgress() method?
If anyone has already used it or if you can give me a tip on that, it would be really greatly appreciated. Ive been searching the forums, but the search function is just hell.
Thanks in advance! :)
Try using signalR (http://signalr.net/). It's a communications library for client+server when you need to keep the connection open for a long time, like chats or file uploads. On the server, I'd set a variable to session, or somewhere, indicating the progress, supposing the server knows the file size. I haven't used it, but it would be where I go for such tasks.

Spell check in winforms

In my win forms C# app, I want to be able to add spell check functionality. But, I want to do it my own way, and NOT use any other components. All I need is just an online service where I can send a request or something and it tells me whether or not the word i sent was spelled correctly.
Preferred but not required: The ability for that online service to also send back suggestions.
Personally, I wonder why you want only online access...what if you lose connection? Also, most online accesses come with restrictions.. which you might hit sooner than you think during debugging.
If you were to use WPF, I'd suggest using the SpellCheck Class.
Since you specified Windows.Forms, you might try the NetSpell library for offline access. You can also try and use Microsoft Word's spellchecker, but you might not have it installed on the machine (or use Linux & Mono)
If you persist on using online access, you can use Yahoo, as Giovanni Galbo says. It's been done in C# before.
A quick google search turned up this:
Search Web Services: Spelling Suggestion
This is not c#/.NET specific. Its a simple REST service provided by Yahoo!. It looks like they do limit you to 5,000 queries per day for free and I'm not sure if Yahoo! lets you upgrade to a pay service.

Categories

Resources