コード例 #1
0
 public FileWrapper(string path)         // : base(path)
 {
     _file = new File(path);
     //Thumbnail = new WeakThumbnail(path);
     //Thumbnail.SourceUpdated += () => { PropChanged(nameof(Thumbnail)); };
     Name = IoObject.GetName(path);
 }
コード例 #2
0
ファイル: IoCall.cs プロジェクト: MilkTool/io-clr
        public static IoObject slotCallMessage(IoObject target, IoObject locals, IoObject message)
        {
            // setSlot("A", Object clone do(setSlot("B", method(call message))))
            IoCall self = target as IoCall;

            return(self.msg);
        }
コード例 #3
0
 public FileWrapper(string path, string msgText) // : base(path)
 {
     _file = new File(path);
     //Thumbnail = new WeakThumbnail(path);
     //Thumbnail.SourceUpdated += () => { PropChanged(nameof(Thumbnail)); };
     Name = IoObject.GetName(path);
     Options.MessageOptions.MessageText = msgText;
 }
コード例 #4
0
ファイル: IoCall.cs プロジェクト: devaspot/io
 //public override IoObject clone(IoState state)
 //{
 //    IoObject proto = state.protoWithInitFunc(name);
 //    IoCall result = new IoCall();
 //    uniqueIdCounter++;
 //    result.uniqueId = uniqueIdCounter;
 //    result.state = state;
 //    result.createProtos();
 //    result.createSlots();
 //    result.protos.Add(proto);
 //    return result;
 //}
 public static IoObject with(IoState state, IoObject sender, IoObject target,
     IoObject message, IoObject slotContext, IoObject activated, IoObject coro)
 {
     IoCall call = IoCall.createObject(state);
     call.sender = sender;
     call.target = target;
     call.msg = message;
     call.slotContext = slotContext;
     call.activated = activated;
     call.coroutine = coro;
     call.stopStatus = IoCallStatus.MESSAGE_STOP_STATUS_NORMAL;
     return call;
 }
コード例 #5
0
ファイル: IoCall.cs プロジェクト: MilkTool/io-clr
        //public override IoObject clone(IoState state)
        //{
        //    IoObject proto = state.protoWithInitFunc(name);
        //    IoCall result = new IoCall();
        //    uniqueIdCounter++;
        //    result.uniqueId = uniqueIdCounter;
        //    result.state = state;
        //    result.createProtos();
        //    result.createSlots();
        //    result.protos.Add(proto);
        //    return result;
        //}

        public static IoObject with(IoState state, IoObject sender, IoObject target,
                                    IoObject message, IoObject slotContext, IoObject activated, IoObject coro)
        {
            IoCall call = IoCall.createObject(state);

            call.sender      = sender;
            call.target      = target;
            call.msg         = message;
            call.slotContext = slotContext;
            call.activated   = activated;
            call.coroutine   = coro;
            call.stopStatus  = IoCallStatus.MESSAGE_STOP_STATUS_NORMAL;
            return(call);
        }
コード例 #6
0
        public IResult Implement(ISynchronousContext context)
        {
            try
            {
                context.LogService.Info("Started restservice");

                string code = context.RequestBody;

                if (String.IsNullOrWhiteSpace(code))
                {
                    return(context.CreateErrorResult(500, "You must supply a body for the code"));
                }

                IoState state = new IoState();
                state.processBootstrap();

                IoObject returnValue = state.onDoCStringWithLabel(state.lobby, code.Trim(), "dotnet:");

                context.LogService.Info("Finished restservice");

                if (returnValue == null)
                {
                    return(context.CreateResult("Return value was null"));
                }

                if (returnValue is IoNumber)
                {
                    return(context.CreateResult((returnValue as IoNumber).asDouble()));
                }

                return(context.CreateResult(returnValue.ToString()));
            }
            catch (Exception e)
            {
                return(context.CreateErrorResult(500, e.Message));
            }
        }
コード例 #7
0
ファイル: IoCall.cs プロジェクト: devaspot/io
 public static IoObject slotTarget(IoObject target, IoObject locals, IoObject message)
 {
     IoCall self = target as IoCall;
     return self.target;
 }
コード例 #8
0
ファイル: IoCall.cs プロジェクト: devaspot/io
 public static IoObject slotSender(IoObject target, IoObject locals, IoObject message)
 {
     IoCall self = target as IoCall;
     return self.sender;
 }
コード例 #9
0
ファイル: IoCall.cs プロジェクト: devaspot/io
 public static IoObject slotCallMessage(IoObject target, IoObject locals, IoObject message)
 {
     // setSlot("A", Object clone do(setSlot("B", method(call message))))
     IoCall self = target as IoCall;
     return self.msg;
 }
コード例 #10
0
ファイル: IoCall.cs プロジェクト: MilkTool/io-clr
        public static IoObject slotTarget(IoObject target, IoObject locals, IoObject message)
        {
            IoCall self = target as IoCall;

            return(self.target);
        }
コード例 #11
0
ファイル: IoCall.cs プロジェクト: MilkTool/io-clr
        public static IoObject slotSender(IoObject target, IoObject locals, IoObject message)
        {
            IoCall self = target as IoCall;

            return(self.sender);
        }