public GeoFenceViewModel(OD.DataSource dataSource)
            : base(dataSource)
        {
            // init the data members with default values
              TrackIdFieldName  = "GeoFenceId";
              NameFieldName     = "Name";
              CategoryFieldName = "Category";
              ActiveFieldName   = "Active";
              Properties["GeometryServiceUrl"]    = @"http://tasks.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer";
              Properties["ServiceAreaServiceUrl"] = @"http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Network/USA/NAServer/Service%20Area";

              // init the commands
              ToggleActiveCommand = new DelegatingCommand(OnToggleActive);
        }
Esempio n. 2
0
        public BaseDataGridViewModel(OD.DataSource dataSource)
        {
            ViewModel  = this;
            Properties = new Dictionary <string, string>();

            InEditMode             = false;
            ConvertToLocalTimeZone = true;

            // init commands
            PanToCommand             = new DelegatingCommand(OnPanTo);
            ZoomToCommand            = new DelegatingCommand(OnZoomTo);
            HighlightCommand         = new DelegatingCommand(OnHighlight);
            FollowCommand            = new DelegatingCommand(OnFollow);
            StopFollowCommand        = new DelegatingCommand(OnStopFollow);
            DeleteItemCommand        = new DelegatingCommand(OnDeleteItem);
            DeleteAllCommand         = new DelegatingCommand(OnDeleteAll);
            GroupByDelegatingCommand = new DelegatingCommand(OnGroupByAction);

            Update(dataSource);
        }
        public AlertViewModel(OD.DataSource dataSource)
            : base(dataSource)
        {
            // init the data members with default values
              Properties["GepHostName"]                   = @"localhost";
              Properties["GepHttpPort"]                   = @"6180";
              Properties["GepHttpsPort"]                  = @"6143";
              Properties["GEP_INCIDENTS_ENDPOINT"]        = @"geoevent/admin/incidents";
              Properties["ALERT_ASSIGN_TO_FIELD_ALIAS"]   = @"Assigned To";
              Properties["ALERT_ASSIGN_TO_URI_PROP"]      = @"AssignedTo";
              Properties["ALERT_NOTE_FIELD_ALIAS"]        = @"Note";
              Properties["ALERT_NOTE_URI_PROP"]           = @"Note";
              Properties["ALERT_DISMISS_STATUS_URI_PROP"] = @"Dismissed";
              Properties["ALERT_DISMISSED_VALUE"]         = @"true";

              // init the commands
              DismissCommand   = new DelegatingCommand(OnDismiss);
              AssignToCommand  = new DelegatingCommand(OnAssignTo);
              NoteCommand      = new DelegatingCommand(OnNote);
        }
    public BaseDataGridViewModel(OD.DataSource dataSource)
    {
      ViewModel = this;
      Properties = new Dictionary<string, string>();

      InEditMode             = false;
      ConvertToLocalTimeZone = true;

      // init commands
      PanToCommand             = new DelegatingCommand(OnPanTo);
      ZoomToCommand            = new DelegatingCommand(OnZoomTo);
      HighlightCommand         = new DelegatingCommand(OnHighlight);
      FollowCommand            = new DelegatingCommand(OnFollow);
      StopFollowCommand        = new DelegatingCommand(OnStopFollow);
      DeleteItemCommand        = new DelegatingCommand(OnDeleteItem);
      DeleteAllCommand         = new DelegatingCommand(OnDeleteAll);
      GroupByDelegatingCommand = new DelegatingCommand(OnGroupByAction);

      Update(dataSource);
    }
    public StopViewModel(OD.DataSource dataSource, OD.DataSource routesDataSource, StopWidget view)
      : base(dataSource)
    {
      // init _wsTimer
      _webSocketKeepAliveTimer = new DispatcherTimer();
      _webSocketKeepAliveTimer.Interval = new TimeSpan(0, 0, 2);
      _webSocketKeepAliveTimer.Tick += new EventHandler(OnWebSocketKeepAliveTick);

      // init _progressDialogTimer
      _progressDialogTimer = new DispatcherTimer();
      _progressDialogTimer.Tick += new EventHandler(OnProgressDialogTimeOut);

      // init the data members with default values
      StopsRouteNameFieldName   = @"RouteName";
      RoutesRouteNameFieldName  = @"Route";
      Properties["GepHostName"]   = @"localhost";
      Properties["GepHttpPort"]   = @"6180";
      Properties["GepHttpsPort"]  = @"6143";
      Properties["GEP_LOAD_PLAN_ENDPOINT"]          = @"geoevent/rest/receiver/route-command-in";
      Properties["GEP_ROUTES_CALCULATE_ENDPOINT"]   = @"geoevent/rest/receiver/route-update-in";
      Properties["GEP_ROUTES_UPDATE_ENDPOINT"]      = @"geoevent/rest/receiver/route-update-in";
      Properties["GEP_DISPATCH_ENDPOINT"]           = @"geoevent/rest/receiver/route-message-in";
      Properties["STOPS_ROUTE_NAME_FIELD_NAME"]     = @"RouteName";
      Properties["ROUTES_ROUTE_NAME_FIELD_NAME"]    = @"RouteName";
      Properties["ROUTES_UN_ASSIGNED_ROUTE_NAME"]   = @"__Unassigned__";

      _unassignedRouteName = GetPropValue("ROUTES_UN_ASSIGNED_ROUTE_NAME");
      SetRouteDataSource(routesDataSource);

      // temp
      _view = view;

      // init commands
      DispatchCommand = new DelegatingCommand(OnDispatch);
      DispatchAllCommand = new DelegatingCommand(OnDispatchAll);
      UnassignCommand = new DelegatingCommand(OnUnassign);
      CutCommand = new DelegatingCommand(OnCut);
      PasteCommand = new DelegatingCommand(OnPaste);
      PasteOnGroupCommand = new DelegatingCommand(OnPasteOnGroup);

      _edits = new HashSet<string>();

      // Web Socket Event Handlers
      _wsOnOpenEH     = new EventHandler(WebSocket_OnOpen);
      _wsOnCloseEH    = new EventHandler<CloseEventArgs>(WebSocket_OnClose);
      _wsOnErrorEH    = new EventHandler<ErrorEventArgs>(WebSocket_OnError);
      _wsOnMessageEH  = new EventHandler<MessageEventArgs>(WebSocket_OnMessage);
    }