• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Store类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Store的典型用法代码示例。如果您正苦于以下问题:C# Store类的具体用法?C# Store怎么用?C# Store使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Store类属于命名空间,在下文中一共展示了Store类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: GetAll

        public IEnumerable<Store> GetAll()
        {
            List<Store> _stores = new List<Store>();

            Store store = new Store();
            store.base_url = "http://www.buccaneers.com";
            store.id = "1";
            store.name = "Bucs";
            store.typical_donation = "5%";

            _stores.Add(store);

            store = new Store();
            store.base_url = "http://www.yahoo.com";
            store.id = "2";
            store.name = "Yahoo";
            store.typical_donation = "10%";

            _stores.Add(store);

            store = new Store();
            store.base_url = "http://www.danschocolates.com";
            store.id = "144";
            store.name = "Dan's Chocolates";
            store.typical_donation = "12%";

            _stores.Add(store);

            return _stores.ToArray();
        }
开发者ID:grefly,项目名称:Buy4,代码行数:30,代码来源:MockStoreRepository.cs


示例2: MainClass

    public MainClass()
    {
        userdir = Path.Combine (
            Environment.GetFolderPath(System.Environment.SpecialFolder.Personal),
            "Monopod");

        // check userdir exists, make if not
        if (!Directory.Exists (userdir)) {
            DirectoryInfo d = Directory.CreateDirectory (userdir);
            if ( d == null ) {
                // TODO: throw a wobbly
            }
        }
        store = new Store (Path.Combine (userdir, ".monopod.db"), userdir);
        if (store.NumberOfChannels == 0) {
            store.AddDefaultChannels ();
            channels = new ChannelWindow (store);
            channels.Show ();
        } else {
            channels = new ChannelWindow (store);
        }
        #if USING_IPOD
        ipodwindow = new IPodChooseWindow (store);
        #endif
        InitIcon ();
        InitMenu ();

        // kick off downloading
        store.FetchNextChannel ();
        store.FetchNextCast ();
    }
开发者ID:BackupTheBerlios,项目名称:monopod-svn,代码行数:31,代码来源:Main.cs


示例3: SubsetMandatory_1a

		public void SubsetMandatory_1a(Store store)
		{
			myTestServices.LogValidationErrors("No Errors Found Initially");
			ORMModel model = store.ElementDirectory.FindElements<ORMModel>()[0];
			Role role_2 = (Role)store.ElementDirectory.GetElement(new Guid("82DF5594-2020-4CA3-8154-FD92EE83F726"));

			myTestServices.LogValidationErrors("Intoduce Error: Make a role of supertype mandatory");
			using (Transaction t = store.TransactionManager.BeginTransaction("Add simple mandatory constraint"))
			{
				role_2.IsMandatory = true;
				t.Commit();
			}
			myTestServices.LogValidationErrors("Error Found. Calling Undo to remove error...");
			store.UndoManager.Undo();
			myTestServices.LogValidationErrors("Error removed with undo.");


			myTestServices.LogValidationErrors("Intoduce Error: Make a role of subtype mandatory");
			using (Transaction t = store.TransactionManager.BeginTransaction("Add simple mandatory constraint"))
			{
				role_2.IsMandatory = true;
				t.Commit();
			}
			myTestServices.LogValidationErrors("Error Found. Calling Undo to remove error...");
			using (Transaction t = store.TransactionManager.BeginTransaction("Add simple mandatory constraint"))
			{
				role_2.IsMandatory = false;
				t.Commit();
			}
			myTestServices.LogValidationErrors("Error is removed with changing property value...");
		}
开发者ID:cjheath,项目名称:NORMA,代码行数:31,代码来源:NotWellModeledTests.cs


示例4: DoValidateCollectionItemSucceedsForUniqueNamedElements

		public void DoValidateCollectionItemSucceedsForUniqueNamedElements()
		{
			Store store = new Store(typeof(CoreDesignSurfaceDomainModel), typeof(ServiceContractDslDomainModel));
			ServiceContractModel model;

			using (Transaction transaction = store.TransactionManager.BeginTransaction())
			{
				model = store.ElementFactory.CreateElement(ServiceContractModel.DomainClassId) as ServiceContractModel;

				ServiceContract contract = store.ElementFactory.CreateElement(ServiceContract.DomainClassId) as ServiceContract;
				contract.Name = "Contract Name";

				Operation part = store.ElementFactory.CreateElement(Operation.DomainClassId) as Operation;
				part.Name = "Part Name";

				contract.Operations.Add(part);

				TestableOperationElementCollectionValidator target = new TestableOperationElementCollectionValidator();

				ValidationResults results = new ValidationResults();
				target.TestDoValidateCollectionItem(part, contract, String.Empty, results);

				Assert.IsTrue(results.IsValid);

				transaction.Commit();
			}
		}
开发者ID:Phidiax,项目名称:open-wssf-2015,代码行数:27,代码来源:OperationElementCollectionValidatorFixture.cs


示例5: XMLIniFile

		public XMLIniFile(string aaDocElementname, int aaVersion, Store aaStore)
		{
			xmldoc = new XmlDocument();
			DocElementname = aaDocElementname;
			DocElementVersion = aaVersion;
			XmlFormat = aaStore;
		}
开发者ID:akretion,项目名称:uninfe,代码行数:7,代码来源:XMLIniFile.cs


示例6: Main

		public static void Main (string[] args)
		{
			Console.WriteLine ("Hello World!");
			
			Model model = new Model(typeof(Demo));
			
			model.Write<ExtModel,ExtModelField>();
			
			Store store = new Store(typeof(Demo));
			store.Write();
			
			List list = new List(typeof(Demo));
			list.Write();
			
			Form form = new Form(typeof(Demo));
			form.Write();
			
			Controller controller = new Controller(typeof(Demo));
			controller.Write();
			
			Application app = new Application(typeof(Demo));
			app.Write();
			
			Console.WriteLine ("This is The End my friend!");
		}
开发者ID:angelcolmenares,项目名称:Aicl.DotJs,代码行数:25,代码来源:Main.cs


示例7: DeleteStore

 public bool DeleteStore(Store store)
 {
     if (store == null) return false;
     _unitOfWork.StoreRepository.Delete(store);
     _unitOfWork.Save();
     return true;
 }
开发者ID:FishAbe,项目名称:cats-hub-module,代码行数:7,代码来源:StoreService.cs


示例8: AddPage

        public static void AddPage(Store store, string itemGuid, string subProcessGuid)
        {
            Project dteProject = getDteProject(store, "page");

            string defaultNamespace = dteProject.Properties.Item("DefaultNamespace").Value.ToString();

            var view = FileTypes.getFileType(FileType.View);
            var model = FileTypes.getFileType(FileType.PageModel);
            var controller = FileTypes.getFileType(FileType.Controller);

            #region Add View
            byte[] item = new UTF8Encoding(true).GetBytes(string.Format(view.Content, defaultNamespace, itemGuid.Replace("-", "_")));
            string fileName = string.Format("{0}.cshtml", itemGuid.Replace("-", "_"));

            AddProcessFile(dteProject, subProcessGuid, view.FolderName, fileName, item, true);
            #endregion

            #region Add Controller
            item = new UTF8Encoding(true).GetBytes(string.Format(controller.Content, defaultNamespace, subProcessGuid.Replace("-", "_"), itemGuid.Replace("-", "_")));
            fileName = string.Format("{0}Controller.cs", itemGuid.Replace("-", "_"));

            AddController(dteProject, controller.FolderName, fileName, item);
            #endregion

            #region Add Model
            item = new UTF8Encoding(true).GetBytes(string.Format(model.Content, itemGuid.Replace("-", "_"), defaultNamespace));
            fileName = string.Format("{0}Model.cs", itemGuid.Replace("-", "_"));

            AddProcessFile(dteProject, subProcessGuid, model.FolderName, fileName, item, true);
            #endregion
        }
开发者ID:Exclr8,项目名称:CloudCore,代码行数:31,代码来源:UserActivities.cs


示例9: BuildCustomSerializationOmissions

		private static Dictionary<DomainClassInfo, object> BuildCustomSerializationOmissions(Store store)
		{
			Dictionary<DomainClassInfo, object> retVal = new Dictionary<DomainClassInfo, object>();
			DomainDataDirectory dataDir = store.DomainDataDirectory;
			retVal[dataDir.FindDomainRelationship(ExcludedORMModelElement.DomainClassId)] = null;
			return retVal;
		}
开发者ID:cjheath,项目名称:NORMA,代码行数:7,代码来源:ORMOialBridge.SerializationExtensions.cs


示例10: PostStore

        public async Task<IHttpActionResult> PostStore(Store entity)
        {
            if (!ModelState.IsValid)
            {
                return BadRequest(ModelState);
            }

            entity.TrackingState = TrackingState.Added;
            _dbContext.ApplyChanges(entity);


            try
            {
                await _dbContext.SaveChangesAsync();
            }
            catch (DbUpdateException)
            {
                if (_dbContext.Stores.Any(e => e.StoreId == entity.StoreId))
                {
                    return Conflict();
                }
                throw;
            }

            await _dbContext.LoadRelatedEntitiesAsync(entity);
            entity.AcceptChanges();
            return CreatedAtRoute("DefaultApi", new { id = entity.StoreId }, entity);
        }
开发者ID:JeredSundquist,项目名称:Project-AES,代码行数:28,代码来源:StoreController.cs


示例11: PutStore

        public async Task<IHttpActionResult> PutStore(Store entity)
        {
            if (!ModelState.IsValid)
            {
                return BadRequest(ModelState);
            }

            _dbContext.ApplyChanges(entity);

            try
            {
                await _dbContext.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!_dbContext.Stores.Any(e => e.StoreId == entity.StoreId))
                {
                    return Conflict();
                }
                throw;
            }

            await _dbContext.LoadRelatedEntitiesAsync(entity);
            entity.AcceptChanges();
            return Ok(entity);
        }
开发者ID:JeredSundquist,项目名称:Project-AES,代码行数:26,代码来源:StoreController.cs


示例12: update

 // Update Store <store>
 public static bool update(Store store)
 {
     using (DataClasses1DataContext database = new DataClasses1DataContext(Globals.connectionString))
     {
         var query = from a in database.Stores
                     where (a.StoreID == store.StoreID)
                     select a;
         foreach (var a in query)
         {
             a.StoreNum = store.StoreNum;
             a.StoreName = store.StoreName;
             a.StoreAddress = store.StoreAddress;
             a.StoreServiceCharge = store.StoreServiceCharge;
         }
         try
         {
             database.SubmitChanges();
             return true;
         }
         catch (Exception e)
         {
             return false;
         }
     }
 }
开发者ID:captaintino,项目名称:Bounced-Check-Manager,代码行数:26,代码来源:StoreDAO.cs


示例13: ProcessExists

        public static SubProcess ProcessExists(string processGuid, string processFolder)
        {
            var store = new Store(typeof(CloudCoreArchitectSubProcessDomainModel));

            if (Directory.Exists(processFolder))
            {
                foreach (string file in Directory.GetFiles(processFolder).Where(f => f.IndexOf(".subprocess") > -1).Select(f => f))
                {
                    StreamReader streamReader = File.OpenText(file);
                    var str = streamReader.ReadToEnd();
                    streamReader.Close();
                    
                    if (str.IndexOf(string.Format(@"visioId=""{0}""", processGuid)) > -1)
                    {
                        using (Transaction transaction = store.TransactionManager.BeginTransaction("load model and diagram"))
                        {
                            SubProcess btProcess = CloudCoreArchitectSubProcessSerializationHelper.Instance.LoadModelAndDiagram(store, file, file + ".diagram", null, null, null);                           

                            transaction.Commit();

                            return btProcess;
                        }                        
                    }
                }
            }
            return null;
        }
开发者ID:Exclr8,项目名称:CloudCore,代码行数:27,代码来源:ImportHelper.cs


示例14: should_allow_for_passing_parameters_to_async_actions

        public async void should_allow_for_passing_parameters_to_async_actions()
        {
            var storeReducerReached = 0;
            var reducer = new SimpleReducer<List<string>>(() => new List<string> {"a"}).When<SomeAction>((s, e) =>
            {
                storeReducerReached += 1;
                return s;
            });
            var store = new Store<List<string>>(reducer);

            var action1 = store.asyncAction<LoginInfo, int>(async (dispatcher, store2, msg) =>
            {
                await Task.Delay(300);
                Assert.That(msg.username, Is.EqualTo("John"));
                dispatcher(new SomeAction());
                return 112;
            });
            var result = await store.Dispatch(action1(new LoginInfo
            {
                username = "John"
            }));

            Assert.That(storeReducerReached, Is.EqualTo(1));
            Assert.That(result, Is.EqualTo(112));
        }
开发者ID:pshomov,项目名称:reducto,代码行数:25,代码来源:AsyncActions.cs


示例15: ConvertStringToLayoutInfo

        public LayoutInfo ConvertStringToLayoutInfo(string layoutInfo, Store store)
        {
            LayoutInfo lInfo = null;

            Microsoft.VisualStudio.Modeling.SerializationResult serializationResult = new Microsoft.VisualStudio.Modeling.SerializationResult();
            DomainXmlSerializerDirectory directory = this.GetDirectory(store);
            System.Text.Encoding encoding = System.Text.Encoding.GetEncoding("ISO-8859-1");
            Microsoft.VisualStudio.Modeling.SerializationContext serializationContext = new SerializationContext(directory, "", serializationResult);
            this.InitializeSerializationContext(store.DefaultPartition, serializationContext, false);

            DomainClassXmlSerializer rootSerializer = directory.GetSerializer(LayoutInfo.DomainClassId);
            using(System.Xml.XmlReader reader = System.Xml.XmlReader.Create(new System.IO.StringReader(layoutInfo)) )
            {
                
                reader.Read(); // Move to the first node - will be the XmlDeclaration if there is one.
                serializationResult.Encoding = encoding;

                reader.MoveToContent();

                lInfo = rootSerializer.TryCreateInstance(serializationContext, reader, store.DefaultPartition) as LayoutInfo;
                rootSerializer.Read(serializationContext, lInfo, reader);
            }

            return lInfo;
        }
开发者ID:apoorv-vijay-joshi,项目名称:FSE-2011-PDE,代码行数:25,代码来源:SerializationHelper.cs


示例16: InsertUser

 public void InsertUser(Store store)
 {
     //ID 和 IsDeleted 在数据库中有默认值 newid() 和 0
     string sql = "Insert into Store(StoreName,StorePassword) values(@Name,@Password) ";
     SqlHelper.ExecuteNonQuery(sql, new SqlParameter("Name", store.StoreName),
         new SqlParameter("Password", store.StorePassword));
 }
开发者ID:hhxyzsm,项目名称:Ordering,代码行数:7,代码来源:UserLoginBLL.cs


示例17: AddEntityForm

 public AddEntityForm(Store store)
     : this()
 {
     this._Store = store;
     this.typeNames = _Store.ElementDirectory.FindElements<ModelClass>().Select(e => e.Name);
     entityNameTextBox.Text = GetNewEntityName();
 }
开发者ID:jeswin,项目名称:AgileFx,代码行数:7,代码来源:AddEntityForm.cs


示例18: GetUniqueName

        public static string GetUniqueName(Store store, Guid domainClassId)
        {
            string nameFree = LanguageDSLElementTypeProvider.Instance.GetTypeName(domainClassId);
            int counter = 1;

            List<string> usedNames = new List<string>();
            ReadOnlyCollection<ModelElement> elements = store.ElementDirectory.FindElements(domainClassId);
            foreach (ModelElement element in elements)
            {
                if (LanguageDSLElementNameProvider.Instance.HasName(element))
                {
                    string s = LanguageDSLElementNameProvider.Instance.GetName(element);
                    usedNames.Add(s);
                }
            }

            while (true)
            {
                if( usedNames.Contains(nameFree + counter.ToString()) )
                    counter++;
                else
                    break;
            }

            return nameFree + counter.ToString();
        }
开发者ID:apoorv-vijay-joshi,项目名称:FSE-2011-PDE,代码行数:26,代码来源:NameHelper.cs


示例19: DataElementAddRuleAddsObjectExtender

		public void DataElementAddRuleAddsObjectExtender()
		{
			Store store = new Store(typeof(CoreDesignSurfaceDomainModel), typeof(Microsoft.Practices.ServiceFactory.DataContracts.DataContractDslDomainModel));

			DataContractModel dcModel;
			DataContract dataContract;
			DataMember dataElement;

			using(Transaction transaction = store.TransactionManager.BeginTransaction())
			{
				dcModel = store.ElementFactory.CreateElement(DataContractModel.DomainClassId) as DataContractModel;
				dataContract = store.ElementFactory.CreateElement(DataContract.DomainClassId) as DataContract;
				dataElement = store.ElementFactory.CreateElement(PrimitiveDataType.DomainClassId) as DataMember;

				dcModel.ImplementationTechnology = new DataContractWcfExtensionProvider();
				dcModel.Contracts.Add(dataContract);
				dataContract.DataMembers.Add(dataElement);
				
				Assert.IsNotNull(dataElement, "DataContract is null");
				Assert.IsNotNull(dataElement.DataContract.DataContractModel.ImplementationTechnology, "ImplementationTechnology is null");

				transaction.Commit();
			}

			Assert.IsNotNull(dataElement.ObjectExtenderContainer, "ObjectExtenderContainer is null");
			Assert.IsFalse(dataElement.ObjectExtenderContainer.ObjectExtenders.Count == 0, "Extender count is zero");
		}
开发者ID:Phidiax,项目名称:open-wssf-2015,代码行数:27,代码来源:DataElementFixture.cs


示例20: ValidationPassedWhenProjectDiffersButNameIsSame

		public void ValidationPassedWhenProjectDiffersButNameIsSame()
		{
			Store store = new Store(typeof(CoreDesignSurfaceDomainModel), typeof(HostDesignerDomainModel));
			using (Transaction t = store.TransactionManager.BeginTransaction())
			{
				ClientApplication clientApp1 = new ClientApplication(store,
									new PropertyAssignment(ClientApplication.ImplementationProjectDomainPropertyId, "Project1"));
				ClientApplication clientApp2 = new ClientApplication(store,
					new PropertyAssignment(ClientApplication.ImplementationProjectDomainPropertyId, "AnotherProject"));

				HostDesignerModel model = new HostDesignerModel(store);

				model.ClientApplications.Add(clientApp1);
				model.ClientApplications.Add(clientApp2);

				Proxy proxy1 = new Proxy(store,
					new PropertyAssignment(Proxy.NameDomainPropertyId, "Proxy1"));
				Proxy proxy2 = new Proxy(store,
					new PropertyAssignment(Proxy.NameDomainPropertyId, "Proxy1"));


				clientApp1.Proxies.Add(proxy1);
				clientApp2.Proxies.Add(proxy2);

				TestableHostModelContainsUniqueProxyNamesAcrossClientsValidator validator = new TestableHostModelContainsUniqueProxyNamesAcrossClientsValidator();


				t.Rollback();
			}
		}
开发者ID:Phidiax,项目名称:open-wssf-2015,代码行数:30,代码来源:HostModelContainsUniqueProxyNamesAcrossClientsValidatorFixture.cs



注:本文中的Store类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# StoreLocation类代码示例发布时间:2022-05-24
下一篇:
C# StorageUri类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap