Exemple #1
0
 public ThresholdData(AreaType SerVolAreaType)
 {
     //signalized intersection delay thresholds only
     //to-do: maybe incorporate into IntersectionData class instead of SegmentData class
     _speed = new int[5];
     Delay  = GetLOSBoundaries_Delay(SerVolAreaType);
 }
Exemple #2
0
    // Use this for initialization
    void Start()
    {
        clas        = FindObjectOfType <SimpleClasses>();
        battleEvent = FindObjectOfType <SimpleBattleHandler>();

        area = AreaType.area1;
    }
Exemple #3
0
        public static PageVisit RegisterPageVisit(HttpRequest request, AreaType area, int?itemId = null, string searchTerm = null, string linkType = null, PageVisit previous = null)
        {
            var repository = DependencyResolver.Current.GetService <IStatsRepository>();

            try
            {
                var visit = new PageVisit
                {
                    AreaType      = area,
                    ItemId        = itemId,
                    SearchTerm    = searchTerm,
                    Referer       = request.UrlReferrer == null ? "" : request.UrlReferrer.AbsoluteUri,
                    Url           = request.Url.AbsoluteUri,
                    LinkType      = linkType,
                    PreviousId    = previous == null ? null : (int?)previous.Id,
                    UserAgent     = request.UserAgent,
                    UserLanguages = request.UserLanguages != null?string.Join("|", request.UserLanguages) : "",
                                        BrowserVersion = request.Browser != null ? request.Browser.Version : "",
                                        BrowserName    = request.Browser != null ? request.Browser.Browser : "",
                                        IpAddress      = request.ServerVariables["REMOTE_ADDR"],
                                        DateTime       = DateTime.Now
                };
                return(new PageVisit(repository.InsertPageVisit(visit)));
            }
            catch (Exception ex)
            {
                Logger.LogException(EventLogType.Error, "TooksCms.ServiceLayer", ex, "RegisterPageVisit", 0);
            }
            return(null);
        }
        public IEnumerable<POCO.StatisticDataItem> GetItems(int id, DateTime startDate, DateTime endDate, AreaType type)
        {
            var parameters = new SqlParameter[] {
                new SqlParameter("@Id", id),
                new SqlParameter("@StartDate", startDate),
                new SqlParameter("@EndDate", endDate)
            };

            string procedureName = String.Empty;
            switch (type)
            {
                case AreaType.Enterprise:
                    procedureName = "GetStatisticDataByEnterprise";
                    break;
                case AreaType.Subject:
                    procedureName = "GetStatisticDataBySubject";
                    break;
                case AreaType.District:
                    procedureName = "GetStatisticDataByDistrict";
                    break;
            }
            var result = context.Database.SqlQuery<StatisticDataItem>(String.Format("Exec dbo.{0} @Id, @StartDate, @EndDate", procedureName), parameters);
            var data = result.ToList<StatisticDataItem>();
            return data;
        }
Exemple #5
0
        public AreaType[,] GenMap(int x, int y)
        {
            Random rnd = new Random();
            AreaType[,] map = new AreaType[x, y];

            for (int i = 0; i < x; i++)
                for (int o = 0; o < y; o++)
                {
                    map[i, o] = (AreaType)rnd.Next(0, 4);
                }

            int checkSumX = 0;
            int checkSumY = 0;

            for (int i = 0; i < x; i++)
            {
                for (int o = 0; o < y; o++)
                {
                    checkSumX += (int)map[i, o];
                    checkSumY += (int)map[o, i];
                }
                if (checkSumX == 10)
                {
                    int j = rnd.Next(0, 9);
                    map[i, j] = (AreaType)0;
                }
                if (checkSumY == 10)
                {
                    int j = rnd.Next(0, 9);
                    map[j, i] = (AreaType)0;
                }
            }
            return map;
        }
Exemple #6
0
 public Area()
 {
     name   = "Empty";
     type   = AreaType.Storage;
     tiles  = new List <Tile>();
     colour = new Color(1f, 0f, 0f);
 }
Exemple #7
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="flags">Current game's flags</param>
 /// <param name="party">Current game's party</param>
 /// <param name="camp">Reference to the camp page, go here on victory and defeat</param>
 /// <param name="quests">Reference to quest page, go where if one wants to back out of entering</param>
 /// <param name="type">Type of area. Should be unique.</param>
 /// <param name="stages">List of stages to put into the area.</param>
 public Area(AreaType type, Stage[] stages, PageGroup[] places)
 {
     this.Type = type;
     this.currentDungeonCount = 0;
     this.stages = stages;
     this.places = places;
 }
    public void SetHeight(float value, AreaType t)
    {
        areaHeight.value = value;
        areaHeight.style = t;

        mArea.height = areaHeight.Calc(mWindowRect.height);
    }
Exemple #9
0
        public int calculateZad7(double x1, double x2, int z, AreaType areaType)
        {
            int n = 1;
            int indexOfFunction = 2; //funkcja kwadratowa

            var isCompleted = executeWithTimeLimit(() =>
            {
                var singleCount = new SingleCount(x1, x2, n, areaType, indexOfFunction);

                while ((int)singleCount.Area % z != 0)
                {
                    n++;
                    singleCount = new SingleCount(x1, x2, n, areaType, indexOfFunction);
                }
            });

            if (isCompleted)
            {
                return(n);
            }
            else
            {
                throw new TimeoutException();
            }
        }
        private void AreaTypeSelectionChanged(object sender, EventArgs e)
        {
            AreaType selectedType = rbOSDExclusion.Checked ? AreaType.OSDExclusion : AreaType.Inclusion;

            m_CalibrationTool.SetAreaType(selectedType);
            TriggerStarMapRecalc();
        }
Exemple #11
0
 public ScoringOfferDetails(
     ScoringOfferStatus status,
     DateTimeOffset acceptingDeadline,
     DateTimeOffset scoringDeadline,
     Address scoringContractAddress,
     long scoringId,
     long expertId,
     string name,
     string countryCode,
     Category category,
     string description,
     AreaType area,
     Guid projectExternalId,
     long projectId,
     bool isPrivate,
     double?finalScore)
 {
     Status                 = status;
     AcceptingDeadline      = acceptingDeadline;
     ScoringDeadline        = scoringDeadline;
     ScoringContractAddress = scoringContractAddress;
     ScoringId              = scoringId;
     ExpertId               = expertId;
     Name              = name;
     IsPrivate         = isPrivate;
     CountryCode       = countryCode;
     Category          = category;
     Description       = description;
     AreaType          = area;
     ProjectExternalId = projectExternalId;
     ProjectId         = projectId;
     FinalScore        = finalScore;
 }
        private void CheckArea(Split split, bool onEnter)
        {
            SplitArea splitArea = Utility.GetEnumValue <SplitArea>(split.Value);

            switch (splitArea)
            {
            case SplitArea.WaterMillSub1: CheckScene(onEnter, "wotwSaveRoomC__clone0__clone1", "waterMillAExit"); break;

            case SplitArea.WaterMillSub2: CheckScene(onEnter, "waterMillBEntrance"); break;

            case SplitArea.WaterMillSub3: CheckScene(onEnter, "waterMillCEntrance"); break;

            case SplitArea.WeepingRidge: CheckScene(onEnter, "weepingRidgeWillowsEndEntrance", "weepingRidgeElevatorFight"); break;

            case SplitArea.WillowsEndBoss: CheckScene(onEnter, "willowCeremonyIntro"); break;

            default:
                AreaType area       = Memory.PlayerArea();
                AreaType splitValue = Utility.GetEnumValue <AreaType>(split.Value);
                if (area != AreaType.None)
                {
                    ShouldSplit  = lastIntValue != (int)area && (onEnter ? (int)area : lastIntValue) == (int)splitValue;
                    lastIntValue = (int)area;
                }
                break;
            }
        }
 public HallSector(string id, int gridX, int gridY, Hallway parentHallway, Knowledge knowledge,
                   AreaType areaType, string textureId) : this(id, gridX, gridY, parentHallway)
 {
     Knowledge = knowledge;
     Type      = areaType;
     TextureId = textureId;
 }
 internal void CalcAxis(PianoProperties pprops, RollConfigures rconf)
 {
     if (_me.Y <= rconf.Const_TitleHeight && _me.Y >= 0)
     {
         _area = AreaType.Title;
     }
     else if (_me.X <= rconf.Const_RollWidth && _me.X >= 0)
     {
         _area = AreaType.Roll;
     }
     else
     {
         _area = AreaType.Track;
     }
     if (_area != AreaType.Title)
     {
         double drawed_noteSpt  = (double)(_me.Y - rconf.Const_TitleHeight) / rconf.Const_RollNoteHeight;
         uint   _noteNumber     = pprops.PianoTopNote - (uint)drawed_noteSpt;
         double cent            = 0.5 - drawed_noteSpt + (uint)drawed_noteSpt;
         int    _notePitchWheel = (int)Math.Round(cent * 0x2000, 0);
         _pitchvp            = new PitchValuePair(_noteNumber, _notePitchWheel);
         _pitchvp.OctaveType = pprops.OctaveType;
     }
     if (_area != AreaType.Roll)
     {
         long drawed_pixel = _me.X - rconf.Const_RollWidth;
         _tick = (long)Math.Round((pprops.PianoStartTick + pprops.dertPixel2dertTick(drawed_pixel)), 0);
     }
 }
        public void buildJunction(ref List <Block> sidewalks)
        {
            // create intersection
            areaInter = Object.Instantiate((Resources.Load("Prefab/DummyObjects/DummyArea") as GameObject).GetComponent <Area>(), Vector3.zero, Quaternion.identity) as SCPAR.SIM.PVATestbed.Area;
            areaInter.initialize(size.numOfVtcLane * 2, size.numOfHrzLane * 2, center, AreaPosition.NA, AreaType.Intersection, ref sidewalks);
            areaInter.transform.parent = transform;

            areas = new Area[4];
            AreaType tempType = (AreaType)2; // AreaType.Forest;// (AreaType)Mathf.Round(Random.Range(0, 3));

            areas[(int)AreaPosition.NW] = Object.Instantiate((Resources.Load("Prefab/DummyObjects/DummyArea") as GameObject).GetComponent <Area>(), Vector3.zero, Quaternion.identity) as SCPAR.SIM.PVATestbed.Area;
            areas[(int)AreaPosition.NW].initialize(size.lenOfHrzLane, size.lenOfVtcLane, new Vector2(-(size.lenOfHrzLane / 2 + size.numOfVtcLane) + (int)center.x,
                                                                                                     size.lenOfVtcLane / 2 + size.numOfHrzLane + (int)center.y), AreaPosition.NW, tempType, ref sidewalks);
            areas[(int)AreaPosition.NW].transform.parent = transform;

            //tempType = (AreaType)Mathf.Round(Random.Range(0, 3));
            areas[(int)AreaPosition.NE] = Object.Instantiate((Resources.Load("Prefab/DummyObjects/DummyArea") as GameObject).GetComponent <Area>(), Vector3.zero, Quaternion.identity) as SCPAR.SIM.PVATestbed.Area;
            areas[(int)AreaPosition.NE].initialize(size.lenOfHrzLane, size.lenOfVtcLane, new Vector2(size.lenOfHrzLane / 2 + size.numOfVtcLane + (int)center.x,
                                                                                                     size.lenOfVtcLane / 2 + size.numOfHrzLane + (int)center.y), AreaPosition.NE, tempType, ref sidewalks);
            areas[(int)AreaPosition.NE].transform.parent = transform;

            //tempType = (AreaType)Mathf.Round(Random.Range(0, 3));
            areas[(int)AreaPosition.SE] = Object.Instantiate((Resources.Load("Prefab/DummyObjects/DummyArea") as GameObject).GetComponent <Area>(), Vector3.zero, Quaternion.identity) as SCPAR.SIM.PVATestbed.Area;
            areas[(int)AreaPosition.SE].initialize(size.lenOfHrzLane, size.lenOfVtcLane, new Vector2(size.lenOfHrzLane / 2 + size.numOfVtcLane + (int)center.x,
                                                                                                     -size.lenOfVtcLane / 2 - size.numOfHrzLane + (int)center.y), AreaPosition.SE, tempType, ref sidewalks);
            areas[(int)AreaPosition.SE].transform.parent = transform;

            //tempType = (AreaType)Mathf.Round(Random.Range(0, 3));
            areas[(int)AreaPosition.SW] = Object.Instantiate((Resources.Load("Prefab/DummyObjects/DummyArea") as GameObject).GetComponent <Area>(), Vector3.zero, Quaternion.identity) as SCPAR.SIM.PVATestbed.Area;
            areas[(int)AreaPosition.SW].initialize(size.lenOfHrzLane, size.lenOfVtcLane, new Vector2(-size.lenOfHrzLane / 2 - size.numOfVtcLane + (int)center.x,
                                                                                                     -size.lenOfVtcLane / 2 - size.numOfHrzLane + (int)center.y), AreaPosition.SW, tempType, ref sidewalks);
            areas[(int)AreaPosition.SW].transform.parent = transform;
        }
        public float MapCompletion(AreaType areaType = AreaType.None)
        {
            float totalCompletion = 0;
            //GameWorld.RuntimeAreas
            IntPtr areas = GameWorld.Read <IntPtr>(Program, 0xb8, 0x0, 0x28);
            //.Count
            int count = Program.Read <int>(areas, 0x18);

            //.Items
            areas = Program.Read <IntPtr>(areas, 0x10);
            byte[] data             = Program.Read(areas + 0x20, count * 0x8);
            int    completionOffset = Version == PointerVersion.V3 ? 0x5c : 0x34;

            for (int i = 0; i < count; i++)
            {
                IntPtr area = (IntPtr)BitConverter.ToUInt64(data, i * 0x8);
                if (areaType != AreaType.None)
                {
                    //.Items[i].Area.WorldMapAreaUniqueID
                    AreaType type = Program.Read <AreaType>(area, 0x10, 0x20);
                    if (type == areaType)
                    {
                        //.Items[i].m_completionAmount
                        return(Program.Read <float>(area, completionOffset) * 100f);
                    }
                }
                else
                {
                    //.Items[i].m_completionAmount
                    totalCompletion += Program.Read <float>(area, completionOffset);
                }
            }
            return(totalCompletion * 100f / (count == 0 ? 1 : count));
        }
 public GenCondition AreaAnd(int width, int height)
 {
     _areaType = AreaType.And;
     _width    = width;
     _height   = height;
     return(this);
 }
 public Dictionary <string, string> GetRangeAreas(AreaType startType, AreaType endType)
 {
     using (var provider = _StaticResourceServiceProvider.NewChannelProvider())
     {
         return(provider.Channel.GetRangeAreasAsync(new Api.OAuth2ClientIdentity(), startType, endType).Result);
     }
 }
Exemple #19
0
 /// <summary>
 /// 球停下来的处理
 /// </summary>
 /// <param name="pos"></param>
 /// <param name="type"></param>
 private static void BallStopProc(Vector3 pos, AreaType type)
 {
     if (type == AreaType.PuttingGreen)
     {
         TipsHelper.ShowTipsMessage("球落在果岭", 1);
     }
     else if (type == AreaType.PuttingGreenLine)
     {
         TipsHelper.ShowTipsMessage("球落在果岭边缘", 1);
     }
     else if (type == AreaType.Fairway)
     {
         TipsHelper.ShowTipsMessage("球落在球道上", 1);
     }
     else if (type == AreaType.SandBunker)
     {
         TipsHelper.ShowTipsMessage("球落在沙坑", 1);
     }
     else if (type == AreaType.Rough)
     {
         TipsHelper.ShowTipsMessage("球落在长草区", 1);
     }
     else if (type == AreaType.OutOfBounds)
     {
         TipsHelper.ShowTipsMessage("球落在界外", 1);
     }
     TipsHelper.ShowTipsMessage("距离:" + Vector3.Distance(pos, SelfSel.StartPos), 1);
 }
 internal ZoneSetBlockBase(BinaryReader binaryReader)
 {
     this.areaType     = (AreaType)binaryReader.ReadInt16();
     this.invalidName_ = binaryReader.ReadBytes(2);
     this.zone         = binaryReader.ReadShortBlockIndex1();
     this.area         = binaryReader.ReadShortBlockIndex2();
 }
Exemple #21
0
    public void SetWidth(float value, AreaType t)
    {
        areaWidth.value = value;
        areaWidth.style = t;

        mArea.width = areaWidth.Calc(mWindowRect.width);
    }
 private void SetAreaType(PlotElementInfoAbs plotElementInfo, AreaType areaType)
 {
     if (plotElementInfo != null)
     {
         plotElementInfo.AreaType = areaType;
     }
 }
Exemple #23
0
        public int calculateZad8(double z, AreaType areaType)
        {
            double trueResult = Math.Sin(Math.PI / 2);
            double x1         = 0;
            double x2         = Math.PI / 2;

            double maxDifference = trueResult * z / 100;


            int n = 1;

            var isCompleted = executeWithTimeLimit(() =>
            {
                var singleCount = new SingleCount(x1, x2, n, areaType, (x) => Math.Cos(x));

                while (Math.Abs(singleCount.Area - trueResult) >= maxDifference)
                {
                    n++;
                    singleCount = new SingleCount(x1, x2, n, areaType, (x) => Math.Cos(x));
                }
            });

            if (isCompleted)
            {
                return(n);
            }
            else
            {
                throw new TimeoutException();
            }
        }
 public string AddArea(string id, string areaId, AreaType areaType, string areaName, string parentId, string zip, string createUserId)
 {
     string areaTypeId = string.Empty;
     switch (areaType)
     {
         case AreaType.Country:
             areaTypeId = "1";
             break;
         case AreaType.Province:
             areaTypeId = "2";
             break;
         case AreaType.City:
             areaTypeId = "3";
             break;
         case AreaType.Distrct:
             areaTypeId = "4";
             break;
         case AreaType.Abroad:
             areaTypeId = "abroad";
             break;
         default:
             throw new FacadeException("不能添加此类型的区域 - " + areaType.ToString());
     }
     return AddArea(id, areaId, areaTypeId, areaName, parentId, zip, createUserId);
 }
Exemple #25
0
 public Area(string _name, AreaType _type, Color _colour)
 {
     name   = _name;
     type   = _type;
     tiles  = new List <Tile>();
     colour = _colour;
 }
Exemple #26
0
 public Area(string _name, AreaType _type, List <Tile> _tiles, Color _colour)
 {
     name   = _name;
     type   = _type;
     tiles  = _tiles;
     colour = _colour;
 }
Exemple #27
0
    public void SetX(float value, AreaType t)
    {
        areaX.value = value;
        areaX.style = t;

        mArea.x = areaX.Calc(mWindowRect.width);
    }
Exemple #28
0
        public double calculateZad3(double x1, double x2, AreaType areaType)
        {
            double result = 0;

            var isCompleted = executeWithTimeLimit(() =>
            {
                SingleCount trueResult = new SingleCount(x1, x2, 0, null, 2);

                for (int i = 1; i <= 6; i++)
                {
                    var singleCount = new SingleCount(x1, x2, (int)Math.Pow(10, i), areaType, 2);

                    result += Math.Pow(trueResult.Area - singleCount.Area, 2);
                }
            });

            if (isCompleted)
            {
                return(result / 6);
            }
            else
            {
                throw new TimeoutException();
            }
        }
Exemple #29
0
 public Area(int _width, int _height, string _name, AreaType aType)
 {
     Width    = _width;
     Height   = _height;
     name     = _name;
     areaType = aType;
 }
Exemple #30
0
            public override bool TryComplete(HitInfo hit)
            {
                var cupboard = hit.HitEntity as BuildingPrivlidge;

                Area area = User.CurrentArea;

                if (area == null)
                {
                    User.SendChatMessage(Messages.YouAreInTheGreatUnknown);
                    return(false);
                }

                if (area.Type == AreaType.Badlands)
                {
                    User.SendChatMessage(Messages.AreaIsBadlands, area.Id);
                    return(false);
                }

                Area[]   ownedAreas = Instance.Areas.GetAllClaimedByFaction(Faction);
                AreaType type       = (ownedAreas.Length == 0) ? AreaType.Headquarters : AreaType.Claimed;

                Instance.PrintToChat(Messages.AreaClaimAssignedAnnouncement, Faction.Id, area.Id);
                Instance.Log($"{Util.Format(User)} assigned {area.Id} to {Faction.Id}");

                Instance.Areas.Claim(area, type, Faction, User, cupboard);
                return(true);
            }
Exemple #31
0
        public string AddArea(string id, string areaId, AreaType areaType, string areaName, string parentId, string zip, string createUserId)
        {
            string areaTypeId = string.Empty;

            switch (areaType)
            {
            case AreaType.Country:
                areaTypeId = "1";
                break;

            case AreaType.Province:
                areaTypeId = "2";
                break;

            case AreaType.City:
                areaTypeId = "3";
                break;

            case AreaType.Distrct:
                areaTypeId = "4";
                break;

            case AreaType.Abroad:
                areaTypeId = "abroad";
                break;

            default:
                throw new FacadeException("不能添加此类型的区域 - " + areaType.ToString());
            }
            return(AddArea(id, areaId, areaTypeId, areaName, parentId, zip, createUserId));
        }
Exemple #32
0
    public void SetY(float value, AreaType t)
    {
        areaY.value = value;
        areaY.style = t;

        mArea.y = areaY.Calc(mWindowRect.height);
    }
Exemple #33
0
        public ZoomFactor(AreaType areatype, int min, int max)
        {
            AreaType = areatype;

            Minimum = min;
            Maximum = max;
        }
Exemple #34
0
 public MapArea(int x, int y, AreaType type, int mapSize)
 {
     X = x;
     Y = y;
     AreaType = type;
     Size = (int)SystemInformation.VirtualScreen.Height / mapSize;
 }
 private static BaseArea Factory(AreaType tsd)
 {
     switch (tsd)
     {
         case AreaType.Castle: return new CastleArea();
         case AreaType.Field: return new FieldArea();
         default: return new RoadArea();
     }
 }
Exemple #36
0
        // класс для вычисления маршрута.
        public static List<Point> FindPath(AreaType[,] field, Point start, Point goal)
        {
            // Шаг 1.
            var closedSet = new Collection<PathNode>();
            var openSet = new Collection<PathNode>();
            // Шаг 2.
            PathNode startNode = new PathNode()
            {
                Position = start,
                CameFrom = null,
                PathLengthFromStart = 0,
                HeuristicEstimatePathLength = GetHeuristicPathLength(start, goal)
            };
            openSet.Add(startNode);
            while (openSet.Count > 0)
            {
                // Шаг 3.

                var currentNode = openSet.OrderBy(node =>
                  node.EstimateFullPathLength).First();
                // Шаг 4.
                if (currentNode.Position == goal /*|| GetHeuristicPathLength(currentNode.Position, start) > 50*/)
                {
                    
                    return GetPathForNode(currentNode);
                  
                }
                // Шаг 5.
                openSet.Remove(currentNode);
                closedSet.Add(currentNode);
                // Шаг 6.
                foreach (var neighbourNode in GetNeighbours(currentNode, goal, field))
                {
                    // Шаг 7.
                    if (closedSet.Count(node => node.Position == neighbourNode.Position) > 0)
                    {
                        continue;
                    }
                        
                    var openNode = openSet.FirstOrDefault(node =>
                      node.Position == neighbourNode.Position);
                    // Шаг 8.
                    if (openNode == null)
                        openSet.Add(neighbourNode);
                    else
                        if (openNode.PathLengthFromStart > neighbourNode.PathLengthFromStart)
                        {
                            // Шаг 9.
                            openNode.CameFrom = currentNode;
                            openNode.PathLengthFromStart = neighbourNode.PathLengthFromStart;
                        }
                }
            }
            // Шаг 10.
            return null;
        }
Exemple #37
0
        public ActionResult DisplaySideTags(AreaType? areaType)
        {
            var userId = _membershipService.GetCurrentMember().UserId;
            List<Tag> model = _tagService.GetByArea(areaType);

            ViewBag.SelectedTags = TempData["SelectedTags"];
            TempData.Keep("SelectedTags");

            return PartialView("Controls/_TagsSideList", model);
        }
Exemple #38
0
        internal void SetAreaType(AreaType areaType)
        {
            Rectangle userFrame;

            LimitByInclusion = areaType == AreaType.Inclusion;
            if (LimitByInclusion)
                userFrame = TangraConfig.Settings.PlateSolve.SelectedScopeRecorderConfig.InclusionArea;
            else
                userFrame = TangraConfig.Settings.PlateSolve.SelectedScopeRecorderConfig.OSDExclusionArea;

            SetUserFrame(userFrame);
        }
 public string GetAreaNameOfLocation(double lat, double lon, AreaType areaType, string prefix)
 {
     string result = null;
     foreach (var sf in _shapeFiles)
     {
         result = sf.GetAreaNameOfLocation(lat, lon, areaType, prefix);
         if (!string.IsNullOrEmpty(result))
         {
             break;
         }
     }
     return result;
 }
        public AreaActor(Vector2 a_Position, int a_AreaType)
            : base()
        {
            m_AreaType = (AreaType)a_AreaType;

            if (m_AreaType == AreaType.Start)
            {
                m_FilePathToTexture = "Sprite/Area_Start";
            }
            if (m_AreaType == AreaType.Finish)
            {
                m_FilePathToTexture = "Sprite/Area_Finish";
            }
            m_Position = a_Position;

            m_SourceRectangle = new Rectangle(0, 0, 192, 192);
            m_Origin = new Vector2(92, 92);
        }
Exemple #41
0
        /// <summary>
        /// Создание различных областей игры, по которым будет путешествовать персонаж
        /// </summary>
        /// <param name="name"></param>
        /// <param name="areaType"></param>
        /// <param name="IsFightArea"></param>
        /// <param name="IsMerchArea"></param>
        /// <param name="IsSecretArea"></param>
        /// <param name="discoverXp"></param>
        /// <returns></returns>
        public Area CreateArea(string name, AreaType areaType, bool IsFightArea, bool IsMerchArea, bool IsSecretArea, bool IsTravelArea, bool IsQuestArea, int discoverXp)
        {
            if (name == "" || name == null) {
                throw new ArgumentException("Name should be filled");
            }

            return new Area {
                Name = name,
                AreaType = areaType,
                DiscoverXp = discoverXp,
                IsFightArea = IsFightArea,
                IsMerchArea = IsMerchArea,
                IsSecretArea = IsSecretArea,
                IsQuestArea = IsQuestArea,
                IsTravelArea = IsTravelArea,
                Undiscovered = true,
                Game = this
            };
        }
        public ChronodexSector(string[] timeData)
        {
            // basic fields
            _startTime = timeData[0].Trim();
            _duration = Int32.Parse(timeData[1]);
            _focus = (FocusLevel)Int32.Parse(timeData[2]);
            _area = GetAreaFrom(timeData[3]);
            _description = timeData.Length > 4 ? String.Join("-", timeData.Skip(4)) : "";
            _layedOut = false;
            _hatchType = _styles[0];

            // derivative fields
            _angleBegin = Chronodex.angles[_startTime];
            _angleEnd = _angleBegin + _duration * 7.5f;
            _angleMiddle = (_angleBegin + _angleEnd) / 2;
            _centralPoint = new PointF(615.0f + (float)Math.Cos(_angleMiddle * Math.PI / 180) * (144 + (Int32)_focus * 30),
                509.0f + (float)Math.Sin(_angleMiddle * Math.PI / 180) * (144 + (Int32)_focus * 30));
            _calloutEnd = new PointF(615.0f + (float)Math.Cos(_angleMiddle * Math.PI / 180) * 380,
                509.0f + (float)Math.Sin(_angleMiddle * Math.PI / 180) * 380);
            _color = Chronodex.colors[_area];
        }
Exemple #43
0
    public MainWindow()
    {
      InitializeComponent();

      // Load plugins
      ServiceScope.Get<IConfigurationManager>().Load();
      // Localise window
      IResourceString settings = LocalizationHelper.CreateLabelProperty("[configuration.areas.settings]");
      areaSettings.Tag = settings;
      areaSettings.Text = settings.ToString();
      IResourceString logs = LocalizationHelper.CreateLabelProperty("[configuration.areas.logs]");
      areaLogs.Tag = logs;
      areaLogs.Text = logs.ToString();
      areaLogs.Enabled = false;
      ServiceScope.Get<ILocalisation>().LanguageChange += LangageChange;
      CheckRightToLeft();
      // Initialize SettingsControl
      _settingsArea = new SettingsControl();
      _settingsArea.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
      _areaType = AreaType.SettingsArea;
      areaControls.Controls.Add(_settingsArea);
    }
 public virtual void SetAreaType(AreaType areaType)
 {
 }
		void SetAxisSort(AreaType area, SortDescriptor sort)
		{
			if (DataManager != null)
			{
				if (area == AreaType.ColumnsArea)
				{
					if (PivotGrid.AxisIsRotated == false)
						DataManager.Axis0_MeasuresSort = sort;
					else
						DataManager.Axis1_MeasuresSort = sort;
				}
				if (area == AreaType.RowsArea)
				{
					if (PivotGrid.AxisIsRotated == false)
						DataManager.Axis1_MeasuresSort = sort;
					else
						DataManager.Axis0_MeasuresSort = sort;
				}
			}
		}
		SortDescriptor GetAxisSort(AreaType area)
		{
			if (DataManager != null)
			{
				if (area == AreaType.ColumnsArea)
				{
					return PivotGrid.AxisIsRotated == false ? DataManager.Axis0_MeasuresSort : DataManager.Axis1_MeasuresSort;
				}
				if (area == AreaType.RowsArea)
				{
					return PivotGrid.AxisIsRotated == false ? DataManager.Axis1_MeasuresSort : DataManager.Axis0_MeasuresSort;
				}
			}
			return null;
		}
        private CustomContextMenu CreateContextMenu(AreaType areaType)
        {
            CustomContextMenu contextMenu = new CustomContextMenu();
            contextMenu.Opened += new EventHandler(contextMenu_Opened);
            contextMenu.Closed += new EventHandler(contextMenu_Closed);
            ContextMenuItem item;

            if ((areaType == AreaType.RowsArea && Rows_IsInteractive) ||
                (areaType == AreaType.ColumnsArea && Columns_IsInteractive))
            {
                item = new ContextMenuItem(Localization.PivotGrid_Expand);
                item.Tag = MemberActionType.Expand;
                if (areaType == AreaType.RowsArea)
                {
                    item.Shortcut = Localization.PivotGrid_Rows_Expand_ShortCut;
                }
                else
                {
                    item.Shortcut = Localization.PivotGrid_Columns_Expand_ShortCut;
                }
                contextMenu.AddMenuItem(item);
                item.ItemClick += new EventHandler(ContextMenu_ItemClick);

                item = new ContextMenuItem(Localization.PivotGrid_Collapse);
                item.Tag = MemberActionType.Collapse;
                if (areaType == AreaType.RowsArea)
                {
                    item.Shortcut = Localization.PivotGrid_Rows_Collapse_ShortCut;
                }
                else
                {
                    item.Shortcut = Localization.PivotGrid_Columns_Collapse_ShortCut;
                }
                contextMenu.AddMenuItem(item);
                item.ItemClick += new EventHandler(ContextMenu_ItemClick);

                item = new ContextMenuItem(Localization.PivotGrid_DrillDown);
                item.Tag = MemberActionType.DrillDown;
                if (areaType == AreaType.RowsArea)
                {
                    item.Shortcut = Localization.PivotGrid_Rows_Drilldown_ShortCut;
                }
                else
                {
                    item.Shortcut = Localization.PivotGrid_Columns_Drilldown_ShortCut;
                }
                contextMenu.AddMenuItem(item);
                item.ItemClick += new EventHandler(ContextMenu_ItemClick);

                contextMenu.AddMenuSplitter();
            }

            if (areaType == AreaType.CellsArea)
            {

                m_CopyValueMenuItem = new ContextMenuItem(Localization.ContextMenu_CopyValue + "      ");
                m_CopyValueMenuItem.Tag = ControlActionType.ValueCopy;
                //item.Icon = UriResources.Images.ActionNode16;
                contextMenu.AddMenuItem(m_CopyValueMenuItem);
                m_CopyValueMenuItem.ItemClick += new EventHandler(ContextMenu_ItemClick);

                m_DeliveryValueMenuItem = new ContextMenuItem(Localization.ContextMenu_DeliveryValue + "      ");
                m_DeliveryValueMenuItem.Tag = ControlActionType.ValueDelivery;
                //item.Icon = UriResources.Images.ActionNode16;
                contextMenu.AddMenuItem(m_DeliveryValueMenuItem);
                m_DeliveryValueMenuItem.ItemClick += new EventHandler(ContextMenu_ItemClick);

                m_DeliveryValueSplitter = contextMenu.AddMenuSplitter();

                m_DrillThroughMenuItem = new ContextMenuItem(Localization.ContextMenu_DrillThrough);
                m_DrillThroughMenuItem.Tag = ControlActionType.DrillThrough;
                //item.Icon = UriResources.Images.ActionNode16;
                contextMenu.AddMenuItem(m_DrillThroughMenuItem);
                m_DrillThroughMenuItem.ItemClick += new EventHandler(ContextMenu_ItemClick);

                m_CopySelectedCellsMenuItem = new ContextMenuItem(Localization.ContextMenu_Copy);
                m_CopySelectedCellsMenuItem.Tag = ControlActionType.Copy;
                m_CopySelectedCellsMenuItem.Icon = UriResources.Images.Copy16;
                contextMenu.AddMenuItem(m_CopySelectedCellsMenuItem);
                m_CopySelectedCellsMenuItem.ItemClick += new EventHandler(ContextMenu_ItemClick);

                m_PasteSelectedCellsMenuItem = new ContextMenuItem(Localization.ContextMenu_Paste);
                m_PasteSelectedCellsMenuItem.Tag = ControlActionType.Paste;
                m_PasteSelectedCellsMenuItem.Icon = UriResources.Images.Paste16;
                contextMenu.AddMenuItem(m_PasteSelectedCellsMenuItem);
                m_PasteSelectedCellsMenuItem.ItemClick += new EventHandler(ContextMenu_ItemClick);

                m_CopyCellsSplitter = contextMenu.AddMenuSplitter();

                if (!CanEdit)
                {
                    m_PasteSelectedCellsMenuItem.Visibility = Visibility.Collapsed;
                    m_CopyValueMenuItem.Visibility = Visibility.Collapsed;
                    m_DeliveryValueMenuItem.Visibility = Visibility.Collapsed;
                    m_DeliveryValueSplitter.Visibility = Visibility.Collapsed;
                }
                else
                {
                    m_PasteSelectedCellsMenuItem.IsEnabled = EditMode & CanEdit;
                }

                if (!DrillThroughCells)
                    m_DrillThroughMenuItem.Visibility = Visibility.Collapsed;
            }

            item = new ContextMenuItem(Localization.ContextMenu_ShowMDX);
            item.Tag = ControlActionType.ShowMDX;
            item.Icon = UriResources.Images.Mdx16;
            contextMenu.AddMenuItem(item);
            item.ItemClick += new EventHandler(ContextMenu_ItemClick);

            if (areaType == AreaType.RowsArea || areaType == AreaType.ColumnsArea)
            {
                item = new ContextMenuItem(Localization.ContextMenu_CustomProperties);
                item.Tag = ControlActionType.ShowAttributes;
                item.Icon = UriResources.Images.MemberProperty16;
                contextMenu.AddMenuItem(item);
                item.ItemClick += new EventHandler(ContextMenu_ItemClick);
            }

            item = new ContextMenuItem(Localization.ContextMenu_Properties);
            item.Tag = ControlActionType.ShowProperties;
            item.Icon = UriResources.Images.LevelProperty16;
            contextMenu.AddMenuItem(item);
            item.ItemClick += new EventHandler(ContextMenu_ItemClick);

            return contextMenu;
        }
 public SecondaryZoneSetBlock(BinaryReader binaryReader)
 {
     this.areaType = (AreaType)binaryReader.ReadInt16();
     this.padding = binaryReader.ReadBytes(2);
     this.zone = binaryReader.ReadShortBlockIndex1();
     this.area = binaryReader.ReadShortBlockIndex2();
 }
        public ActionResult DisplaySideTasks(AreaType? areaType, int? itemId, bool detail=false)
        {
            var userId = _membershipService.GetCurrentMember().UserId;
            List<Task> model;

            if (String.IsNullOrEmpty(itemId.ToString()))
            {
                //get all tasks for this user
                model = _taskService.GetAll().Where(x => x.AssignedID == userId).Take(5).ToList();
            }
            else
            {
                //get tasks for a specific item (lead or sale)
                model = _taskService.GetAll().Where(x => x.AssignedID == userId && x.AreaType == areaType && x.ItemID == itemId).Take(5).ToList();
            }

            ViewBag.Detail = detail;

            return PartialView("Controls/_TasksSideList", model);
        }
 public MembersAreaInfo(AreaType type)
 { 
     Type = type;
 }
 public List<AreaInfo> GetAreasByLevel(AreaType level)
 {
     List<AreaInfo> result = new List<AreaInfo>();
     foreach (var sf in _shapeFiles)
     {
         result.AddRange((from a in sf.AreaInfos where a.Level == level select a).ToList());
     }
     return result;
 }
 public List<AreaInfo> GetAreasByName(string name, AreaType level)
 {
     List<AreaInfo> result = new List<AreaInfo>();
     foreach (var sf in _shapeFiles)
     {
         result.AddRange((from a in sf.AreaInfos where string.Compare(a.Name, name, true) == 0 && a.Level == level select a).ToList());
     }
     return result;
 }
Exemple #53
0
        //списка соседей для точки:
        private static Collection<PathNode> GetNeighbours(PathNode pathNode,
          Point goal, AreaType[,] field)
        {
            var result = new Collection<PathNode>();

            // Соседними точками являются соседние по стороне клетки.
            Point[] neighbourPoints = new Point[8];
            neighbourPoints[0] = new Point(pathNode.Position.X + 1, pathNode.Position.Y);
            neighbourPoints[1] = new Point(pathNode.Position.X - 1, pathNode.Position.Y);
            neighbourPoints[2] = new Point(pathNode.Position.X, pathNode.Position.Y + 1);
            neighbourPoints[3] = new Point(pathNode.Position.X, pathNode.Position.Y - 1);
            neighbourPoints[4] = new Point(pathNode.Position.X + 1, pathNode.Position.Y+1);
            neighbourPoints[5] = new Point(pathNode.Position.X - 1, pathNode.Position.Y-1);
            neighbourPoints[6] = new Point(pathNode.Position.X-1, pathNode.Position.Y + 1);
            neighbourPoints[7] = new Point(pathNode.Position.X+1, pathNode.Position.Y - 1);
            foreach (var point in neighbourPoints)
            {
                // Проверяем, что не вышли за границы карты.
                if (point.X < 0 || point.X >= field.GetLength(0)*10)
                    continue;
                if (point.Y < 0 || point.Y >= field.GetLength(1)*10)
                    continue;
                // Проверяем, что по клетке можно ходить.
                if ((field[(int)point.X/10, (int)point.Y/10]== AreaType.Water))
                    continue;
                // Заполняем данные для точки маршрута.
                var neighbourNode = new PathNode()
                {
                    Position = point,
                    CameFrom = pathNode,
                    PathLengthFromStart = pathNode.PathLengthFromStart +
                      GetDistanceBetweenNeighbours(),
                    HeuristicEstimatePathLength = GetHeuristicPathLength(point, goal)
                };
                result.Add(neighbourNode);
            }
            return result;
        }
 public override bool PrepareRun(Database.DBCon db, string tableName)
 {
     _level = AreaType.State;
     _prefix = "";
     _field = "";
     if (Values.Count > 0)
     {
         _level = (AreaType)Enum.Parse(typeof(AreaType), Values[0]);
     }
     if (Values.Count > 1)
     {
         _prefix = Values[1];
     }
     if (Values.Count > 2)
     {
         _field = Values[2];
     }
     return base.PrepareRun(db, tableName);
 }
        private CustomContextMenu CreateContextMenu(AreaType areaType)
        {
            CustomContextMenu contextMenu = new CustomContextMenu();
            contextMenu.Opened += new EventHandler(contextMenu_Opened);
            contextMenu.Closed += new EventHandler(contextMenu_Closed);
            ContextMenuItem item;

            if ((areaType == AreaType.RowsArea && Rows_IsInteractive) ||
                (areaType == AreaType.ColumnsArea && Columns_IsInteractive))
            {
                item = new ContextMenuItem(Localization.PivotGrid_Expand);
                item.Tag = MemberActionType.Expand;
                if (areaType == AreaType.RowsArea)
                {
                    item.Shortcut = Localization.PivotGrid_Rows_Expand_ShortCut;
                }
                else
                {
                    item.Shortcut = Localization.PivotGrid_Columns_Expand_ShortCut;
                }
                contextMenu.AddMenuItem(item);
                item.ItemClick += new EventHandler(ContextMenu_ItemClick);

                item = new ContextMenuItem(Localization.PivotGrid_Collapse);
                item.Tag = MemberActionType.Collapse;
                if (areaType == AreaType.RowsArea)
                {
                    item.Shortcut = Localization.PivotGrid_Rows_Collapse_ShortCut;
                }
                else
                {
                    item.Shortcut = Localization.PivotGrid_Columns_Collapse_ShortCut;
                }
                contextMenu.AddMenuItem(item);
                item.ItemClick += new EventHandler(ContextMenu_ItemClick);

                item = new ContextMenuItem(Localization.PivotGrid_DrillDown);
                item.Tag = MemberActionType.DrillDown;
                if (areaType == AreaType.RowsArea)
                {
                    item.Shortcut = Localization.PivotGrid_Rows_Drilldown_ShortCut;
                }
                else
                {
                    item.Shortcut = Localization.PivotGrid_Columns_Drilldown_ShortCut;
                }
                contextMenu.AddMenuItem(item);
                item.ItemClick += new EventHandler(ContextMenu_ItemClick);

                contextMenu.AddMenuSplitter();
            }

            // Пуекты для сортировки элементов
            if ((areaType == AreaType.RowsArea) ||
                (areaType == AreaType.ColumnsArea))
            {
                item = new ContextMenuItem(Localization.ContextMenu_SortingByProperty);
                item.Tag = ControlActionType.SortingByProperty;
                contextMenu.AddMenuItem(item);
                item.ItemClick += new EventHandler(ContextMenu_ItemClick);

                item = new ContextMenuItem(Localization.ContextMenu_SortingByMeasure);
                item.Tag = ControlActionType.SortingAxisByMeasure;
                contextMenu.AddMenuItem(item);
                item.ItemClick += new EventHandler(ContextMenu_ItemClick);

                item = new ContextMenuItem(Localization.ContextMenu_SortingByValue);
                item.Tag = ControlActionType.SortingByValue;
                contextMenu.AddMenuItem(item);
                item.ItemClick += new EventHandler(ContextMenu_ItemClick);

                //item = new ContextMenuItem(Localization.ContextMenu_ClearAxisSorting);
                //item.Tag = ControlActionType.ClearAxisSorting;
                //contextMenu.AddMenuItem(item);
                //item.ItemClick += new EventHandler(ContextMenu_ItemClick);

                contextMenu.AddMenuSplitter();
            }

            if (areaType == AreaType.CellsArea)
            {

                m_CopyValueMenuItem = new ContextMenuItem(Localization.ContextMenu_CopyValue + "      ");
                m_CopyValueMenuItem.Tag = ControlActionType.ValueCopy;
                //item.Icon = UriResources.Images.ActionNode16;
                contextMenu.AddMenuItem(m_CopyValueMenuItem);
                m_CopyValueMenuItem.ItemClick += new EventHandler(ContextMenu_ItemClick);

                m_DeliveryValueMenuItem = new ContextMenuItem(Localization.ContextMenu_DeliveryValue + "      ");
                m_DeliveryValueMenuItem.Tag = ControlActionType.ValueDelivery;
                //item.Icon = UriResources.Images.ActionNode16;
                contextMenu.AddMenuItem(m_DeliveryValueMenuItem);
                m_DeliveryValueMenuItem.ItemClick += new EventHandler(ContextMenu_ItemClick);

                m_DeliveryValueSplitter = contextMenu.AddMenuSplitter();

                m_DrillThroughMenuItem = new ContextMenuItem(Localization.ContextMenu_DrillThrough);
                m_DrillThroughMenuItem.Tag = ControlActionType.DrillThrough;
                //item.Icon = UriResources.Images.ActionNode16;
                contextMenu.AddMenuItem(m_DrillThroughMenuItem);
                m_DrillThroughMenuItem.ItemClick += new EventHandler(ContextMenu_ItemClick);

                m_CopySelectedCellsMenuItem = new ContextMenuItem(Localization.ContextMenu_Copy);
                m_CopySelectedCellsMenuItem.Tag = ControlActionType.Copy;
                m_CopySelectedCellsMenuItem.Icon = UriResources.Images.Copy16;
                contextMenu.AddMenuItem(m_CopySelectedCellsMenuItem);
                m_CopySelectedCellsMenuItem.ItemClick += new EventHandler(ContextMenu_ItemClick);

                m_PasteSelectedCellsMenuItem = new ContextMenuItem(Localization.ContextMenu_Paste);
                m_PasteSelectedCellsMenuItem.Tag = ControlActionType.Paste;
                m_PasteSelectedCellsMenuItem.Icon = UriResources.Images.Paste16;
                contextMenu.AddMenuItem(m_PasteSelectedCellsMenuItem);
                m_PasteSelectedCellsMenuItem.ItemClick += new EventHandler(ContextMenu_ItemClick);

                m_CopyCellsSplitter = contextMenu.AddMenuSplitter();

                if (!CanEdit)
                {
                    m_PasteSelectedCellsMenuItem.Visibility = Visibility.Collapsed;
                    m_CopyValueMenuItem.Visibility = Visibility.Collapsed;
                    m_DeliveryValueMenuItem.Visibility = Visibility.Collapsed;
                    m_DeliveryValueSplitter.Visibility = Visibility.Collapsed;
                }
                else
                {
                    m_PasteSelectedCellsMenuItem.IsEnabled = EditMode & CanEdit;
                }

                if (!DrillThroughCells)
                    m_DrillThroughMenuItem.Visibility = Visibility.Collapsed;
            }

            item = new CheckedContectMenuItem(Localization.ContextMenu_AutoWidthColumns);
            item.Tag = ControlActionType.AutoWidth;
            (item as CheckedContectMenuItem).IsChecked = AutoWidthColumns;
            contextMenu.AddMenuItem(item);
            item.ItemClick += new EventHandler(ContextMenu_ItemClick);

            #region Подменю для управления режимом реорганизации данных
            CustomContextMenu subMenu1 = new CustomContextMenu();
            item = new CheckedContectMenuItem(Localization.ContextMenu_DataReorganizationType_None);
            item.Tag = ControlActionType.DataReorganizationType_None;
            subMenu1.AddMenuItem(item);
            item.ItemClick += new EventHandler(ContextMenu_ItemClick);

            item = new CheckedContectMenuItem(Localization.ContextMenu_DataReorganizationType_MergeNeighbors);
            item.Tag = ControlActionType.DataReorganizationType_MergeNeighbors;
            subMenu1.AddMenuItem(item);
            item.ItemClick += new EventHandler(ContextMenu_ItemClick);

            item = new CheckedContectMenuItem(Localization.ContextMenu_DataReorganizationType_HitchToParent);
            item.Tag = ControlActionType.DataReorganizationType_HitchToParent;
            subMenu1.AddMenuItem(item);
            item.ItemClick += new EventHandler(ContextMenu_ItemClick);

            item = new ContextMenuItem(Localization.ContextMenu_DataReorganizationType);
            item.Tag = ControlActionType.DataReorganizationType;
            item.SubMenu = subMenu1;
            contextMenu.AddMenuItem(item);
            #endregion

            item = new ContextMenuItem(Localization.ContextMenu_ShowMDX);
            item.Tag = ControlActionType.ShowMDX;
            item.Icon = UriResources.Images.Mdx16;
            contextMenu.AddMenuItem(item);
            item.ItemClick += new EventHandler(ContextMenu_ItemClick);

            if (areaType == AreaType.RowsArea || areaType == AreaType.ColumnsArea)
            {
                item = new ContextMenuItem(Localization.ContextMenu_CustomProperties);
                item.Tag = ControlActionType.ShowAttributes;
                item.Icon = UriResources.Images.MemberProperty16;
                contextMenu.AddMenuItem(item);
                item.ItemClick += new EventHandler(ContextMenu_ItemClick);
            }

            item = new ContextMenuItem(Localization.ContextMenu_Properties);
            item.Tag = ControlActionType.ShowProperties;
            item.Icon = UriResources.Images.LevelProperty16;
            contextMenu.AddMenuItem(item);
            item.ItemClick += new EventHandler(ContextMenu_ItemClick);

            return contextMenu;
        }
Exemple #56
0
        public ActionResult DisplaySideTasks(AreaType? areaType, int? itemId, bool detail=false)
        {
            var userId = _membershipService.GetCurrentMember().UserId;
            List<Task> model;

            if (String.IsNullOrEmpty(itemId.ToString()))
            {
                //get all tasks for this user
                model = _taskService.GetAll(new TaskFilterOptions() { AssignedID = userId }, new PagingSettings() { PageCount = 5, PageIndex = 1}).ToList();
            }
            else
            {
                //get tasks for a specific item (lead or sale)
                model = _taskService.GetAll(new TaskFilterOptions() { AssignedID = userId, Area = areaType }, new PagingSettings() { PageCount = 5, PageIndex = 1 }).ToList();
            }

            ViewBag.Detail = detail;

            return PartialView("Controls/_TasksSideList", model);
        }
Exemple #57
0
    /// <summary>
    /// Creates the ClickedCellInfo from the data grid and the mouse coordinates of the click.
    /// </summary>
    /// <param name="dg">The data grid.</param>
    /// <param name="mouseCoord">The mouse coordinates of the click.</param>
    public void MouseClick(WinFormsWorksheetController dg, Point mouseCoord)
    {

      bool bIsPropertyColumn=false;
      _clickedCellRectangle = new Rectangle(0,0,0,0);
      _clickedColumn = GetColumnNumber(dg,mouseCoord, ref _clickedCellRectangle);
      _clickedRow    = GetRowNumber(dg,mouseCoord,ref _clickedCellRectangle, out bIsPropertyColumn);

      if(bIsPropertyColumn)
      {
        if(_clickedColumn==-1)
          _clickedAreaType = AreaType.PropertyColumnHeader;
        else if(_clickedColumn>=0)
          _clickedAreaType = AreaType.PropertyCell;
        else
          _clickedAreaType = AreaType.OutsideAll;

        int h=_clickedColumn; _clickedColumn = _clickedRow; _clickedRow = h; // Swap columns and rows since it is a property column
      }
      else // it is not a property related cell
      {
        if(_clickedRow==-1 && _clickedColumn==-1)
          _clickedAreaType = AreaType.TableHeader;
        else if(_clickedRow==-1 && _clickedColumn>=0)
          _clickedAreaType = AreaType.DataColumnHeader;
        else if(_clickedRow>=0 && _clickedColumn==-1)
          _clickedAreaType = AreaType.DataRowHeader;
        else if(_clickedRow>=0 && _clickedColumn>=0)
          _clickedAreaType = AreaType.DataCell;
        else
          _clickedAreaType = AreaType.OutsideAll;
      }
    }
Exemple #58
0
    public void SetWidth(float value, AreaType t)
    {
        areaWidth.value = value;
        areaWidth.style = t;

        mArea.width = areaWidth.Calc(mWindowRect.width);
    }
Exemple #59
0
    public void SetY(float value, AreaType t)
    {
        areaY.value = value;
        areaY.style = t;

        mArea.y = areaY.Calc(mWindowRect.height);
    }
Exemple #60
0
    public void SetHeight(float value, AreaType t)
    {
        areaHeight.value = value;
        areaHeight.style = t;

        mArea.height = areaHeight.Calc(mWindowRect.height);
    }