コード例 #1
0
        private void InitRibbon()
        {
            _ribbon                   = new Ribbon();
            _ribbon.Height            = 150;
            _ribbon.ThemeColor        = RibbonTheme.Black;
            _ribbon.OrbDropDown.Width = 150;
            _ribbon.OrbStyle          = RibbonOrbStyle.Office_2013;
            _ribbon.OrbText           = GetText.Text("File");
            _ribbon.QuickAccessToolbar.MenuButtonVisible = false;
            _ribbon.QuickAccessToolbar.Visible           = false;
            _ribbon.QuickAccessToolbar.MinSizeMode       = RibbonElementSizeMode.Compact;
            _ribbon.Dock   = DockStyle.None;
            _ribbon.Top    = -25;
            _ribbon.Left   = 0;
            _ribbon.Width  = this.Width;
            _ribbon.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right)));
            _ribbon.Tabs.Add(_intInf.Tsm);

            _btn_open            = new RibbonButton(GetText.Text("Open"));
            _btn_open.Image      = Tools.Utilities.UI.Resources.ResourceIconSet32Default.open_folder;
            _btn_open.SmallImage = Tools.Utilities.UI.Resources.ResourceIconSet16Default.open_folder;
            _btn_open.Click     += B_open_Click;
            _ribbon.OrbDropDown.MenuItems.Add(_btn_open);

            _btn_exit            = new RibbonButton(GetText.Text("Exit"));
            _btn_exit.Image      = Tools.Utilities.UI.Resources.ResourceIconSet32Default.door_out;
            _btn_exit.SmallImage = Tools.Utilities.UI.Resources.ResourceIconSet16Default.door_out;
            _btn_exit.Click     += B_exit_Click;
            _ribbon.OrbDropDown.MenuItems.Add(_btn_exit);

            _ribbon.OrbDropDown.Width = 700;
            this.Controls.Add(_ribbon);
        }
コード例 #2
0
        private void setGetTextDelegate()
        {
            string extension = Path.GetExtension(FileName).ToLower();

            if (extension == ".txt")
            {
                getTextDelegate            = readTxt;
                fileButton.BackgroundImage = Properties.Resources.txt_icon;
            }
            else if (extension == ".docx" || extension == ".doc")
            {
                getTextDelegate            = readWordDoc;
                fileButton.BackgroundImage = Properties.Resources.doc_icon;
            }
            else if (extension == ".pdf")
            {
                getTextDelegate            = readPdf;
                fileButton.BackgroundImage = Properties.Resources.pdf_icon;
            }
            else if (extension == ".png" || extension == ".jpeg" || extension == ".jpg")
            {
                getTextDelegate            = readImage;
                fileButton.BackgroundImage = Properties.Resources.image_icon;
            }
        }
コード例 #3
0
 public Retriever()
 {
     localization =
         GetText.Parse(Path.Combine(".", "gettext", "es_ES.po"), Encoding.GetEncoding("iso8859-1"));
     localizationIndex = localization.GetIndex("es_ES");
     Catalog.Init("catalog", "./gettext");
 }
コード例 #4
0
        private void insertt(object sender, EventArgs e)
        {
            ListViewItem listView = new ListViewItem();
            GetText      text     = new GetText();
            Eleme        eleme    = new Eleme();
            string       data     = System.Web.HttpUtility.UrlDecode(cookie.Text, System.Text.Encoding.UTF8) + ";";
            int          ID       = listView1.Items.Count + 1;
            string       openid   = text.TextMiddle(data, "\"openid\":\"", "\",", 0);
            string       sign     = text.TextMiddle(data, "\"eleme_key\":\"", "\",", 0);
            string       SID      = text.TextMiddle(data, "SID=", ";", 0);

            if (eleme.E_Add(openid, sign, SID) == 0)
            {
                MessageBox.Show("小号没有绑定手机号或者cookie不完整!");
            }
            else
            {
                ID            = listView1.Items.Count + 1;
                listView.Text = ID.ToString();
                listView.SubItems.Add(openid);
                listView.SubItems.Add(sign);
                listView.SubItems.Add(SID);
                listView1.Items.Add(listView);
                MessageBox.Show("添加成功!");
            }
        }
コード例 #5
0
ファイル: TextField.cs プロジェクト: AaronCC/Dread-Dungeon
 public override void Update()
 {
     Menus.Menu menu = Managers.Executive.menuStack.Peek();
     if (Get == null)
     {
         Get = menu.GetText;
         text = Get();
     }
     if (Send == null)
         Send = menu.TextInput;
     if(typing)
     {
         flagged = true;
         string input = Managers.User.Typed();
         if (input == "Back" && text.Length > 0)
             text = text.Substring(0, text.Length - 1);
         else
             text += input;
     }
     if (Managers.User.kState.IsKeyDown(Keys.Enter) && Managers.User.old_kState.IsKeyDown(Keys.Enter))
     {
         flagged = false;
         typing = false;
         Send(text);
         text = Get();
     }
 }
コード例 #6
0
ファイル: Localizer.cs プロジェクト: Smilefounder/Ecommerce
        static IDictionary <EntityKey, TextDictionary> GetText(IDictionary <EntityKey, TextDictionary> originalTextInfos, CultureInfo culture)
        {
            var @event = new GetText(originalTextInfos, culture);

            Event.Raise(@event, CommerceInstance.Current);
            return(@event.Texts);
        }
コード例 #7
0
    void setText(RewardButton button)
    {
        if (button == null)
        {
            //   Debug.Log("SetText blank\n");
            foreach (MyText t in verbose_label.moretext)
            {
                t.setText("");
            }
        }
        else
        {
            //     Debug.Log("Setting text for " + button.game_event.reward_trigger.condition + "\n");

            verbose_label.getText(LabelName.Name).setText(GetText.getName(button.game_event.reward_trigger.getReward().reward_type));

            string[] req = new string[2];
            req[0] = button.game_event.reward_trigger.number.ToString();
            req[1] = button.game_event.reward_trigger.getReward().current_number.ToString();
            string requirement = Show.FixText(GetText.getLabel(button.game_event.reward_trigger.getReward().reward_type), req);
            if (button.game_event.reward_trigger.getReward().unlocked)
            {
                requirement += " YOU ALREADY UNLOCKED THIS!";
            }
            verbose_label.getText(LabelName.Requirement).setText(requirement);

            verbose_label.getText(LabelName.Reward).setText(GetText.getReward(button.game_event.reward_trigger.getReward().reward_type));
        }
    }
コード例 #8
0
 public UILabel(Vector2 pos, ReLogic.Graphics.DynamicSpriteFont font, Vector2 size, Color color, Color borderColour, GetText updateText, UIObject parent = null) : base(pos, size, parent)
 {
     this.color       = color;
     this.borderColor = borderColour;
     this.font        = font;
     this.Update      = updateText;
 }
コード例 #9
0
        private void BuildPanelInfra()
        {
            _infraHome             = new RibbonButton();
            _infraHome.Name        = "Home";
            _infraHome.Text        = GetText.Text(_infraHome.Name);
            _infraHome.Image       = Tools.Utilities.UI.Resources.ResourceIconSet32Default.application_view_tile;
            _infraHome.SmallImage  = Tools.Utilities.UI.Resources.ResourceIconSet16Default.application_view_tile;
            _infraHome.MaxSizeMode = RibbonElementSizeMode.Large;
            _infraHome.Click      += _infra_Click;

            _infraOpen             = new RibbonButton();
            _infraOpen.Name        = "Open";
            _infraOpen.Text        = GetText.Text(_infraOpen.Name);
            _infraOpen.Image       = Tools.Utilities.UI.Resources.ResourceIconSet32Default.layer_open;
            _infraOpen.SmallImage  = Tools.Utilities.UI.Resources.ResourceIconSet16Default.layer_open;
            _infraOpen.MaxSizeMode = RibbonElementSizeMode.Medium;
            _infraOpen.Click      += _infra_Click;

            _infraSave             = new RibbonButton();
            _infraSave.Name        = "Save";
            _infraSave.Text        = GetText.Text(_infraSave.Name);
            _infraSave.Image       = Tools.Utilities.UI.Resources.ResourceIconSet32Default.layer_save;
            _infraSave.SmallImage  = Tools.Utilities.UI.Resources.ResourceIconSet16Default.layer_save;
            _infraSave.MaxSizeMode = RibbonElementSizeMode.Medium;
            _infraSave.Click      += _infra_Click;

            _infraNew             = new RibbonButton();
            _infraNew.Name        = "New";
            _infraNew.Text        = GetText.Text(_infraNew.Name);
            _infraNew.Image       = Tools.Utilities.UI.Resources.ResourceIconSet32Default.layer_create;
            _infraNew.SmallImage  = Tools.Utilities.UI.Resources.ResourceIconSet16Default.layer_create;
            _infraNew.MaxSizeMode = RibbonElementSizeMode.Medium;
            _infraNew.Click      += _infra_Click;

            _infraSettings             = new RibbonButton();
            _infraSettings.Name        = "Setting";
            _infraSettings.Text        = GetText.Text(_infraSettings.Name);
            _infraSettings.Image       = Tools.Utilities.UI.Resources.ResourceIconSet32Default.layers;
            _infraSettings.SmallImage  = Tools.Utilities.UI.Resources.ResourceIconSet16Default.layers;
            _infraSettings.MaxSizeMode = RibbonElementSizeMode.Large;
            _infraSettings.Click      += _infra_Click;

            _infraAdd             = new RibbonButton();
            _infraAdd.Name        = "Add";
            _infraAdd.Text        = GetText.Text(_infraAdd.Name);
            _infraAdd.Image       = Tools.Utilities.UI.Resources.ResourceIconSet32Default.layer_add;
            _infraAdd.SmallImage  = Tools.Utilities.UI.Resources.ResourceIconSet16Default.layer_add;
            _infraAdd.MaxSizeMode = RibbonElementSizeMode.Large;
            _infraAdd.Click      += _infra_Click;

            _panelInfra = new RibbonPanel(GetText.Text("Infra"));
            _panelInfra.Items.Add(_infraOpen);
            _panelInfra.Items.Add(_infraSave);
            _panelInfra.Items.Add(_infraNew);
            _panelInfra.Items.Add(_infraSettings);
            _panelInfra.Items.Add(_infraHome);
            _panelInfra.Items.Add(_infraAdd);
            this.Panels.Add(_panelInfra);
        }
コード例 #10
0
        public void Parse()
        {
            string testPath = Path.Combine(".", "gettext", "es_ES.po");

            Core.Localization localization = GetText.Parse(testPath, Encoding.GetEncoding("iso8859-1"));

            DateTime start = DateTime.UtcNow;
            Dictionary <string, string> indexed = localization.GetIndex("es_ES");
            DateTime end     = DateTime.UtcNow;
            TimeSpan elapsed = end - start;
        }
コード例 #11
0
 public override void ChangeLanguage()
 {
     RefreshData();
     labelDaemonStatus.Text      = GetText.Text("daemonstatus");
     labelConfigFolderPath.Text  = GetText.Text("configFolderPath");
     labelDaemonPID.Text         = GetText.Text("daemonPid");
     labelLogin.Text             = GetText.Text("login");
     labelPassword.Text          = GetText.Text("password");
     labelSynchroDate.Text       = GetText.Text("synchroDate");
     buttonSynchroStartStop.Text = _syncany.SynchronisationRunning ? GetText.Text("Started") : GetText.Text("Stopped");
 }
コード例 #12
0
 private void SwitchSynchro()
 {
     if (_syncany.SynchronisationRunning)
     {
         _syncany.SuspendSynchro();
     }
     else
     {
         _syncany.ResumeSynchro();
     }
     buttonSynchroStartStop.Text = _syncany.SynchronisationRunning ? GetText.Text("Started") : GetText.Text("Stopped");
 }
コード例 #13
0
        private static void Main(string[] args)
        {
            Console.WriteLine("\n--------   Calculation   --------\n");

            PerformCalculation getSum = Addition;

            Console.WriteLine(getSum(6, 4.5));

            PerformCalculation getSub = Substraction;

            Console.WriteLine(getSub(6, 4.5));

            /*********    Multi-cast     ***********/

            PerformCalculation operations = getSum + getSub;

            operations(3, 5);

            operations += Multiplication;
            operations(3, 5);

            operations -= Addition;
            operations(3, 5);
            operations -= getSub;
            operations(3, 5);

            //Dont do it: Give a logical fails, it runs but return last method.
            //Console.WriteLine(operations(3, 5));

            Console.WriteLine("\n\n\n");

            GetText welcomeMsg = Intro;

            Console.WriteLine(welcomeMsg("raph"));

            GetText welcomeName = delegate(string nametxt)
            {
                return("Hello, " + nametxt);
            };

            Console.WriteLine(welcomeName("Raphael"));

            // Call display method, send anonymous delegate function (one param and one string return)
            Display(welcomeName);



            Console.WriteLine("\n");

            Console.WriteLine(benVindo("Luana"));
            Console.WriteLine(bemVindo("Luana"));
        }
コード例 #14
0
        private void button1_Click(object sender, EventArgs e)
        {
            Eleme   eleme   = new Eleme();
            GetText text    = new GetText();
            int     number  = 0;
            int     number2 = 0;
            string  sn      = text.TextMiddle(Packets.Text, "sn=", "&theme_id", 0);

            if (sn == "")
            {
                MessageBox.Show("红包连接错误,请重新输入!");
            }
            else
            {
                int Packets_number = eleme.Packets_number(sn) - 1;
                if (listView1.Items.Count < Packets_number)
                {
                    MessageBox.Show("小号数量不足,请您添加!");
                }
                else
                {
                    for (int i = 0; i < listView1.Items.Count; i++)
                    {
                        string openid = listView1.Items[i].SubItems[1].Text;
                        string sign   = listView1.Items[i].SubItems[2].Text;
                        string SID    = listView1.Items[i].SubItems[3].Text;
                        number = eleme.Packets_Receive(openid, sign, SID, sn);
                        if (number > number2)
                        {
                            number2 = number;
                        }
                        if (number2 == Packets_number)
                        {
                            MessageBox.Show("当前红包总数量为" + Packets_number + 1 + "已领取数量" + number2 + "请您手动领取最大手气红包");
                            break;
                        }
                        if (number2 > Packets_number)
                        {
                            MessageBox.Show("最大手气已经被领取");
                            break;
                        }

                        if (i + 1 == listView1.Items.Count)
                        {
                            MessageBox.Show("当前红包总数量为" + Packets_number + 1 + "已领取数量" + number2);
                        }
                    }
                }
            }
        }
コード例 #15
0
 public override void RefreshData()
 {
     if (_syncany != null)
     {
         labelDaemonStatusValue.Text = Daemon.Started ? GetText.Text("Started") : GetText.Text("Stopped");
         labelConfigFileValue.Text   = string.IsNullOrEmpty(_syncany.CloudConfigPath) ? GetText.Text("Noconfigpathsaved") : _syncany.CloudConfigPath;
         labelDaemonPIDValue.Text    = Daemon.ProcessId.ToString();
         labelLoginValue.Text        = string.IsNullOrEmpty(_syncany.Login) ? GetText.Text("Unknow") : _syncany.Login;
         labelPasswordValue.Text     = string.IsNullOrEmpty(_syncany.Password) ? GetText.Text("Unknow") : "*******";
         labelSynchroDateValue.Text  = _syncany.LastSynchronisation.ToString();
         buttonSynchroStartStop.Text = _syncany.SynchronisationRunning ? GetText.Text("Started") : GetText.Text("Stopped");
         RefreshDataDirectories();
     }
 }
コード例 #16
0
    /// <summary>
    /// Adds a text reading to this object.
    /// </summary>
    /// <param name="name"></param>
    /// <param name="text"></param>
    public virtual void AddText(string name, string text, GetText getText = null)
    {
        var tex = Instantiate(TextObj, transform);

        tex.name = name;
        var texto = tex.GetComponent <Text>();

        texto.text = text;

        if (getText != null)
        {
            var update = tex.GetComponent <UpdateText>();
            update.UpdateTextDelegate = getText;
        }

        buttons.Add(name, tex);
    }
コード例 #17
0
        private void Init()
        {
            BuildPanelInfra();
            //BuildPanelComputer();
            //BuildPanelDocker();
            ////BuildPanelSyncany();
            ////BuildPanelGitHub();
            //BuildPanelBitbucket();
            ////BuildPanelJenkins();
            ////BuildPanelJira();
            ////BuildPanelSonar();
            //BuildPanelTeamCity();
            //BuildPanelYoutrack();
            //BuildPanelVPN();
            //BuildPanelPostGreSql();

            this.Text = GetText.Text("Infra");
        }
コード例 #18
0
        ///   <summary>
        ///   获取验证码基本配置
        ///   </summary>
        ///  <param name="qq">QQ号</param>
        ///   <param name="cap_cd">cap_cd</param>
        ///   <param name="sid">sid</param>
        ///  <param name="sess">sess</param>
        /// <returns>逻辑型</returns>
        public bool GetSliderInfo(string qq, string cap_cd, ref string sid, ref string sess)
        {
            string callback, data, url, temp = string.Empty;
            Json   json = new Json();

            callback = "_aq_" + GetText.GetRandom(111111, 999999);
            url      = "https://ssl.captcha.qq.com/cap_union_prehandle?aid=" + Resources.aid + "&captype=&protocol=https&clientype=1&disturblevel=&apptype=2&noheader=0&color=&showtype=&fb=1&theme=&lang=2052&ua=" + Resources.ua + "&cap_cd=" + cap_cd + "&uid=" + qq + "&callback=" + callback + "&sess=&subsid=1";
            data     = WEB.GetWebData(url, ref temp, ref temp, ref temp);
            data     = GetText.TextMiddle(data, callback + "(", ")", 0);
            json.Analysis(data);
            sid  = json.Getvalue("sid");
            sess = json.Getvalue("sess");
            if (sid == "" || sess == "")
            {
                return(false);
            }
            else
            {
                return(true);
            }
        }
コード例 #19
0
    void Update()
    {
        if (Input.GetMouseButtonDown(0))
        {
            WWWFormScore   thingconnection = (WWWFormScore)gameObject.AddComponent(typeof(WWWFormScore));
            GetText        haeteksti       = (GetText)gameObject.AddComponent(typeof(GetText));
            GetTemperature temperature     = (GetTemperature)gameObject.AddComponent(typeof(GetTemperature));
            TurnLight      valo            = (TurnLight)gameObject.AddComponent(typeof(TurnLight));

            Ray        ray = Camera.main.ScreenPointToRay(Input.mousePosition);
            RaycastHit hit;


            if (Physics.Raycast(ray, out hit, 100.0f))
            {
                this.Nimi   = hit.transform.name;
                ShowThisGUI = true;

                Debug.Log("Pisteessa " + hit.point + " on " + hit.transform.name + " ja arvo on : " + value);
            }
        }
    }
コード例 #20
0
 private void Form1_FormClosing(object sender, FormClosingEventArgs e)
 {
     try
     {
         GetText text = new GetText();
         string  path = AppDomain.CurrentDomain.BaseDirectory + "cookie.txt";
         string  data = "";
         for (int i = 0; i < listView1.Items.Count; i++)
         {
             Console.WriteLine(listView1.Items[i].SubItems[1].Text);
             string openid = listView1.Items[i].SubItems[1].Text;
             string sign   = listView1.Items[i].SubItems[2].Text;
             string SID    = listView1.Items[i].SubItems[3].Text;
             data = data + openid + "----" + sign + "----" + SID + Environment.NewLine;
         }
         text.WriteOutText(path, data);
         MessageBox.Show("cookie小号已经保存到路径   " + path);
     }
     catch {
         MessageBox.Show("保存cookie小号失败,请检查是否有读写权限!");
     }
 }
コード例 #21
0
        private void Form1_DragDrop(object sender, DragEventArgs e)
        {
            string path = ((System.Array)e.Data.GetData(DataFormats.FileDrop)).GetValue(0).ToString();

            if (path.Substring(path.Length - 4) == ".txt")
            {
                GetText  text  = new GetText();
                string   data  = text.GetTxt(path);
                int      line  = text.TextOccurrences(data, Environment.NewLine);
                string[] data2 = text.DivisionText(data, Environment.NewLine);
                for (int i = 0; i < line; i++)
                {
                    try
                    {
                        ListViewItem listView = new ListViewItem();
                        string[]     data3    = text.DivisionText(data2[i], "----");
                        int          ID       = listView1.Items.Count + 1;
                        listView.Text = ID.ToString();
                        listView.SubItems.Add(data3[0]);
                        listView.SubItems.Add(data3[1]);
                        listView.SubItems.Add(data3[2]);
                        listView1.Items.Add(listView);
                        //    Console.WriteLine(data3[1]);
                    }
                    catch {
                        MessageBox.Show("请拖入程序保存的cookie文件!");
                        break;
                    }
                }
            }


            else
            {
                MessageBox.Show("请拖入.txt文本");
            }
        }
コード例 #22
0
        ///   <summary>
        ///   是否需要验证码
        ///   </summary>
        ///  <param name="qq">QQ号</param>
        ///   <param name="cap_cd">cap_cd</param>
        ///   <param name="code">code</param>
        ///  <param name="verify">verify</param>
        /// <returns>逻辑型</returns>
        public bool Is_Code(string qq, ref string cap_cd, ref string code, ref string verify)
        {
            string url  = "https://ssl.ptlogin2.qq.com/check?pt_tea=2&uin=" + qq + "&appid=" + Resources.aid + "&ptlang=2052&regmaster=&pt_uistyle=9&r=" + GetText.GenerateTimeStamp() + "&pt_jstoken=1468653375";
            string temp = string.Empty;

            temp = WEB.GetWebData(url, ref temp, ref temp, ref temp);

            string [] data = GetText.TextMiddle(temp, "ptui_checkVC(", ")", 0).Replace("'", "").Split(',');
            if (data[0] == "0")
            {
                code   = data[1];
                verify = data[3];
                return(false);
            }
            else if (data[0] == "1")
            {
                cap_cd = data[1];
                return(true);
            }
            else
            {
                return(false);
            }
        }
コード例 #23
0
 public GraphicalWidget(GameInfo gameInfo, HUDAlignment hudAlignment, GetText func, Texture2D baseTexture)
     : base(gameInfo, hudAlignment, func)
 {
     BaseTexture = baseTexture;
 }
コード例 #24
0
 public GraphicalWidget(GameInfo gameInfo, HUDAlignment hudAlignment, GetText func, Texture2D baseTexture)
     : base(gameInfo, hudAlignment, func)
 {
     BaseTexture = baseTexture;
 }
コード例 #25
0
 string On(GetText q) => text;
コード例 #26
0
ファイル: TextWidget.cs プロジェクト: AlanFoster/Game-of-Life
 public TextWidget(GameInfo gameInfo, HUDAlignment hudAlignment, GetText func)
     : base(hudAlignment)
 {
     GameInfo = gameInfo;
     _getTextFunc = func;
 }
コード例 #27
0
 /// <summary> convenience constructor. </summary>
 public Access(GetText get, SetText set)
 {
     this.get = get; this.set = set;
 }
コード例 #28
0
ファイル: Request_response.cs プロジェクト: nuspect/Orleankka
 public string On(GetText q) => text;
コード例 #29
0
 public TimedWidget(GameInfo gameInfo, int timer, GetText func, HUDAlignment hudAlignment = HUDAlignment.Center)
     : base(gameInfo, hudAlignment, func)
 {
     _timer = timer;
 }
コード例 #30
0
 public static void Display(GetText textDelegated)
 {
     Console.WriteLine(textDelegated("Ivan"));
 }
コード例 #31
0
 public TimedWidget(GameInfo gameInfo, int timer, GetText func, HUDAlignment hudAlignment = HUDAlignment.Center)
     : base(gameInfo, hudAlignment, func)
 {
     _timer = timer;
 }
コード例 #32
0
 public string On(GetText q)
 {
     return(text);
 }
コード例 #33
0
 public Core.Localization ParseGetText() =>
 GetText.Parse(Path.Combine(".", "gettext", "es_ES.po"), Encoding.GetEncoding("iso8859-1"));
コード例 #34
0
ファイル: Analogies.cs プロジェクト: nated099/gbrainy
        public Analogy GetNext()
        {
            Analogy analogy;             // Holds a deep copy
            Analogy analogy_ref;         // Holds reference to the object
            ArrayListIndicesRandom indices = null;
            int  new_right = 0;
            bool localized = true;

            List.TryGetValue(Variant, out analogy_ref);
            analogy = analogy_ref.Copy();

            if (analogy.answers != null)               // Randomize answers order
            {
                string [] answers;

                indices = new ArrayListIndicesRandom(analogy.answers.Length);
                answers = new string [analogy.answers.Length];

                indices.Initialize();

                for (int i = 0; i < indices.Count; i++)
                {
                    if (GetText.StringExists(analogy.answers [indices[i]]) == false)
                    {
                        localized = false;
                    }

                    answers [i] = Translations.GetString(analogy.answers [indices[i]]);
                    if (indices[i] == analogy.right)
                    {
                        new_right = i;
                    }
                }
                analogy.right   = new_right;
                analogy.answers = answers;
            }

            if ((GetText.StringExists(analogy.question) == false) ||
                (String.IsNullOrEmpty(analogy.tip) == false && GetText.StringExists(analogy.tip) == false) ||
                (String.IsNullOrEmpty(analogy.rationale) == false && GetText.StringExists(analogy.rationale) == false))
            {
                localized = false;
            }

            if (localized == true)
            {
                analogy.question = Translations.GetString(analogy.question);

                if (String.IsNullOrEmpty(analogy.tip) == false)
                {
                    analogy.tip = Translations.GetString(analogy.tip);
                }

                if (String.IsNullOrEmpty(analogy.rationale) == false)
                {
                    analogy.rationale = Translations.GetString(analogy.rationale);
                }
            }
            else
            {
                // Get analogy again
                List.TryGetValue(Variant, out analogy_ref);
                analogy = analogy_ref.Copy();

                if (analogy.answers != null)                   // Randomize answers order
                {
                    string [] answers;

                    answers = new string [analogy.answers.Length];

                    for (int i = 0; i < indices.Count; i++)
                    {
                        answers [i] = analogy.answers [indices[i]];
                    }

                    analogy.right   = new_right;
                    analogy.answers = answers;
                }
            }
            return(analogy);
        }
コード例 #35
0
 public void ChangeLanguage()
 {
     _ribbon.OrbText = GetText.Text("File");
     _btn_open.Text  = GetText.Text("Open");
     _btn_exit.Text  = GetText.Text("Exit");
 }