Example #1
0
 public GridItemsEventArgs(GridItemType type, List<MapItem> items)
 {
     this.m_Type = type;
     this.m_Items = items;
 }
 protected static bool Initializable(GridItemType itemType)
 {
     return !(itemType == GridItemType.Item || itemType == GridItemType.EditItem || itemType == GridItemType.EditFormItem
         || itemType == GridItemType.AlternatingItem);
 }
Example #3
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="regionHandle"></param>
        /// <param name="item"></param>
        /// <param name="layer"></param>
        /// <param name="timeoutMS"></param>
        /// <returns></returns>
        public List<MapItem> MapItems(ulong regionHandle, GridItemType item, GridLayerType layer, int timeoutMS)
        {
            List<MapItem> itemList = null;
            AutoResetEvent itemsEvent = new AutoResetEvent(false);

            EventHandler<GridItemsEventArgs> callback =
                delegate(object sender, GridItemsEventArgs e)
                {
                    if (e.Type == GridItemType.AgentLocations)
                    {
                        itemList = e.Items;
                        itemsEvent.Set();
                    }
                };

            GridItems += callback;

            RequestMapItems(regionHandle, item, layer);
            itemsEvent.WaitOne(timeoutMS, false);

            GridItems -= callback;

            return itemList;
        }
Example #4
0
 public DnnGridItem(GridTableView ownerTableView, int itemIndex, int dataSetIndex, GridItemType itemType) : base(ownerTableView, itemIndex, dataSetIndex, itemType)
 {
 }
        public multipleMapItemReply GetMapItems(ulong regionHandle, GridItemType gridItemType)
        {
            Dictionary<string, object> sendData = new Dictionary<string, object>();

            sendData["REGIONHANDLE"] = regionHandle;
            sendData["GRIDITEMTYPE"] = (int)gridItemType;
            sendData["METHOD"] = "getmapitems";

            string reqString = WebUtils.BuildQueryString(sendData);

            try
            {
                List<string> serverURIs = m_registry.RequestModuleInterface<IConfigurationService>().FindValueOf("GridServerURI");
                foreach (string m_ServerURI in serverURIs)
                {
                    string reply = SynchronousRestFormsRequester.MakeRequest("POST",
                            m_ServerURI,
                            reqString);
                    if (reply != string.Empty)
                    {
                        Dictionary<string, object> replyData = WebUtils.ParseXmlResponse(reply);

                        if (replyData != null)
                        {
                            multipleMapItemReply items = new multipleMapItemReply();
                            if (replyData.ContainsKey("Result") && (replyData["Result"].ToString().ToLower() == "failure"))
                                return items;

                            items = new multipleMapItemReply((replyData["MapItems"]) as Dictionary<string, object>);

                            // Success
                            return items;
                        }

                        else
                            m_log.DebugFormat("[GRID CONNECTOR]: GetMapItems {0} received null response",
                                regionHandle);
                    }
                }
            }
            catch (Exception e)
            {
                m_log.DebugFormat("[GRID CONNECTOR]: Exception when contacting server: {0}", e.Message);
            }

            return null;
        }
 private static bool Initializable(GridItemType itemType)
 {
     return !(itemType == GridItemType.Item || itemType == GridItemType.EditItem || itemType == GridItemType.EditFormItem
         || itemType == GridItemType.AlternatingItem);
     //return
     //(itemType == GridItemType.FilteringItem || itemType == GridItemType.Header || itemType == GridItemType.Pager || itemType == GridItemType.Footer
     //|| itemType == GridItemType.GroupFooter || itemType == GridItemType.GroupHeader);
 }
Example #7
0
 public multipleMapItemReply GetMapItems(ulong regionHandle, GridItemType gridItemType)
 {
     multipleMapItemReply reply = m_localService.GetMapItems(regionHandle, gridItemType);
     if (reply.items.Count == 0)
     {
         reply = m_remoteService.GetMapItems(regionHandle, gridItemType);
     }
     return reply;
 }
 public multipleMapItemReply GetMapItems(ulong regionHandle, GridItemType gridItemType)
 {
     return new multipleMapItemReply();
 }
 public DnnGridImageCommandColumnTemplate(GridItemType itemType)
 {
     ItemType = itemType;
 }
 public multipleMapItemReply GetMapItems(ulong regionHandle, GridItemType gridItemType)
 {
     return m_GridService.GetMapItems(regionHandle, gridItemType);
 }
        public multipleMapItemReply GetMapItems(ulong regionHandle, GridItemType gridItemType)
        {
            multipleMapItemReply reply = m_localService.GetMapItems(regionHandle, gridItemType);
            if (reply.items.Count == 0)
                reply = (multipleMapItemReply)DoRemoteForced(regionHandle, gridItemType);

            return reply;
        }
Example #12
0
 public multipleMapItemReply GetMapItems(ulong regionHandle, GridItemType gridItemType)
 {
     throw new NotImplementedException();
 }
 public multipleMapItemReply GetMapItems(List<UUID> scopeIDs, ulong regionHandle, GridItemType gridItemType)
 {
     return null;
 }
Example #14
0
 private static bool Initializable(GridItemType itemType)
 {
     return itemType != GridItemType.Item && itemType != GridItemType.EditItem && itemType != GridItemType.EditFormItem && itemType != GridItemType.AlternatingItem;
 }
Example #15
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="regionHandle"></param>
        /// <param name="item"></param>
        /// <param name="layer"></param>
        /// <param name="timeoutMS"></param>
        /// <returns></returns>
        public List<GridItem> MapItems(ulong regionHandle, GridItemType item, GridLayerType layer, int timeoutMS)
        {
            List<GridItem> itemList = null;
            AutoResetEvent itemsEvent = new AutoResetEvent(false);

            GridItemsCallback callback =
                delegate(GridItemType type, List<GridItem> items)
                {
                    if (type == GridItemType.AgentLocations)
                    {
                        itemList = items;
                        itemsEvent.Set();
                    }
                };

            OnGridItems += callback;

            RequestMapItems(regionHandle, item, layer);
            itemsEvent.WaitOne(timeoutMS, false);

            OnGridItems -= callback;

            return itemList;
        }
        /// <summary>
        /// Creates a ImageCommandColumnTemplate
        /// </summary>
        /// <returns>A ImageCommandColumnTemplate</returns>
        private DnnGridImageCommandColumnTemplate CreateTemplate(GridItemType type)
        {
            bool isDesignMode = HttpContext.Current == null;
            var template = new DnnGridImageCommandColumnTemplate(type);
            if (type != GridItemType.Header)
            {
                template.ImageURL = ImageURL;
                if (!isDesignMode)
                {
                    template.CommandName = CommandName;
                    template.VisibleField = VisibleField;
                    template.KeyField = KeyField;
                }
            }
            template.EditMode = EditMode;
            template.NavigateURL = NavigateURL;
            template.NavigateURLFormatString = NavigateURLFormatString;
            template.OnClickJs = OnClickJs;
            template.ShowImage = ShowImage;
            template.Visible = Visible;

            template.Text = type == GridItemType.Header ? HeaderText : Text;

            //Set Design Mode to True
            template.DesignMode = isDesignMode;

            return template;
        }
Example #17
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="regionHandle"></param>
        /// <param name="item"></param>
        /// <param name="layer"></param>
        public void RequestMapItems(ulong regionHandle, GridItemType item, GridLayerType layer)
        {
            MapItemRequestPacket request = new MapItemRequestPacket();
            request.AgentData.AgentID = Client.Self.AgentID;
            request.AgentData.SessionID = Client.Self.SessionID;
            request.AgentData.Flags = (uint)layer;
            request.AgentData.Godlike = false; // Filled in on the sim
            request.AgentData.EstateID = 0; // Filled in on the sim

            request.RequestData.ItemType = (uint)item;
            request.RequestData.RegionHandle = regionHandle;

            Client.Network.SendPacket(request);
        }
Example #18
0
 private GridItem(int value, GridItemType type, int health)
 {
     this.value = value;
     this.type = type;
     this.health = health;
 }