} // end of function - CommentFileHandler /*----------------------- ExecuteCommentProvider ------------------------*/ /// <summary> /// Executes the comment provider with the specified context /// </summary> /// <param name="context"> /// The main context object to exucute with /// </param> protected virtual void ExecuteCommentProvider(IItemContext context) { var provider = ProviderFactory.Instance.BuildProvider(context); provider?.Comment(); return; } // end of function - ExecuteCommentProvider
public ShopItemLogic(StorageType storageType) { switch (storageType) { //case StorageType.Database: context = new ItemDBContext(); break; case StorageType.Memory: context = new ShopItemMemoryContext(); break; } }
/************************ Construction ***********************************/ public EnvDetails(IItemContext context) { EndLine = context.CodeElement.EndPoint.Line; EndLineCharOffset = context.CodeElement.EndPoint.LineCharOffset; EndLineLength = context.CodeElement.EndPoint.LineLength; Name = context.CodeElement.Name; StartLine = context.CodeElement.StartPoint.Line; StartLineCharOffset = context.CodeElement.StartPoint.LineCharOffset; }
/*======================= PUBLIC ========================================*/ /************************ Events *****************************************/ /************************ Properties *************************************/ /************************ Construction ***********************************/ /************************ Methods ****************************************/ /*----------------------- BuildProvider ---------------------------------*/ /// <summary> /// /// </summary> public virtual ICommentProvider BuildProvider(IItemContext context) { var retval = m_providers .Where(v => (v.Metadata.SupportedCommandTypes & (int)context.CommentType) != 0 && v.Metadata.SupportedExtensions.Contains(context.Extension)) .SingleOrDefault(); retval?.Value?.Initialize(context); return(retval == null ? null : retval.Value); } // end of function - BuildProvider
public static void Initialize(IItemContext context) { context.Database.EnsureCreated(); if (context.Items.Any()) { return; } // Seed with items.txt data var items = new Item[] { new Item { Name = "ITEM 1", Cost = 100 }, new Item { Name = "ITEM 2", Cost = 200 }, new Item { Name = "ITEM 1", Cost = 250 }, new Item { Name = "ITEM 3", Cost = 300 }, new Item { Name = "ITEM 4", Cost = 50 }, new Item { Name = "ITEM 4", Cost = 40 }, new Item { Name = "ITEM 2", Cost = 200 }, }; context.Items.AddRange(items); context.SaveChanges(); }
public ItemLogic() { _context = new ItemContext(); }
public ItemRepository(IItemContext context) { this.context = context; }
public ItemCollection(IItemContext context) { _itemContext = context; }
public ItemController(IItemContext itemContext, IStorageProvider storageProvider) { _itemContext = itemContext; _storageProvider = storageProvider; }
} // end of property - Context /************************ Construction ***********************************/ /************************ Methods ****************************************/ /*----------------------- Initialize ------------------------------------*/ /// <summary> /// Initializes the provider with the context /// </summary> /// <param name="context"> /// Context object to initialize with /// </param> public void Initialize(IItemContext context) { Context = context; InitializeProvider(); return; } // end of function - Initialize
public ItemsController(IItemContext db) : base() { _db = db; }
public ItemRepo(IItemContext context) { this.ctx = context; }
} // end of function - MacroExpander /*----------------------- MacroExpander ---------------------------------*/ /// <summary> /// /// </summary> /// <param name="state"></param> public MacroExpander(IItemContext context) { m_context = context; } // end of function - MacroExpander
} // end of function - Expand /*----------------------- Initialize ------------------------------------*/ /// <summary> /// Initializes this object with the specified state /// </summary> /// <param name="context"></param> public virtual void Initialize(IItemContext context) { m_context = context; return; } // end of function - Initialize
public HirezApiService(IHirezApiContext hirezApi, IGodContext godContext, IItemContext itemContext) { _hirezApi = hirezApi; _godContext = godContext; _itemContext = itemContext; }
public ItemRepository(IItemContext context) { _context = context; }