Пример #1
0
        public static RSR FromSR(TCore.SR sr)
        {
            RSR rsr = new RSR();

            rsr.Result = sr.Result;
            rsr.Reason = sr.Reason;

            return rsr;
        }
Пример #2
0
    private void RightMouseClick()
    {
        GenericMenu menu = new GenericMenu();


        menu.AddItem(new GUIContent("Size/Small"), TCore.isCurentSize(TODOListSize.SMALL), SubMenuCallBack, TODOMenuItem.SIZE_SMALL);
        menu.AddItem(new GUIContent("Size/Large"), TCore.isCurentSize(TODOListSize.LARGE), SubMenuCallBack, TODOMenuItem.SIZE_LARGE);
        menu.AddSeparator("");
        menu.AddItem(new GUIContent("Documentation"), false, SubMenuCallBack, TODOMenuItem.DOCUMENTATION);


        menu.ShowAsContext();
    }
Пример #3
0
    private void initializeView()
    {
        createSelectionTexture();

        _tags = new List <TagTemplate>();
        TagTemplate tpl = new TagTemplate("#All", "#All");

        tpl.isAllTag = true;

        _tags.Add(tpl);

        TCore.view = this;
        initTags();
        TCore.init();
        minSize = new Vector2(700, 320);
    }
Пример #4
0
        /// <summary>
        /// 开启线程加载
        /// </summary>
        /// <param name="audioPath"></param>
        private void ThreadDownLoad(object audioPath)
        {
            float waitTime = 5000;

            //Debug.Log("线程加载");
            while (!TCore.active)
            {
                Thread.Sleep(100);
                waitTime -= 100;
                if (waitTime < 0)
                {
                    connectError = true;
                    return;
                }
            }
            while (waitAudioQueue.Count > 0)
            {
                var item = waitAudioQueue.Dequeue();
                //Debug.Log(item.Key+":"+item.Value);
                TCore.TextToSpeech(item.Key, item.Value.ToString(), Path.Combine(audioPath.ToString(), AudioFileName(item.Key, item.Value)));
            }
        }
Пример #5
0
                public string SGenerateUpdateQuery(TCore.Sql sql, bool fAdd)
                {
                    if (!fAdd)
                        return null;
                    string sInsertExtra = "";
                    string sValuesExtra = "";
                    string sValuesTemplate = "VALUES ('{0}','{1}','{2}','{3}','{4}',{5},{6},{7},{8}{9})";

                    // let's figure out if we're going to include ReleasedFieldsDate and ReleasedCagesDate
                    if (m_dttmReleasedFieldsDate != null)
                        {
                        sInsertExtra += ", ReleasedFieldsDate";
                        sValuesExtra += String.Format(",'{0}'",
                                                      m_dttmReleasedFieldsDate.Value.ToString("M/d/yyyy HH:mm"));
                        }

                    if (m_dttmReleasedCagesDate != null)
                        {
                        sInsertExtra += ", ReleasedCagesDate";
                        sValuesExtra += String.Format(",'{0}'",
                                                      m_dttmReleasedCagesDate.Value.ToString("M/d/yyyy HH:mm"));
                        }

                    if (m_sEmail1 != null)
                        {
                        sInsertExtra += ", Email1";
                        sValuesExtra += String.Format(",'{0}'", m_sEmail1);
                        }

                    if (m_sEmail2 != null)
                        {
                        sInsertExtra += ", Email2";
                        sValuesExtra += String.Format(",'{0}'", m_sEmail2);
                        }

                    string sQueryBase = String.Format(s_sSqlInsert, sInsertExtra);
                    string sQueryValues = String.Format(sValuesTemplate, Sql.Sqlify(m_sName),
                                                        Sql.Sqlify(m_sDivision),
                                                        Sql.Sqlify(m_sPassword),
                                                        m_dttmCreated.Value.ToString("M/d/yyyy HH:mm"),
                                                        m_dttmUpdated.Value.ToString("M/d/yyyy HH:mm"),
                                                        m_cFieldsReleased, m_cCagesReleased, m_cFieldsReleasedToday,
                                                        m_cCagesReleasedToday, sValuesExtra);
                    return String.Format("{0} {1}", sQueryBase, sQueryValues);
                }
Пример #6
0
                /* P R E F L I G H T */
                /*----------------------------------------------------------------------------
                    %%Function: Preflight
                    %%Qualified: RwpSvc.Practice:Teams:RwpTeam.Preflight
                    %%Contact: rlittle

                ----------------------------------------------------------------------------*/
                public RSR Preflight(TCore.Sql sql)
                {
                    List<string> plsFail = new List<string>();

                    CheckLength(m_sName, "TeamName", 50, plsFail);
                    CheckLength(m_sDivision, "Division", 10, plsFail);
                    CheckLength(m_sPassword, "PW", 20, plsFail);

                    if (plsFail.Count > 0)
                        return SRFromPls("preflight failed", plsFail);

                    return RSR.Success();
                }
Пример #7
0
                /* L O A D  R W P T  F R O M  C S V */
                /*----------------------------------------------------------------------------
                    %%Function: LoadRwptFromCsv
                    %%Qualified: RwpSvc.Practice:Teams:CsvTeams.LoadRwptFromCsv
                    %%Contact: rlittle

                ----------------------------------------------------------------------------*/
                public RSR LoadRwptFromCsv(string sLine, TCore.Sql sql, out RwpTeam rwpt, out bool fAdd, out List<string> plsDiff)
                {
                    string []rgs = LineToArray(sLine);
                    SqlWhere sw = new SqlWhere();
                    fAdd = true;
                    rwpt = new RwpTeam();
                    plsDiff = new List<string>();

                    sw.AddAliases(RwpTeam.s_mpAliases);
                    try
                        {
                        rwpt.Name = GetStringVal(rgs, "TEAMNAME");
                        if (rwpt.Name == "")
                            return RSR.Success();

                        sw.Add(String.Format("$$rwllteams$$.TeamName = '{0}'", Sql.Sqlify(rwpt.Name)), SqlWhere.Op.And);
                        SqlReader sqlr = new SqlReader(sql);
                        if (sqlr.FExecuteQuery(sw.GetWhere(RwpTeam.s_sSqlQueryString), _sResourceConnString)
                            && sqlr.Reader.Read())
                            {
                            sqlr.Close();
                            // found a match.  for now, this is an error
                            throw new Exception(String.Format("team name {0} already exists", rwpt.Name));
                            }
                        sqlr.Close();

                        rwpt.Division = GetStringValNullable(rgs, "DIVISION");
                        rwpt.Password = GetStringValNullable(rgs, "PW");
                        rwpt.Created = GetDateValNullable(rgs, "DATECREATED");
                        rwpt.Updated = GetDateValNullable(rgs, "DATEUPDATED");
                        rwpt.FieldsReleased = GetIntVal(rgs, "FIELDSRELEASECOUNT");
                        rwpt.CagesReleased = GetIntVal(rgs, "CAGESRELEASECOUNT");
                        rwpt.FieldsReleasedToday = GetIntVal(rgs, "RELEASEDFIELDSTODAY");
                        rwpt.CagesReleasedToday = GetIntVal(rgs, "RELEASEDCAGESTODAY");
                        rwpt.ReleasedFieldsDate = GetDateValNullable(rgs, "RELEASEDFIELDSDATE");
                        rwpt.ReleasedCagesDate = GetDateValNullable(rgs, "RELEASEDCAGESDATE");
                        rwpt.Email1 = GetStringValNullable(rgs, "EMAIL1");
                        rwpt.Email2 = GetStringValNullable(rgs, "EMAIL2");
                        }
                    catch (Exception e)
                        {
                        return RSR.Failed(e);
                        }

                    return RSR.Success();
                }
Пример #8
0
    //--------------------------------------
    // INITIALIZE
    //--------------------------------------

    //--------------------------------------
    // PUBLIC METHODS
    //--------------------------------------

    public static void renderTag(TagTemplate tpl, int index)
    {
        int FONT_SIZE = 12;


        int d  = 30;
        int m  = 40;
        int l  = 25;
        int w  = 40;
        int x  = 15;
        int mx = 15;

        if (TCore.size == TODOListSize.SMALL)
        {
            FONT_SIZE = 9;
            m         = 25;
            d         = 20;
            w         = 25;
            x         = 5;
            l         = 18;
            mx        = 18;
        }

        tpl.rect = new Rect(0, index * m - d - x, TODOMainView.TAGS_PANLE_WIDTH, w);


        if (tpl.isSelected)
        {
            Rect r = tpl.rect;
            r.x      += 1f;
            r.y      += 1f;
            r.height -= 1f;

            if (TCore.view.selectionTexture == null)
            {
                TCore.view.createSelectionTexture();
            }

            GUI.DrawTexture(r, TCore.view.selectionTexture);
        }


        GUILayout.BeginArea(new Rect(mx, index * m - d, TODOMainView.TAGS_PANLE_WIDTH, 50), ""); {
            GUIStyle s = new GUIStyle(EditorStyles.boldLabel);
            s.fontSize = FONT_SIZE;
            if (TCore.size == TODOListSize.SMALL)
            {
                s.fontStyle = FontStyle.Normal;
            }

            int count = TCore.getTagCount(tpl.name);

            if (tpl.isAllTag)
            {
                foreach (TagTemplate t in TCore.view.tags)
                {
                    count += TCore.getTagCount(t.name);
                }
            }

            GUILayout.Label(tpl.name + " (" + count.ToString() + ")", s);
        } GUILayout.EndArea();



        //Drawing.DrawLine(new Vector2(0, index * m - d + l) TODOMainView.TAGS_PANLE_WIDTH);
        Drawing.DrawDashLine(new Vector2(0, index * m - d + l), 10, TODOMainView.TAGS_PANLE_WIDTH);
    }