コード例 #1
0
        } // 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
コード例 #2
0
 public ShopItemLogic(StorageType storageType)
 {
     switch (storageType)
     {
     //case StorageType.Database: context = new ItemDBContext(); break;
     case StorageType.Memory: context = new ShopItemMemoryContext(); break;
     }
 }
コード例 #3
0
 /************************ 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;
 }
コード例 #4
0
        /*======================= 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
コード例 #5
0
        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();
        }
コード例 #6
0
 public ItemLogic()
 {
     _context = new ItemContext();
 }
コード例 #7
0
ファイル: ItemRepository.cs プロジェクト: UserLuuk013/RPG-S2
 public ItemRepository(IItemContext context)
 {
     this.context = context;
 }
コード例 #8
0
ファイル: ItemCollection.cs プロジェクト: RageMouse/ItemShop
 public ItemCollection(IItemContext context)
 {
     _itemContext = context;
 }
コード例 #9
0
 public ItemController(IItemContext itemContext, IStorageProvider storageProvider)
 {
     _itemContext     = itemContext;
     _storageProvider = storageProvider;
 }
コード例 #10
0
 } // 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
コード例 #11
0
 public ItemsController(IItemContext db) : base()
 {
     _db = db;
 }
コード例 #12
0
 public ItemRepo(IItemContext context)
 {
     this.ctx = context;
 }
コード例 #13
0
        } // end of function - MacroExpander

        /*----------------------- MacroExpander ---------------------------------*/
        /// <summary>
        ///
        /// </summary>
        /// <param name="state"></param>
        public MacroExpander(IItemContext context)
        {
            m_context = context;
        } // end of function - MacroExpander
コード例 #14
0
        }     // 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
コード例 #15
0
 public HirezApiService(IHirezApiContext hirezApi, IGodContext godContext, IItemContext itemContext)
 {
     _hirezApi    = hirezApi;
     _godContext  = godContext;
     _itemContext = itemContext;
 }
コード例 #16
0
ファイル: ItemRepository.cs プロジェクト: kaanaydemir/Dephion
 public ItemRepository(IItemContext context)
 {
     _context = context;
 }