Beispiel #1
0
        void Start()
        {
            _destManager = new DestinationManager(gameObject, directionIndicator, coordinatesModifier);

            _rigidbody = GetComponent <Rigidbody2D>();
            if (_rigidbody == null)
            {
                throw new NullReferenceException("rigidbody is not set up");
            }

            _animator = GetComponent <Animator>();
            if (_animator == null)
            {
                throw new NullReferenceException("animator is not set up");
            }

            if (_destManager.NextWaypointAvailable)
            {
                SetUpNextWaypoint();
                _moving = true;
                SetUpAnimatorParams();
            }
            else
            {
                Debug.LogWarning("No waypoints on path.");
            }
        }
Beispiel #2
0
        public ActionResult TripPlanning()
        {
            var model = new TripPlanningViewModel();

            if (Request.IsAuthenticated)
            {
                // find all trips for the user
                List <BlViewTrip> _allTrips = null;
                var blError = TripManager.GetAllTripsForUser(User.Identity.GetUserId(), out _allTrips);
                model.AllTrips = _allTrips;

                // find any active trip - to move to a business layer method
                var _activeTrip = _allTrips.FirstOrDefault(p => (p.DlTripView.Status.Trim() == TripStatus.booked.ToString()));

                // if there IS an active trip - redirect to view
                if (_activeTrip != null)
                {
                    var _tripViewModel = new TripViewModel()
                    {
                        ActiveTrip = _activeTrip
                    };
                    return(View("Trip", _tripViewModel));
                }

                // else show all the planned trips
                var _plannedTrips = _allTrips.Where(p => (p.DlTripView.Status.Trim() == TripStatus.planned.ToString() || p.DlTripView.Status.Trim() == TripStatus.consulting.ToString())).ToList();
                model.PlannedTrips = _plannedTrips;

                List <Destination> _destinations = null;
                blError = DestinationManager.GetTopDestinations("", 8, out _destinations);
                model.SuggestedDestinations = _destinations;
            }

            return(View(model));
        }
Beispiel #3
0
        //*******************************************************************

        #region CreateDestinationX
        private int CreateDestinationX()
        {
            var          cnf        = new ConfigurationData();
            var          lg         = new Logger();
            var          driveCode  = DriveCode;
            var          driveTitle = DriveTitle;
            var          fm         = new FileManager(cnf, lg);
            IDataManager dm         = new DataManager(cnf, fm, lg, MaxImagesInDirectory);
            string       drvLetter  = DriveLetter;
            Dictionary <string, object> addParams = new Dictionary <string, object>();

            addParams.Add("IsSecret", IsSecret);
            int driveId = dm.CreateDrive(DriveLetter, DriveTitle, DriveCode, addParams);

            if (driveId != 0)
            {
                var destMngr = new DestinationManager(
                    new FillInfoParameters(DriveLetter, (SaveImages == 1), (SaveMedia == 1), (SaveThumbnails == 1), (SaveThumbnailsToDb == 1), driveId), dm, fm, cnf);
                destMngr.Execute();
            }
            else
            {
                System.Windows.Forms.MessageBox.Show(dm.logger.GetLog());
            }
            return(driveId);
        }
        public void GetOrCreateItem_NonExistentItem_CreatesNewItem()
        {
            var manager = new DestinationManager();

            var item = manager.GetOrCreateItem("abc", item => { });

            Assert.NotNull(item);
            Assert.Equal("abc", item.DestinationId);
        }
Beispiel #5
0
 public ExtractArchiveAction(IOptions <ExtractArchiveOptions> options, DestinationManager destinationManager, CarrierManager carrierManager, ILogger <ExtractArchiveAction> logger)
 {
     this.options            = options;
     this.destinationManager = destinationManager;
     this.carrierManager     = carrierManager;
     this.logger             = logger;
     Key      = "ExtractArchive";
     Priority = 1;
 }
Beispiel #6
0
    void OnGUI()
    {
        GUILayout.Label("Base Settings", EditorStyles.boldLabel);

        destinationManager = (DestinationManager)EditorGUILayout.ObjectField("Destination Manager", destinationManager, typeof(DestinationManager), true);

        if (GUILayout.Button("Assign"))
        {
            MapButtonAssigner.Assign(destinationManager.destinations, destinationManager.destMapButtons);
        }
    }
Beispiel #7
0
 void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
     else if (instance != this)
     {
         Destroy(this);
     }
 }
Beispiel #8
0
        public Core(ISettings settings, IPlatform platform)
        {
            if (settings == null)
            {
                throw new ArgumentNullException(nameof(settings));
            }
            if (platform == null)
            {
                throw new ArgumentNullException(nameof(platform));
            }

            Settings = settings;
            Platform = platform;

            KeyManager keyManager = new KeyManager(settings);

            rsaProvider = new RSACryptoServiceProvider();
            rsaProvider.ImportParameters(keyManager.EncryptionParameters);
            nodeID = Common.Utils.SHA512Str(rsaProvider.ToXmlString(false));

            FileSystem = new FileSystemProvider(this);

            ShareBuilder = new ShareBuilder(this);
            ShareBuilder.FinishedIndexing += ShareBuilder_FinishedIndexing;

            shareWatcher = new ShareWatcher(this);

            ShareHasher = new ShareHasher();

            transportManager = new TransportManager(this);

            FileTransferManager = new FileTransferManager(this);

            FileSearchManager = new FileSearchManager(this);

            DestinationManager = new DestinationManager(this);

            // XXX: Use reflection to load these:
            DestinationManager.RegisterSource(new TCPIPv4DestinationSource(this));
            DestinationManager.RegisterSource(new TCPIPv6DestinationSource(this));

            TrackerFactory.Register("meshwork", typeof(MeshworkTracker));

            ITransportListener tcpListener = new TcpTransportListener(this, Settings.TcpListenPort);

            transportListeners.Add(tcpListener);

            if (FinishedLoading != null)
            {
                FinishedLoading(null, EventArgs.Empty);
            }
        }
Beispiel #9
0
        public static IEnumerable <SelectListItem> GetDestinationsSelectList()
        {
            var _dbDestinations = new List <Destination>();
            var blError         = DestinationManager.GetAllDestinations(out _dbDestinations);
            var _destinations   = _dbDestinations.Select(x =>
                                                         new SelectListItem
            {
                Value = x.Id.ToString(),
                Text  = x.Name
            });

            return(new SelectList(_destinations, "Value", "Text"));
        }
Beispiel #10
0
    void Start()
    {
        line = GetComponent <LineRenderer>();

        DestinationManager dm = DestinationManager.current;

        dm.onAddDestination.AddListener((a) => AddDestination(a));

        // dm.AddDestination(new Destination("destination1", new Vector3(0, 0, 0), true, true));
        // dm.AddDestination(new Destination("destination2", new Vector3(10, 0, 10), true, true));
        // dm.AddDestination(new Destination("destination3", new Vector3(0, 0, 20), true, true));

        UpdateSpline();
    }
Beispiel #11
0
        internal ClusterInfo GetCluster()
        {
            var destinationManager = new DestinationManager();

            destinationManager.GetOrCreateItem("dest-A", d => { });
            destinationManager.GetOrCreateItem(AffinitizedDestinationName, d => { });
            destinationManager.GetOrCreateItem("dest-C", d => { });

            var cluster = new ClusterInfo("cluster-1", destinationManager);

            cluster.Config = ClusterConfig;
            cluster.UpdateDynamicState();
            return(cluster);
        }
        public ActionResult Tibet()
        {
            var destination = new Destination();
            var blError     = DestinationManager.GetDestinationForAlias("Tibet", out destination);

            if (blError.ErrorCode != 0 || destination == null)
            {
                throw new ApplicationException(blError.ErrorMessage);
            }
            var model = new DomingoModelBase()
            {
                PageName = "Tibet Trips", Destination = destination
            };

            return(View(model));
        }
        // GET: Circuit - get all circuits for Europe
        public ActionResult Europe()
        {
            List <Destination> _destinations = null;
            var blError = DestinationManager.GetDestinationsForContinent("europe", out _destinations);

            if (blError.ErrorCode != 0 || _destinations == null || _destinations.Count == 0)
            {
                throw new ApplicationException(blError.ErrorMessage);
            }
            var _model = new CircuitModelBase()
            {
                AllDestinations = _destinations, CircuitName = "Europe"
            };

            return(View(_model));
        }
        public ActionResult SupercarSuperbikeBritain()
        {
            var destination = new Destination();
            var blError     = DestinationManager.GetDestinationForAlias("SupercarBritain", out destination);

            if (blError.ErrorCode != 0 || destination == null)
            {
                throw new ApplicationException(blError.ErrorMessage);
            }
            var model = new DomingoModelBase()
            {
                PageName = "Supercar & Superbike tours of Britain", Destination = destination
            };

            return(View(model));
        }
        //[Guid("9FF35F56-5324-4B94-8038-EA9C10C3EB76")]
        public ActionResult HB9FF35F56_5324_4B94_8038_EA9C10C3EB76()
        {
            List <Destination> _destinations = null;
            var blError = DestinationManager.GetAllDestinations(out _destinations);

            if (blError.ErrorCode != 0 || _destinations == null || _destinations.Count == 0)
            {
                throw new ApplicationException(blError.ErrorMessage);
            }

            var _model = new CircuitModelBase()
            {
                AllDestinations = _destinations, CircuitName = "All Destinations"
            };

            return(View("Index", _model));
        }
        public void DeleteDestination(DestinationViewModel destViewModel)
        {
            try
            {
                tbl_Destination tblDestination = new tbl_Destination();
                tblDestination.daId        = destViewModel.DAID;
                tblDestination.DestID      = destViewModel.destID;
                tblDestination.EntityState = DA.DomainModel.EntityState.Deleted;

                DestinationManager destManager = new DestinationManager();
                destManager.DeleteDestination(tblDestination);
            }
            catch (Exception)
            {
                throw;
            }
        }
        // GET: Circuit - get Destination
        public ActionResult Destination(string destination)
        {
            List <SubDestination> _subDestinationList = null;
            var _blerror = DestinationManager.SearchSubDestination(destination, out _subDestinationList);

            if (_blerror.ErrorCode != 0 || _subDestinationList == null || _subDestinationList.Count == 0)
            {
                return(View("Error404"));
            }

            var _model = new CircuitDestinationViewModel()
            {
                Name = destination, SubDestinations = _subDestinationList
            };

            return(View(_model));
        }
Beispiel #18
0
    public Location getLocation()
    {
        #region DB functions
        SqlCommand cmd = new SqlCommand();
        cmd.CommandType = CommandType.Text;
        SqlParameter[] cmdParams = new SqlParameter[1];
        cmdParams[0] = cmd.Parameters.AddWithValue("name", Name);
        string    query = "select * from Location where Name=@name";
        Location  l     = new Location();
        DbService db    = new DbService();
        DataSet   ds    = db.GetDataSetByQuery(query, true, cmd.CommandType, cmdParams);
        DataRow   dr    = ds.Tables[0].Rows[0];

        l.Type      = dr["Type"].ToString();
        l.Name      = dr["Name"].ToString();
        l.Area      = dr["Area"].ToString();
        l.Direction = dr["adress"].ToString();
        //l.Responsible = (Volunteer)dr["Responsible"];
        l.IsActive    = bool.Parse(dr["IsActive"].ToString());
        l.Remarks     = dr["Remarks"].ToString();
        l.EnglishName = dr["EnglishName"].ToString();
        if (dr["DestinationManager"].ToString() != "")
        {
            int        managerId = int.Parse(dr["DestinationManager"].ToString());
            SqlCommand cmd2      = new SqlCommand();
            cmd2.CommandType = CommandType.Text;
            SqlParameter[] cmdParams2 = new SqlParameter[1];
            cmdParams2[0] = cmd2.Parameters.AddWithValue("Id", managerId);
            string query2 = "select * from DestinationManagers where Id=@Id";

            DestinationManager m   = new DestinationManager();
            DbService          db2 = new DbService();
            DataSet            ds2 = db2.GetDataSetByQuery(query2, true, cmd2.CommandType, cmdParams2);
            DataRow            dr2 = ds2.Tables[0].Rows[0];
            l.ManagerName     = dr2["FirstName"].ToString();
            l.ManagerLastName = dr2["LastName"].ToString();
            l.managerPhones   = dr2["Phone"].ToString();
        }
        l.Region = new Region(Convert.ToInt32(dr["RegionId"]));

        #endregion

        return(l);
    }
        public void GetOrCreateItem_NonExistentItem_CreatesNewItem()
        {
            // Arrange
            var endpointManager        = new DestinationManager();
            var proxyHttpClientFactory = new Mock <IProxyHttpClientFactory>().Object;

            Mock <IDestinationManagerFactory>()
            .Setup(e => e.CreateDestinationManager())
            .Returns(endpointManager);
            var manager = Create <ClusterManager>();

            // Act
            var item = manager.GetOrCreateItem("abc", item => { });

            // Assert
            Assert.NotNull(item);
            Assert.Equal("abc", item.ClusterId);
            Assert.Same(endpointManager, item.DestinationManager);
        }
        public bool CheckDuplicate(DestinationViewModel destViewModel)
        {
            try
            {
                DestinationManager destmanager = new DestinationManager();

                var destination = destmanager.FindDestinationDesc(destViewModel.destDesc, destViewModel.DAID);

                if (destination != null && destination.DestID != destViewModel.destID && destination.DestDesc.ToUpper() == destViewModel.destDesc.ToUpper())
                {
                    return(true);
                }
                return(false);
            }
            catch (Exception)
            {
                throw;
            }
        }
        public DestinationViewModel FindDestination(int?destID)
        {
            try
            {
                DestinationViewModel destViewModel = new DestinationViewModel();

                DestinationManager destManager = new DestinationManager();
                var dest = destManager.FindDestination(destID);

                destViewModel.destID   = dest.DestID;
                destViewModel.destDesc = dest.DestDesc;
                destViewModel.DAID     = dest.daId;

                return(destViewModel);
            }
            catch (Exception)
            {
                throw;
            }
        }
Beispiel #22
0
    public int getDestinationManagerId()
    {
        #region DB functions
        SqlCommand cmd = new SqlCommand();
        cmd.CommandType = CommandType.Text;
        SqlParameter[] cmdParams = new SqlParameter[1];
        cmdParams[0] = cmd.Parameters.AddWithValue("name", ManagerName);
        string query = "select * from DestinationManagers where FirstName=@name";


        DestinationManager m  = new DestinationManager();
        DbService          db = new DbService();
        DataSet            ds = db.GetDataSetByQuery(query, true, cmd.CommandType, cmdParams);
        DataRow            dr = ds.Tables[0].Rows[0];

        m.Id = int.Parse(dr["Id"].ToString());
        #endregion

        return(m.Id);
    }
Beispiel #23
0
        public void GetOrCreateItem_NonExistentItem_CreatesNewItem()
        {
            var endpointManager = new DestinationManager();

            Mock <IDestinationManagerFactory>()
            .Setup(e => e.CreateDestinationManager())
            .Returns(endpointManager);
            var changeListener = new Mock <IClusterChangeListener>();

            Provide(changeListener.Object);
            var manager = Create <ClusterManager>();

            var item = manager.GetOrCreateItem("abc", item => { });

            Assert.NotNull(item);
            Assert.Equal("abc", item.ClusterId);
            Assert.Same(endpointManager, item.DestinationManager);
            changeListener.Verify(l => l.OnClusterAdded(item), Times.Once);
            changeListener.VerifyNoOtherCalls();
        }
        public ActionResult GoldenTriangle()
        {
            var destination = new Destination();
            var blError     = DestinationManager.GetDestinationForAlias("GoldenTriangle", out destination);

            if (blError.ErrorCode != 0 || destination == null)
            {
                throw new ApplicationException(blError.ErrorMessage);
            }
            // get all the tags for this destination
            List <View_TagDestination> tags;

            _GetTagsForDestination(destination, out blError, out tags);

            var model = new DomingoModelBase()
            {
                PageName = "Trips in the Golden Triangle", Destination = destination, DestinationTags = tags
            };

            return(View(model));
        }
        internal ClusterInfo GetCluster()
        {
            var destinationManager = new DestinationManager();

            destinationManager.GetOrCreateItem("dest-A", d => { });

            var cluster = new ClusterInfo("cluster-1", destinationManager);

            cluster.Config = new ClusterConfig(new Cluster
            {
                SessionAffinity = new SessionAffinityOptions
                {
                    Enabled       = true,
                    Mode          = "Mode-B",
                    FailurePolicy = "Policy-1",
                }
            },
                                               new HttpMessageInvoker(new Mock <HttpMessageHandler>().Object));

            cluster.UpdateDynamicState();
            return(cluster);
        }
        public ActionResult ScottishIsles()
        {
            // get the destination object
            var destination = new Destination();
            var blError     = DestinationManager.GetDestinationForAlias("ScottishIsles", out destination);

            if (blError.ErrorCode != 0 || destination == null)
            {
                throw new ApplicationException(blError.ErrorMessage);
            }

            // get all the tags for this destination
            List <View_TagDestination> tags = null;

            _GetTagsForDestination(destination, out blError, out tags);
            var model = new DomingoModelBase()
            {
                PageName = "Trips to the Scottish Isles", Destination = destination, DestinationTags = tags
            };

            return(View(model));
        }
        public void GetDestinationDetails(int daId)
        {
            try
            {
                DestinationManager destManager = new DestinationManager();
                var destList = destManager.GetDestinationDetails(daId);

                DestList = new List <DestinationViewModel>();
                foreach (var item in destList)
                {
                    DestinationViewModel destViewModel = new DestinationViewModel();

                    destViewModel.destID   = item.DestID;
                    destViewModel.destDesc = item.DestDesc;
                    destViewModel.DAID     = item.daId;// 1;

                    DestList.Add(destViewModel);
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
Beispiel #28
0
    void Awake()
    {
        instance     = this;
        destinations = new List <Destination>();
        FindBoids();

        offset = new Vector3[13];

        offset[0] = new Vector3(0, 0, 0);

        offset[1] = new Vector3(1, 0, 0);
        offset[2] = new Vector3(0.5f, 0, 0.87f);
        offset[3] = new Vector3(-0.5f, 0, 0.87f);
        offset[4] = new Vector3(-1, 0, 0);
        offset[5] = new Vector3(-0.5f, 0, -0.87f);
        offset[6] = new Vector3(0.5f, 0, -0.87f);

        offset[7]  = new Vector3(0.87f, 0, 0.5f);
        offset[8]  = new Vector3(0, 0, 1);
        offset[9]  = new Vector3(-0.87f, 0, 0.5f);
        offset[10] = new Vector3(-0.87f, 0, -0.5f);
        offset[11] = new Vector3(0, 0, -1);
        offset[12] = new Vector3(0.87f, 0, -0.5f);
    }
Beispiel #29
0
 /// <summary>Get a list of destinations that we can connect to.</summary>
 public IDestination[] GetConnectableDestinations(Core core)
 {
     return(DestinationManager.GetConnectableDestinations(GetDestinations(core)));
 }
Beispiel #30
0
        private void DestinationMenuButton_OnPreviewMouseDown(object sender, MouseButtonEventArgs e)
        {
            var destinationWindow = new DestinationManager();

            destinationWindow.Show();
        }