private bool SaveModel(EmptyModel model)
        {
            var greet = Models.Get <HelloModel>(Uri.Scheme("hello").Model("greeting"));

            greet.Greeting = "Anybody here?";

            InvokeChanged(greet, ChangingSource.Save);
            return(true);
        }
Exemple #2
0
        public static async Task <EmptyModelDTO> ConvertToDTO(Task <EmptyModel> emptyModel)
        {
            EmptyModel modle = await emptyModel;
            var        res   = new EmptyModelDTO()
            {
                ETag = modle.ETag
            };

            return(res);
        }
        public void SerializedPacket_WriteRead_EmptyPacket()
        {
            DataBuffer buffer = new DataBuffer();
            EmptyModel model  = new EmptyModel();

            model.WriteTo(buffer);
            buffer.Seek(0);

            model = new EmptyModel();
            model.ReadFrom(buffer);
        }
        public void AddSerializedDataAppendsDataToStringWhenSerializationReturnsEmptyJson()
        {
            var key   = Guid.NewGuid().ToString("N", CultureInfo.InvariantCulture);
            var value = new EmptyModel();

            var sut = new TimeoutException();

            sut.AddSerializedData(key, value);

            var actual = sut.Data[key].As <string>();

            _output.WriteLine("Stored data is: {0}", actual);

            actual.Should().Be(typeof(EmptyModel).FullName);
        }
Exemple #5
0
        static void Main(string[] args)
        {
            var       rand  = new Random();
            CodeTimer timer = new CodeTimer();

            timer.Initialize();

            EmptyModel model = new EmptyModel();

            Console.WriteLine(model == new EmptyModel());

            Console.WriteLine(model.Equals(1));

            Console.WriteLine("Hello World");

            Console.ReadKey(true);
        }
        public override async Task GetCustomers(EmptyModel request, IServerStreamWriter <CustomerModel> responseStream, ServerCallContext context)
        {
            var customers = new List <CustomerModel> {
                new CustomerModel {
                    Email = "*****@*****.**", Name = "Ike"
                },
                new CustomerModel {
                    Email = "*****@*****.**", Name = "Ola"
                },
                new CustomerModel {
                    Email = "*****@*****.**", Name = "Ife"
                },
            };

            foreach (var customer in customers)
            {
                await responseStream.WriteAsync(customer);
            }
        }
Exemple #7
0
 public HexViewerViewModel(IContainerExtension container) : base(container)
 {
     Model = new EmptyModel();
     View  = new HexViewer();
 }
Exemple #8
0
 private static string NewDeleteResultJson(string message, bool success = false, EmptyModel value = null)
 {
     return(JsonConvert.SerializeObject(new Result <EmptyModel>()
     {
         Message = message,
         Success = success,
         Value = value
     }));
 }
Exemple #9
0
 public StringOutputViewModel(IContainerExtension container) : base(container)
 {
     Model = new EmptyModel();
     View  = new StringOutputView();
 }
 private bool LoadModel(EmptyModel model) => true;
Exemple #11
0
        /**
         * This method executes a flightplan at a RPi connection. This basically means that the method does:
         * Get the proper information needed, like the RPi connection object and the Flightplan object.
         * Then it validates that you are connected to the RPi connection.
         * Then it formats the classes (found below this class), so that it is readable by the RPi backend.
         * It then starts a flight in this system.
         * Then it sends the flightplan to the RPi backend.
         * It then asks the RPi connection to execute the flightplan.
         */
        public bool HandFlightplanToRPiConnection(int receiverRPiConnectionId, string flightplanName, int priority)
        {
            this.rpiConDbService.DisconnectOldRPiConnections();
            this.UpdateLastTouch();
            Flightplan    fpToSend = this.fpService.GetFlightplan(flightplanName);
            RPiConnection receiverRPiConnection = this.GetRPiConnection(receiverRPiConnectionId);

            int uid = this.GetUserId();

            if (receiverRPiConnection.status == "disconnected")
            {
                Console.WriteLine("RPi not connected");
                return(false);
            }
            else if (receiverRPiConnection.userId != uid)
            {
                Console.WriteLine("You have no connections!");
                return(false);
            }

            FlightplanModelForJava flightplanModelForJava = new FlightplanModelForJava();

            flightplanModelForJava.created_at = fpToSend.createdAt;
            flightplanModelForJava.priority   = priority;
            flightplanModelForJava.commands   = new List <CommandModelForJava>();
            foreach (KeyValuePair <int, Command> entry in fpToSend.commands)
            {
                CommandModelForJava commandModelForJava = new CommandModelForJava();
                commandModelForJava.cmd_id     = entry.Value.CmdId;
                commandModelForJava.parameters = entry.Value.Params;
                flightplanModelForJava.commands.Insert(entry.Key, commandModelForJava);
            }

            // Start flight
            this.rpiConDbService.StartFlight(receiverRPiConnection.rowId, fpToSend.rowId, uid);

            string urlIpPort = "http://" + receiverRPiConnection.ip + ":" + receiverRPiConnection.port;

            string urlStoreFlightplan   = urlIpPort + "/api/flightplan/store/";
            string sendFlightplanResult = this.sendHttpService.SendPost(urlStoreFlightplan, ref flightplanModelForJava, receiverRPiConnection.password);

            if (!this.sendHttpService.DeserializeJsonString <bool>(sendFlightplanResult))
            {
                throw new TimeoutException("Could not send flightplan to RPi!");
            }

            // TODO: Log to flight that flightplan has been sent

            string     urlExecuteFlightplan = urlIpPort + "/api/flightplan/execute/";
            EmptyModel emptyModel           = new EmptyModel();
            string     executeFlightplan    = this.sendHttpService.SendPost(urlExecuteFlightplan, ref emptyModel, receiverRPiConnection.password);

            if (!this.sendHttpService.DeserializeJsonString <bool>(executeFlightplan))
            {
                throw new TimeoutException("Could not execute flightplan at RPi!");
            }

            // TODO: Log to flight that flightplan has been executed


            return(true);
        }
 public ActionResult Index()
 {
     var output = new EmptyModel();
     return View(output);
 }
 public ICryptoCodeGenerationTaskModel CreateAndSetModel()
 {
     Model = new EmptyModel();
     return(Model);
 }
Exemple #14
0
 public ApiResult <EmptyModel> PostEmptyModel(EmptyModel model)
 {
     return(GetApiResult(model));
 }
Exemple #15
0
 public TaskRunTestsViewModel(IContainerExtension container) : base(container)
 {
     Title = "Task Run Tests";
     Model = new EmptyModel();
     View  = new TaskRunTests();
 }
Exemple #16
0
        public void TestModelWithoutPropertiesPost()
        {
            var personModel = new EmptyModel();

            TestPost(personModel, "TestApi/PostEmptyModel", "Cannot convert data to multipart/form-data format. No data found.");
        }
Exemple #17
0
 public BitmapViewModel(IContainerExtension container) : base(container)
 {
     Model = new EmptyModel();
     View  = new BitmapView();
 }