![](/img/trans.png)
[英]I want to know if or how I can use the flag enum and return the enum parameter in another class
[英]I want to know the type of this value and how can I use it?
我正在為Camtasia創建一個SDK,並且正在用以下代碼查看此文件:
"backgroundColor" : [239, 0, 191, 255]
當然,我需要做的比這更多,但這基本上就是我正在做的。 我需要用c#創建相同的東西。 我無法執行此操作,因為它給了我一個錯誤:
jobject.Add("backgroundColor", [239, 0, 191, 255]);
但是,當我用雙引號將值引起來時,將其轉換為字符串時,該值將用雙引號引起來,如下所示:
"backgroundColor" : "[239, 0, 191, 255]"
但是我無法將值括在雙引號中,因為Camtasia無法讀取它,它需要在雙引號之外。
有人可以幫忙嗎? 如果需要,我將很樂意提供其他信息。
當用“”換行時-您正在傳遞字符串。 您需要傳遞數組:
jobject.Add("backgroundColor", new int[]{ 239, 0, 191, 255 });
使用一個JArray
string[] parameterNames = new string[] { "Test1", "Test2", "Test3" };
JArray jarrayObj = new JArray();
foreach (string parameterName in parameterNames)
{
jarrayObj.Add(parameterName);
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.