本文整理汇总了C#中INakoFuncCallInfo类的典型用法代码示例。如果您正苦于以下问题:C# INakoFuncCallInfo类的具体用法?C# INakoFuncCallInfo怎么用?C# INakoFuncCallInfo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
INakoFuncCallInfo类属于命名空间,在下文中一共展示了INakoFuncCallInfo类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: _append
private object _append(INakoFuncCallInfo info)
{
object ary = info.StackPop(); // 参照渡しなので変数への参照が得られる
object s = info.StackPop();
if (!(ary is NakoVariable))
{
throw new NakoPluginRuntimeException("『追加』の引数がvariableではありません");
}
NakoVariable ary_link = (NakoVariable)ary;
if (ary_link.Body is NakoVarArray)
{
NakoVarArray arr = (NakoVarArray)ary_link.Body;
NakoVariable new_item = new NakoVariable();
new_item.SetBodyAutoType(s);
arr.Add(new_item);
}else if(ary_link.Body is string && (string)ary_link.Body==""){
NakoVarArray arr = new NakoVarArray();
NakoVariable new_item = new NakoVariable();
new_item.SetBodyAutoType(s);
arr.Add(new_item);
ary_link.SetBody(arr,NakoVarType.Array);
}
// 結果をセット
return null;
}
示例2: _abort
// Define Method
public object _abort(INakoFuncCallInfo info)
{
string s = info.StackPopAsString();
foreach(System.Diagnostics.Process p in System.Diagnostics.Process.GetProcessesByName(s)){
p.Kill();
}
return null;
}
示例3: _decode
public object _decode(INakoFuncCallInfo info)
{
string s = info.StackPopAsString();
var json = fastJSON.JSON.Instance.Parse(s);
NakoVarArray a = ArrayToNakoVarArray(json);
return a;
// System.Web.Script.Serialization.JavaScriptSerializer serializer = new System.Web.Script.Serialization.JavaScriptSerializer();
// object json = serializer.Deserialize<object>(s);
}
示例4: _eval
// Define Method
public Object _eval(INakoFuncCallInfo info)
{
string s = info.StackPopAsString();
NakoCompiler compiler = new NakoCompiler();
compiler.DirectSource = s;
NakoInterpreter runner = new NakoInterpreter(compiler.Codes);
runner.Run();
Console.WriteLine("EVALLOG=" + runner.PrintLog);
return runner.globalVar.GetValue(0);
}
示例5: _ps
public object _ps(INakoFuncCallInfo info)
{
NakoVarArray result = new NakoVarArray();
foreach(System.Diagnostics.Process p in System.Diagnostics.Process.GetProcesses()){
try{
result.SetValue(result.Count,p.ProcessName);
}catch(Exception e){
}
}
return result;
}
示例6: _encode
//Dictionary<string,object> objects = new Dictionary<string, object>();
public object _encode(INakoFuncCallInfo info)
{
object v = info.StackPop();
if(v is NakoVarArray){
NakoVarArray arr = (NakoVarArray)v;
object objects = NakoVarArrayToArray(arr);
return fastJSON.JSON.Instance.ToJSON(objects);
// JavaScriptSerializer serializer = new JavaScriptSerializer();
// string s = serializer.Serialize(objects);
}
return null;
}
示例7: _close
public object _close(INakoFuncCallInfo info)
{
object c = info.StackPop();
if(!(c is NpgsqlConnection)){
throw new NakoPluginArgmentException("connection not found");
}
NpgsqlConnection con = (NpgsqlConnection)c;
con.Close();
return null;
/* if(!(c is ADODB.Connection)){
throw new NakoPluginArgmentException("connection not found");
}
ADODB.Connection con = (ADODB.Connection)c;
con.Close();
return null;*/
}
示例8: _directoryDialog
public Object _directoryDialog(INakoFuncCallInfo info)
{
string s = info.StackPopAsString();
FolderBrowserDialog fbd = new FolderBrowserDialog();
//RootFolderには特殊フォルダしか指定できないのでとりあえずSelectedPathで代用
fbd.SelectedPath = s;
//ダイアログを表示する
if (fbd.ShowDialog() == DialogResult.OK)
{
//OKボタンがクリックされたとき
return fbd.SelectedPath;
}
return null;
}
示例9: _close
public object _close(INakoFuncCallInfo info)
{
object stream = info.StackPop();
if(stream is FileStream){
FileStream filestream = (FileStream)stream;
filestream.Close();
filestream.Dispose();
}
else if(stream is StreamReader){
StreamReader filestream = (StreamReader)stream;
filestream.Close();
filestream.Dispose();
}
else if(stream is StreamWriter){
StreamWriter filestream = (StreamWriter)stream;
filestream.Close();
filestream.Dispose();
}
return null;
}
示例10: _sample_addEx
public Object _sample_addEx(INakoFuncCallInfo info)
{
Object ar = info.StackPop();
Object b = info.StackPop();
if (!(ar is NakoVariable))
{
throw new ApplicationException("『接続!』の引数が変数ではありません");
}
Object a = ((NakoVariable)ar).Body;
Object c;
if (a is string && b is string)
{
c = (string)a + (string)b;
}
else
{
c = null;
}
// 結果をセット
((NakoVariable)ar).SetBodyAutoType(c);
return (c);
}
示例11: _zeroFill
/// <summary>
/// ゼロ埋め
/// </summary>
/// <param name="info"></param>
/// <returns></returns>
private object _zeroFill(INakoFuncCallInfo info)
{
long s = info.StackPopAsInt();
string l = info.StackPopAsInt().ToString();
return String.Format(@"{0:D"+l+"}",s);
}
示例12: _trim
/// <summary>
/// トリム
/// </summary>
/// <param name="info"></param>
/// <returns></returns>
private object _trim(INakoFuncCallInfo info)
{
string s = info.StackPopAsString();
return s.Trim();
}
示例13: _strpos
private object _strpos(INakoFuncCallInfo info)
{
string s = info.StackPopAsString();
string ss = info.StackPopAsString();
int i = s.IndexOf(ss);
return (i + 1); // 1からはじまるので
}
示例14: _right
/// <summary>
/// 右から部分文字列を返す
/// </summary>
/// <param name="info"></param>
/// <returns></returns>
private object _right(INakoFuncCallInfo info)
{
string s = info.StackPopAsString();
int len = (int)info.StackPopAsInt();
return s.Substring(s.Length-len);
}
示例15: _replace
/// <summary>
/// 置換
/// </summary>
/// <param name="info"></param>
/// <returns></returns>
private object _replace(INakoFuncCallInfo info)
{
string s = info.StackPopAsString();
string search = info.StackPopAsString();
string replace = info.StackPopAsString();
return s.Replace(search,replace);
}