void ShowNearbyPoi_OnPoiSelected(object sender, ShowNearbyPoi.PoiEventArgs e)
        {
            Vertex           poi    = e.SelectedPoi; // ShowNearbyPoi.SelectedVertexPOI;
            AbsoluteLocation absLoc = poi.AbsoluteLocations.First();

            JSInterface.centerAt(webBrowserOffline, (double)absLoc.latitude, (double)absLoc.longitude);
        }
Example #2
0
        public override string DBFileName()
        {
            string world = JSInterface.GetWorldNum();

            if (!string.IsNullOrWhiteSpace(world))
            {
                world = world.Trim().Replace(" ", "");

                string path = (AppDomain.CurrentDomain.GetData("DataDirectory") as string ?? "");

                if (!string.IsNullOrWhiteSpace(path))
                {
                    path += @"\";
                }

                var baseFile = path + @"data\db.sqlite";
                var dataDir  = path + string.Format(@"data\{0}", world);
                m_DataFile = dataDir + @"\db.sqlite";

                if (!System.IO.File.Exists(m_DataFile))
                {
                    System.IO.Directory.CreateDirectory(dataDir);
                    System.IO.File.Copy(baseFile, m_DataFile, false);
                }
            }

            return(m_DataFile);
        }
Example #3
0
        private void Form1_Load(object sender, EventArgs e)
        {
            jsi = new JSInterface(SetInfo);
            var workingArea = SystemInformation.WorkingArea;

            SetDesktopLocation(workingArea.Width - Size.Width, 40);
            reloadRightData();
            cboListScript.DataSource = cboBindData;
            HotKey.RegisterHotKey(Handle, 101, HotKey.KeyModifiers.Ctrl | HotKey.KeyModifiers.Shift, Keys.S);
        }
Example #4
0
 private void UI_UpdateNewLocation(WifiSnifferPositioningService.PositionEstimate location)
 {
     if (uiMode == UiMode.GOOGLE_MAPS)
     {
         JSInterface.updateNewLocation(browser, location);
     }
     else if (uiMode == UiMode.BING_MAPS)
     {
         OnPositionEstimateChanged(this, new PositionEstimateArgs(location));
     }
 }
Example #5
0
 /// <summary>
 /// Clear map overlay
 /// NOTE: Can be used with either Bing maps or Google Maps
 /// </summary>
 protected void UI_ClearOverlays()
 {
     if (uiMode == UiMode.GOOGLE_MAPS)
     {
         JSInterface.clearOverlays(browser);
     }
     else if (uiMode == UiMode.BING_MAPS)
     {
         OnClearOverlayChanged(this, null);
     }
 }
Example #6
0
 /// <summary>
 /// This is used to center the map (Bing map or Google Map) at the specified coordinates.
 /// NOTE: Can be used with either Google Maps or Bing Maps
 /// </summary>
 /// <param name="lat"></param>
 /// <param name="lon"></param>
 public void UI_CenterAt(double lat, double lon)
 {
     if (uiMode == UiMode.GOOGLE_MAPS)
     {
         JSInterface.centerAt(this.browser, lat, lon);
     }
     else if (uiMode == UiMode.BING_MAPS)
     {
         OnCenterChanged(this, new CoordinateArgs(lat, lon));
     }
 }
Example #7
0
 /// <summary>
 /// Notify the UI to show the selected location
 /// (i.e., center at the selected coordinates)
 /// </summary>
 /// <param name="lat"></param>
 /// <param name="lon"></param>
 private void UI_ShowSelectedLocation(double lat, double lon)
 {
     if (uiMode == UiMode.GOOGLE_MAPS)
     {
         JSInterface.showSelectedLocation(browser, lat, lon);
     }
     else if (uiMode == UiMode.BING_MAPS)
     {
         OnSelectedLocationChanged(this, new SelectedLocationArgs(lat, lon));
     }
 }
Example #8
0
        //NOTE: Consider refactoring
        //Change name to 'ShowVertices'
        //This method is called to show the vertices
        protected void UI_ShowVertices(int floorNum)
        {
            IEnumerable <Vertex> verts = getVisibleVertices(floorNum);

            if (uiMode == UiMode.GOOGLE_MAPS)
            {
                JSInterface.showVertices(browser, verts, floorNum, isOnline());
            }
            else
            {
                OnVisibleVerticesChanged(this, new VisibleVerticesArgs(verts));
            }
        }
Example #9
0
        private void DoRefreshPlayerName()
        {
            PlayerName      = JSInterface.GetPlayerName();
            MainWindowTitle = string.Format("CotGBrowser, {0} ({1})",
                                            Assembly.GetExecutingAssembly().GetName().Version.ToString(),
                                            PlayerName);

            if (!string.IsNullOrWhiteSpace(PlayerName))
            {
                m_Timer.IsEnabled = false;

                var dbHelper = IoCHelper.GetIoC().Resolve <DialectHelper>();
                StatusInfo = "DB file: " + dbHelper.DBFileName();

                HasAccess2Reports = true;
            }
        }
Example #10
0
        //This method is called to show edges (IFF edges should be shown)
        protected void UI_ShowEdges(int floorNum)
        {
            IEnumerable <Edge> edges = null;

            if (LocationService.CurrentBuilding != null && showEdges())
            {
                edges = getVisibleEdges(floorNum); //mGraph.getEdges(floorNum);

                if (uiMode == UiMode.GOOGLE_MAPS)
                {
                    JSInterface.showEdges(browser, edges, floorNum);
                }
                else if (uiMode == UiMode.BING_MAPS)
                {
                    OnVisibleEdgesChanged(this, new VisibleEdgesArgs(edges));
                }
            }
        }
Example #11
0
    void Start()
    {
        Instance = this;
        //Application.ExternalCall("MyFunction2", "Hello from Unity!");
        log = GameObject.Find("log").GetComponent <UILabel>();
        log.gameObject.SetActive(false);
        if (SystemInfo.supportedRenderTargetCount == 1)
        {
            OnIncompatible();
            //ShowLog( SystemInfo.supportedRenderTargetCount.ToString());
        }

        uiroot = GameObject.Find("UIRoot");
        tables = GameObject.Find("table1");
        gu1    = GameObject.Find("scroll_grid_1").GetComponent <GridUpdate>();
        gu2    = GameObject.Find("scroll_grid_2").GetComponent <GridUpdate>();
        gu3    = GameObject.Find("scroll_grid_3").GetComponent <GridUpdate>();
        gu4    = GameObject.Find("scroll_grid_4").GetComponent <GridUpdate>();
        //DrawOneAttackLonLat("{\"data\" : [1,1,20,20,40,40]}");
        //DrawAttackBatch("{\"list\":[{\"ID\":\"1\",\"eventtype\":\"蠕虫\",\"eventname\":\"事件名称\",\"srcip\":\"源ip\",\"dstip\":\"宿ip\",\"eventcount\":\"事件发生次数\",\"eventtime\":\"攻击时间\",\"eventlevel\":\"事件级别\",\"srcipposition\":\"源ip经纬度\",\"dstipposition\":\"宿ip经纬度\"},{\"ID\":\"1\",\"eventtype\":\"蠕虫\",\"eventname\":\"事件名称\",\"srcip\":\"源ip\",\"dstip\":\"宿ip\",\"eventcount\":\"事件发生次数\",\"eventtime\":\"攻击时间\",\"eventlevel\":\"事件级别\",\"srcipposition\":\"源ip经纬度\",\"dstipposition\":\"宿ip经纬度\"}]}");
    }
Example #12
0
        public void HyperLinkClicked(object sender, RoutedEventArgs e)
        {
            var hl = e.Source as Hyperlink;

            if (hl != null && hl.NavigateUri != null)
            {
                if (hl.NavigateUri.OriginalString.StartsWith("r"))
                {
                    JSInterface.ShowReport(hl.NavigateUri.OriginalString.Substring(1));
                }
                else if (hl.NavigateUri.OriginalString.StartsWith("p"))
                {
                    JSInterface.ShowPlayer(hl.NavigateUri.OriginalString.Substring(1));
                }
                else if (hl.NavigateUri.OriginalString.StartsWith("c"))
                {
                    JSInterface.ShowCityCoords(hl.NavigateUri.OriginalString.Substring(1));
                }
                else if (hl.NavigateUri.OriginalString.StartsWith("a"))
                {
                    JSInterface.ShowAlliance(hl.NavigateUri.OriginalString.Substring(1));
                }
            }
        }
Example #13
0
        public ChatWindowMV()
        {
            m_IsWorldVisible   = true;
            m_IsAllyVisible    = true;
            m_IsOfficerVisible = true;
            m_IsWhisperVisible = true;
            m_Out2Ally         = true;
            m_Out2Officers     = false;
            m_Out2World        = false;
            m_AutoScroll       = true;
            m_IsWhisperMode    = false;
            m_IsOfficer        = true;
            m_WndState         = WindowState.Normal;

            if (IoCHelper.IsInitialized)
            {
                Notify = IoCHelper.GetIoC().Resolve <CotGNotifyIcon>();

                ChatDoc             = new FlowDocument();
                ChatDoc.PagePadding = new Thickness(1);

                m_ChatP            = new Paragraph();
                m_ChatP.FontFamily = new FontFamily("Segoe UI");
                m_ChatP.FontSize   = 13.333;
                ChatDoc.Blocks.Add(m_ChatP);

                JSInterface = IoCHelper.GetIoC().Resolve <JScriptInterface>();
                JSInterface.InitChat();
                JSInterface.ChatMessage      += JSInterface_ChatMessage;
                JSInterface.ChatInputChanged += JSInterface_ChatInputChanged;

                IsOfficer = JSInterface.IsOfficer();

                ReloadMessages();
            }
        }
 private void DoRefreshCmd()
 {
     JSInterface.RefreshTroopsOverview();
 }
 private void dpad_down_Tap(object sender, GestureEventArgs e)
 {
     JSInterface.updateSelectedLocation(webBrowserOffline, 0, Map2DOffline.RELATIVE_PIXEL_UPDATE_INTERVAL);
 }
 private void DoDownloadEmpireRankingsCmd()
 {
     JSInterface.DownloadAllRankings();
 }
 private void DoTestCmd()
 {
     JSInterface.InitAjaxHandlers();
 }
Example #18
0
        public void SendMessage()
        {
            m_OutHistory.Add(OutMsg);
            m_histPos = m_OutHistory.Count - 1;

            List <string> replaced;

            string outMsg = OutMsg + " "; //dodaj zeby wyr. regularne zadziałało

            var                           //@@Aliance ->  <alliance>Aliance</alliance>
                r = new Regex("(@@[a-zA-Z0-9_]+)+");

            replaced = new List <string>();

            foreach (Match m in r.Matches(outMsg))
            {
                if (!replaced.Contains(m.Groups[1].Value))
                {
                    outMsg = outMsg.Replace(m.Groups[1].Value, string.Format("<alliance>{0}</alliance>", m.Groups[1].Value.Substring(1).Trim()));
                    replaced.Add(m.Groups[1].Value);
                }
            }

            //@Player -> <player>Player</player>
            r        = new Regex("(@[a-zA-Z0-9_]+)+");
            replaced = new List <string>();

            foreach (Match m in r.Matches(outMsg))
            {
                if (!replaced.Contains(m.Groups[1].Value))
                {
                    outMsg = outMsg.Replace(m.Groups[1].Value, string.Format("<player>{0}</player>", m.Groups[1].Value.Substring(1).Trim()));
                    replaced.Add(m.Groups[1].Value);
                }
            }

            r        = new Regex("#([0-9]{1,3}:[0-9]{1,3})+");
            replaced = new List <string>();

            foreach (Match m in r.Matches(outMsg))
            {
                if (!replaced.Contains(m.Groups[1].Value))
                {
                    outMsg = outMsg.Replace('#' + m.Groups[1].Value, string.Format("<coords>{0}</coords>", m.Groups[1].Value.Trim()));
                    replaced.Add(m.Groups[1].Value);
                }
            }


            outMsg = outMsg.Trim();

            if (IsWhisperMode.HasValue ? IsWhisperMode.Value : false && !string.IsNullOrWhiteSpace(WhisperTo))
            {
                var users = WhisperTo.Split(';');

                foreach (var u in users)
                {
                    var msgs = new List <string>();

                    if (!string.IsNullOrWhiteSpace(u))
                    {
                        msgs.Add(string.Format("/w {0} {1}", u, outMsg));
                    }

                    JSInterface.SendAllyChatMessage(msgs);
                }
            }
            else
            {
                if (Out2Ally.HasValue ? Out2Ally.Value : false)
                {
                    JSInterface.SendAllyChatMessage(outMsg);
                }
                else if (Out2World.HasValue ? Out2World.Value : false)
                {
                    JSInterface.SendWorldChatMessage(outMsg);
                }
                else if (Out2Officers.HasValue ? Out2Officers.Value : false)
                {
                    JSInterface.SendOfficerChatMessage(outMsg);
                }
            }

            OutMsg = "";
        }
Example #19
0
 private void DoRefreshCmd()
 {
     JSInterface.RefreshRaidsReports();
 }