예제 #1
0
 public Cubie this[Sticker index]
 {
     get
     {
         return this.Cubies[index];
     }
     set
     {
         this.Cubies[index] = value;
     }
 }
예제 #2
0
        public static void Fix(Cube cube, Sticker[] allStickers, Sticker bufferPosition, Action<OSticker> addStickerSequence)
        {
            Sticker? cycleHead = null;
            var stickersLeft = new List<Sticker>(allStickers);

            OSticker? next = null;
            bool atCycleHead = true;

            do
            {
                if (next.HasValue)
                {
                    if (cycleHead.HasValue || next.Value.Sticker() != bufferPosition)
                    {
                        addStickerSequence(next.Value);
                    }

                    if (
                        (!cycleHead.HasValue && next.Value.Sticker() == bufferPosition) ||
                        (cycleHead.HasValue && !atCycleHead && next.Value.Sticker() == cycleHead.Value))
                    {
                        if (stickersLeft.Count() == 0)
                        {
                            break;
                        }

                        // Find new path start
                        cycleHead = null;
                        do
                        {
                            if (cycleHead.HasValue)
                            {
                                stickersLeft.Remove(next.Value.Sticker());
                                if (stickersLeft.Count() == 0)
                                {
                                    break;
                                }
                            }
                            cycleHead = stickersLeft.First();
                            atCycleHead = true;
                            next = cycleHead.Value.PrimarySticker();
                        }
                        while (cube[next.Value.Sticker()].Type == cycleHead && cube[next.Value.Sticker()].IsCorrect);

                        if (stickersLeft.Count() == 0)
                        {
                            break;
                        }

                        continue;
                    }
                }
                else
                {
                    next = bufferPosition.PrimarySticker();
                }

                atCycleHead = false;

                stickersLeft.Remove(next.Value.Sticker());

                next = cube[next.Value];
                //var nextCubie = cube[next.Value.Sticker()];
                //next = nextCubie.Oriented(next.Value);
            }
            while (true);
        }
예제 #3
0
 private void SetColorMapping(Sticker type)
 {
     this.ColorMapping = new OSticker[6];
     switch (type)
     {
         case Sticker.sULF:
             this.ColorMapping[_U] = OSticker.ULF;
             this.ColorMapping[_L] = OSticker.LFU;
             this.ColorMapping[_F] = OSticker.FUL;
             break;
         case Sticker.sUFR:
             this.ColorMapping[_U] = OSticker.UFR;
             this.ColorMapping[_F] = OSticker.FRU;
             this.ColorMapping[_R] = OSticker.RUF;
             break;
         case Sticker.sUBL:
             this.ColorMapping[_U] = OSticker.UBL;
             this.ColorMapping[_B] = OSticker.BLU;
             this.ColorMapping[_L] = OSticker.LUB;
             break;
         case Sticker.sURB:
             this.ColorMapping[_U] = OSticker.URB;
             this.ColorMapping[_R] = OSticker.RBU;
             this.ColorMapping[_B] = OSticker.BUR;
             break;
         case Sticker.sDFL:
             this.ColorMapping[_D] = OSticker.DFL;
             this.ColorMapping[_F] = OSticker.FLD;
             this.ColorMapping[_L] = OSticker.LDF;
             break;
         case Sticker.sDRF:
             this.ColorMapping[_D] = OSticker.DRF;
             this.ColorMapping[_R] = OSticker.RFD;
             this.ColorMapping[_F] = OSticker.FDR;
             break;
         case Sticker.sDLB:
             this.ColorMapping[_D] = OSticker.DLB;
             this.ColorMapping[_L] = OSticker.LBD;
             this.ColorMapping[_B] = OSticker.BDL;
             break;
         case Sticker.sDBR:
             this.ColorMapping[_D] = OSticker.DBR;
             this.ColorMapping[_B] = OSticker.BRD;
             this.ColorMapping[_R] = OSticker.RDB;
             break;
         case Sticker.sUF:
             this.ColorMapping[_U] = OSticker.UF;
             this.ColorMapping[_F] = OSticker.FU;
             break;
         case Sticker.sUL:
             this.ColorMapping[_U] = OSticker.UL;
             this.ColorMapping[_L] = OSticker.LU;
             break;
         case Sticker.sUR:
             this.ColorMapping[_U] = OSticker.UR;
             this.ColorMapping[_R] = OSticker.RU;
             break;
         case Sticker.sUB:
             this.ColorMapping[_U] = OSticker.UB;
             this.ColorMapping[_B] = OSticker.BU;
             break;
         case Sticker.sLF:
             this.ColorMapping[_L] = OSticker.LF;
             this.ColorMapping[_F] = OSticker.FL;
             break;
         case Sticker.sLB:
             this.ColorMapping[_L] = OSticker.LB;
             this.ColorMapping[_B] = OSticker.BL;
             break;
         case Sticker.sRF:
             this.ColorMapping[_R] = OSticker.RF;
             this.ColorMapping[_F] = OSticker.FR;
             break;
         case Sticker.sRB:
             this.ColorMapping[_R] = OSticker.RB;
             this.ColorMapping[_B] = OSticker.BR;
             break;
         case Sticker.sDF:
             this.ColorMapping[_D] = OSticker.DF;
             this.ColorMapping[_F] = OSticker.FD;
             break;
         case Sticker.sDL:
             this.ColorMapping[_D] = OSticker.DL;
             this.ColorMapping[_L] = OSticker.LD;
             break;
         case Sticker.sDR:
             this.ColorMapping[_D] = OSticker.DR;
             this.ColorMapping[_R] = OSticker.RD;
             break;
         case Sticker.sDB:
             this.ColorMapping[_D] = OSticker.DB;
             this.ColorMapping[_B] = OSticker.BD;
             break;
     }
 }
예제 #4
0
 public void StickerSendExecute(Sticker sticker)
 {
     StickerSendExecute(sticker, null, null);
 }
예제 #5
0
 public void OpenSticker(Sticker sticker)
 {
 }
예제 #6
0
 public void Remove(Sticker stickerIn) =>
 _stickers.DeleteOne(sticker => sticker.Id == stickerIn.Id);
예제 #7
0
 public void Update(Sticker sticker)
 {
     _sticker = sticker;
 }
예제 #8
0
 public Sticker Create(Sticker sticker)
 {
     _stickers.InsertOne(sticker);
     return(sticker);
 }
예제 #9
0
        internal override void Update(ClientState state, Model model)
        {
            base.Update(state, model);

            SocketGuild guild = (Channel as SocketGuildChannel)?.Guild;

            if (model.IsTextToSpeech.IsSpecified)
            {
                _isTTS = model.IsTextToSpeech.Value;
            }
            if (model.Pinned.IsSpecified)
            {
                _isPinned = model.Pinned.Value;
            }
            if (model.EditedTimestamp.IsSpecified)
            {
                _editedTimestampTicks = model.EditedTimestamp.Value?.UtcTicks;
            }
            if (model.MentionEveryone.IsSpecified)
            {
                _isMentioningEveryone = model.MentionEveryone.Value;
            }
            if (model.RoleMentions.IsSpecified)
            {
                _roleMentions = model.RoleMentions.Value.Select(x => guild.GetRole(x)).ToImmutableArray();
            }

            if (model.Attachments.IsSpecified)
            {
                var value = model.Attachments.Value;
                if (value.Length > 0)
                {
                    var attachments = ImmutableArray.CreateBuilder <Attachment>(value.Length);
                    for (int i = 0; i < value.Length; i++)
                    {
                        attachments.Add(Attachment.Create(value[i]));
                    }
                    _attachments = attachments.ToImmutable();
                }
                else
                {
                    _attachments = ImmutableArray.Create <Attachment>();
                }
            }

            if (model.Embeds.IsSpecified)
            {
                var value = model.Embeds.Value;
                if (value.Length > 0)
                {
                    var embeds = ImmutableArray.CreateBuilder <Embed>(value.Length);
                    for (int i = 0; i < value.Length; i++)
                    {
                        embeds.Add(value[i].ToEntity());
                    }
                    _embeds = embeds.ToImmutable();
                }
                else
                {
                    _embeds = ImmutableArray.Create <Embed>();
                }
            }

            if (model.UserMentions.IsSpecified)
            {
                var value = model.UserMentions.Value;
                if (value.Length > 0)
                {
                    var newMentions = ImmutableArray.CreateBuilder <SocketUser>(value.Length);
                    for (int i = 0; i < value.Length; i++)
                    {
                        var val = value[i];
                        if (val.Object != null)
                        {
                            var user = Channel.GetUserAsync(val.Object.Id, CacheMode.CacheOnly).GetAwaiter().GetResult() as SocketUser;
                            if (user != null)
                            {
                                newMentions.Add(user);
                            }
                            else
                            {
                                newMentions.Add(SocketUnknownUser.Create(Discord, state, val.Object));
                            }
                        }
                    }
                    _userMentions = newMentions.ToImmutable();
                }
            }

            if (model.Content.IsSpecified)
            {
                var text = model.Content.Value;
                _tags         = MessageHelper.ParseTags(text, Channel, guild, _userMentions);
                model.Content = text;
            }

            if (model.ReferencedMessage.IsSpecified && model.ReferencedMessage.Value != null)
            {
                var        refMsg       = model.ReferencedMessage.Value;
                ulong?     webhookId    = refMsg.WebhookId.ToNullable();
                SocketUser refMsgAuthor = null;
                if (refMsg.Author.IsSpecified)
                {
                    if (guild != null)
                    {
                        if (webhookId != null)
                        {
                            refMsgAuthor = SocketWebhookUser.Create(guild, state, refMsg.Author.Value, webhookId.Value);
                        }
                        else
                        {
                            refMsgAuthor = guild.GetUser(refMsg.Author.Value.Id);
                        }
                    }
                    else
                    {
                        refMsgAuthor = (Channel as SocketChannel).GetUser(refMsg.Author.Value.Id);
                    }
                    if (refMsgAuthor == null)
                    {
                        refMsgAuthor = SocketUnknownUser.Create(Discord, state, refMsg.Author.Value);
                    }
                }
                else
                {
                    // Message author wasn't specified in the payload, so create a completely anonymous unknown user
                    refMsgAuthor = new SocketUnknownUser(Discord, id: 0);
                }
                _referencedMessage = SocketUserMessage.Create(Discord, state, refMsgAuthor, Channel, refMsg);
            }

            if (model.Stickers.IsSpecified)
            {
                var value = model.Stickers.Value;
                if (value.Length > 0)
                {
                    var stickers = ImmutableArray.CreateBuilder <Sticker>(value.Length);
                    for (int i = 0; i < value.Length; i++)
                    {
                        stickers.Add(Sticker.Create(value[i]));
                    }
                    _stickers = stickers.ToImmutable();
                }
                else
                {
                    _stickers = ImmutableArray.Create <Sticker>();
                }
            }
        }
예제 #10
0
        public async Task <ActionResult> PostStickerDetail([FromBody] Sticker sticker)
        {
            await _stickerService.Add(sticker);

            return(CreatedAtAction("GetStickerDetail", new { id = sticker.Id }, sticker));
        }
예제 #11
0
        public ActionResult Search(int?Stick_Type, int?Object_Type, int?Cities, int?Regions)
        {
            Stick_Type        = Stick_Type ?? null;
            Object_Type       = Object_Type ?? null;
            Cities            = Cities ?? null;
            Regions           = Regions ?? null;
            ViewBag.StickType = db.Stick_Type.ToList();

            //return Content("Stick type: " + Stick_Type + " Object: " + Object_Type + " " + "cities: " + Cities + " Regions: " + Regions);

            //create query
            var queryString = "Select * from Stickers where Status = 0";

            if (Stick_Type != null)
            {
                queryString += " and Type_İD = " + Stick_Type;
            }

            if (Object_Type != null)
            {
                queryString += " and Object_İd = " + Object_Type;
            }

            if (Cities != null)
            {
                queryString += " and City_İd = " + Cities;
            }

            if (Regions != null)
            {
                queryString += " and Region_İd = " + Regions;
            }

            //return Content(queryString);
            //create rresponse
            List <Sticker> columnData = new List <Sticker>();

            using (SqlConnection connection = new SqlConnection("Data Source=31.31.196.127;initial catalog=u0506899_REcomp;User Id=u0506899_admin;Password=kH7l2?9e;MultipleActiveResultSets=True;App=EntityFramework&quot;"))
            {
                connection.Open();
                using (SqlCommand command = new SqlCommand(queryString, connection))
                {
                    using (SqlDataReader reader = command.ExecuteReader())
                    {
                        while (reader.Read())
                        {
                            Sticker st = new Sticker
                            {
                                İD           = (int)reader["İD"],
                                Name         = reader["Name"].ToString(),
                                Price        = reader["Price"].ToString(),
                                Short_info   = reader["Short_info"].ToString(),
                                Type_İD      = (int)reader["Type_İD"],
                                Area         = reader["Area"].ToString(),
                                GarageStatus = (bool)reader["GarageStatus"],
                                Status       = (bool)reader["Status"],
                                Long_Info    = reader["Long_Info"].ToString()
                            };
                            columnData.Add(st);
                        }
                    }
                }
            }


            ViewBag.Stickers = columnData;

            ViewBag.SticPhoto = db.Stick_Photo.ToList();
            ViewBag.Room      = db.Rooms.ToList();
            ViewBag.Footer    = db.Footors.First();

            return(View());
        }
예제 #12
0
        public StickerViewModel(IProtoService protoService, IEventAggregator aggregator, Sticker sticker)
        {
            _protoService = protoService;
            _aggregator   = aggregator;

            _sticker = sticker;
        }
예제 #13
0
        async Task <Sticker> IService <Sticker, int> .Update(Sticker entity)
        {
            var Sticker = await db.Stickers.Update(entity);

            return(Sticker);
        }
	public void GetObjects(Sticker s)
	{

		string file = s.themeName + "/" + s.stickerName;

		S3Client.GetObjectAsync(S3BucketName, file, (responseObj) =>

		{
			var response = responseObj.Response;
				if (response.ResponseStream != null)
			{
					Texture2D t = new Texture2D(4,4);
					byte[] imageData = new byte[response.ResponseStream.Length];
					response.ResponseStream.Read(imageData, 0, (int)imageData.Length);
					t.LoadImage(imageData);
					t.name = s.stickerName;
					instantiateTexture(t, s);
			} else {
				Debug.Log("Nothing found in Bucket");
			}
		});
	}
예제 #15
0
 private void Stickers_ItemClick(Sticker obj)
 {
     StickerClick?.Invoke(obj);
 }
예제 #16
0
 /// <summary>
 /// Activates obtained sticker in Sticker Gallery. Sets material to newObtainedMaterial and enables interaction.
 /// </summary>
 /// <param name="obtainedSticker">Sticker that has been obtained.</param>
 public void ObtainSticker(Sticker obtainedSticker)
 {
     stickerGallery.ActivateSpesificSticker(obtainedSticker);
 }
예제 #17
0
 private void StickerDeleteExecute(Sticker sticker)
 {
     ProtoService.Send(new RemoveRecentSticker(false, new InputFileId(sticker.StickerValue.Id)));
 }
예제 #18
0
 public void Update(string id, Sticker stickerIn) =>
 _stickers.ReplaceOne(sticker => sticker.Id == id, stickerIn);
예제 #19
0
 public void UpdateSticker(Sticker Sticker)
 {
     _stickerRepository.Update(Sticker);
     SaveSticker();
 }
예제 #20
0
 private void Do(Axis axis, bool inverse, Sticker[][] allMoves)
 {
     var clone = Clone();
     foreach (var moves in allMoves)
     {
         if (!inverse)
         {
             for (int i = 0; i < moves.Length; ++i)
             {
                 this[moves[(i + 1) % moves.Length]] = clone[moves[i]].Rot(axis, inverse);
             }
         }
         else
         {
             for (int i = moves.Length-1; i >= 0; --i)
             {
                 this[moves[i]] = clone[moves[(i + 1) % moves.Length]].Rot(axis, inverse);
             }
         }
     }
 }
예제 #21
0
 public void CreateSticker(Sticker Sticker)
 {
     _stickerRepository.Add(Sticker);
     SaveSticker();
 }
예제 #22
0
 /// <summary>
 /// Updates the Sticker component of the sticker and updates the new sprite.
 /// </summary>
 /// <param name="newInformation">New Sticker informaton to replace with.</param>
 public void UpdateStickerInformation(Sticker newInformation)
 {
     stickerInformation    = newInformation;
     m_stickerImage.sprite = stickerInformation.icon;
 }
 public void SetStickerData(Sticker stickerData)
 {
     this.sticker = stickerData;
 }
예제 #24
0
        private static void UpdateLastIdMessage(SendMessageObject messages, UserInfoObject userData, string hashId)
        {
            try
            {
                var checker = MessagesBoxActivity.MAdapter?.MessageList?.FirstOrDefault(a => a.Id == Convert.ToInt32(hashId));
                if (checker != null)
                {
                    checker.Id          = messages.Data.Id;
                    checker.FromName    = UserDetails.FullName;
                    checker.FromAvater  = UserDetails.Avatar;
                    checker.ToName      = userData?.Fullname ?? "";
                    checker.ToAvater    = userData?.Avater ?? "";
                    checker.From        = messages.Data.From;
                    checker.To          = messages.Data.To;
                    checker.Text        = Methods.FunString.DecodeString(messages.Data.Text);
                    checker.Media       = checker.Media.Contains("upload/chat/") && !messages.Data.Media.Contains(Client.WebsiteUrl)? Client.WebsiteUrl + "/" + messages.Data.Media: messages.Data.Media;
                    checker.FromDelete  = messages.Data.FromDelete;
                    checker.ToDelete    = messages.Data.ToDelete;
                    checker.Sticker     = messages.Data.Sticker;
                    checker.CreatedAt   = messages.Data.CreatedAt;
                    checker.Seen        = messages.Data.Seen;
                    checker.Type        = "Sent";
                    checker.MessageType = messages.Data.MessageType;

                    string text = Methods.FunString.DecodeString(messages.Data.Text);

                    switch (checker.MessageType)
                    {
                    case "text":
                    {
                        text = string.IsNullOrEmpty(text) ? Application.Context.GetText(Resource.String.Lbl_SendMessage) : Methods.FunString.DecodeString(messages.Data.Text);
                        break;
                    }

                    case "media":
                    {
                        text = Application.Context.GetText(Resource.String.Lbl_SendImageFile);
                        break;
                    }

                    case "sticker" when checker.Sticker.Contains(".gif"):
                    {
                        text = Application.Context.GetText(Resource.String.Lbl_SendGifFile);
                        break;
                    }

                    case "sticker":
                    {
                        text = Application.Context.GetText(Resource.String.Lbl_SendStickerFile);
                        break;
                    }
                    }

                    var dataUser = LastChatActivity.MAdapter?.UserList?.FirstOrDefault(a => a.User.Id == messages.Data.To);
                    if (dataUser != null)
                    {
                        var index = LastChatActivity.MAdapter?.UserList?.IndexOf(LastChatActivity.MAdapter.UserList?.FirstOrDefault(x => x.User.Id == messages.Data.To));
                        if (index > -1)
                        {
                            dataUser.Text = text;

                            LastChatActivity.MAdapter?.UserList?.Move(Convert.ToInt32(index), 0);
                            LastChatActivity.MAdapter?.NotifyItemMoved(Convert.ToInt32(index), 0);

                            var data = LastChatActivity.MAdapter?.UserList?.FirstOrDefault(a => a.User.Id == dataUser.User.Id);
                            if (data != null)
                            {
                                data.Id          = dataUser.Id;
                                data.Owner       = dataUser.Owner;
                                data.User        = dataUser.User;
                                data.Seen        = dataUser.Seen;
                                data.Text        = dataUser.Text;
                                data.Media       = dataUser.Media;
                                data.Sticker     = dataUser.Sticker;
                                data.Time        = dataUser.Time;
                                data.CreatedAt   = dataUser.CreatedAt;
                                data.NewMessages = dataUser.NewMessages;
                                data.MessageType = dataUser.MessageType;

                                LastChatActivity.MAdapter.NotifyItemChanged(LastChatActivity.MAdapter.UserList.IndexOf(data));
                            }
                        }
                    }
                    else
                    {
                        if (userData != null)
                        {
                            LastChatActivity.MAdapter?.UserList?.Insert(0, new GetConversationListObject.DataConversation()
                            {
                                Id          = userData.Id,
                                Owner       = 0,
                                User        = userData,
                                Seen        = 1,
                                Text        = text,
                                Media       = checker.Media,
                                Sticker     = messages.Data.Sticker,
                                Time        = messages.Data.CreatedAt,
                                CreatedAt   = messages.Data.CreatedAt,
                                NewMessages = 0
                            });

                            LastChatActivity.MAdapter?.NotifyItemInserted(0);
                        }
                    }

                    SqLiteDatabase dbDatabase = new SqLiteDatabase();
                    GetChatConversationsObject.Messages message = new GetChatConversationsObject.Messages
                    {
                        Id          = messages.Data.Id,
                        FromName    = UserDetails.FullName,
                        FromAvater  = UserDetails.Avatar,
                        ToName      = userData?.Fullname ?? "",
                        ToAvater    = userData?.Avater ?? "",
                        From        = messages.Data.From,
                        To          = messages.Data.To,
                        Text        = Methods.FunString.DecodeString(messages.Data.Text),
                        Media       = checker.Media,
                        FromDelete  = messages.Data.FromDelete,
                        ToDelete    = messages.Data.ToDelete,
                        Sticker     = messages.Data.Sticker,
                        CreatedAt   = messages.Data.CreatedAt,
                        Seen        = messages.Data.Seen,
                        Type        = "Sent",
                        MessageType = messages.Data.MessageType,
                    };
                    //Update All data users to database
                    dbDatabase.InsertOrUpdateToOneMessages(message);
                    dbDatabase.Dispose();

                    MessagesBoxActivity.UpdateOneMessage(message);
                    MessagesBoxActivity.GetInstance()?.ChatBoxRecyclerView.ScrollToPosition(MessagesBoxActivity.MAdapter.MessageList.IndexOf(MessagesBoxActivity.MAdapter.MessageList.Last()));

                    if (AppSettings.RunSoundControl)
                    {
                        Methods.AudioRecorderAndPlayer.PlayAudioFromAsset("Popup_SendMesseges.mp3");
                    }
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
예제 #25
0
        public string orderText(Sticker sticker)
        {
            _text =
                "#!A1#DC" +
                "#IMSR150.08/210.16" +
                "#RX0" +
                "#ERN/1//0" +
                "#R0/0" +

                "#T18.00 #J80.83" +
                "#YG/1///C:\\GRAPHICS\\kordsa_logo.gif#G" +

                "#T143.41 #J204.50 #YB13/2P2.0O/10.16/2///" + sticker.PAKET + "#G" +
                "#T143.58 #J66.50 #YB13/2P2.0O/10.16/2///" + sticker.PAKET + "#G" +
                "#T143.66 #J139.41 #YB13/2P2.0O/10.16/2///" + sticker.PAKET + "#G" +
                "#T115.58 #J205.00 #YB13/2P2.0O/20.00/13///" + sticker.PAKET + "#G" +
                "#T03.83 #J181.00 #YL0/0/01.00/116.33" +
                "#T122.16 #J04.16 #YL0/1/01.00/200.16" +
                "#T39.58 #J05.66 #YL0/1/01.00/176.50" +
                "#T65.41 #J05.66 #YL0/1/01.00/176.50" +
                "#T81.91 #J05.08 #YL0/1/01.00/176.41" +
                "#T97.25 #J05.66 #YL0/1/01.00/176.50" +
                "#T22.91 #J05.08 #YL0/1/01.00/176.41" +
                "#T122.41 #J69.83 #YL0/0/01.00/27.25" +
                "#T122.25 #J143.33 #YL0/0/01.00/26.91" +
                "#T44.66 #J12.16 #YN101/1B/59///PALLET NO#G" +
                "#T28.75 #J12.16 #YN101/1B/59///MATERIAL#G" +
                "#T36.16 #J12.16 #YN101/1B/85///" + sticker.TIP + "#G" +
                "#T50.08 #J136.83 #YN101/1B/59///MERGE#G" +
                "#T27.50 #J137.58 #YN101/1B/59///REF-PIN#G" +
                "#T37.66 #J137.00 #YN101/1B/80///" + sticker.REF + "#G" +
                "#T19.41 #J82.91 #YN101/1B/55///Made in TURKEY#G" +
                "#T62.58 #J11.08 #YN101/1B/288///" + sticker.PAKET + "#G" +
                "#T61.00 #J136.58 #YN101/1B/119///" + sticker.GERCEKMERGE + "#G" +
                "#T71.50 #J11.25 #YN101/1B/59///TYPE#G" +
                "#T78.58 #J11.25 #YN101/1B/85///" + sticker.DENYE + "#G" +
                "#T71.16 #J78.75 #YN101/1B/59///DTEX/DENIER#G" +
                "#T78.58 #J78.75 #YN101/1B/85///" + sticker.DTEX + "/" + sticker.DENIER + "#G" +
                "#T70.58 #J136.66 #YN101/1B/59///FILAMENTS#G" +
                "#T78.91 #J137.08 #YN101/1B/102///" + sticker.FILAMENT + "#G" +
                "#T101.91 #J10.16 #YN101/1B/59///COMMERCIAL WEIGHT#G" +
                "#T110.50 #J10.25 #YN101/1B/85///" + sticker.TICAGKG + " KG#G" +
                "#T119.00 #J10.25 #YN101/1B/85///" + sticker.TICAGLB + " LB#G" +
                "#T87.00 #J10.41 #YN101/1B/59///PACK DATE#G" +
                "#T93.41 #J10.41 #YN101/1B/85///" + sticker.PACKDATE + "#G" +
                "#T86.50 #J78.08 #YN101/1B/59///## OF BOBBINS#G" +
                "#T93.50 #J78.16 #YN101/1B/85///" + sticker.UNIT + "#G" +
                "#T86.66 #J136.50 #YN101/1B/59///ICN#G" +
                "#T95.58 #J136.16 #YN101/1B/102///" + sticker.REFERANS + "#G" +
                "#T101.91 #J77.58 #YN101/1B/59///GROSS WEIGHT#G" +
                "#T110.50 #J77.58 #YN101/1B/85///" + sticker.TOPLAMAGKG + " KG#G" +
                "#T119.00 #J77.58 #YN101/1B/85///" + sticker.TOPLAMAGLB + " LB#G" +
                "#T102.66 #J136.16 #YN101/1B/59///ERP CODE#G" +
                "#T130.66 #J10.50 #YN101/1B/85///" + sticker.PAKET + "#G" +
                "#T130.91 #J76.33 #YN101/1B/85///" + sticker.PAKET + "#G" +
                "#T136.41 #J10.91 #YN101/1B/42///" + sticker.GERCEKMERGE + "-" + sticker.DTEX + "/" + sticker.DENYE + "#G" +
                "#T113.75 #J135.33 #YN101/1B/102///" + sticker.SAPKOD + "#G" +
                "#T142.41 #J11.25 #YN101/1B/59///" + sticker.SAPKOD + "#G" +
                "#T136.75 #J76.75 #YN101/1B/42///" + sticker.GERCEKMERGE + "-" + sticker.DTEX + "/" + sticker.DENYE + "#G" +
                "#T146.58 #J11.75 #YN101/1B/42///" + sticker.PACKDATE + "#G" +
                "#T132.91 #J148.83 #YN101/1B/102///" + sticker.PAKET + "#G" +
                "#T142.66 #J77.08 #YN101/1B/59///" + sticker.SAPKOD + "#G" +
                "#T137.33 #J149.33 #YN101/1B/42///" + sticker.GERCEKMERGE + "-" + sticker.DTEX + "/" + sticker.DENYE + "#G" +
                "#T146.91 #J77.58 #YN101/1B/42///" + sticker.PACKDATE + "#G" +
                "#T143.33 #J149.66 #YN101/1B/59///" + sticker.SAPKOD + "#G" +
                "#T147.50 #J150.08 #YN101/1B/42///" + sticker.PACKDATE + "#G" +
                "#Q1#G" +
                "#!P1";
            return(_text);
        }
예제 #26
0
 public Cubie(Sticker type, int orientation = _UF)
 {
     this.Type = type;
     this.Orientation = orientation;
 }
        private void StickerViewExecute(Sticker sticker)
        {
            Delegate?.HideStickers();

            OpenSticker(sticker);
        }
예제 #28
0
        private OSticker Oriented(Sticker location)
        {
            //var f = (this.Orientation - u*64) / 8;
            //var b = (f / 2)*2 + (1 - (f % 2));

            OSticker osticker;
            switch (location)
            {
                case Sticker.sULF:
                case Sticker.sUFR:
                case Sticker.sUBL:
                case Sticker.sURB:
                case Sticker.sUB:
                case Sticker.sUF:
                case Sticker.sUL:
                case Sticker.sUR:
                    {
                        var u = this.Orientation / 64;
                        osticker = this.ColorMapping[u];
                        break;
                    }
                case Sticker.sDFL:
                case Sticker.sDRF:
                case Sticker.sDLB:
                case Sticker.sDBR:
                case Sticker.sDB:
                case Sticker.sDF:
                case Sticker.sDL:
                case Sticker.sDR:
                    {
                        var u = this.Orientation / 64;
                        var d = (u / 2) * 2 + (1 - (u % 2));
                        osticker = this.ColorMapping[d];
                        break;
                    }
                case Sticker.sLB:
                case Sticker.sLF:
                    {
                        var l = this.Orientation % 8;
                        osticker = this.ColorMapping[l];
                        break;
                    }
                case Sticker.sRB:
                case Sticker.sRF:
                    {
                        var l = this.Orientation % 8;
                        var r = (l / 2)*2 + (1 - (l % 2));
                        osticker = this.ColorMapping[r];
                        break;
                    }
                default:
                    throw new InvalidOperationException(String.Format("Color mapping not defined for location '{0}'", location));
            }

            return osticker;
        }
 private void StickerUnfaveExecute(Sticker sticker)
 {
     ProtoService.Send(new RemoveFavoriteSticker(new InputFileId(sticker.StickerValue.Id)));
 }
	private void addItem(Dictionary<string, AttributeValue> attributeList) {
		Sticker sticker = new Sticker();

		foreach (var kvp in attributeList) {
			string attributeName = kvp.Key;
			AttributeValue value = kvp.Value;
			// Create a new sticker based on each Key/Value pair
			if (attributeName == "Theme") {
				sticker.themeName = value.S;
			} else if (attributeName == "StickerName") {
				sticker.stickerName = value.S;
			} else if (attributeName == "Link") {
				sticker.link = value.S;
			}
		}
		stickers.Add(sticker.stickerName, sticker);
	}
예제 #31
0
        private void Initialize(LastChatAdapterViewHolder holder, GetConversationListObject.DataConversation item)
        {
            try
            {
                GlideImageLoader.LoadImage(ActivityContext, item.User.Avater, holder.ImageAvatar, ImageStyle.CircleCrop, ImagePlaceholders.Drawable);

                string name = Methods.FunString.DecodeString(QuickDateTools.GetNameFinal(item.User));
                if (holder.TxtUsername.Text != name)
                {
                    holder.TxtUsername.Text = name;
                }

                //If message contains Media files
                switch (item.MessageType)
                {
                case "text":
                {
                    holder.LastMessagesIcon.Visibility = ViewStates.Gone;
                    holder.TxtLastMessages.Text        = item.Text.Contains("http")
                            ? Methods.FunString.SubStringCutOf(item.Text, 30)
                            : Methods.FunString.DecodeString(Methods.FunString.SubStringCutOf(item.Text, 30))
                                                         ?? ActivityContext.GetText(Resource.String.Lbl_SendMessage);
                    break;
                }

                case "media":
                {
                    holder.LastMessagesIcon.Visibility = ViewStates.Visible;
                    FontUtils.SetTextViewIcon(FontsIconFrameWork.IonIcons, holder.LastMessagesIcon, IonIconsFonts.Images);
                    holder.TxtLastMessages.Text = Application.Context.GetText(Resource.String.Lbl_SendImageFile);
                    break;
                }

                case "sticker" when item.Sticker.Contains(".gif"):
                {
                    holder.LastMessagesIcon.Visibility = ViewStates.Visible;
                    FontUtils.SetTextViewIcon(FontsIconFrameWork.FontAwesomeLight, holder.LastMessagesIcon, FontAwesomeIcon.Gift);
                    holder.TxtLastMessages.Text = Application.Context.GetText(Resource.String.Lbl_SendGifFile);
                    break;
                }

                case "sticker":
                {
                    holder.LastMessagesIcon.Visibility = ViewStates.Visible;
                    FontUtils.SetTextViewIcon(FontsIconFrameWork.IonIcons, holder.LastMessagesIcon, IonIconsFonts.Happy);
                    holder.TxtLastMessages.Text = Application.Context.GetText(Resource.String.Lbl_SendStickerFile);
                    break;
                }
                }

                //last seen time
                holder.TxtTimestamp.Text = Methods.Time.ReplaceTime(item.Time);

                //Check read message
                if (item.ToId != UserDetails.UserId && item.FromId == UserDetails.UserId)
                {
                    if (item.Seen == 0)
                    {
                        holder.ImageColor.Visibility = ViewStates.Invisible;
                        holder.TxtUsername.SetTypeface(Typeface.Default, TypefaceStyle.Normal);
                        holder.TxtLastMessages.SetTypeface(Typeface.Default, TypefaceStyle.Normal);
                    }
                    else
                    {
                        holder.ImageColor.Visibility = ViewStates.Visible;
                        holder.TxtUsername.SetTypeface(Typeface.Default, TypefaceStyle.Normal);
                        holder.TxtLastMessages.SetTypeface(Typeface.Default, TypefaceStyle.Normal);
                    }
                }
                else
                {
                    if (item.Seen == 0)
                    {
                        holder.TxtUsername.SetTypeface(Typeface.Default, TypefaceStyle.Bold);
                        holder.TxtLastMessages.SetTypeface(Typeface.Default, TypefaceStyle.Bold);

                        var drawable = TextDrawable.InvokeBuilder().BeginConfig().FontSize(25).EndConfig().BuildRound("N", Color.ParseColor(AppSettings.MainColor));
                        holder.ImageColor.SetImageDrawable(drawable);
                        holder.ImageColor.Visibility = ViewStates.Visible;
                    }
                    else
                    {
                        holder.ImageColor.Visibility = ViewStates.Invisible;
                        holder.TxtUsername.SetTypeface(Typeface.Default, TypefaceStyle.Normal);
                        holder.TxtLastMessages.SetTypeface(Typeface.Default, TypefaceStyle.Normal);
                    }
                }

                //if (item.NewMessages <= 0)
                //{
                //    holder.ImageColor.Visibility = ViewStates.Invisible;
                //}
                //else
                //{
                //    var drawable = TextDrawable.TextDrawable.TextDrawbleBuilder.BeginConfig().FontSize(25).EndConfig().BuildRound(item.NewMessages.ToString(), Color.ParseColor(AppSettings.MainColor));
                //    holder.ImageColor.SetImageDrawable(drawable);
                //    holder.ImageColor.Visibility = ViewStates.Visible;
                //}
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
	// Change this to a foreach, when all are downloaded
	private void instantiateTexture(Texture2D t, Sticker s) {

		// Instantiate a sticker object and assign it the texture
		Rect r = new Rect(0, 0, t.width, t.height);
		Sprite temp = Sprite.Create(t, r, new Vector2());
		temp.name = t.name;

		GameObject stickerButton = Instantiate(Resources.Load("StickerSelector")) as GameObject;
		stickerButton.transform.SetParent(dlc.transform);
		stickerButton.transform.position = stickerButton.transform.parent.position;
		stickerButton.GetComponent<Image>().sprite = temp;
		stickerButton.name = Path.GetFileNameWithoutExtension(temp.name);
		// Add Texture to sticker object
		s.stickerGO = stickerButton;
		completedDownload++;
		if(completedDownload == downloadedStickers.Count) 	
			finishedDownload = true;
	}
예제 #33
0
 /// <summary>
 /// Initializes a new instance of the <see cref="StickerComposeExtensionCard"/> class.
 /// </summary>
 /// <param name="sticker">The <see cref="sticker"/> for this card.</param>
 public StickerComposeExtensionCard(Sticker sticker)
 {
     this.sticker = sticker ?? throw new ArgumentNullException(nameof(sticker));
 }