コード例 #1
0
        static void Main(string[] args)
        {
            var mdl = new TestModel();

            //mdl.MyEntities.Add(new MyEntity()
            //{
            //    Id = 1,
            //    Name = "ahmet"
            //});
            //mdl.SaveChanges();

            var prms = new pList()
            {
                filter = new filter()
                {
                    filters = new List <filterItem>()
                    {
                        new filterItem()
                        {
                            field     = "Name",
                            @operator = "eq",
                            value     = "volkan"
                        }
                    }
                }
            };

            var list = mdl.MyEntities.Filter(prms);

            Console.WriteLine("test");
            Console.ReadKey();
        }
コード例 #2
0
        internal static void Initialize()
        {
            if (BeatmapInfo != null)
            {
                return;
            }

            BeatmapInfo = new pList <BeatmapInfo>();

            if (File.Exists(databasePath))
            {
                try
                {
                    using (FileStream fs = File.OpenRead(databasePath))
                        using (SerializationReader reader = new SerializationReader(fs))
                        {
                            Version = reader.ReadInt32();
                            if (Version > 3)
                            {
                                BeatmapInfo = reader.ReadBList <BeatmapInfo>();
                            }
                        }
                }
                catch (Exception e)
                {
#if DEBUG
                    Console.WriteLine("Error while reading database! " + e);
#endif
                }
            }

#if iOS && DIST
            //move beatmaps from Documents to Library/Cache/ as per new storage guidelines (see https://www.marco.org/2011/10/13/ios5-caches-cleaning)
            if (Version < 8)
            {
                string newLocation = SongSelectMode.BeatmapPath;
                foreach (string file in Directory.GetFiles(Environment.GetFolderPath(Environment.SpecialFolder.Personal), "*.os*"))
                {
                    string newFile = newLocation + "/" + Path.GetFileName(file);
                    File.Delete(newFile);
                    File.Move(file, newFile);
                }
            }
            else if (Version < 9)
            {
                if (HardwareDetection.RunningiOS5OrHigher)
                {
                    foreach (string file in Directory.GetFiles(SongSelectMode.BeatmapPath, "*.os*"))
                    {
                        Foundation.NSFileManager.SetSkipBackupAttribute(file, true);
                    }
                }
            }
#endif

#if DEBUG
            Console.WriteLine("Read beatmap database: " + BeatmapInfo.Count);
#endif
        }
コード例 #3
0
        internal rList <rUsers> List(pList prms, Bilet blt, CuteModel db)
        {
            var result = dalUsers.List(prms, db);

            LogYaz("Kullanıcı listelendi.", blt);

            return(result);
        }
コード例 #4
0
 public rList <MyEntity> List(pList prms)
 {
     try
     {
         var db = new ModelTest();
         return(db.MyEntities.OrderBy(p => p.Id).Filter(prms));
     }
     catch (Exception ex)
     {
         return(new rList <MyEntity>(ex));
     }
 }
コード例 #5
0
        /// <summary>
        /// Logs listeler. (volkansendag - 02.08.2016)
        /// </summary>
        internal rList <rLogs> List(pList prms, Bilet blt, CuteModel db)
        {
            Add(new pLogs()
            {
                appName  = "CuteDev.Log",
                logData  = prms.toJson(),
                logLevel = "bllLog",
                message  = "Loglar listelendi"
            }, blt, db);

            return(dal.List(prms, blt, db));
        }
コード例 #6
0
 /// <summary>
 /// Logs listeler. (volkansendag - 02.08.2016)
 /// </summary>
 public rList <rLogs> List(pList prms, Bilet blt)
 {
     using (var db = getDb())
     {
         try
         {
             return(List(prms, blt, db));
         }
         catch (ProcessException ex)
         {
             return(ex.GetResult <rList <rLogs> >());
         }
     }
 }
コード例 #7
0
 public rList <rUsers> List(pList args, Bilet blt)
 {
     using (var db = getDb())
     {
         try
         {
             return(List(args, blt, db));
         }
         catch (Exception ex)
         {
             LogYaz(ex, blt);
             throw ex;
         }
     }
 }
コード例 #8
0
        /// <summary>
        /// Logs listeler. (volkansendag - 08.10.2017)
        /// </summary>
        public rList <rLogs> List(pList prms, Bilet blt, CuteModel db)
        {
            var query = (from p in db.Logs
                         orderby p.id descending
                         select new rLogs
            {
                id = p.id,
                createDate = p.createDate,
                creatorId = p.creatorId,
                creatorIP = p.creatorIP,
                appName = p.appName,
                logLevel = p.logLevel,
                message = p.message,
                logData = p.logData,
            });

            return(query.toList <rLogs>(prms));
        }
コード例 #9
0
        /// <summary>
        /// Adds a new hitObject to be managed by this manager.
        /// </summary>
        /// <param name="h">The hitObject to manage.</param>
        internal void Add(HitObject h, Difficulty difficulty)
        {
            int diffIndex = (int)difficulty;

            pList <HitObject> diffObjects = StreamHitObjects[diffIndex];

            if (diffObjects == null)
            {
                diffObjects = new pList <HitObject> {
                    UseBackwardsSearch = true, InsertAfterOnEqual = true
                };
                StreamHitObjects[diffIndex]     = diffObjects;
                streamSpriteManagers[diffIndex] = new SpriteManager {
                    ForwardPlayOptimisedAdd = true
                };
            }

            diffObjects.AddInPlace(h);
            streamSpriteManagers[diffIndex].Add(h);
        }
コード例 #10
0
        private void drawHitObjects(Graphics g, pList <HitObject> objects, Color color, int vOffset)
        {
            if (objects == null)
            {
                return;
            }

            int width  = beatmapLayout.Width;
            int height = (int)(beatmapLayout.Height / 4f);

            int h1 = height * vOffset;
            int h2 = height * (vOffset + 1) - 1;

            Pen brush = new Pen(Color.FromArgb(100, color.R, color.G, color.B));

            foreach (HitObject h in objects)
            {
                int objWidth = (int)Math.Max(1, (float)(h.EndTime - h.StartTime) / beatmapLength);
                g.DrawRectangle(brush, new Rectangle((int)((float)h.StartTime / beatmapLength * width), h1, objWidth, height));
            }
        }
コード例 #11
0
ファイル: gSpreadsheet.cs プロジェクト: dgx80/peon
        public void OnSubmit()
        {
            pList oList = new pList();

            oList.StartNewList("items");

            foreach (System.Data.DataRow row in m_oValidationDataTable.Rows)
            {
                if ((bool)row[0] == true)
                {
                    oList.PushBack(row[1].ToString());
                }
            }

            if (oList.Rows.Count > 0)
            {
                forms.SubmitForm oSub = new forms.SubmitForm();
                oSub.AddList(oList);

                if (oSub.ShowDialog() == DialogResult.OK)
                {
                    int i = 0;

                    foreach (System.Data.DataRow row in m_oValidationDataTable.Rows)
                    {
                        if ((bool)row[0] == true)
                        {
                            RemoveRow(i);
                        }
                        i++;
                    }
                    System.Windows.Forms.MessageBox.Show("items cleared:)");
                }
                else
                {
                    System.Windows.Forms.MessageBox.Show("action canceled");
                }
            }
            ReadColumn(m_oCurrentColumn.sName);
        }
コード例 #12
0
        /// <summary>
        /// Users listeler. (volkansendag - 24.02.2018)
        /// </summary>
        public static rList <rUsers> List(pList prms, CuteModel db)
        {
            var query = (from p in db.Users
                         join meta in db.UsersMeta on p.id equals meta.user_Id into mtk
                         where p.deleted == false
                         orderby p.id
                         select new rUsers
            {
                id = p.id,
                email = p.email,
                fullname = p.fullname,
                role = p.role,
                phone = mtk.Where(a => a.metaKey == "phone").Select(x => x.metaValue).FirstOrDefault(),
                company_logo = mtk.Where(a => a.metaKey == "company_logo").Select(x => x.metaValue).FirstOrDefault(),
                company_name = mtk.Where(a => a.metaKey == "company_name").Select(x => x.metaValue).FirstOrDefault(),
                company_adress = mtk.Where(a => a.metaKey == "company_adress").Select(x => x.metaValue).FirstOrDefault(),
                company_sector = mtk.Where(a => a.metaKey == "company_sector").Select(x => x.metaValue).FirstOrDefault(),
                company_status = mtk.Where(a => a.metaKey == "company_status").Select(x => x.metaValue).FirstOrDefault(),
                company_employee = mtk.Where(a => a.metaKey == "company_employee").Select(x => x.metaValue).FirstOrDefault()
            });

            return(query.toList <rUsers>(prms));
        }
コード例 #13
0
        /// <summary>
        /// Call at the point of judgement. Will switch stream to new difficulty as soon as possible (next new combo).
        /// </summary>
        /// <param name="newDifficulty">The new stream difficulty.</param>
        /// <returns>The time at which the switch will take place. -1 on failure.</returns>
        public virtual int SetActiveStream(Difficulty newDifficulty, bool instant = false)
        {
            Difficulty oldActiveStream = ActiveStream;

            if (ActiveStream == newDifficulty || (Clock.AudioTime > 0 && Clock.AudioTime < nextStreamChange))
            {
                return(-1); //already switching stream
            }
            pList <HitObject> oldStreamObjects = ActiveStreamObjects;

            if (oldActiveStream == Difficulty.None || instant)
            {
                //loading a new stream.
                ActiveStream = newDifficulty;
                ProcessFrom  = 0;
                ProcessTo    = -1;

                return(0);
            }

            if (StreamHitObjects[(int)newDifficulty] == null)
            {
                return(-1); //no difficulty is mapped for the target stream.
            }
            int switchTime = Clock.AudioTime + DifficultyManager.PreEmpt;

            if (oldStreamObjects != null)
            {
                if (nextPossibleSwitchTime < switchTime)
                {
                    //need to find a new switch time.
                    removeBeforeObjectIndex = 0;

                    if (beatmap.StreamSwitchPoints != null)
                    {
                        bool foundPoint = false;
                        int  c          = beatmap.StreamSwitchPoints.Count;
                        for (int i = 0; i < c; i++)
                        {
                            if (beatmap.StreamSwitchPoints[i] > switchTime)
                            {
                                switchTime = beatmap.StreamSwitchPoints[i];
                                foundPoint = true;
                                break;
                            }
                        }

                        if (!foundPoint)
                        {
                            //exhausted all stream switch points.
                            nextPossibleSwitchTime = int.MaxValue;
                            return(-1);
                        }
                    }


                    //find a good point to stream switch. this will be mapper set later.
                    for (int i = ProcessFrom; i < oldStreamObjects.Count; i++)
                    {
                        if (oldStreamObjects[i].NewCombo && oldStreamObjects[i].StartTime > switchTime)
                        {
                            removeBeforeObjectIndex = i;
                            switchTime = i > 0 ? oldStreamObjects[i - 1].EndTime : oldStreamObjects[i].StartTime;
                            break;
                        }
                    }

                    nextPossibleSwitchTime = switchTime;
                }

                if (removeBeforeObjectIndex == 0)
                {
                    //failed to find a suitable stream switch point.
                    nextPossibleSwitchTime = int.MaxValue;
                    return(-1);
                }

                switchTime = nextPossibleSwitchTime;

                int judgementStart = (int)(switchTime - Player.Beatmap.beatLengthAt(Clock.AudioTime) * 8);

                //check we are close enough to the switch time to actually judge this
                if (newDifficulty > oldActiveStream && Clock.AudioTime < judgementStart)
                {
#if FULL_DEBUG
                    DebugOverlay.AddLine("Waiting for next judgement section starting at " + judgementStart + "...");
#endif

                    return(-1);
                }

                nextPossibleSwitchTime = 0;

                ActiveStream = newDifficulty;

                pList <HitObject> newStreamObjects = ActiveStreamObjects;
                SpriteManager     newSpriteManager = ActiveStreamSpriteManager;

                for (int i = ProcessFrom; i < removeBeforeObjectIndex; i++)
                {
                    newSpriteManager.Add(oldStreamObjects[i]);
                }

                if (removeBeforeObjectIndex - ProcessFrom > 0)
                {
                    int removeBeforeIndex = 0;
                    for (int i = 0; i < newStreamObjects.Count; i++)
                    {
                        HitObject h = newStreamObjects[i];

                        if (h.StartTime > switchTime && h.NewCombo)
                        {
                            removeBeforeIndex = i;
                            break;
                        }

                        h.Sprites.ForEach(s =>
                        {
                            s.Transformations.Clear();
                            s.Alpha = 0;
                        });
                        h.Dispose();
                    }

                    newStreamObjects.RemoveRange(0, removeBeforeIndex);
                    newStreamObjects.InsertRange(0, oldStreamObjects.GetRange(ProcessFrom, removeBeforeObjectIndex - ProcessFrom));
                }
            }

            ProcessFrom = 0;
            ProcessTo   = -1;

            nextStreamChange = switchTime;
            return(switchTime);
        }