Beispiel #1
0
        public static long getNextId(INDEX index)
        {
            long nextId = getValue(index);

            storeValue(index, nextId + 1);
            return(nextId);
        }
Beispiel #2
0
        private static long getValue(INDEX index)
        {
            long nextId = 1;

            switch (index)
            {
            case INDEX.TeamId:
                nextId = somReportUtils.Properties.Settings.Default.TeamId;
                break;

            case INDEX.PlayerId:
                nextId = somReportUtils.Properties.Settings.Default.PlayerId;
                break;

            case INDEX.LineupItemId:
                nextId = somReportUtils.Properties.Settings.Default.LineupItemId;
                break;

            case INDEX.LineupDataId:
                nextId = somReportUtils.Properties.Settings.Default.LineupDataId;
                break;

            case INDEX.TestTeamId:
                nextId = somReportUtils.Properties.Settings.Default.TestTeamId;
                break;

            case INDEX.DefenseId:
                nextId = somReportUtils.Properties.Settings.Default.DefenseId;
                break;
            }
            return(nextId);
        }
Beispiel #3
0
        private static void storeValue(INDEX index, long storeId)
        {
            switch (index)
            {
            case INDEX.TeamId:
                somReportUtils.Properties.Settings.Default.TeamId = storeId;
                break;

            case INDEX.PlayerId:
                somReportUtils.Properties.Settings.Default.PlayerId = storeId;
                break;

            case INDEX.LineupItemId:
                somReportUtils.Properties.Settings.Default.LineupItemId = storeId;
                break;

            case INDEX.LineupDataId:
                somReportUtils.Properties.Settings.Default.LineupDataId = storeId;
                break;

            case INDEX.TestTeamId:
                somReportUtils.Properties.Settings.Default.TestTeamId = storeId;
                break;

            case INDEX.DefenseId:
                somReportUtils.Properties.Settings.Default.DefenseId = storeId;
                break;
            }
            somReportUtils.Properties.Settings.Default.Save();
        }
Beispiel #4
0
        public virtual INDEX GetINDEXHSX()
        {
            try
            {
                Database  database  = DatabaseFactory.CreateDatabase("DatabasePriceHSX");
                DbCommand dbCommand = database.GetStoredProcCommand("HN_AGStock_Session_SelectIndex");

                INDEX item = new INDEX();
                using (IDataReader reader = database.ExecuteReader(dbCommand))
                {
                    while (reader.Read())
                    {
                        item = CreateShareTypeFromReader(reader);
                        break;
                        //listItem.Add(item);
                    }
                    reader.Close();
                }
                //totalRecords = (int)database.GetParameterValue(dbCommand, "@TotalRecords");
                return(item);
            }
            catch (Exception ex)
            {
                // log this exception
                log4net.Util.LogLog.Error(ex.Message, ex);
                // wrap it and rethrow
                throw;
            }
        }
Beispiel #5
0
 public static void resetAllIndexs()
 {
     foreach (INDEX index in INDEX.GetValues(typeof(INDEX)))
     {
         storeValue(index, 1);
     }
 }
Beispiel #6
0
        /// <summary>
        /// Loads a Halo 2 Map file using the specified <see cref="HaloIO"/> instance.
        /// </summary>
        /// <param name="io">The <see cref="HaloIO"/> used to access the map file.</param>
        private void LoadMap(HaloIO io)
        {
            //Open
            io.OpenIO();

            //Read Header
            io.Position = 0;
            header      = io.In.ReadStructure <HEADER>();

            //Prepare Index Table Header
            io.Position = header.IndexOffset;
            index       = io.In.ReadStructure <INDEX>();

            //Load File Names
            LoadFileNamesInfo(io);

            //Load Tag Objects
            LoadTagsInfo(io);

            //Load Index Objects
            LoadObjectInfo(io);

            //Load Strings
            LoadStringsInfo(io);

            //Fix SBSPs and LTMPs
            FixSpecialEntries(io);

            //Close Map
            io.CloseIO();
        }
Beispiel #7
0
            private void DijkstraLink(INDEX index, int indexX, int indexY)
            {
                if (field_[indexX, indexY].link_.LinkObject.Length == 0)
                {
                    GameObject[] objs = new GameObject[1];

                    objs[0] = field_[index.indexX, index.indexY].link_.gameObject;

                    field_[indexX, indexY].link_.LinkObject = objs;
                }
                else
                {
                    GameObject[] objs = new GameObject[field_[indexX, indexY].link_.LinkObject.Length + 1];

                    if (index.indexX == -1 || index.indexY == -1)
                    {
                        return;
                    }

                    int cnt = 0;
                    foreach (var links in field_[indexX, indexY].link_.LinkObject)
                    {
                        objs[cnt] = links;
                        cnt++;
                    }

                    objs[cnt] = field_[index.indexX, index.indexY].link_.gameObject;
                    field_[indexX, indexY].link_.LinkObject = objs;
                }
            }
Beispiel #8
0
 public static Index Get(INDEX index)
 {
     return(new Index
     {
         Id = index.ID,
         Value = index.VALUE
     });
 }
Beispiel #9
0
        public virtual INDEX CreateShareTypeFromReader(IDataReader reader)
        {
            INDEX item = new INDEX();

            try
            {
                if (!reader.IsDBNull(reader.GetOrdinal("IndexName")))
                {
                    item.IndexName = (string)reader["IndexName"];
                }
                if (!reader.IsDBNull(reader.GetOrdinal("Index")))
                {
                    item.Index = (decimal)reader["Index"];
                }
                if (!reader.IsDBNull(reader.GetOrdinal("SessionDate")))
                {
                    item.SessionDate = (DateTime)reader["SessionDate"];
                }
                if (!reader.IsDBNull(reader.GetOrdinal("Total")))
                {
                    item.Total = (decimal)reader["Total"];
                }
                if (!reader.IsDBNull(reader.GetOrdinal("TotalShare")))
                {
                    item.TotalShare = (int)reader["TotalShare"];
                }
                if (!reader.IsDBNull(reader.GetOrdinal("Diff")))
                {
                    item.Diff = (decimal)reader["Diff"];
                }
                if (!reader.IsDBNull(reader.GetOrdinal("DiffRate")))
                {
                    item.DiffRate = (decimal)reader["DiffRate"];
                }

                if (!reader.IsDBNull(reader.GetOrdinal("Advances")))
                {
                    item.Advances = (int)reader["Advances"];
                }
                if (!reader.IsDBNull(reader.GetOrdinal("Declines")))
                {
                    item.Declines = (int)reader["Declines"];
                }
                if (!reader.IsDBNull(reader.GetOrdinal("NoChange")))
                {
                    item.NoChange = (int)reader["NoChange"];
                }
            }
            catch (Exception ex)
            {
                // log this exception
                log4net.Util.LogLog.Error(ex.Message, ex);
                // wrap it and rethrow
                throw;
            }
            return(item);
        }
Beispiel #10
0
        public void AddEntry(System.Collections.Specialized.StringCollection item)
        {
            Entry entry = new FileFolderEntry(item, INDEX.ToString());

            INDEX++;

            if (entries.Contains(entry))
            {
                entries.Remove(entry);
            }

            entries.Add(entry);
        }
                    public string ToString(INDEX indx = INDEX.ID_PUT)
                    {
                        string strRes = string.Empty;

                        switch (indx)
                        {
                        case INDEX.ID_ALG:
                            strRes = _values[(int)INDEX.ID_ALG].ToString();
                            break;

                        case INDEX.ID_PUT:
                            strRes = _values[(int)INDEX.ID_ALG].ToString() + DELIMETER_KEY + _values[(int)INDEX.ID_PUT].ToString();
                            break;
                        }

                        return(strRes);
                    }
Beispiel #12
0
        internal virtual void OnIndexEdit(INDEX index)
        {
            //Get State
            bool ioState = io.Open;

            if (!ioState)
            {
                io.OpenIO();
            }

            //Write
            io.Position = header.IndexOffset;
            io.Out.Write(index);

            //Close?
            if (!ioState)
            {
                io.CloseIO();
            }
        }
Beispiel #13
0
        // add new entry
        public void AddEntry(String content)
        {
            Entry entry = new TextEntry(content, INDEX.ToString());

            INDEX++;

            // if equal content is beeng copied in the past, remove it.
            // this is how we hande duplicates.
            // new content should be last in the list.
            if (entries.Contains(entry))
            {
                entries.Remove(entry);
            }

            if (entries.Count >= maximumEntriesAlowed)
            {
                entries.RemoveAt(1);
            }

            entries.Add(entry);
        }
Beispiel #14
0
        void setValueField(string[] l, INDEX i)
        {
            list  = l;
            index = (int)i;

            if (list == null)
            {
                throw new ArgumentException("Parameter cannot be null", "list");
            }
            else if (index >= list.Length)
            {
                StringBuilder sb = new StringBuilder();

                sb.Append("Lista nâo contem o dado a ser convertido");
                sb.Append(" index = " + index);
                sb.Append(" length =  " + list.Length);

                throw new ArgumentException(sb.ToString(), "list");
            }
            else
            {
                strField = list[index];
            }
        }
Beispiel #15
0
    ///
//C++ TO C# CONVERTER TODO TASK: The implementation of the following method could not be found:
//  virtual void SelectSurfaceOfPoint(Point<3> p, PointGeomInfo gi);
    ///
//C++ TO C# CONVERTER WARNING: 'const' methods are not available in C#:
//ORIGINAL LINE: virtual void ProjectPoint(INDEX, Point<3> &) const
    public virtual void ProjectPoint(INDEX UnnamedParameter, ref Point <3>)
    {
Beispiel #16
0
 internal FieldFrame(INDEX i, string[] l)
 {
     unit = UNIT_FIELD.GRAU_DECIMAL;
     setValueField(l, i);
 }
Beispiel #17
0
 internal FieldFrame(INDEX i, string[] l, UNIT_FIELD u)
 {
     unit = u;
     setValueField(l, i);
 }
Beispiel #18
0
 public ICbValue this[INDEX index]
 {
     get => Values[(int)index];
Beispiel #19
0
 public static void resetIndex(INDEX index)
 {
     storeValue(index, 1);
 }
Beispiel #20
0
    void SetDataDictionary(string[] elements, Dictionary <string, float> dictionary, string textName)
    {
        //foreach(string ellement in workArray)
        //{
        //    if(ellement == "" || ellement == null)
        //    {
        //        Debug.Assert(false,"データの読み込みに失敗しています");
        //        return;
        //    }
        //}

        // ディクショナリの「key」と「value」にするものを保持しておく配列
        string[] keyValue = new string[2];
        // 文字を読み取るたびに増やしていく
        //int workIndex = 0;
        INDEX workIndex = INDEX.KEY;

        for (int i = 0; i < elements.Length; i++)
        {
            // 添え字をKEY(0)→VALUE(1)→KEY(0)→...に循環させる
            workIndex = (INDEX)Mathf.Repeat((int)workIndex, 2);
            // 空のセル( "" )
            string emptyCell = "";
            // 空のセルなら添え字を増加させない
            if (elements[i] == emptyCell)
            {
                continue;
            }

            // 保持領域に数値を代入
            keyValue[(int)workIndex] = elements[i];

            // valueのほうに代入が完了した(key/valueがどっちもそろった)ならディクショナリに移す
            if (workIndex == INDEX.VALUE)
            {
                // ディクショナリのkeyになる変数
                string key = keyValue[(int)INDEX.KEY];
                // keyが数字でないかチェック
                StringCheck(key, textName);
                // ディクショナリのvalueになる変数をfloat型に変換
                float value = ChangeStringToFloat(keyValue[(int)INDEX.VALUE], textName);
                // ディクショナリにセット
                dictionary.Add(key, value);
            }
            // インデックスを進める
            workIndex++;
        }

        // keyのほうが埋まっているのにディクショナリへの変換が残っている
        // = key と value が対になっていない場合に警告を出す
        if (workIndex == INDEX.VALUE)
        {
            // テキストのもとになったシートの名前
            var sheetName = textNameToSheetNameDic[textName];
            // エラー用ポップアップウィンドウをアクティブ化
            errorPopObj.SetActive(true);
            // テキスト変更
            errorPop.ChangeText("グーグルスプレッドシートの入力が間違っています\n" +
                                "テキスト名:" + sheetName + "\n" +
                                "エラー内容:入力されていないセルがあります\n" +
                                "数値を直してアプリを再起動してください\n" +
                                "数値の入っているセルを選択しているとその数値は反映されないので" +
                                "何も記入していないセルをクリックしてください");
        }
    }