Пример #1
0
        //*******************************************************************************
        //   Function Name : subUnitTable
        //   Description   : 콤보박스의 선택된 유닛의 테이블을 만듬.
        //   Parameters    : ddtUnit = 그리드에 뿌려줄 테이블,
        //                   dintComboIndex = 콤보 박스의 선택된 인덱스
        //   Return Value  :
        //   Special Notes : None
        //*******************************************************************************
        //   2007/03/19         박 근 태
        //*******************************************************************************
        public void subAddColumnsUnitTb()
        {
            try
            {
                int dintLoop = 0;           //Loop를 돌리기 위함.
                //pdtUnitTable.Clear();
                //grdAlarmList.DataSource = null;
                pdtUnitTable.Columns.Clear();
                //pdtUnitTable에 컬럼값들을 추가함.
                pdtUnitTable = PclsDataGridView.funAddColumn(pdtUnitTable, "LOTID", "LOTID");
                pdtUnitTable = PclsDataGridView.funAddColumn(pdtUnitTable, "SlotID", "SlotID");
                pdtUnitTable = PclsDataGridView.funAddColumn(pdtUnitTable, "GLSID", "GLSID");

                //pdtUnitTable = PclsDataGridView.funAddColumn(pdtUnitTable, "UnitID", "UnitID");
                //pdtUnitTable = PclsDataGridView.funAddColumn(pdtUnitTable, "CSTID", "CSTID");
                //pdtUnitTable = PclsDataGridView.funAddColumn(pdtUnitTable, "LOTIndex", "LOTIndex");
                //pdtUnitTable = PclsDataGridView.funAddColumn(pdtUnitTable, "GLSStartTime", "GLSStartTime");
                //pdtUnitTable = PclsDataGridView.funAddColumn(pdtUnitTable, "DLPPID", "DLPPID");
                //pdtUnitTable = PclsDataGridView.funAddColumn(pdtUnitTable, "ACPPID", "ACPPID");

                //if (PintComboIndex > 0 && PintComboIndex < 13)
                //{
                for (dintLoop = 1; dintLoop <= PInfo.Unit(0).SubUnit(0).GLSAPDCount; dintLoop++)
                {
                    //pdtUnitTable = PclsDataGridView.funAddColumn(pdtUnitTable, PInfo.Unit(PintComboIndex).SubUnit(0).GLSAPD(dintLoop).Name, PInfo.Unit(PintComboIndex).SubUnit(0).GLSAPD(dintLoop).Name);
                    pdtUnitTable = PclsDataGridView.funAddColumn(pdtUnitTable, PInfo.Unit(0).SubUnit(0).GLSAPD(dintLoop).Name, PInfo.Unit(0).SubUnit(0).GLSAPD(dintLoop).Name);
                }
                //}
            }
            catch (Exception ex)
            {
                this.PInfo.subLog_Set(InfoAct.clsInfo.LogType.CIM, ex.ToString());
            }
        }
Пример #2
0
        public List <PInfo> ReadAll(string filename)
        {
            // A list that has all PInfos
            List <PInfo> listOfPInfo = new List <PInfo>();
            PInfo        tmp;
            string       line;

            // Read the file
            System.IO.StreamReader file =
                new System.IO.StreamReader(filename);

            while ((line = file.ReadLine()) != null)
            {
                // Taking a string
                String str = line;
                // spearator
                char spearator = ';';
                // Split every line
                String[] strlist = str.Split(spearator);

                // If we have more than two elements that means we can add them.
                if (strlist.Length > 1)
                {
                    tmp = new PInfo(strlist[0].Trim(new Char[] { '\n', '\r' }), strlist[1].Trim(new Char[] { '\n', '\r' }));
                    listOfPInfo.Add(tmp);
                }
            }
            file.Close();
            return(listOfPInfo);
        }
Пример #3
0
        public SQLDefinitionField Add <TProperty>(Expression <Func <T, TProperty> > expression, string fieldName = null, string suffix = null, int?listIndex = null)
        {
            var result = new SQLDefinitionField(PInfo <T> .Info(expression, false), fieldName, suffix, listIndex);

            Definition.Add(result);
            return(result);
        }
Пример #4
0
    public void AddParticle(Vector3f v, Colorf c)
    {
        v -= Origin;

        if (UniqueParticles && Uniques.Contains(v))
        {
            return;
        }

        Vector3i key = ToIndex(v);
        PInfo    pinfo;

        if (Particles.TryGetValue(key, out pinfo))
        {
            pinfo.count++;
            //pinfo.AccumColor += new Vector3f(c.r, c.g, c.b);
            pinfo.AccumColor = pinfo.count * new Vector3f(c.r, c.g, c.b);
            Particles[key]   = pinfo;
        }
        else
        {
            pinfo = new PInfo()
            {
                count = 1, AccumColor = c
            };
            Particles.Add(key, pinfo);
            Extents.Contain(key);
        }

        if (UniqueParticles)
        {
            Uniques.Add(v);
        }
    }
            public PInfo[,] GetDrawn(PInfo look)
            {
                PInfo[,] info;

                if (look.HasBackground)
                {
                    info = getInked(MaxLength, 1, new PInfo().SetBg(look.Background));
                }
                else
                {
                    info = getInked(MaxLength, 1, new PInfo());
                }


                int i = 0;

                foreach (var item in content)
                {
                    foreach (var c in item.content)
                    {
                        info[i, 0].SetC(c);
                        info[i, 0].SetFg(look.Foreground);
                        i++;
                    }
                    if (i < MaxLength)
                    {
                        i++;
                    }
                }
                return(info);
            }
Пример #6
0
        public ReadXML()
        {
            string   fname = Directory.GetCurrentDirectory() + "\\projects.xml";
            FileInfo finfo = new FileInfo(fname);

            if (!finfo.Exists)
            {
                Console.WriteLine("file not exit");
            }
            else
            {
                XElement xe = XElement.Load("projects.xml");
                IEnumerable <XElement> elements = from PInfo in xe.Elements("Project")
                                                  where PInfo.Attribute("Vendor").Value != null && PInfo.Attribute("Header").Value != null
                                                  select PInfo;

                foreach (XElement element in elements)
                {
                    Project pro = new Project();
                    pro = ReadXeToProject(element);
                    if (pro != null)
                    {
                        projects.Add(pro);
                    }
                }
                foreach (Project my in projects)
                {
                    Console.WriteLine(my.Vendor + my.Header);
                    my.ProjectDevices.DeviceListPrint();
                    Console.WriteLine("+++++");
                }
            }
        }
Пример #7
0
        public void TestPInfo()
        {
            PInfo[,] data = new PInfo[_BufferWidth, _BufferHeight];
            data.Populate(new PInfo().SetC('c').SetBg(ConsoleColor.Red).SetFg(ConsoleColor.Blue));

            PrintBuffer(data);
        }
Пример #8
0
        public static PInfo[,] getColoredStrip(int height, Tuple <Tuple <int, int, int>, PInfo> mid, PInfo top, PInfo bottom)
        {
            //int notwall = (height - mid.Item1 ) / 2;
            PInfo[,] data = new PInfo[1, height];
            data.Populate();
            for (int y = 0; y < height; y++)
            {
                if (y < mid.Item1.Item1)
                {
                    data[0, y].Override(top);
                }
                else
                {
                    if (y < mid.Item1.Item1 + mid.Item1.Item2)
                    {
                        data[0, y].Override(mid.Item2);
                    }
                    else
                    {
                        data[0, y].Override(bottom);
                    }
                }
            }

            return(data);
        }
Пример #9
0
        public static short ColorToAttribute(PInfo info)
        {
            int f = (int)info.Foreground;
            int b = (int)info.Background;

            return((short)(f | (b << 4)));
        }
Пример #10
0
        /// <summary>
        /// DataReader 转换为 Model
        /// </summary>
        /// <param name="idr"></param>
        /// <returns></returns>
        protected virtual T DataReaderToModel(IDataReader idr)
        {
            if (null == idr)
            {
                return(null);
            }
            if (idr.Read())
            {
                T model = new T();
                PropertyInfo[] arrPInfo = model.GetType().GetProperties();
                foreach (PropertyInfo PInfo in arrPInfo)
                {
                    if (!idr.HasField(PInfo.Name))
                    {
                        continue;
                    }

                    if (DBNull.Value != idr[PInfo.Name])
                    {
                        PInfo.SetValue(model, idr[PInfo.Name], null);
                    }
                }
                return(model);
            }
            else
            {
                return(null);
            }
        }
Пример #11
0
        // To process all types that are not defined in System.TypeCode
        private void SetValueForObjects(object data, string argValue)
        {
            switch (PInfo.PropertyType.FullName)
            {
            case "System.Uri":
                PInfo.SetValue(data, GetObjectValue <Uri>(argValue,
                                                          (str) => { return(new Uri(str)); }));
                break;

            case "System.Version":
                PInfo.SetValue(data, GetComparableValue <Version>(argValue,
                                                                  (str) => { return(new Version(str)); }));
                break;

            case "System.Byte[]":
                PInfo.SetValue(data, GetObjectValue <byte[]>(argValue,
                                                             (str) => { return(Encoding.ASCII.GetBytes(str)); }));
                break;

            case "System.Char[]":
                PInfo.SetValue(data, GetObjectValue <char[]>(argValue,
                                                             (str) => { return(str.ToArray <char>()); }));
                break;

            default:
                throw new NotSupportedException(string.Format("The type of the argument '{0}' is not supported.", NamedArgument.Name));
            }
        }
Пример #12
0
 private void CachePropertyInfo(PInfo flags)
 {
     if ((cached & flags) != flags)
     {
         get_property_info(this, ref info, flags);
         cached |= flags;
     }
 }
Пример #13
0
 private void CachePropertyInfo(PInfo flags)
 {
     if ((this.cached & flags) != flags)
     {
         MonoPropertyInfo.get_property_info(this, ref this.info, flags);
         this.cached |= flags;
     }
 }
Пример #14
0
 public TextBox(string indexer, string content, PInfo style, int x, int y, Alignment parentAnchor, int width, int heigth)
 {
     Indexer      = indexer;
     Content      = content;
     Style        = style;
     X            = x;
     Y            = y;
     ParentAnchor = parentAnchor;
     Width        = width;
     Heigth       = heigth;
 }
Пример #15
0
        public bool AddModel(T model)
        {
            bool   isSuccess = false;
            string cmdtext   = model.AddSQL;

            try
            {
                if (model.PKeyDataType.IsDigitType())
                {
                    object obj = DbHelperSQL.GetSingle(cmdtext, model.ParamsForAdd);

                    if (null != obj && DBNull.Value != obj && obj.ToString() != "0")
                    {
                        PropertyInfo[] arrPInfo = model.GetType().GetProperties();
                        foreach (PropertyInfo PInfo in arrPInfo)
                        {
                            if (PInfo.Name.Equals(PKey))
                            {
                                if (model.PKeyDataType == typeof(System.Int32))
                                {
                                    PInfo.SetValue(model, System.Int32.Parse(obj.ToString()), null);
                                }
                                else if ((model.PKeyDataType == typeof(System.Int64)))
                                {
                                    PInfo.SetValue(model, System.Int64.Parse(obj.ToString()), null);
                                }

                                break;
                            }
                        }
                        isSuccess = true;
                    }
                    else
                    {
                        isSuccess = false;
                    }
                }
                else
                {
                    if (DbHelperSQL.ExecuteSql(cmdtext, model.ParamsForAdd) > 0)
                    {
                        isSuccess = true;
                    }
                }
            }
            catch (Exception ex)
            {
                isSuccess = false;
                throw ex;
            }

            return(isSuccess);
        }
Пример #16
0
    // Use this for initialization
    void Start()
    {
        client = GameObject.Find("Network").GetComponent <TestClient>();
        packet = new Packet();

        pInfo = GameObject.Find("Player").GetComponent <PInfo>();

        message    = new CMessage((int)PROTOCOL.PLAYER_INFO);
        playerInfo = new PlayerInfo((int)PROTOCOL.PLAYER_INFO);

        e       = new SocketAsyncEventArgs();
        pbuffer = new byte[512];
    }
Пример #17
0
        public static SQLDefinition <TVTPerson> GetPersonSQLDefinition()
        {
            var definition = new SQLDefinition <TVTPerson>();

            definition.Table = "tvt_people";

            //AddEntityBaseSQLDefinition(definition);

            definition.Add(x => x.Id);

            definition.Add(x => x.FirstName);
            definition.Add(x => x.LastName);
            definition.Add(x => x.NickName);

            definition.Add(x => x.FakeFirstName);
            definition.Add(x => x.FakeLastName);
            definition.Add(x => x.FakeNickName);

            definition.Add(x => x.TmdbId);
            definition.Add(x => x.ImdbId);
            definition.Add(x => x.ImageUrl);

            definition.Add(new SQLDefinitionFieldList <TVTPersonFunction>(PInfo <TVTPerson> .Info(x => x.Functions, false)));
            //definition.Add(x => x.Functions);
            definition.Add(x => x.Gender);

            definition.Add(x => x.Birthday);
            definition.Add(x => x.Deathday);
            definition.Add(x => x.Country);

            definition.Add(x => x.Prominence);
            definition.Add(x => x.Skill);
            definition.Add(x => x.Fame);
            definition.Add(x => x.Scandalizing);
            definition.Add(x => x.PriceMod);

            definition.Add(x => x.Power);
            definition.Add(x => x.Humor);
            definition.Add(x => x.Charisma);
            definition.Add(x => x.Appearance);

            definition.Add(x => x.TopGenre1);
            definition.Add(x => x.TopGenre2);

            definition.Add(x => x.ProgrammeCount);

            //Zusatzinfos
            AdditionalFields(definition);

            return(definition);
        }
Пример #18
0
        public PInfo[,] RenderImage()
        {
            Stopwatch watch = new Stopwatch();


            Vector3[,] rays = GetRays();

            List <Task> tasks = new List <Task>();

            watch.Start();
            int boxCount = 0;

            for (int x = 0; x < ScreenWidth; x++)
            {
                int tx = x;
                tasks.Add(Task.Run(() =>
                {
                    try
                    {
                        for (int y = 0; y < ScreenHeight; y++)
                        {
                            int ty = y;


                            RayHit hit = MarchRay(rays[tx, ty], MaxLength, Position);

                            RayHit skyHit = MarchRay(new Vector3(0, 1, 0), LightHeight - hit.Position.Y,
                                                     hit.Position + new Vector3(0, MarchPrecission * 2, 0));
                            if (hit.Object != null)
                            {
                                if (hit.Object.Type == Geometry.GType.Box)
                                {
                                    boxCount++;
                                }
                            }
                            ScreenBuffer[tx, ty] = new PInfo().SetBg(skyHit.Object == null ? hit.color : Shade(hit.color));
                        }
                    }
                    catch (Exception)
                    {
                    }
                }));
            }

            Task.WaitAll(tasks.ToArray());
            watch.Stop();
            Debug.WriteLine("Final Render Time: " + watch.ElapsedMilliseconds);
            Debug.WriteLine("Boxes: " + boxCount);
            return(ScreenBuffer);
        }
Пример #19
0
        public static void PlaceImage(IRenderingApplication app, int x, int y, PInfo[,] info)
        {
            PInfo[,] flipped = new PInfo[info.GetLength(0), info.GetLength(1)];

            for (int ax = 0; ax < info.GetLength(0); ax++)
            {
                for (int ay = 0; ay < info.GetLength(1); ay++)
                {
                    flipped[ax, info.GetLength(1) - ay - 1] = info[ax, ay];
                }
            }

            app.App_DrawScreen(flipped, x + 2, (height - y - flipped.GetLength(1)) + 2, null);
        }
Пример #20
0
        void Update()
        {
            if (GameStart == 1 && Application.loadedLevelName != "BattleRoom")
            {
                Buffer.BlockCopy(recv_E.Buffer, 4, id_temp, 0, 4);
                Application.LoadLevel("BattleRoom");
            }
            if (GameStart == 1 && Application.loadedLevelName == "BattleRoom")
            {
                readyInfo.SetReady();
                pInfo     = GameObject.Find("Player").GetComponent <PInfo>();
                enemyInfo = GameObject.Find("EnemyPlayer").GetComponent <EnemyPlayerInfo>();

                pInfo.player_Info.user_id = BitConverter.ToInt32(id_temp, 0);

                enemyInfo.transform.position = new Vector3(-10, 0, 0);
                pInfo.transform.position     = new Vector3(0, 0, 0);

                if (pInfo.player_Info.user_id == 2)
                {
                    pInfo.transform.position     = new Vector3(-10, 0, 0);
                    enemyInfo.transform.position = new Vector3(0, 0, 0);
                }

                Packet.Serialize(readyInfo).CopyTo(pbuffer, 0);
                packet.Packet_Create(pbuffer);
                send_E.SetBuffer(packet.GetPacket(), 0, packet.GetPacket().Length);

                send(send_E);

                GameStart++;
            }
            if (GameStart == 2 && Application.loadedLevelName == "BattleRoom")
            {
                if (playerInfo.user_id == pInfo.player_Info.user_id)
                {
                    return;
                }

                enemyInfo.SetPos(playerInfo.playerPos);
                enemyInfo.SetRot(playerInfo.playerRot);
                enemyInfo.SetHealth(playerInfo.health);
                enemyInfo.SetShoot(playerInfo.shoot);
                enemyInfo.SetWalking(playerInfo.walking);
                enemyInfo.SetDeath(playerInfo.death);
                enemyInfo.SetSkill(playerInfo.skill);
                enemyInfo.SetAimPos(playerInfo.CannonPos);
            }
        }
Пример #21
0
        //顯示選中XML節點的詳細訊息
        private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            strID = dataGridView1.Rows[e.RowIndex].Cells[3].Value.ToString();
            XElement xe = XElement.Load(strPath);
            IEnumerable <XElement> elements = from PInfo in xe.Elements("People")
                                              where PInfo.Attribute("ID").Value == strID
                                              select PInfo;

            foreach (XElement element in elements)
            {
                textBox11.Text         = element.Element("Name").Value;
                comboBox1.SelectedItem = element.Element("Sex").Value;
                textBox12.Text         = element.Element("Salary").Value;
            }
        }
Пример #22
0
        //显示选中XML节点的详细信息
        private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            strID = dataGridView1.Rows[e.RowIndex].Cells[3].Value.ToString();     //记录选中的ID编号
            XElement xe = XElement.Load(strPath);                                 //加载XML文档
            IEnumerable <XElement> elements = from PInfo in xe.Elements("People") //根据编号查找信息
                                              where PInfo.Attribute("ID").Value == strID
                                              select PInfo;

            foreach (XElement element in elements)                        //遍历查找到的所有信息
            {
                textBox11.Text         = element.Element("Name").Value;   //显示员工姓名
                comboBox1.SelectedItem = element.Element("Sex").Value;    //显示员工性别
                textBox12.Text         = element.Element("Salary").Value; //显示员工薪水
            }
        }
Пример #23
0
        // --------------------------------------------------------------------------------------------------
        #region Methods

        /// <summary>
        /// Set the Content
        /// </summary>
        /// <param name="value">new content</param>
        /// <param name="content">notify change on "Content" if true, on "Item" if false</param>
        public void Set(object value, bool content = true)
        {
            bool changed = !Object.Equals(Content, value);

            if (!changed && Type != null)
            {
                return;
            }

            LimeMsg.Debug("LimeProperty Content set: {0} = {1}", Ident, value);

            if (PInfo != null)
            {
                PInfo.SetValue(Source, value);
            }
            else
            {
                Source = value;

                if (Type == null)
                {
                    Type = value.GetType();
                }
                else if (value != null && value.GetType() != Type)
                {
                    throw new InvalidCastException(string.Format("LimeProperty Set Content: {0} (expected {1})", value.GetType(), Type));
                }
            }


            // Bind the new object
            if (changed && value is INotifyPropertyChanged src)
            {
                //LimeMsg.Debug("LimeProperty Set: Subscribe {0} / {1} ({2})", Ident, src, src.GetType());
                src.PropertyChanged += SourcePropertyChanged;
            }

            if (content)
            {
                OnPropertyChanged("Content");
                OnPropertyChanged("Value");
                OnPropertyChanged("Serialize");
            }
            else
            {
                OnPropertyChanged("Item");
            }
        }
Пример #24
0
        public virtual PInfo[,] Render(double Dist, int ScreenHeight, double PlayerHeight, double RoomHeight, double DistFromLeft)
        {
            double updown = 30 * Math.PI / 180;
            // calculate required height of sprite
            // TODO: Make the system "realistic" things further up will be visible differently than headon
            // currently only spreading the pixels over the calculated are


            double upHigh = RoomHeight - PlayerHeight;



            double unseenTop = Math.Tan(updown) * upHigh;
            double unseenBot = Math.Tan(updown) * PlayerHeight;

            double angleMidTop = Math.Atan(upHigh / Dist);
            double angleMidBot = Math.Atan(PlayerHeight / Dist);
            double angleTop    = (90 * Math.PI / 180) - unseenTop - angleMidTop;
            double angleBot    = (90 * Math.PI / 180) - unseenBot - angleMidBot;

            double halfheight = ScreenHeight / 2;

            double Top    = (int)Math.Round((angleTop / (angleTop + angleMidTop)) * halfheight);
            double Mid    = (int)Math.Round(((angleMidTop / (angleTop + angleMidTop)) * halfheight) + ((angleMidBot / (angleBot + angleMidBot)) * halfheight));
            double Bottom = (int)Math.Round((angleBot / (angleBot + angleMidBot)) * halfheight);

            while (Top + Mid + Bottom < ScreenHeight)
            {
                Mid++;
            }
            // now we have the height of our image


            // then return one by one the pixels of the sprite equivalent to the pixel on screen
            PInfo[,] data = new PInfo[1, ScreenHeight];
            data.Populate();
            double scale = Sprite.GetLength(1) / Mid * 1.0;

            int column = (int)((Sprite.GetLength(0) / Width) * DistFromLeft);

            for (int i = 0; i < Mid; i++)
            {
                // set pixel to the the right image
                data[0, i + (int)Bottom] = Sprite[column, (int)Math.Floor((i) * scale)];
            }
            //Debug.WriteLine("i showed a sprite");
            return(data);
        }
Пример #25
0
 public override MethodInfo GetSetMethod(bool nonPublic)
 {
     if ((cached & PInfo.SetMethod) == 0)
     {
         MonoPropertyInfo.get_property_info(this, out info, PInfo.SetMethod);
         cached |= PInfo.SetMethod;
     }
     if (info.set_method != null && (nonPublic || info.set_method.IsPublic))
     {
         return(info.set_method);
     }
     else
     {
         return(null);
     }
 }
        public static PInfo[,] TextToPInfo(string text, int maxwidth, int maxheight, PInfo apperence)
        {
            string[] parts = text.Split(' ');
            if (parts.Length == 1)
            {
                parts[0] = text;
            }


            PInfo[,] data = getInked(maxwidth, maxheight, apperence);

            // used to know when to stop
            int height = 0;
            // index of current word
            int word = 0;

            Line[] lines = new Line[maxheight];
            for (int i = 0; i < lines.Length; i++)
            {
                lines[i] = new Line(maxwidth);
            }

            while (height < maxheight && word < parts.Length)
            {
                if (lines[height].Fit(new Word(parts[word])))
                {
                    // it fits so we will proceede with next word
                    word++;
                }
                else
                {
                    // next line
                    height++;
                }
            }

            for (int h = 0; h < maxheight; h++)
            {
                PInfo[,] info = lines[h].GetDrawn(apperence);
                for (int w = 0; w < info.GetLength(0); w++)
                {
                    data[w, h] = info[w, 0];
                }
            }
            return(data);
        }
Пример #27
0
        //로딩시 실행되는 함수
        #region subFormLoad

        //*******************************************************************************
        //  Function Name : subFormLoad()
        //  Description   : Base 폼의 Load를 호출하여 폼을 초기화 한다.
        //  Parameters    :
        //  Return Value  :
        //  Special Notes : 폼이 안보이다가 보이게 될 경우 실행된다.
        //*******************************************************************************
        //  2007/01/31          어 경태         [L 00]
        //  2007/03/09          최 성원
        //  2007/03/22          박 근태
        //*******************************************************************************
        public void subFormLoad()
        {
            string dstrLOTName   = "";      //DB에 추가되는 컬럼네임을 LOTAPD테이블에 추가하기 위한 변수.
            int    dintLOTAPDCnt = 0;

            try
            {
                //DB에 등록되 있는 LOTAPD의 갯수를 가져온다.
                dintLOTAPDCnt = PInfo.Unit(0).SubUnit(0).LOTAPDCount;
                //CommonListView (부모) 함수를 호출한다.
                subFormLoad("LOTAPD");

                //컬럼헤더의 높이값을 정한다.
                grdAlarmList.ColumnHeadersHeight = 27;



                //LOTAPTCount가 달라지면 테이블의 컬럼을 새로 만든다.
                //if (dintLOTAPDTmp != dintLOTAPDCnt)
                //{
                //    this.subInitTable();
                //DB에 있는 LOTAPD항목을 pdtLOTAPdtable의 컬럼에 추가.
                pdtLOTAPDTable = new DataTable();
                for (int dintLOTCount = 1; dintLOTCount <= PInfo.Unit(0).SubUnit(0).LOTAPDCount; dintLOTCount++)
                {
                    dstrLOTName    = PInfo.Unit(0).SubUnit(0).LOTAPD(dintLOTCount).Name;
                    pdtLOTAPDTable = PclsDataGridView.funAddColumn(pdtLOTAPDTable, dstrLOTName, dstrLOTName);
                }
                //    dintLOTAPDTmp = dintLOTAPDCnt;
                //}
                //데이터 테이블을 만들어서 화면에 표시한다.
                this.subDisplay();

                //폼을 표시한다.
                this.Show();
            }

            catch (Exception ex)
            {
                this.PInfo.subLog_Set(InfoAct.clsInfo.LogType.CIM, ex.ToString());
            }
        }
Пример #28
0
        public static string ModelToJsonData <T>(T model)
        {
            StringBuilder jsonSB = new StringBuilder();

            jsonSB.Append("{");
            Type t = typeof(T);

            PropertyInfo[] propertyArr = t.GetProperties();
            int            index       = 0;

            foreach (PropertyInfo PInfo in propertyArr)
            {
                if (index > 0)
                {
                    jsonSB.Append(",");
                }
                jsonSB.Append("\"" + PInfo.Name + "\":\"" + PInfo.GetValue(model, null).ToString().Replace((char)13, ' ').Replace((char)10, ' ').Replace("\n\r", " ") + "\"");
                index++;
            }
            jsonSB.Append("}");
            return(jsonSB.ToString());
        }
 public static PInfo[,] getInked(int width, int height, PInfo pi)
 {
     PInfo[,] data = new PInfo[width, height];
     for (int i = 0; i < width; i++)
     {
         for (int y = 0; y < height; y++)
         {
             data[i, y] = new PInfo();
             if (pi.HasForeground)
             {
                 data[i, y].SetFg(pi.Foreground);
             }
             if (pi.HasBackground)
             {
                 data[i, y].SetBg(pi.Background);
             }
             if (pi.HasCharacter)
             {
                 data[i, y].SetC(pi.Character);
             }
         }
     }
     return(data);
 }
Пример #30
0
        /// <summary>
        /// Parameter가 있는 첫번째 Constructor의 정보를 리턴함.
        /// </summary>
        /// <param name="TypeOfClass">Class의 형식</param>
        /// <param name="aTypeIs">각 Parameter의 Type</param>
        /// <param name="aDescriptionIs">각 Parameter의 Description(없으면 Name)</param>
        /// <returns>Parameter가 있는 Constructor가 없으면 false를 리턴하고, 아니면 true를 리턴함.</returns>
        /// <example>
        /// 다음은 ConTest 클래스의 Constructor 정보를 출력합니다.
        /// <code>
        /// List&lt;Type&gt; aTypeIs;
        /// List&lt;string&gt; aNameIs;
        /// List&lt;string&gt; aDescriptionIs;
        ///
        /// if (GetFirstConstructorParamInfo(typeof(ConTest), out aTypeIs, out aNameIs, out aDescriptionIs))
        /// {
        ///	 for (int i = 0; i &lt; aTypeIs.Count; i++)
        ///	 {
        ///		 Console.WriteLine("Type: {0}, Name: {1}, Description: {2}",  aTypeIs[i].ToString(), aNameIs[i], aDescriptionIs[i]);
        ///	 }
        /// }
        ///
        /// public class ConTest
        /// {
        ///     public ConTest()
        ///     {
        ///     }
        ///     public ConTest(
        ///         [Description("숫자")]
        ///         int i,
        ///         [Description("문자열 이야")]
        ///         string s,
        ///         [Description("개체(Object)")]
        ///         object o)
        ///     {
        ///
        ///     }
        /// }
        /// </code>
        /// </example>
        public static bool GetFirstConstructorParamInfo(Type TypeOfClass,
                                                        out List <Type> aTypeIs, out List <string> aNameIs, out List <string> aDescriptionIs)
        {
            aTypeIs        = new List <Type>();
            aNameIs        = new List <string>();
            aDescriptionIs = new List <string>();

            ConstructorInfo[] aConstInfo = TypeOfClass.GetConstructors();
            ParameterInfo[]   aPInfo     = null;
            foreach (ConstructorInfo Info in aConstInfo)
            {
                aPInfo = Info.GetParameters();
                if (aPInfo.Length > 0)
                {
                    break;
                }
            }

            if (aPInfo.Length == 0)
            {
                return(false);
            }

            foreach (ParameterInfo PInfo in aPInfo)
            {
                aTypeIs.Add(PInfo.ParameterType);
                aNameIs.Add(PInfo.Name);

                DescriptionAttribute[] aAttr = (DescriptionAttribute[])PInfo.GetCustomAttributes(typeof(DescriptionAttribute), false);
                string Description           = (aAttr.Length > 0) ? aAttr[0].Description : PInfo.Name;

                aDescriptionIs.Add(Description);
            }

            return(true);
        }
		internal static extern void get_property_info (MonoProperty prop, ref MonoPropertyInfo info,
		PInfo req_info);
		internal static void get_property_info (MonoProperty prop, ref MonoPropertyInfo info,
		PInfo req_info)
		{
			throw new System.NotImplementedException();
		}