• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# INakoFuncCallInfo类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中INakoFuncCallInfo的典型用法代码示例。如果您正苦于以下问题:C# INakoFuncCallInfo类的具体用法?C# INakoFuncCallInfo怎么用?C# INakoFuncCallInfo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



INakoFuncCallInfo类属于命名空间,在下文中一共展示了INakoFuncCallInfo类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
 }
开发者ID:wnoguchi,项目名称:nadesiko2,代码行数:25,代码来源:NakoPluginArray.cs


示例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;
 }
开发者ID:wnoguchi,项目名称:nadesiko2,代码行数:9,代码来源:NakoPluginProcess.cs


示例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);
 }
开发者ID:wnoguchi,项目名称:nadesiko2,代码行数:9,代码来源:NakoPluginJSON.cs


示例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);
 }
开发者ID:wnoguchi,项目名称:nadesiko2,代码行数:11,代码来源:NakoPluginEval.cs


示例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;
 }
开发者ID:wnoguchi,项目名称:nadesiko2,代码行数:11,代码来源:NakoPluginProcess.cs


示例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;
        }
开发者ID:wnoguchi,项目名称:nadesiko2,代码行数:14,代码来源:NakoPluginJSON.cs


示例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;*/
 }
开发者ID:wnoguchi,项目名称:nadesiko2,代码行数:16,代码来源:NakoPluginPgsql.cs


示例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;
        }
开发者ID:wnoguchi,项目名称:nadesiko2,代码行数:16,代码来源:NakoPluginDialog.cs


示例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;
 }
开发者ID:wnoguchi,项目名称:nadesiko2,代码行数:20,代码来源:NakoPluginStream.cs


示例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);
 }
开发者ID:wnoguchi,项目名称:nadesiko2,代码行数:22,代码来源:NakoPluginSample.cs


示例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);
 }
开发者ID:wnoguchi,项目名称:nadesiko2,代码行数:11,代码来源:NakoPluginString.cs


示例12: _trim

 /// <summary>
 /// トリム
 /// </summary>
 /// <param name="info"></param>
 /// <returns></returns>
 private object _trim(INakoFuncCallInfo info)
 {
     string s = info.StackPopAsString();
     return s.Trim();
 }
开发者ID:wnoguchi,项目名称:nadesiko2,代码行数:10,代码来源:NakoPluginString.cs


示例13: _strpos

 private object _strpos(INakoFuncCallInfo info)
 {
     string s = info.StackPopAsString();
     string ss = info.StackPopAsString();
     int i = s.IndexOf(ss);
     return (i + 1); // 1からはじまるので
 }
开发者ID:wnoguchi,项目名称:nadesiko2,代码行数:7,代码来源:NakoPluginString.cs


示例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);
 }
开发者ID:wnoguchi,项目名称:nadesiko2,代码行数:11,代码来源:NakoPluginString.cs


示例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);
 }
开发者ID:wnoguchi,项目名称:nadesiko2,代码行数:12,代码来源:NakoPluginString.cs


示例16: _remove

 private object _remove(INakoFuncCallInfo info)
 {
     object sr = info.StackPop();
     int a = NadesikoPositionToCSPosition((int)info.StackPopAsInt());
     int b = (int)info.StackPopAsInt();
     object s = ((NakoVariable)sr).Body;
     object ret;
     if(s is string){
         ret = ((string)s).Remove(a,b);
     }else{
         ret = null;
     }
     ((NakoVariable)sr).SetBodyAutoType(ret);
     return null;
 }
开发者ID:wnoguchi,项目名称:nadesiko2,代码行数:15,代码来源:NakoPluginString.cs


示例17: _removeright

 private object _removeright(INakoFuncCallInfo info)
 {
     object sr = info.StackPop();
     int a = (int)info.StackPopAsInt();
     object s = ((NakoVariable)sr).Body;
     object ret;
     if(s is string){
         string _tmp = (string)s;
         ret = _tmp.Remove(_tmp.Length - a);
     }else{
         ret = null;
     }
     ((NakoVariable)sr).SetBodyAutoType(ret);
     return null;
 }
开发者ID:wnoguchi,项目名称:nadesiko2,代码行数:15,代码来源:NakoPluginString.cs


示例18: _explode

 private object _explode(INakoFuncCallInfo info)
 {
     string s = info.StackPopAsString();
     string a = info.StackPopAsString();
     string[] splitted = s.Split(new string[]{a},StringSplitOptions.None);
     NakoVarArray arr = info.CreateArray();
     for(int i=0;i<splitted.Length;i++){
         arr.SetValue(i,splitted[i]);
     }
     return arr;
 }
开发者ID:wnoguchi,项目名称:nadesiko2,代码行数:11,代码来源:NakoPluginString.cs


示例19: _replace_a

 /// <summary>
 /// 単置換
 /// </summary>
 /// <param name="info"></param>
 /// <returns></returns>
 private object _replace_a(INakoFuncCallInfo info)
 {
     string s = info.StackPopAsString();
     string search = info.StackPopAsString();
     string replace = info.StackPopAsString();
     int index = s.IndexOf(search);
     string pre = s.Substring(0,index);
     string post = s.Substring(index+search.Length);
     return pre + replace + post;
 }
开发者ID:wnoguchi,项目名称:nadesiko2,代码行数:15,代码来源:NakoPluginString.cs


示例20: _extract

 /// <summary>
 /// 文字抜き出す
 /// </summary>
 /// <param name="info"></param>
 /// <returns></returns>
 private object _extract(INakoFuncCallInfo info)
 {
     string s = info.StackPopAsString();
     int a = NadesikoPositionToCSPosition((int)info.StackPopAsInt());
     int cnt = (int)info.StackPopAsInt();
     return s.Substring(a,cnt);
 }
开发者ID:wnoguchi,项目名称:nadesiko2,代码行数:12,代码来源:NakoPluginString.cs



注:本文中的INakoFuncCallInfo类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# INamable类代码示例发布时间:2022-05-24
下一篇:
C# INakedObjectAdapter类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap