public string translate_instruction()
        {
            for (int i = 0; i < Labels.Count; i++)
            {
                if (label == Labels.ElementAt(i).Key)
                {
                    address = Labels.ElementAt(i).Value;
                    break;
                }
            }
            string B_J = Convert.ToString(jInstruction.ElementAt(0).Value, 2);

            while (B_J.Length != 6)
            {
                B_J = '0' + B_J;
            }
            //Address = Target Address / 4
            address    = address / 4;
            retaddress = Convert.ToString(address, 2);
            while (retaddress.Length != 26)
            {
                retaddress = '0' + retaddress;
            }
            retaddress = B_J + retaddress;
            return(retaddress);
        }
Esempio n. 2
0
        public void DrawText(CCPoint position, string text, Font font, CCSize targetSize, CCColor3B color)
        {
            CCLabel label;

            if (UsageIndex >= Labels.Count || Labels.ElementAt(UsageIndex).Value != font.FontSize)
            {
                if (UsageIndex < Labels.Count && Labels.ElementAt(UsageIndex).Value != font.FontSize)
                {
                    Labels.Remove(Labels.ElementAt(UsageIndex).Key);
                }
                label = new CCLabel(text, font.FontPath, font.FontSize, targetSize, font.FontType)
                {
                    HorizontalAlignment = CCTextAlignment.Left,
                    VerticalAlignment   = CCVerticalTextAlignment.Center,
                    LineBreak           = CCLabelLineBreak.Word,
                };
                Labels.Add(label, font.FontSize);
                AddChild(label);
            }
            else
            {
                label = Labels.ElementAt(UsageIndex).Key;
            }
            if (label.Text != text)
            {
                label.Text = text;
            }
            if (label.Color != color)
            {
                label.Color = color;
            }
            label.Position = position;
            label.Visible  = true;
            UsageIndex++;
        }
Esempio n. 3
0
 /// <summary>
 /// Возвращает ярлык из репозитория по индексу
 /// </summary>
 /// <param name="index"></param>
 /// <returns></returns>
 public LabelModel GetLabel(Int32 index)
 {
     return(Labels.ElementAt(index));
 }