How to edit a Comment value in Manatee.Trello? - c#

I have a comment I would like to be able to modify but I am not sure how to process.
Here is what I've tried so far :
using Manatee.Trello;
public class MyClass
{
//identification is done beforehand as per Manatee.Trello's wiki
Card c = new Card(existingCardID);
foreach(Action comment in card.Comments)
{
comment.Data.Value="empty comment";
}
}
However, Action.Data.Value only has get capabilities. What is the correct way to update a comment data using this library?

Updated!
action.Data.Text = "updated comment";
You'll likely get an error from Trello if the action isn't a comment.
I'll add a note in the wiki. I realize it's a bit hidden.
Edit... 2, I guess.
I've recently published Manatee.Trello v1.16.0 which resolves this bug. Use it as indicated above.

Related

Cannot Get Windows MR Controllers Unity Input

I tried using the following code from the official Windows documentation but I couldn't get the inputs from the controller.
if (Input.GetButton("Button 14 "))
{
// ...
}
How can I get the inputs from the Mixed Reality controllers?
https://developer.microsoft.com/en-us/windows/mixed-reality/gestures_and_motion_controllers_in_unity details that to get a key but its qualified name you use
if (Input.GetKey("name")) { ... }
For button14 you would use "joystick button 14".
Else try "button 14" since the documentation isn't clear which one will work.
I just googled and had a little research since I don't personally own this set of hardware to test, so I hope it works (otherwise I'll delete answer).

Xamarin says "Allow Multiple Bind To Same Port only allowed on Windows". What do I do?

I'm trying to use SocketLite.PCL with my iOS/Android solution in Xamarin,
but I get the message Allow Multiple Bind To Same Port only allowed on Windows when running it.
What does it mean and how do I fix it?
EDIT:
Example code I'm using can be found here: https://github.com/1iveowl/SocketLite.PCL
I put the following code inside rotected async override void OnStart(){} of the app:
var udpReceived = new UdpSocketReceiver();
await udpReceived.StartListeningAsync(4992, allowMultipleBindToSamePort: true);
var udpMessageSubscriber = udpReceived.ObservableMessages.Subscribe(
msg =>
{
System.Console.WriteLine($"Remote adrres: {msg.RemoteAddress}");
System.Console.WriteLine($"Remote port: {msg.RemotePort}");
var str = System.Text.Encoding.UTF8.GetString(msg.ByteData);
System.Console.WriteLine($"Messsage: {str}");
},
ex =>
{
// Exceptions received here
}
);
EDIT 2:
Ok, so setting allowMultipleBindToSamePort to false stopped that error.
Now I get the error Address already in use.
However I am still curious as to what allowMultipleBindToSamePort is used for.
As you can see in the new documentation:
IMPORTANT: Please notice that the parameter allowMultipleBindToSamePort will only work on Windows. On other platforms it should be set to false
About However I am still curious as to what allowMultipleBindToSamePort is used for.
There is a good and complete explanation on this post, you can read more in the following stackoverflow post

How to get all changes to a file in Git, with Lib2GitSharp

I want to be able to Get a list of all changes done to a file. I've seen this post
How to get file's contents on Git using LibGit2Sharp?, but this requires to start off with a commit. I want to start digging with the filename.
Also is this possible without getting the whole repo locally?
After a bit of research I think I found an answer.
/*Small test*/
using (Repository repo = new Repository(strLocalDeliveryPath))
{
var fileHistory = repo.Commits.QueryBy(#"Path/To/file.ini").ToList();
int i = fileHistory.Count();
}
This is in order newest to oldest, and that suits me fine. I would normally only need the latest version of the file content, but nor i have the option of digging through the history of the file.
You can see this answer for a bit more info, but yes, the functionality was added in libgit2sharp 0.22.0. Here's an example:
var fileHistory = repository.Commits.QueryBy(filePathRelativeToRepository);
foreach (var version in fileHistory)
{
// Get further details by inspecting version.Commit
}

Alchemy-Websockets - WebSocketClient Path

I'm new to stackoverflow.
I'm currently working on a WebSocket project and using a component called Alchemy-Websockets.
My question is when I trying to use Alchemy.WebSocketClient class like this :
var aClient = new WebSocketClient("ws://172.28.1.103:8100");
I got a FormatException error.
the documentation here :
http://alchemywebsockets.net/docs/class_alchemy_1_1_web_socket_client.html
didn't show any sample code.
so, could anyone gives me some help here?
TKS.
Jack here, maintainer of Alchemy. (We need to update our autogenerated docs.)
Try appending a channel to the end of your connection, like this:
var aClient = new WebSocketClient("ws://172.28.1.103:8100/channel");
Note the /channel on the end. The value can be anything. You can see an example in our integration tests: https://github.com/Olivine-Labs/Alchemy-Websockets/blob/master/test/Integration/Alchemy/ClientServer.cs

P4.NET - How to list user's workspaces?

I am not an expert in P4.NET plugin, but I would like to show the existing workspaces for a user in a combo box, so that I can set the p4.Client to the selected workspace.
using (var p4 = new P4Connection())
{
p4.Connect();
???
}
How do I get the list of existing workspaces?
I think the command line to achieve this would be
p4 clients -m 100 -u username
If P4.Net behaves similar to the official Perforce APIs, then you would likely want to run:
p4.Run("clients", "-m 100 -u username")
or similar. Inspired by the P4Ruby documentation.
Ok I have no choice than answering my own question, because the code would be too much to insert as comments to jhwist answer. Sorry jhwist. I had no choice.
#appinger, I hope you find this answer helpful. Took me hours to figure out this api working. :)
cmbBoxPerforceWorkspaceLocation is just your combobox for your workspaces. I am using Winforms by the way.
I need to extract a shortname from the windows username. Windows username starts usually with xxxx\\username. In my code I extract the username out of the longname and save it as shortname. If your network is set differently this code might have to change accordingly.
Let me know if it worked for you.
using (var p4 = new P4Connection())
{
p4.Connect();
var longName = WindowsIdentity.GetCurrent().Name;
var shortname = longName.Substring(longName.IndexOf("\\") + 1);
var records = p4.Run("clients", "-u", shortname);
cmbBoxPerforceWorkspaceLocation.Items.Clear();
foreach (P4Record record in records.Records)
{
cmbBoxPerforceWorkspaceLocation.Items.Add(record["client"]);
}
}
P4.Net is designed to be similar to the scripting APIs, which in turn are designed around the command line interface. It definitely does not have a intuitive object-oriented interface... which is off putting at first. But if you start from the command-line (esp -ztag flag) and piece together all data/actions your app needs, you will find it pretty easy to use P4.Net. And since it's similar to all the scripting APIs, you'll find it natural to pickup Python or Ruby if you wish :-)

Categories