public static bool UploadFileOnServer(DataImage dataImage)
        {
            HttpPostedFileBase objFile     = (HttpPostedFileBase) new MemoryPostedFile(dataImage.Multimedia);
            String             UploadImage = String.Format("{0}/{1}/{2}", "ftp://made.corporativorilea.com.mx", "ImagesLanding", dataImage.Description);
            FtpWebRequest      request     = (FtpWebRequest)WebRequest.Create(UploadImage);

            request.Credentials = new NetworkCredential("made", "n#65sl6P");
            request.Proxy       = null;
            request.KeepAlive   = true;
            request.UseBinary   = true;
            request.Method      = WebRequestMethods.Ftp.UploadFile;

            byte[] fileContents = dataImage.Multimedia;

            request.ContentLength = fileContents.Length;
            Stream requestStream = request.GetRequestStream();

            requestStream.Write(fileContents, 0, fileContents.Length);
            requestStream.Close();

            FtpWebResponse responseFtp = (FtpWebResponse)request.GetResponse();

            Debug.WriteLine("Upload File Complete, status {0}", responseFtp.StatusDescription);
            return(true);
        }
Exemplo n.º 2
0
        public static string GetExtension(DataImage image)
        {
            var extension = "";

            switch (image.MimeType)
            {
            case "image/jpeg":
                extension = ".jpeg";
                break;

            case "image/jpg":
                extension = ".jpg";
                break;

            case "image/gif":
                extension = ".gif";
                break;

            case "image/png":
                extension = ".png";
                break;
            }

            return(extension);
        }
        public Respuesta UpdateDataImage([FromBody] DataImage dataImage)

        {
            Respuesta respuesta = new Respuesta();
            ResponseTemplateElements response = new ResponseTemplateElements();

            respuesta.resultado = 0;

            //respuesta.mensaje = Tools.VerifyToken(new Token() { usuario = USER, token = TOKEN }, 0);

            //if (respuesta.mensaje != "1") { return respuesta; }
            Uri url = new Uri($"ftp://made.corporativorilea.com.mx/ImagesLanding/{dataImage.UrlOld}");

            DeleteFileOnServer(url);

            UploadFileOnServer(dataImage);


            try
            {
                using (SqlConnection connection = new SqlConnection(ConfigurationManager.ConnectionStrings["APIDB"].ConnectionString))
                {
                    connection.Open();
                    SqlTransaction transaction = connection.BeginTransaction();


                    SqlCommand cmd = new SqlCommand("dbo.UpdateTemplateElement", connection, transaction);
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("@Id", dataImage.id);
                    cmd.Parameters.AddWithValue("@IdLanding", dataImage.id_landing);
                    cmd.Parameters.AddWithValue("@IdElement", dataImage.id_element);
                    cmd.Parameters.AddWithValue("@Content", dataImage.content);


                    cmd.ExecuteNonQuery();
                    response.id         = dataImage.id;
                    response.id_element = dataImage.id_element;
                    response.id_landing = dataImage.id_landing;
                    response.content    = dataImage.content;
                    //response.content = $"http://made.corporativorilea.com.mx/ImagesLanding/{dataImage.Description}";

                    transaction.Commit();

                    respuesta.resultado = 1;
                    respuesta.mensaje   = "Operación exitosa";
                    respuesta.data      = response;
                }
            }
            catch (Exception ex)
            {
                respuesta.resultado = 0;
                respuesta.mensaje   = ex.Message;
                respuesta.data      = ex;
            }
            return(respuesta);
        }
Exemplo n.º 4
0
        private async void PickImg_Click(object sender, RoutedEventArgs e)
        {
            var temp = await DataImage.GetImagePicker().PickSingleFileAsync();

            if (temp != null)
            {
                Img = temp;
                ImgFileName.Text = Img.Name;
            }
        }
    // Token: 0x06000826 RID: 2086 RVA: 0x00022A0C File Offset: 0x00020E0C
    public void Load(string name, JSONNode json)
    {
        this.TID = name;
        DataImage image = DataManager.Instance.dataImageGroup.GetImage(this.TID);

        this.price        = image.price;
        this.canvasLength = image.canvasLength;
        this.tag          = json["tag"];
        JSONNode jsonnode = json["colorRank"];
        int      count    = jsonnode.Count;

        for (int i = 1; i <= count; i++)
        {
            DataTiles.ColorTile colorTile = new DataTiles.ColorTile();
            colorTile.trueColor = new Color(0f, 0f, 0f, 1f);
            colorTile.greyColor = new Color(0f, 0f, 0f, 1f);
            colorTile.count     = 0;
            string   aKey      = i + string.Empty;
            JSONNode jsonnode2 = jsonnode[aKey];
            colorTile.trueColor.r = (float)jsonnode2[0].AsInt / 255f;
            colorTile.trueColor.g = (float)jsonnode2[1].AsInt / 255f;
            colorTile.trueColor.b = (float)jsonnode2[2].AsInt / 255f;
            float greyscaleWeight  = DataManager.Instance.dataConfig.greyscaleWeight;
            float greyscaleWeight2 = DataManager.Instance.dataConfig.greyscaleWeight2;
            float greyValue        = ColorHelper.GetGreyValue(colorTile.trueColor, greyscaleWeight, greyscaleWeight2);
            colorTile.greyColor.r = greyValue;
            colorTile.greyColor.g = greyValue;
            colorTile.greyColor.b = greyValue;
            this._colorRank.Add(i, colorTile);
        }
        JSONNode jsonnode3 = json["dataList"];

        foreach (JSONNode jsonnode4 in jsonnode3.Childs)
        {
            DataTiles.DataTile dataTile = new DataTiles.DataTile();
            dataTile.Init();
            dataTile.indexX     = jsonnode4[0].AsInt;
            dataTile.indexY     = jsonnode4[1].AsInt;
            dataTile.colorIndex = JsonReader.Int(jsonnode4[2]);
            if (dataTile.colorIndex == 0)
            {
                dataTile.isWhite             = true;
                dataTile.colorTile           = new DataTiles.ColorTile();
                dataTile.colorTile.trueColor = Color.white;
                dataTile.colorTile.greyColor = Color.white;
            }
            else
            {
                this._colorRank.TryGetValue(dataTile.colorIndex, out dataTile.colorTile);
                this._colorRank[dataTile.colorIndex].count++;
            }
            string key = dataTile.indexX + "_" + dataTile.indexY;
            this._dataTileDic.Add(key, dataTile);
        }
    }
Exemplo n.º 6
0
    // Token: 0x06000A2E RID: 2606 RVA: 0x0002C1DC File Offset: 0x0002A5DC
    private void AddThumb(string TID, int n)
    {
        GameObject gameObject = this.item0;

        if (n == 1)
        {
            gameObject = this.item1;
        }
        GameObject gameObject2 = gameObject.transform.Find("ThumbVip").gameObject;
        Dictionary <string, DataTiles> dicDataTiles = DataManager.Instance.dataTilesGroup.dicDataTiles;
        DataTiles dataTiles;

        dicDataTiles.TryGetValue(TID, out dataTiles);
        if (dataTiles != null)
        {
            if (dataTiles.price == 0)
            {
                gameObject2.SetActive(false);
            }
            else
            {
                gameObject2.SetActive(true);
            }
        }
        GameObject gameObject3      = gameObject.transform.Find("ThumbFinish").gameObject;
        GameObject gameObject4      = gameObject.transform.Find("ThumbNew").gameObject;
        bool       onePictureFinish = PlayerManager.Instance.GetOnePictureFinish(TID);

        if (onePictureFinish)
        {
            gameObject3.SetActive(true);
            gameObject4.SetActive(false);
        }
        else
        {
            gameObject3.SetActive(false);
            DataImage image = DataManager.Instance.dataImageGroup.GetImage(TID);
            if (image.isDailyNew)
            {
                gameObject4.SetActive(true);
            }
            else
            {
                gameObject4.SetActive(false);
            }
        }
        if (n == 0)
        {
            this.LoadImage0();
        }
        else
        {
            this.LoadImage1();
        }
    }
Exemplo n.º 7
0
        private void addFolderToolStripMenuItem_Click(object sender, EventArgs e)
        {
            folderBrowserDialog1.ShowDialog();

            var fold = folderBrowserDialog1.SelectedPath;

            foreach (var f in new DirectoryInfo(fold).GetFiles())
            {
                var n_img = new DataImage(f.FullName, ImgW, ImgH);
                Imgs.Add(n_img);
                Console.WriteLine("Loaded:" + f.Name);
            }
        }
    // Token: 0x06000801 RID: 2049 RVA: 0x000220E0 File Offset: 0x000204E0
    public void UpdateOtherCategory()
    {
        int count = this._picList.Count;

        for (int i = count - 1; i >= 0; i--)
        {
            string    text  = this._picList[i];
            DataImage image = DataManager.Instance.dataImageGroup.GetImage(text);
            if (!image.isCanShow)
            {
                this._picList.Remove(text);
            }
        }
    }
Exemplo n.º 9
0
        public EditorImage AddImage(string fileName)
        {
            DataImage dImg = new DataImage
            {
                File  = fileName,
                Boxes = new List <DataBox>()
            };

            EditorImage edImg = new EditorImage(dImg);

            DlibObject.Images.Add(dImg);
            Images.Add(edImg);

            return(edImg);
        }
Exemplo n.º 10
0
        public IHttpActionResult Upload(DataModel data)
        {
            try
            {
                var img     = "";
                var image   = DataImage.TryParse(data.ImageBase64);
                var replace = image.RawData;
                if (replace != null)
                {
                    var guid      = Guid.NewGuid().ToString();
                    var extension = Utils.GetExtension(image);
                    img = guid + extension;
                }

                var    password = ConfigurationManager.AppSettings["Key"] ?? "";
                string file1List;
                if (replace != null)
                {
                    var filePath       = HttpContext.Current.Server.MapPath("~/" + img);
                    var filePathResult = HttpContext.Current.Server.MapPath("~/NewImage/" + img);

                    file1List = data.IsExtraction
                        ? Utils.Hide2(data, image.Image, filePath, password, filePathResult)
                        : Utils.Extract2(image.Image, password, filePathResult);

                    var fileInfo = new FileInfo(filePathResult);


                    return(Ok(new
                    {
                        path = data.IsExtraction ? "~/NewImage/" + img : img,
                        data = file1List,
                        base64 = data.IsExtraction ? Convert.ToBase64String(File.ReadAllBytes(filePath)) : ""
                    }));
                }

                file1List = null;
                return(BadRequest("File Not Found"));
            }
            catch (FileNotFoundException ex)
            {
                return(BadRequest("File Not Found"));
            }
            catch (Exception ex)
            {
                return(BadRequest(ex.Message));
            }
        }
Exemplo n.º 11
0
    // Token: 0x06000811 RID: 2065 RVA: 0x00022440 File Offset: 0x00020840
    private void Load(string name)
    {
        string fileName = "DataConfig/" + name + ".json";

        byte[]   bytes         = ResourceHelper.QueryFileContent(fileName);
        string   aJSON         = StringHelper.ReadFromBytes(bytes);
        JSONNode jsonnode      = JSON.Parse(aJSON);
        int      pictureAmount = DataManager.Instance.dataConfig.pictureAmount;

        for (int i = 0; i < pictureAmount; i++)
        {
            string    text      = string.Format("{0:D4}", i + 1);
            JSONNode  json      = jsonnode[text];
            DataImage dataImage = new DataImage();
            dataImage.Load(json);
            this._dicImages.Add(text, dataImage);
        }
    }
    // Token: 0x06000833 RID: 2099 RVA: 0x00022F0C File Offset: 0x0002130C
    private void CreateDailyImage()
    {
        DataCategory dataCategory = DataManager.Instance.dataDirectoryGroup.dataCategoryList[0];

        foreach (string text in dataCategory.picList)
        {
            DataImage     image = DataManager.Instance.dataImageGroup.GetImage(text);
            List <string> list;
            this._dicDailyImage.TryGetValue(image.date, out list);
            if (list == null)
            {
                list = new List <string>();
                this._dicDailyImage.Add(image.date, list);
            }
            list.Add(text);
            this._maxDateStr = TimeHelper.MaxDateDayStr(image.date, this._maxDateStr);
        }
        this._isExpired = TimeHelper.IsExpiredDay(this._maxDateStr);
    }
Exemplo n.º 13
0
    // Token: 0x06000A23 RID: 2595 RVA: 0x0002BCAC File Offset: 0x0002A0AC
    public void Init(string TID)
    {
        this._TID = TID;
        Dictionary <string, DataTiles> dicDataTiles = DataManager.Instance.dataTilesGroup.dicDataTiles;
        DataTiles dataTiles;

        dicDataTiles.TryGetValue(this._TID, out dataTiles);
        if (dataTiles != null)
        {
            if (dataTiles.price == 0)
            {
                this._isVip = false;
            }
            else
            {
                this._isVip = true;
            }
        }
        this.AddThumb(this._TID);
        if (this._isVip)
        {
            this.AddThumbVip();
        }
        this._isFinish = PlayerManager.Instance.GetOnePictureFinish(this._TID);
        if (this._isFinish)
        {
            this.AddThumbFinish();
        }
        else
        {
            DataImage image = DataManager.Instance.dataImageGroup.GetImage(this._TID);
            if (image.isDailyNew)
            {
                this.AddThumbNew();
            }
        }
        Button component = base.gameObject.GetComponent <Button>();

        component.onClick.AddListener(delegate
        {
            this.OnCellClick(base.gameObject);
        });
    }
Exemplo n.º 14
0
        static void Save(string dataPath, string GameName, string Rating, string Playtime, string Style, string Status)
        {
            List <DataImage> dataImageList = new List <DataImage>();
            DataImage        dataImage     = new DataImage();

            string json;

            if (new FileInfo(dataPath).Length == 0)
            {
                //Console.WriteLine("File's empty");

                dataImage.GameName = GameName;
                dataImage.Rating   = Convert.ToInt32(Rating);
                dataImage.Playtime = Convert.ToInt32(Playtime);
                dataImage.Style    = Style;
                dataImage.Status   = Status;

                dataImageList.Add(dataImage);

                json = JsonConvert.SerializeObject(dataImageList);
                File.WriteAllText(dataPath, json);
            }
            else
            {
                //Console.WriteLine("File's not empty");

                dataImage.GameName = GameName;
                dataImage.Rating   = Convert.ToInt32(Rating);
                dataImage.Playtime = Convert.ToInt32(Playtime);
                dataImage.Style    = Style;
                dataImage.Status   = Status;

                dataImageList = JsonConvert.DeserializeObject <List <DataImage> >(File.ReadAllText(dataPath));
                dataImageList.Add(dataImage);

                json = JsonConvert.SerializeObject(dataImageList);
                File.WriteAllText(dataPath, json);
            }
        }
Exemplo n.º 15
0
        public async void Validate(object sender)
        {
            TextBlock txt = new TextBlock();

            if (ImgName.Text == "")
            {
                txt.Text       = "Veuillez renseigner un nom.";
                txt.Foreground = (Application.Current as App).Resources["CloVisOrange"] as SolidColorBrush;
            }
            else if (Index.Find(ImgName.Text) != null)
            {
                txt.Text       = "Ce nom est déjà utilisé pour un autre élément.";
                txt.Foreground = (Application.Current as App).Resources["CloVisOrange"] as SolidColorBrush;
            }
            else if (Img == null)
            {
                txt.Text       = "Veuillez selectionner une image.";
                txt.Foreground = (Application.Current as App).Resources["CloVisOrange"] as SolidColorBrush;
            }
            else if (await DataImage.IsImageFilePresent(ImgName.Text))
            {
                txt.Text       = "Il existe déjà une image portant ce nom.";
                txt.Foreground = (Application.Current as App).Resources["CloVisOrange"] as SolidColorBrush;
            }
            else
            {
                new DataImage(ImgName.Text, Img);
                ImgName.Text = "";

                txt.Text = "Image ajoutée à Images.";
            }

            var fo = new Flyout()
            {
                Content = txt
            };

            fo.ShowAt(ImgName);
        }
Exemplo n.º 16
0
        public async Task <string> Add(DataImage base64Image)
        {
            if (base64Image.RawData.Length > _configuration.MaxSizeByte)
            {
                throw new ClientException("too-big-image");
            }
            else if (base64Image == null)
            {
                throw new ClientException("inc-photo-type", base64Image.ToString());
            }
            string       Id = null;
            MemoryStream ms = new MemoryStream();

            try
            {
                new ImageProcessor.ImageFactory()
                .Load(base64Image.RawData)
                .Constrain(_configuration.MaxSize)
                .Format(_configuration.Format)
                .Save(ms);
                Id = await _fileService.Add(Convert.ToBase64String(ms.ToArray()));

                await _imageGR.CreateAsync(new Image { FileId = Id, Type = _configuration.Format.MimeType });
            }
            catch (Exception)
            {
                if (Id != null)
                {
                    await _fileService.Remove(Id);
                }
                throw new ClientException("image-load-err");
            }
            finally
            {
                ms.Close();
            }
            return(Id);
        }
Exemplo n.º 17
0
        public Respuesta AddDataImage([FromBody] DataImage dataImage)

        {
            Respuesta respuesta = new Respuesta();
            ResponseTemplateElements response = new ResponseTemplateElements();

            respuesta.resultado = 0;

            //respuesta.mensaje = Tools.VerifyToken(new Token() { usuario = USER, token = TOKEN }, 0);

            //if (respuesta.mensaje != "1") { return respuesta; }
            HttpPostedFileBase objFile     = (HttpPostedFileBase) new MemoryPostedFile(dataImage.Multimedia);
            String             UploadImage = String.Format("{0}/{1}/{2}", "ftp://made.corporativorilea.com.mx", "ImagesLanding", dataImage.Description);
            FtpWebRequest      request     = (FtpWebRequest)WebRequest.Create(UploadImage);

            request.Credentials = new NetworkCredential("made", "n#65sl6P");
            request.Proxy       = null;
            request.KeepAlive   = true;
            request.UseBinary   = true;
            request.Method      = WebRequestMethods.Ftp.UploadFile;

            byte[] fileContents = dataImage.Multimedia;

            request.ContentLength = fileContents.Length;
            Stream requestStream = request.GetRequestStream();

            requestStream.Write(fileContents, 0, fileContents.Length);
            requestStream.Close();

            FtpWebResponse responseFtp = (FtpWebResponse)request.GetResponse();

            Debug.WriteLine("Upload File Complete, status {0}", responseFtp.StatusDescription);


            try
            {
                using (SqlConnection connection = new SqlConnection(ConfigurationManager.ConnectionStrings["APIDB"].ConnectionString))
                {
                    connection.Open();
                    SqlTransaction transaction = connection.BeginTransaction();


                    SqlCommand cmd = new SqlCommand("dbo.InsertTemplateElement", connection, transaction);
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("@IdLanding", dataImage.id_landing);
                    cmd.Parameters.AddWithValue("@IdElement", dataImage.id_element);
                    //cmd.Parameters.AddWithValue("@Content", $"made.corporativorilea.com.mx/ImagesLanding/{dataImage.Description}");
                    cmd.Parameters.AddWithValue("@Content", dataImage.content);
                    cmd.Parameters.Add(new SqlParameter("@Id", SqlDbType.Int)
                    {
                        Direction = ParameterDirection.ReturnValue
                    });

                    cmd.ExecuteNonQuery();
                    response.id         = (int)cmd.Parameters["@Id"].Value;
                    response.id_element = dataImage.id_element;
                    response.id_landing = dataImage.id_landing;
                    //response.content = $"http://made.corporativorilea.com.mx/ImagesLanding/{dataImage.Description}";
                    response.content = dataImage.content;

                    transaction.Commit();

                    respuesta.resultado = 1;
                    respuesta.mensaje   = "Operación exitosa";
                    respuesta.data      = response;
                }
            }
            catch (Exception ex)
            {
                respuesta.resultado = 0;
                respuesta.mensaje   = ex.Message;
                respuesta.data      = ex;
            }
            return(respuesta);
        }
Exemplo n.º 18
0
        public static Template GetTemplate_3()
        {
            var template = new Template("Green Peace");

            var fonts = new Fonts("Polices_cv")
            {
                new FontElement("Gadugi", 6, new Color()
                {
                    R = 120, G = 0, B = 0, A = 200
                }, false, false, false, false)                                                                              //italic, gras, souligné
            };

            var fonts_titre = new Fonts("Polices_cv")
            {
                new FontElement("Gadugi", 10, new Color()
                {
                    R = 120, G = 0, B = 0, A = 200
                }, false, false, false, false)                                                                               //italic, gras, souligné
            };

            var fonts_petit = new Fonts("Polices_cv")
            {
                new FontElement("Gadugi", 5, new Color()
                {
                    R = 120, G = 0, B = 0, A = 200
                }, false, false, false, false)                                                                              //italic, gras, souligné
            };

            var fonts_petit_droit = new Fonts("Polices_cv", Windows.UI.Xaml.TextAlignment.Right)
            {
                new FontElement("Gadugi", 5, new Color()
                {
                    R = 120, G = 0, B = 0, A = 200
                }, false, false, false, false)                                                                              //italic, gras, souligné
            };

            var fonts_tres_petit = new Fonts("Polices_cv", Windows.UI.Xaml.TextAlignment.Justify)
            {
                new FontElement("Gadugi", 4, new Color()
                {
                    R = 120, G = 0, B = 0, A = 200
                }, false, false, false, false)                                                                              //italic, gras, souligné
            };

            var fonts_langues = new Fonts("Polices_cv")
            {
                new FontElement("Gadugi", 6.5, new Color()
                {
                    R = 120, G = 0, B = 0, A = 200
                }, false, false, false, true),
                new FontElement("Gadugi", 1, new Color()
                {
                    R = 120, G = 0, B = 0, A = 0
                }, false, false, false, false)
            };

            var fonts_corps = new Fonts("Polices_cv", Windows.UI.Xaml.TextAlignment.Right)
            {
                new FontElement("Gadugi", 6.5, new Color()
                {
                    R = 120, G = 0, B = 0, A = 0
                }, false, false, false, true),
                new FontElement("Gadugi", 5, new Color()
                {
                    R = 120, G = 0, B = 0, A = 200
                }, false, false, false, false)
            };

            var fonts_normal = new Fonts("Polices_cv")
            {
                new FontElement("Gadugi", 6.5, new Color()
                {
                    R = 120, G = 0, B = 0, A = 200
                }, false, false, false, false),
                new FontElement("Gadugi", 5, new Color()
                {
                    R = 120, G = 0, B = 0, A = 200
                }, false, false, false, false)
            };

            var boite_diplomes = new BoxText(8, 170, 20, 193, 64, 0, "Diplômes", fonts_normal);
            var boite_études   = new BoxText(8, 200, 20, 193, 64, 0, "Études", fonts_normal);
            var boite_pro      = new BoxText(8, 220, 20, 193, 64, 0, "Expériences professionnelles", fonts_normal);

            var boite_coordonnées2 = new BoxText(134, 45, 20, 67, 30, 0, "Coordonnées", fonts_corps);
            var boite_coordonnées  = new BoxText(157, 38, 20, 67, 52, 0, "Coordonnées", fonts_langues);

            //var boite_coordonnées1 = new BoxText(134, 52, 20, 67, 52, 0, "Nom", fonts_petit_droit);
            //var boite_coordonnées2 = new BoxText(134, 59, 20, 67, 52, 0, "Téléphone", fonts_petit_droit);
            //var boite_coordonnées3= new BoxText(134, 66, 20, 67, 52, 0, "Mél", fonts_petit_droit);

            var boite_langues  = new BoxText(172, 90, 10, 49, 28, 0, "Langues", fonts_langues);
            var boite_langue_1 = new BoxText(144, 108, 10, 29, 28, 0, "Langue 1", fonts_petit);
            var boite_langue_2 = new BoxText(144, 116, 10, 29, 28, 0, "Langue 2", fonts_petit);
            var boite_langue_3 = new BoxText(144, 124, 10, 29, 28, 0, "Langue 3", fonts_petit);
            var boite_langue_4 = new BoxText(144, 132, 10, 29, 28, 0, "Langue 4", fonts_petit);

            var boite_d_obj  = new BoxText(8, 38, 60, 70, 40, 0, "Mon Objectif", fonts_langues);
            var boite_d_obj2 = new BoxText(7, 52, 60, 70, 40, 0, "obj", fonts_tres_petit);


            var boite_compétence_1 = new BoxText(7, 107, 10, 29, 28, 0, "Politique", fonts_petit);
            var boite_compétence_2 = new BoxText(7, 115, 10, 29, 28, 0, "Meurtre", fonts_petit);
            var boite_compétence_3 = new BoxText(7, 123, 10, 29, 28, 0, "Mariage", fonts_petit);
            var boite_compétence_4 = new BoxText(7, 131, 10, 29, 28, 0, "Ruse", fonts_petit);

            var boite_nom         = new BoxText(88, 12, 20, 81, 15, 0, "Nom", fonts_titre);
            var boite_profession  = new BoxText(84, 33, 0, 81, 20, 0, "Profession");
            var boite_competences = new BoxText(7, 90, 0, 50, 64, 0, "Compétences", fonts_langues);

            var img         = new DataImage("profile", true);
            var boite_photo = new BoxBackground(105 - 50 / 2, 90 + 5, 50, 40, 40, 0, BoxBackgroundShape.Ellipse)
            {
                Image = img
            };

            var fond = new BoxBackground(0, 0, 0, 210, 297, 0)
            {
                Image = new DataImage("Temp3_-_fond", true)
            };

            template.Layout = new Layout();
            template.Fonts  = fonts;
            template.Layout.AddTextBox(boite_coordonnées2);
            template.Layout.AddTextBox(boite_coordonnées);

            //template.Layout.AddTextBox(boite_coordonnées1);
            //template.Layout.AddTextBox(boite_coordonnées2);
            //template.Layout.AddTextBox(boite_coordonnées3);
            template.Layout.AddTextBox(boite_diplomes);
            template.Layout.AddTextBox(boite_études);
            template.Layout.AddTextBox(boite_pro);
            template.Layout.AddTextBox(boite_langues);
            template.Layout.AddTextBox(boite_langue_1);
            template.Layout.AddTextBox(boite_langue_2);
            template.Layout.AddTextBox(boite_langue_3);
            template.Layout.AddTextBox(boite_langue_4);
            template.Layout.AddTextBox(boite_compétence_1);
            template.Layout.AddTextBox(boite_compétence_2);
            template.Layout.AddTextBox(boite_compétence_3);
            template.Layout.AddTextBox(boite_compétence_4);
            template.Layout.AddTextBox(boite_nom);
            template.Layout.AddTextBox(boite_d_obj);
            template.Layout.AddTextBox(boite_d_obj2);
            template.Layout.AddTextBox(boite_profession);
            template.Layout.AddTextBox(boite_competences);
            template.Layout.AddBackBox(fond);
            template.Layout.AddBackBox(boite_photo);

            return(template);
        }
Exemplo n.º 19
0
        public static void AddGame(string dataPath)
        {
            string GameName;
            string Rating;   //int
            string Playtime; //int
            string Style;
            string Status;

            Console.WriteLine("");
            Console.Write("*Inser game name: ");
            GameName = Console.ReadLine();

            if (GameName == "")
            {
                GameName = "Non-defined";
            }

            Console.WriteLine("");
            Console.Write("*Insert rating out of 10: ");
            Rating = Console.ReadLine();

            if (Rating == "")
            {
                Rating = "0";
            }

            Console.WriteLine("");
            Console.Write("Insert playtime: ");
            Playtime = Console.ReadLine();

            if (Playtime == "")
            {
                Playtime = "0";
            }

            Console.WriteLine("");
            Console.Write("Insert playstyle (Cooperative/Solo/MMO/Multiplayer): ");
            Style = Console.ReadLine();

            if (Style == "")
            {
                Style = "Non-defined";
            }

            Console.WriteLine("");
            Console.Write("Insert status (Finished/Playing/Plan to play/Pre-ordered): ");
            Status = Console.ReadLine();

            if (Status == "")
            {
                Status = "Non-defined";
            }

            Console.Clear();
            Console.WriteLine("Game " + GameName + " entry was saved!");
            Thread.Sleep(1500);
            Console.Clear();

            DataImage dataImage = new DataImage();

            Save(dataPath, GameName, Rating, Playtime, Style, Status);
        }
Exemplo n.º 20
0
 public async Task <string> Add(string base64Image)
 => await Add(DataImage.TryParse(base64Image));
Exemplo n.º 21
0
        public static Resume GetResumeTest2()
        {
            Resume CV;

            var nom         = new Data <string>("Nom", "Clovis", -1, "", true);
            var titre       = new Data <string>("Titre", "Roi des Francs", -1, "", true);
            var coordonnees = new ElementList <Element>("Coordonnées")
            {
                new Data <string>("Téléphone", "+33660606060", -1, "", true),
                new Data <string>("Mél", "*****@*****.**", -1, "", true),
                new Data <string>("Adresse", "17 rue de la Réussite\n75012 Paris", -1, "", true)
            };

            var objectif = new ElementList <Element>("Objectif")
            {
                new ElementList <Element>("Mon Objectif")
                {
                    new Data <string>("obj", "Je compte unir les Francs, conquérir le nord de la Loire, puis l'Est, et je vaincrai les Burgondes. Mais je ne cesserai pas, et je m'emparerai du Centre et du Sud Ouest de la gaule !", -1, "", true)
                }
            };

            var competences = new ElementList <Element>("Compétences")
            {
                new ElementList <Element>("Diplomatie")
                {
                    new Data <string>("Politique", "Politique", 4, "", true),
                    new Data <string>("Assassinat", "Assassinat", 3, "", true),
                    new Data <string>("Mariage", "Mariage", 2, "", true),
                    new Data <string>("Soudoiement", "Soudoiement", 2, "", true),
                },
            };

            var langues = new ElementList <Element>("Langues")
            {
                new Data <string>("Francique", "Francique", 5, "", true),
                new Data <string>("Français moderne", "Français moderne", 1, "", true),
                new Data <string>("Allemand moderne", "Allemand moderne", 1, "", true),
            };

            var diplomes = new ElementList <Element>("Dynastie")
            {
                new DataDated <string>("Mérovingien", new DateTime(466, 1, 1), default(DateTimeOffset), "Depuis $1(yyy)$", -1, "", true),
            };

            var fonts = new Fonts("Polices_cv")
            {
                new FontElement("Garamond", 5, new Color()
                {
                    R = 0, G = 0, B = 255, A = 255
                }, false, false, false, true),                                                                            //ARGB 0 on voit rien, 255 opaque
                new FontElement("Garamond", 5, new Color()
                {
                    R = 0, G = 0, B = 150, A = 255
                }, false, true, false, false),
                new FontElement("Garamond", 5, new Color()
                {
                    R = 100, G = 100, B = 200, A = 255
                }, true, false, false, false),
                new FontElement("Calibri", 5, new Color()
                {
                    R = 70, G = 70, B = 200, A = 190
                })
            };

            var fonts1 = new Fonts("obj", Windows.UI.Xaml.TextAlignment.Justify)
            {
                new FontElement("Garamond", 5, new Color()
                {
                    R = 168, G = 215, B = 203, A = 255
                }, false, false, false, false),
            };

            var boite_de_nom   = new BoxText(90, 15, 60, 40, 20, 0, "nom");
            var boite_de_titre = new BoxText(80, 28, 60, 40, 10, 0, "titre");
            var boite_d_obj    = new BoxText(15, 50, 60, 70, 40, 0, "obj", fonts1);

            var boite_de_coordonnees = new BoxText(140, 50, 60, 80, 60, 0, "Coordonnées");
            var boite_de_competences = new BoxText(20, 95, 60, 40, 50, 0, "Diplomatie");
            var boite_de_langues     = new BoxText(140, 95, 60, 80, 50, 0, "Langues");
            var boite_de_diplomes    = new BoxText(15, 160, 60, 150, 15, 0, "Dynastie");

            var fond = new BoxBackground(0, 90, 10, 210, 50)
            {
                Fill = new Color()
                {
                    A = 140, G = 255
                } //verte un peu transparente
            };    //boite de fond

            var img   = new DataImage("CV 2_-_profil", true);
            var photo = new BoxBackground(105 - 50 / 2, 90 + 5, 50, 40, 40, 0, BoxBackgroundShape.Ellipse)
            {
                Image = img
            };

            /*var fond2 = new BoxBackground(115, 150, 100, 160, 73, null, -40)
             *          {
             *                  Color = new Color() { A = 190, B = 170, G = 255 } //turquoise ? transparent
             *          }; //boite de fond
             *
             *          var fond3 = new BoxBackground(-15, -4, 100, 700, 65, null, 50)
             *          {
             *                  Color = new Color() { A = 255, B = 200, G = 200, R = 255 }
             *          };*/

            boite_de_nom.Element         = nom;
            boite_de_titre.Element       = titre;
            boite_d_obj.Element          = objectif;
            boite_de_competences.Element = competences;
            boite_de_coordonnees.Element = coordonnees;
            boite_de_langues.Element     = langues;
            boite_de_diplomes.Element    = diplomes;

            CV = new Resume("CV 2")
            {
                Fonts = fonts
            };

            CV.Layout = new Layout();
            CV.Layout.AddBackBox(fond);
            CV.Layout.AddBackBox(photo);
            //CV.Layout.AddBackBox(fond2);
            //CV.Layout.AddBackBox(fond3);

            CV.Layout.AddTextBox(boite_d_obj);
            CV.Layout.AddTextBox(boite_de_nom);
            CV.Layout.AddTextBox(boite_de_titre);
            CV.Layout.AddTextBox(boite_de_competences);
            CV.Layout.AddTextBox(boite_de_coordonnees);
            CV.Layout.AddTextBox(boite_de_langues);
            CV.Layout.AddTextBox(boite_de_diplomes);

            return(CV);
        }