public HomeModelAdapter(IModelAdapter <HeroModel> heroModelAdapter, IModelAdapter <FooterHomeModel> footerModelAdapter ) { _heroModelAdapter = heroModelAdapter; _footerModelAdapter = footerModelAdapter; }
private void CollectAllRelated(IModelAdapter x, IInstance root) { foreach (uint related in root.RelatedInstances) { x.RelatedInstances.Add(CreateAdapter(im.Read(related))); } }
public ContentPageController(IModelAdapter <MasterModel> masterModelAdapter, IModelAdapter <InitialState> initialStateModelAdapter, IModelAdapter <ContentPageModel> contentPageModelAdapter) : base(masterModelAdapter, initialStateModelAdapter) { _contentPageModelAdapter = contentPageModelAdapter; }
public PasswordDisplayProps(IModelAdapter <UserAccount> userAccount, IModelAdapter <PasswordTracker> pwTracker, IZipEncrypt zipEncrypt) { _userAccount = userAccount; _pwTracker = pwTracker; _zipper = zipEncrypt; }
public static XElement Adapt(this MetaModel model, IModelAdapter adapter) { return(new XElement(Namespace + "Database", new XAttribute("Name", adapter.AdaptDatabase(model.DatabaseName)), new XAttribute("Provider", model.ProviderType.AssemblyQualifiedName), model.GetTables().Select(table => table.Adapt(adapter)), model.GetFunctions().Select(function => function.Adapt(adapter)) )); }
internal IModelAdapter LoadBoard(uint boardId) { ModelAdapters = new List <IModelAdapter>(); IInstance board = im.Read(boardId); IModelAdapter temp = CreateAdapter(board); CollectAllRelated(temp, board); return(temp); }
public static XElement Adapt(this MetaFunction function, IModelAdapter adapter) { return(new XElement(Namespace + "Function", new XAttribute("Name", function.Name), new XAttribute("Method", adapter.AdaptFunction(function.Method.Name)), new XAttribute("IsComposable", function.IsComposable.ToString()), function.Parameters.Select(parameter => parameter.Adapt()), (function.ReturnParameter == null ? (object)function.ResultRowTypes.Select(resultType => resultType.Adapt()) : function.ReturnParameter.AdaptAsReturnType()) )); }
public static XElement Adapt(this MetaTable table, IModelAdapter adapter) { return(new XElement(Namespace + "Table", new XAttribute("Name", adapter.AdaptTable(table.TableName)), new XElement(Namespace + "Type", new XAttribute("Name", table.RowType.Name), table.RowType.DataMembers .Where(member => member.StorageMember != null) .Select(member => member.Adapt()) ) )); }
public AdaptingMappingSource(MappingSource mappingSource, IModelAdapter modelAdapter) : base() { if (mappingSource == null) { throw new ArgumentNullException("mappingSource"); } if (modelAdapter == null) { throw new ArgumentNullException("modelAdapter"); } UnderlyingMappingSource = mappingSource; ModelAdapter = modelAdapter; }
public Display(IDisplayProps props, IPasswordEncryption encryption, IZipEncrypt zipper, IModelAdapter <EmailAccount> email, IModelAdapter <UserAccount> userAccount, IModelAdapter <PasswordTracker> pwTracker, ITextFileReadWriter readerWriter) : this() { _props = props; _pwTracker = pwTracker; _email = email; _userAccount = userAccount; _zipper = zipper; _encryptDecrypt = encryption; _readerWriter = readerWriter; _loginForm = new Login(_props, userAccount, _email); }
public void SetEmailAccount(string emailAddress, IModelAdapter <EmailAccount> emailAccount) { var email = emailAccount.GetRecordById(emailAccount.Id); if (email == null) { email = new EmailAccount() { Email = emailAddress, UserId = emailAccount.Id }; emailAccount.InsertNewRecord(email); } else { emailAccount.EditEntry(email); } }
public string GetPhotoLocationFromFile(IModelAdapter <EmailAccount> emailAccount, int userId) { try { var fileName = GetTextFile(); if (!File.Exists(fileName)) { return(DefaultFile); } var email = emailAccount.GetRecordById(userId); email.PhotoLocation = fileName; emailAccount.EditEntry(email); return(fileName); } catch (Exception) { MessageBox.Show("Help!"); return(null); } }
static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); NinjectConfig.CreateKernel(); var kernel = NinjectConfig.Kernel; IPasswordEncryption encryption = kernel.Get <IPasswordEncryption>(); IZipEncrypt zipper = kernel.Get <IZipEncrypt>(); IModelAdapter <EmailAccount> email = kernel.Get <IModelAdapter <EmailAccount> >(); IModelAdapter <UserAccount> userAccount = kernel.Get <IModelAdapter <UserAccount> >(); IModelAdapter <PasswordTracker> pwTracker = kernel.Get <IModelAdapter <PasswordTracker> >(); ITextFileReadWriter reader = kernel.Get <ITextFileReadWriter>(); IDisplayProps props = kernel.Get <IDisplayProps>(); ISubscriberTracker tracker = kernel.Get <ISubscriberTracker>(); tracker.Subscribe(email); tracker.Subscribe(pwTracker); Application.Run(new Display(props, encryption, zipper, email, userAccount, pwTracker, reader)); }
/// <summary> /// Creates an DecoratorModelAdapter by decorating the underlying decorated IModelAdapter /// </summary> /// <param name="decoratedModel">The IModelAdapter to decorate</param> protected BaseDecoratorModelAdapter(IModelAdapter decoratedModel) : this() { DecoratedModel = decoratedModel; }
public ProductsController(IModelAdapter <MasterModel> masterModelAdapter, IModelAdapter <InitialState> initialStateModelAdapter, IModelAdapter <ProductsModel> productsModelAdapter) : base(masterModelAdapter, initialStateModelAdapter) { _productsModelAdapter = productsModelAdapter; }
public ProductsModelAdapter(IModelAdapter <ProductModel> productModelAdapter) { _productModelAdapter = productModelAdapter; }
public MasterModelAdapter(IModelAdapter <MetaData> metaDataModelAdapter) { _metaDataModelAdapter = metaDataModelAdapter; }
/// <summary> /// Instantiates a TablePrefixModelAdapter using the given prefix AND decorates the passed-in /// IModelAdapter /// </summary> /// <param name="prefix">The prefix to use during adaptation</param> /// <param name="decoratedModel">The IModelAdapter to decorate</param> public TablePrefixModelAdapter(string prefix, IModelAdapter decoratedModel) : base(decoratedModel) { Prefix = prefix; }
public HomeController(IModelAdapter <MasterModel> masterModelAdapter, IModelAdapter <InitialState> initialStateModelAdapter, IModelAdapter <HomeModel> homeModelAdapter) : base(masterModelAdapter, initialStateModelAdapter) { _homeModelAdapter = homeModelAdapter; }
public DotNetNukeDataContext(IDbConnection connection, MappingSource mapping, IModelAdapter adapter) : base(connection, mapping, adapter) { }
public PeopleModelAdapter(IModelAdapter <PersonModel> personModelAdapter) { _personModelAdapter = personModelAdapter; }
public InitialStateModelAdapter(IModelAdapter <MetaData> metaModelAdapter, IModelAdapter <RequestModel> requestModelAdapter) { _metaModelAdapter = metaModelAdapter; _requestModelAdapter = requestModelAdapter; }
public ModelAdapter(uint tid, uint id, IModelAdapter parent) { Tid = tid; Id = id; Parent = parent; }
public BlogpostController(IModelAdapter <MasterModel> masterModelAdapter, IModelAdapter <InitialState> initialStateModelAdapter, IModelAdapter <BlogPostModel> blogpostModelAdapter) : base(masterModelAdapter, initialStateModelAdapter) { _blogpostModelAdapter = blogpostModelAdapter; }
public DotNetNukeDataContext(MappingSource mapping, IModelAdapter adapter) : this(DotNetNuke.Common.Utilities.Config.GetConnectionString(), mapping, adapter) { }
/// <summary> /// Instantiates a TableSuffixModelAdapter using the given suffix AND decorates the passed-in /// IModelAdapter /// </summary> /// <param name="suffix">The suffix to use during adaptation</param> /// <param name="decoratedModel">The IModelAdapter to decorate</param> public TableSuffixModelAdapter(string suffix, IModelAdapter decoratedModel) : base(decoratedModel) { Suffix = suffix; }
public AdaptingDataContext(IDbConnection connection, MappingSource mapping, IModelAdapter adapter) : base(adapter.AdaptConnection(connection), new AdaptingMappingSource(mapping, adapter)) { }
public ServiceVerbatized(IRepository repository, IModelAdapter <TEntity, TEntityDto> adapter) { Repository = repository; Adapter = adapter; }
public AdaptingDataContext(string fileOrServerConnection, MappingSource mapping, IModelAdapter adapter) : base(adapter.AdaptConnection(fileOrServerConnection), new AdaptingMappingSource(mapping, adapter)) { }
public DotNetNukeDataContext(string fileOrServerConnection, MappingSource mapping, IModelAdapter adapter) : base(fileOrServerConnection, mapping, adapter) { }