private static void SaveData(ICollection <FamilyParserModel> parsedFamilies, IDataFactory dataFactory)
        {
            parsedFamilies.ToList().ForEach(f =>
            {
                var family = f.ParseToFamily(dataFactory);
                dataFactory.AddFamily(family);
                dataFactory.SaveAllChanges();

                f.Visits.ToList().ForEach(v =>
                {
                    var visit      = v.ParseToVisit(dataFactory);
                    visit.FamilyId = family.Id;
                    visit.UserId   = family.AssignedStaffMember.Id;
                    dataFactory.AddVisit(visit);
                });

                var children  = family.Children.ToList();
                var fchildren = f.Children.ToList();

                for (int i = 0; i < children.Count; i++)
                {
                    var child = children[i];
                    fchildren[i].MedicalRecords.ToList().ForEach(mr =>
                    {
                        var medicalRecord     = mr.ParseToMedicalRecord();
                        medicalRecord.ChildId = child.Id;
                        dataFactory.AddMedicalRecord(medicalRecord);
                    });
                }
            });
            dataFactory.SaveAllChanges();
        }
 public DeleteSiteCommand(IDataFactory dataFactory, UserService userService, BusinessModuleFactory businessModuleFactory, ICacheRepository cacheRepository)
 {
     _dataFactory           = dataFactory;
     _userService           = userService;
     _businessModuleFactory = businessModuleFactory;
     _cacheRepository       = cacheRepository;
 }
示例#3
0
 internal EntryTile(uint id, IDataFactory factory, ITileData tiledata, bool valid)
 {
     _EntryId    = id;
     dataFactory = factory;
     _TileData   = tiledata;
     _IsValid    = valid;
 }
示例#4
0
        protected override void Context()
        {
            _dataFactory         = A.Fake <IDataFactory>();
            _dimensionRepository = A.Fake <IDimensionRepository>();
            sut = new DataRepositoryFromResultsCreator(_dimensionRepository, new ObjectPathFactoryForSpecs(), _dataFactory);

            _simulation       = new IndividualSimulation().WithName("S");
            _simulation.Model = new OSPSuite.Core.Domain.Model();
            var root = new Container().WithContainerType(ContainerType.Simulation).WithName(_simulation.Name);

            _simulation.Model.Root = root;
            var liver = new Container().WithName("LIVER");

            liver.Add(new Observer().WithName("C"));
            var kidney = new Container().WithName("KIDNEY");

            kidney.Add(new Observer().WithName("C"));
            root.Add(liver);
            root.Add(kidney);

            _simulationResults  = new SimulationResults();
            _simulation.Results = _simulationResults;
            _timeValues         = new QuantityValues {
                QuantityPath = "Time", Values = new[] { 1f, 2f, 3f }
            };
            _simulationResults.Time = _timeValues;

            _individualResults = new IndividualResults();
            _individualResults.Add(new QuantityValues {
                QuantityPath = "LIVER|C", Time = _timeValues, Values = new[] { 10f, 20f, 30f }
            });
            _individualResults.Add(new QuantityValues {
                QuantityPath = "KIDNEY|C", Time = _timeValues, Values = new[] { 11f, 22f, 33f }
            });
        }
示例#5
0
        public static async Task <SeoBusinessModel> LoadSeoBusinessModelAsync(IDataFactory datafactory, string siteId)
        {
            var itemDataModel = await GetSeoItemDataModelAsync(datafactory, siteId);

            SeoBusinessModel seoBusinessModel = null;

            if (itemDataModel != null && itemDataModel.Data != null)
            {
                seoBusinessModel = itemDataModel.Data as SeoBusinessModel;
            }
            else
            {
                seoBusinessModel = new SeoBusinessModel
                {
                    Disallows = new List <string>(),
                    Metas     = new List <SeoValidationMeta>()
                };
                seoBusinessModel.Metas.Add(new SeoValidationMeta {
                    Engine = SeoEngine.Google
                });
                seoBusinessModel.Metas.Add(new SeoValidationMeta {
                    Engine = SeoEngine.Bing
                });
            }

            if (seoBusinessModel.Redirects == null)
            {
                seoBusinessModel.Redirects = new  List <SeoRedirect>();
            }

            return(seoBusinessModel);
        }
        public static async Task <GetNewsItemResult> GetNewsItemResult(IDataFactory dataFactory, UserService userService
                                                                       , ItemDataModel itemDataModel, string userId)
        {
            var result = await GetNewsItemResultAsync <NotificationItemBusinessModel, GetNewsItemResult>(dataFactory, userService, itemDataModel);

            return(result);
        }
 public StatefullAggregateRepository(AggregateStore store, IDataFactory dataFactory, ISerializer serializer, AggregateRegistry aggregateRegistry, ITransitionStore transitionStore, AggregateDefinition definition)
     : base(store, dataFactory, definition)
 {
     _serializer = serializer;
     _aggregateRegistry = aggregateRegistry;
     _transitionStore = transitionStore;
 }
示例#8
0
 public SuperAdminDeleteModuleCommand(IDataFactory dataFactory, UserService userService,
                                      CacheProvider cacheProvider)
 {
     _dataFactory   = dataFactory;
     _userService   = userService;
     _cacheProvider = cacheProvider;
 }
示例#9
0
 public SaveMenuCommand(IDataFactory dataFactory, UserService userService, CacheProvider cacheProvider, ModuleManager moduleManager)
 {
     _dataFactory   = dataFactory;
     _userService   = userService;
     _cacheProvider = cacheProvider;
     _moduleManager = moduleManager;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="MassTerminateController"/> class.
 /// </summary>
 public MassTerminateController(IDataFactory dataFactory,
                                IAuthorizationProvider authorization, IMappingFactory mapFactory)
 {
     this.DataFactory   = dataFactory;
     this.Authorization = authorization;
     this._mapFactory   = mapFactory;
 }
示例#11
0
        protected override void Context()
        {
            _dataFactory               = A.Fake <IDataFactory>();
            _simModelExporter          = A.Fake <ISimModelExporter>();
            _simModelSimulationFactory = A.Fake <ISimModelSimulationFactory>();
            _simModelSimulation        = A.Fake <ISimulation>();

            sut = new SimModelBatch(_simModelExporter, _simModelSimulationFactory, _dataFactory);

            A.CallTo(() => _simModelSimulationFactory.Create()).Returns(_simModelSimulation);
            _modelCoreSimulation = A.Fake <IModelCoreSimulation>();
            _simModelXmlString   = "SimModelXml";
            A.CallTo(() => _simModelExporter.Export(_modelCoreSimulation, SimModelExportMode.Optimized)).Returns(_simModelXmlString);

            _parameterProperties1 = A.Fake <IParameterProperties>();
            _parameterProperties2 = A.Fake <IParameterProperties>();
            _parameterProperties3 = A.Fake <IParameterProperties>();

            A.CallTo(() => _parameterProperties1.Path).Returns("ParameterPath1");
            A.CallTo(() => _parameterProperties2.Path).Returns("ParameterPath2");
            A.CallTo(() => _parameterProperties3.Path).Returns("ParameterPath3");

            _allSimModelParameters = new List <IParameterProperties> {
                _parameterProperties1, _parameterProperties2, _parameterProperties3
            };
            A.CallTo(() => _simModelSimulation.ParameterProperties).Returns(_allSimModelParameters);

            _variableParameterPaths = new List <string> {
                _parameterProperties1.Path, _parameterProperties2.Path
            };
        }
        public ViewModelLocator()
        {
            // default factory
            this.DataFactory = new StringDataFactory();

            SimpleIoc.Default.Register <ViewModel_Main>(() => new ViewModel_Main(this.DataFactory));
        }
        public static int ParseFamiliesJsonData(string filePath, string dateFormat, IDataFactory dataFactory)
        {
            var parsedFamilies = JsonParser.ParseJson <ICollection <FamilyParserModel> >(filePath, "dd.MM.yyyy").ToList();

            SaveData(parsedFamilies, dataFactory);
            return(parsedFamilies.Count());
        }
示例#14
0
        public override async Task <ItemDataModel> CreateFromAsync(IDataFactory dataFactorySource,
                                                                   IDataFactory dataFactoryDestination,
                                                                   ItemDataModel itemDataModelSource,
                                                                   ItemDataModel itemDataModelDestinationParent, bool isTransfert, object data = null)
        {
            var itemDataModelDestination = await SiteBusinessModule.DuplicateAllAsync(_businessModuleFactory, dataFactorySource,
                                                                                      dataFactoryDestination, itemDataModelSource, itemDataModelDestinationParent, isTransfert);

            var addSiteInput = data as CreateFromSiteModel;

            if (addSiteInput != null)
            {
                var siteBusinessModel = (MasterBusinessModel)itemDataModelDestination.Data;
                siteBusinessModel.Elements.First(e => e.Property == "Title").Data = addSiteInput.Title;

                // On met à jour les id des images
                var imageIcones = GetImages(siteBusinessModel, "ImageIcone");
                if (imageIcones != null && imageIcones.Count > 0)
                {
                    UpdateImageId(imageIcones, itemDataModelDestination);
                    var element = siteBusinessModel.Elements.First(e => e.Property == "ImageIcone");
                    element.Data = JsonConvert.SerializeObject(imageIcones);
                }
                var imageLogos = GetImages(siteBusinessModel, "ImageLogo");
                if (imageLogos != null && imageLogos.Count > 0)
                {
                    UpdateImageId(imageLogos, itemDataModelDestination);
                    var element = siteBusinessModel.Elements.First(e => e.Property == "ImageLogo");
                    element.Data = JsonConvert.SerializeObject(imageLogos);
                }
            }

            return(itemDataModelDestination);
        }
示例#15
0
        public override void GlobalContext()
        {
            base.GlobalContext();

            _objectPathFactory   = IoC.Resolve <IObjectPathFactory>();
            _modelCoreSimulation = IoC.Resolve <SimulationHelperForSpecs>().CreateSimulation();
            var simModelExporter          = IoC.Resolve <ISimModelExporter>();
            var simModelSimulationFactory = A.Fake <ISimModelSimulationFactory>();

            A.CallTo(() => simModelSimulationFactory.Create()).Returns(new Simulation());
            _simModelManagerForSpecs = new SimModelManagerForSpecs(simModelExporter, simModelSimulationFactory);

            _simModelSimulation     = _simModelManagerForSpecs.CreateSimulation(_modelCoreSimulation);
            _dataFactory            = A.Fake <IDataFactory>();
            _variableParameterPaths = new[]
            {
                _objectPathFactory.CreateObjectPathFrom(ConstantsForSpecs.Organism, ConstantsForSpecs.BW).PathAsString,
                _objectPathFactory.CreateObjectPathFrom(ConstantsForSpecs.Organism, ConstantsForSpecs.TableParameter1).PathAsString,
            };

            _variableSpeciesPath = new []
            {
                _objectPathFactory.CreateObjectPathFrom(ConstantsForSpecs.Organism, ConstantsForSpecs.ArterialBlood, ConstantsForSpecs.Plasma, "A").PathAsString,
                _objectPathFactory.CreateObjectPathFrom(ConstantsForSpecs.Organism, ConstantsForSpecs.VenousBlood, ConstantsForSpecs.Plasma, "B").PathAsString,
            };

            sut = new SimModelBatch(simModelExporter, simModelSimulationFactory, _dataFactory);
        }
示例#16
0
 public RouteProvider(IDataFactory dataFactory, BusinessModuleFactory businessModuleFactory, IHostingEnvironment env, IOptions <BusinessConfig> businessConfig)
 {
     _dataFactory           = dataFactory;
     _businessModuleFactory = businessModuleFactory;
     _env            = env;
     _businessConfig = businessConfig.Value;
 }
 private IAggregate EstablishStatelessAggregate(Type aggregateType, String aggregateId, Int32 version, IDataFactory dataFactory)
 {
     var aggregate = _store.CreateStatelessAggregate(aggregateType);
     var context = new StatelessAggregateContext(aggregateId, version, dataFactory);
     aggregate.EstablishContext(context);
     return aggregate;
 }
示例#18
0
 /// <summary>
 /// Creates transition builder
 /// </summary>
 public TransitionBuilder(IDataFactory dataFactory, String streamId, Int32 streamVersion, DateTime timestamp)
 {
     _dataFactory = dataFactory;
     _streamId = streamId;
     _streamVersion = streamVersion;
     _timestamp = timestamp;
 }
示例#19
0
        public static async Task <ItemDataModel> Get <T>(SaveModuleInputBase input, IDataFactory data, string moduleName)
            where T : class, new()
        {
            var siteId   = input.Site.SiteId;
            var parentId = input.ParentId;

            if (string.IsNullOrEmpty(parentId))
            {
                parentId = siteId;
            }

            ItemDataModel itemDataModel;

            if (string.IsNullOrEmpty(input.ModuleId))
            {
                itemDataModel = await InitItemDataModelAsync <T>(data, moduleName, siteId, parentId, input.PropertyName);
            }
            else
            {
                itemDataModel = await data.ItemRepository.GetItemAsync(input.Site.SiteId, input.ModuleId, false, true);

                SavePropertyName(itemDataModel, input.PropertyName);
            }
            return(itemDataModel);
        }
示例#20
0
        /// <summary>
        /// 数据库工厂构造函数
        /// </summary>
        /// <param name="dbtype">数据库枚举</param>
        static DataHelper()
        {
            try
            {
                if (File.Exists(INIPATH))
                {
                    StringBuilder sb = new StringBuilder(STRINGMAX);

                    WinAPI.GetPrivateProfileString("HOST", "REMOTEIP", m_RemoteIP, sb, STRINGMAX, INIPATH);
                    m_RemoteIP = sb.ToString();

                    WinAPI.GetPrivateProfileString("HOST", "LOCALIP", m_LocalIP, sb, STRINGMAX, INIPATH);
                    m_LocalIP = sb.ToString();

                    WinAPI.GetPrivateProfileString("HOST", "REMOTEPORT", m_RemotePort, sb, STRINGMAX, INIPATH);
                    m_RemotePort = sb.ToString();

                    WinAPI.GetPrivateProfileString("HOST", "LOCALPORT", m_LocalPort, sb, STRINGMAX, INIPATH);
                    m_LocalPort = sb.ToString();

                    WinAPI.GetPrivateProfileString("DATABASE", "ARCHIVE", m_Path, sb, STRINGMAX, INIPATH);
                    m_Path = sb.ToString();
                    WinAPI.GetPrivateProfileString("DATABASE", "TYPE", m_type, sb, STRINGMAX, INIPATH);
                    m_type = sb.ToString();

                    WinAPI.GetPrivateProfileString("OTHERS", "SAVEBYTES", m_SaveBytes, sb, STRINGMAX, INIPATH);
                    m_SaveBytes = sb.ToString();

                    WinAPI.GetPrivateProfileString("OTHERS", "HAVEVEDIO", m_HaveVedio, sb, STRINGMAX, INIPATH);
                    m_HaveVedio = sb.ToString();

                    if (m_type.ToUpper().Equals("MSSQL"))
                    {
                        WinAPI.GetPrivateProfileString("DATABASE", "CONNSTRING", m_ConnStr, sb, STRINGMAX, INIPATH);
                        m_ConnStr = sb.ToString();
                    }
                }
                _ins = new SQLiteFac();
                //test
                //switch (m_type.ToUpper())
                //{
                //    case "MSSQL":
                //        _ins = new MssqlFactory();
                //        break;
                //    case "ACCESS":
                //        _ins = new AccessFactory();
                //        break;
                //    case "SQLITE":
                //        _ins = new SQLiteFac();
                //        break;
                //    default:
                //        _ins = new AccessFactory();
                //        break;
                //}
            }
            catch (Exception e)
            {
                AddErrorLog(e);
            }
        }
示例#21
0
 public LocationVector ToLocationVector(IDataFactory dataFactory)
 {
     return(new LocationVector(
                Distance.HasValue ? dataFactory.CreateWherigoObject <Distance>(Distance.Value) : null,
                Bearing
                ));
 }
示例#22
0
        public static async Task <Site> SiteUrlAsync(IRouteManager routeManager, IDataFactory dataFactory, string siteId)
        {
            var siteRepository = dataFactory.ItemRepository;
            var itemDataModel  = await siteRepository.GetItemAsync(null, siteId);

            var sitemap = await SitemapUrlAsync(itemDataModel, dataFactory, routeManager);

            var siteBusinessModel = (SiteBusinessModel)itemDataModel.Data;
            var siteUrl           = sitemap.BaseUrl;
            var siteName          = siteBusinessModel.Name;

            var itemMasterDataModel = (await
                                       dataFactory.ItemRepository.GetItemsAsync(siteId, new ItemFilters {
                ParentId = siteId, Module = MasterBusinessModule.ModuleName
            }))
                                      .FirstOrDefault();

            if (itemMasterDataModel != null)
            {
                var masterBusinessModel = (MasterBusinessModel)itemMasterDataModel.Data;
                siteName = masterBusinessModel.Elements.First(e => e.Property == "Title").Data;
            }

            return(new Site {
                Name = siteName, Url = siteUrl
            });
        }
示例#23
0
 public AggregateStore(ITransitionStore transitionStore, IDataFactory dataFactory, ISerializer serializer)
 {
     _transitionStore = transitionStore;
     _dataFactory = dataFactory;
     _serializer = serializer;
     _aggregateRegistry = new AggregateRegistry();
 }
示例#24
0
			public LocationVector ToLocationVector(IDataFactory dataFactory)
			{
				return new LocationVector(
					Distance.HasValue ? dataFactory.CreateWherigoObject<Distance>(Distance.Value) : null,
					Bearing
					);
			}
示例#25
0
        /// <summary>
        /// Create and initialized UODataManager object, wich represent viewmodel and logic of UO data.
        /// </summary>
        /// <param name="uri">Folder path to client data or data-server address. At this momment only local path are supported.</param>
        /// <param name="type">Combination of flags to specify general behavior of UOEngine.
        /// * if you want to use _x version of maps and statics use UseExtFacet flag (only for SA and HS),
        /// * to use special abilities of UOEngine you need additional files, to do it use UseExtFiles flag.</param>
        /// <param name="language">Specify language that used in data files and server.</param>
        /// <param name="dataoptions">Additional options. Set it 'null' for autodetect.</param>
        /// <param name="realtime">If true, engine will save all data at realtime, otherwise it will caching them and save changes in local folder.</param>
        public UODataManager(Uri uri, UODataType type, Language language, UODataOptions dataoptions = null, bool realtime = true)
        {
            CheckValues(uri, type, language, dataoptions, realtime);

            Location        = uri;
            DataType        = type;
            Language        = language;
            RealTime        = realtime;
            m_Instanes[uri] = this;

            dataOptions = dataoptions ?? new UODataOptions(Location);
            dataFactory = (type.HasFlag(UODataType.UseMulFiles) || type.HasFlag(UODataType.UseUopFiles)) ? new ClassicFactory(this) : null;

            if (dataFactory == null)
            {
                return;
            }

            // Initialize data... its loading, wait, wait
            // TODO: We need separeted thread for data working
            _storageMaps = dataFactory.GetMapFacets();
            _storageLand = dataFactory.GetLandTiles();
            _storageItem = dataFactory.GetItemTiles();
            _storageGump = dataFactory.GetGumpSurfs();
            _storageAnim = dataFactory.GetAnimations();
        }
示例#26
0
        /// <summary>
        /// Create and initialized UODataManager object, wich represent viewmodel and logic of UO data.
        /// </summary>
        /// <param name="uri">Folder path to client data or data-server address. At this momment only local path are supported.</param>
        /// <param name="type">Combination of flags to specify general behavior of UOEngine.
        /// * if you want to use _x version of maps and statics use UseExtFacet flag (only for SA and HS),
        /// * to use special abilities of UOEngine you need additional files, to do it use UseExtFiles flag.</param>
        /// <param name="language">Specify language that used in data files and server.</param>
        /// <param name="dataoptions">Additional options. Set it 'null' for autodetect.</param>
        /// <param name="realtime">If true, engine will save all data at realtime, otherwise it will caching them and save changes in local folder.</param>
        public UODataManager(Uri uri, UODataType type, Language language, UODataOptions dataoptions = null, bool realtime = true)
        {
            if (uri == null || type == 0 || language == null)
            {
                throw new ArgumentException("Bad parametre values");
            }
            if (m_Instanes.ContainsKey(uri))
            {
                throw new ArgumentException("Already inited with selected Uri");
            }

            Location        = uri;
            DataType        = type;
            Language        = language;
            RealTime        = realtime;
            m_Instanes[uri] = this;

            dataOptions = dataoptions ?? new UODataOptions(Location);
            dataFactory = (type.HasFlag(UODataType.UseMulFiles) || type.HasFlag(UODataType.UseUopFiles)) ? new ClassicFactory(this) : null;

            // Initialize data... its loading, wait, wait
            // TODO: We need separeted thread for data working
            StorageMaps = dataFactory.GetMapFacets();
            StorageLand = dataFactory.GetLandTiles();
            StorageItem = dataFactory.GetItemTiles();
            StorageGump = dataFactory.GetGumpSurfs();
            StorageAnim = dataFactory.GetAnimations();
        }
        public static int ParseFamiliesXMLData(string filePath, IDataFactory dataFactory)
        {
            var parsedFamilies = XMLParser.ParseXML <List <FamilyParserModel> >(filePath, "Families");

            SaveData(parsedFamilies, dataFactory);
            return(parsedFamilies.Count);
        }
        /// <summary>
        /// Creates StatefullAggregateContext
        /// </summary>
        public StatefullAggregateContext(Object state, String aggregateId, Int32 version, IDataFactory dataFactory) 
            : base(aggregateId, version, dataFactory)
        {
            if (state == null)
                throw new NullAggregateStateException();

            _aggregateState = state;
        }
 public SaveSocialCommand(IDataFactory dataFactory, UserService userService, CacheProvider cacheProvider, ModuleManager moduleManager, SocialBusinessModule socialBusinessModule)
 {
     _dataFactory          = dataFactory;
     _userService          = userService;
     _cacheProvider        = cacheProvider;
     _moduleManager        = moduleManager;
     _socialBusinessModule = socialBusinessModule;
 }
示例#30
0
 /// <summary>
 /// Default constructor
 /// </summary>
 public MessageRelayHandler(IMassTerminationService <Commands.DataloadRequest> massTerminationService,
                            IMassRehireService <Commands.DataloadRequest> massRehireService
                            , IDataFactory dataFactory)
 {
     MassTerminationService = massTerminationService;
     MassRehireService      = massRehireService;
     this.DataFactory       = dataFactory;
 }
示例#31
0
 public TransfertSiteCommand(IDataFactory dataFactorySource, IDataFactory dataFactoryDestination,
                             CacheProvider cacheProvider, BusinessModuleFactory businessModuleFactory)
 {
     _dataFactorySource      = dataFactorySource;
     _dataFactoryDestination = dataFactoryDestination;
     _cacheProvider          = cacheProvider;
     _businessModuleFactory  = businessModuleFactory;
 }
示例#32
0
 public SaveFreeCommand(IDataFactory dataFactory, UserService userService, CacheProvider cacheProvider, ModuleManager moduleManager, FreeBusinessModule freeBusinessModule)
 {
     _dataFactory        = dataFactory;
     _userService        = userService;
     _cacheProvider      = cacheProvider;
     _moduleManager      = moduleManager;
     _freeBusinessModule = freeBusinessModule;
 }
示例#33
0
 public ListMessageCommand(ILogger <ListMessageCommand> logger, IDataFactory dataFactory, UserService userService, IMessageService messageService, ISiteMap sitemap)
 {
     _logger         = logger;
     _userService    = userService;
     _messageService = messageService;
     _sitemap        = sitemap;
     _dataFactory    = dataFactory;
 }
 public SendNotificationCommand(UserService userService, IDataFactory dataFactory, IEmailService emailService, SiteUserService siteUserService, IRouteManager routeManager)
 {
     _userService     = userService;
     _dataFactory     = dataFactory;
     _emailService    = emailService;
     _siteUserService = siteUserService;
     _routeManager    = routeManager;
 }
示例#35
0
 public SaveNewsCommand(IDataFactory dataFactory, UserService userService, CacheProvider cacheProvider, ModuleManager moduleManager, NewsBusinessModule newsBusinessModule)
 {
     _dataFactory        = dataFactory;
     _userService        = userService;
     _cacheProvider      = cacheProvider;
     _moduleManager      = moduleManager;
     _newsBusinessModule = newsBusinessModule;
 }
示例#36
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MassRehireController"/> class.
 /// </summary>
 public MassRehireController(IDataFactory factory,
                             IAuthorizationProvider authorization,
                             IMappingFactory mapper)
 {
     this.dataFactory           = factory;
     this.authorizationProvider = authorization;
     this._mapFactory           = mapper;
 }
示例#37
0
 protected ServiceBase(IDataFactory dataFactory, HttpContextBase httpContext)
 {
     DataFactory = dataFactory;
     CurrentUser = httpContext.GetOwinContext().GetUserManager<ApplicationUserManager>().FindById(System.Web.HttpContext.Current.User.Identity.GetUserId());
     //            CurrentUser = user ??
     //                           HttpContext.Current.GetOwinContext()
     //                               .GetUserManager<ApplicationUserManager>()
     //                               .FindById(System.Web.HttpContext.Current.User.Identity.GetUserId());
 }
示例#38
0
 public UnitOfWork(IDataFactory dataFactory)
 {
     this._dataFactory = dataFactory;
 }
示例#39
0
        /// <summary>
        /// Create and initialized UODataManager object, wich represent viewmodel and logic of UO data.
        /// </summary>
        /// <param name="uri">Folder path to client data or data-server address. At this momment only local path are supported.</param>
        /// <param name="type">Combination of flags to specify general behavior of UOEngine. 
        /// * if you want to use _x version of maps and statics use UseExtFacet flag (only for SA and HS),
        /// * to use special abilities of UOEngine you need additional files, to do it use UseExtFiles flag.</param>
        /// <param name="language">Specify language that used in data files and server.</param>
        /// <param name="dataoptions">Additional options. Set it 'null' for autodetect.</param>
        /// <param name="realtime">If true, engine will save all data at realtime, otherwise it will caching them and save changes in local folder.</param>
        public UODataManager(Uri uri, UODataType type, Language language, UODataOptions dataoptions = null, bool realtime = true)
        {
            if (uri == null || type == 0 || language == null)
                throw new ArgumentException("Bad parametre values");
            if (m_Instanes.ContainsKey(uri))
                throw new ArgumentException("Already inited with selected Uri");

            Location = uri;
            DataType = type;
            Language = language;
            RealTime = realtime;
            m_Instanes[uri] = this;

            dataOptions = dataoptions ?? new UODataOptions(Location);
            dataFactory = (type.HasFlag(UODataType.UseMulFiles) || type.HasFlag(UODataType.UseUopFiles)) ? new ClassicFactory(this) : null;

            // Initialize data... its loading, wait, wait
            // TODO: We need separeted thread for data working
            StorageMaps = dataFactory.GetMapFacets();
            StorageLand = dataFactory.GetLandTiles();
            StorageItem = dataFactory.GetItemTiles();
            StorageGump = dataFactory.GetGumpSurfs();
            StorageAnim = dataFactory.GetAnimations();
        }
示例#40
0
 public AdvisorLocator(IDataFactory dataFactory)
 {
     _dataFactory = dataFactory;
 }
示例#41
0
 public MapFacet(IDataFactory factory, byte mapindex, FacetDesc desc)
 {
     _Desc   = desc;
     _Width  = desc.Width;
     _Height = desc.Height;
     _Blocks = new MapBlock[_Width * _Height];
     dataFactory = factory;
     _MapIndex = mapindex;
 }
示例#42
0
		public GeoMathHelper()
		{
			_dataFactory = Data.Native.NativeDataFactory.Instance;
		}
 public StatelessAggregateContextBuilder SetDataFactory(IDataFactory dataFactory)
 {
     _dataFactory = dataFactory;
     return this;
 }
示例#44
0
 public CourierService(IDataFactory dataFactory, HttpContextBase httpContext)
     : base(dataFactory, httpContext)
 {
 }
示例#45
0
 public QuestionController(IAdviseManager adviseManager, IDataFactory dataFactory)
 {
     _adviseManager = adviseManager;
     _dataFactory = dataFactory;
 }
示例#46
0
 public EventWebSocket(IDataFactory dataFactory, string email)
 {
     _dataFactory = dataFactory;
     _email = email;
 }
示例#47
0
			public ZonePoint ToZonePoint(IDataFactory _dataFactory)
			{
				return _dataFactory.CreateWherigoObject<ZonePoint>(Lat, Lon);
			}
示例#48
0
		internal GeoMathHelper(IDataFactory dataFactory)
		{
			_dataFactory = dataFactory;
		}
示例#49
0
 public AdviseManager(IDataFactory dataFactory, IAdvisorLocator advisorLocator, IEventManager eventManager)
 {
     _dataFactory = dataFactory;
     _advisorLocator = advisorLocator;
     _eventManager = eventManager;
 }
 public StatelessAggregateContext(String aggregateId, Int32 version, IDataFactory dataFactory) 
     : base(aggregateId, version, dataFactory)
 {
 }        
 public StatelessAggregateRepository(AggregateStore store, IDataFactory dataFactory, AggregateDefinition aggregateDefinition) : base(store, dataFactory, aggregateDefinition)
 {
 }
示例#52
0
 public CategoryController(IDataFactory dataFactory)
 {
     _dataFactory = dataFactory;
 }
示例#53
0
 public SocketManager(IDataFactory dataFactory)
 {
     _dataFactory = dataFactory;
 }
 /// <summary>
 /// Constructs AggregateRepositoryBase
 /// </summary>
 protected AggregateRepositoryBase(AggregateStore store, IDataFactory dataFactory, AggregateDefinition definition)
 {
     _store = store;
     _dataFactory = dataFactory;
     _definition = definition;
 }
示例#55
0
 public WarehouseService(IDataFactory dataFactory, HttpContextBase httpContext)
     : base(dataFactory, httpContext)
 {
 }
示例#56
0
 public ProfileController(IDataFactory dataFactory, IScoreKeeper scoreKeeper)
 {
     _dataFactory = dataFactory;
     _scoreKeeper = scoreKeeper;
 }
示例#57
0
 internal GumpEntry(uint id, IDataFactory factory, bool valid)
 {
     _EntryId    = id;
     dataFactory = factory;
     _IsValid    = valid;
 }
 public SecondaryProcessor(IDataFactory dataFactory)
 {
     _dataFactory = dataFactory;
 }
 public AuthenticationService(IDataFactory dataFactory)
 {
     _dataFactory = dataFactory;
 }
示例#60
0
 public RequestController(IDataFactory dataFactory, IAdviseManager adviseManager)
 {
     _dataFactory = dataFactory;
     _adviseManager = adviseManager;
 }