public override int GetHashCode() { unchecked { var hashCode = Id; hashCode = (hashCode * 397) ^ (CategoryName != null ? CategoryName.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (Description != null ? Description.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (Picture != null ? Picture.GetHashCode() : 0); return(hashCode); } }
private bool ValidCategory() { if (string.IsNullOrEmpty(CategoryName)) { return(false); } var parts = CategoryName.Split("."); return(string.Equals(parts[0], "Historian")); }
public DomainCategory AddNew(string categoryPath) { NameValidator.ValidateCategoryPath(categoryPath); var categoryName = new CategoryName(categoryPath); if (this.ContainsKey(categoryName.ParentPath) == false) { this.AddNew(categoryName.ParentPath); } return(this.BaseAddNew(categoryName.Name, categoryName.ParentPath, null, null)); }
public void Restore(Authentication authentication, Domain domain) { authentication.Sign(); var dataBase = this.Context.CremaHost.DataBases[domain.DataBaseID]; var categoryName = CategoryName.Create(dataBase.Name, domain.DomainInfo.ItemType); var category = this.Context.Categories.Prepare(categoryName); domain.Category = category; domain.Dispatcher = new CremaDispatcher(domain); domain.Dispatcher.InvokeAsync(() => this.InvokeDomainCreatedEvent(authentication, domain)); }
public UserCategory AddNew(Authentication authentication, string name, string parentPath) { this.Dispatcher.VerifyAccess(); var categoryName = new CategoryName(parentPath, name); var result = this.Context.Service.NewUserCategory(categoryName); result.Validate(authentication); var category = this.BaseAddNew(name, parentPath, authentication); this.InvokeCategoriesCreatedEvent(authentication, new UserCategory[] { category }); return(category); }
private static CategoryName GetCategory(LogEvent logEvent, Database db) { CategoryName category = CategoryName.OneWhere(cc => cc.Value == logEvent.Category, db); if (category == null) { category = new CategoryName(); category.Value = logEvent.Category; category.Save(db); } return(category); }
public async Task AddAsync(Authentication authentication, Domain domain, DataBase dataBase) { await this.Dispatcher.InvokeAsync(() => { var categoryName = CategoryName.Create(dataBase.Name, domain.DomainInfo.ItemType); var category = this.Categories.Prepare(categoryName); domain.Category = category; domain.Context = this; domain.Logger = new DomainLogger(this.Serializer, domain); this.Domains.InvokeDomainCreatedEvent(authentication, new Domain[] { domain }); }); }
public override void OnValidateRename(IAuthentication authentication, object target, string oldPath, string newPath) { base.OnValidateRename(authentication, target, oldPath, newPath); if (this.templateList.Any() == true) { throw new CremaException("새로운 테이블을 생성중일때는 이름을 변경할 수 없습니다."); } var categoryName = new CategoryName(Regex.Replace(this.Path, $"^{oldPath}", newPath)); this.Context.ValidateCategoryPath(categoryName); }
public override int GetHashCode() { unchecked { var hashCode = Id; hashCode = (hashCode * 397) ^ (Name != null ? Name.GetHashCode() : 0); hashCode = (hashCode * 397) ^ Repetitions.GetHashCode(); hashCode = (hashCode * 397) ^ (CategoryName != null ? CategoryName.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (UnitType != null ? UnitType.GetHashCode() : 0); return(hashCode); } }
//重置 protected void Reset_Click(object sender, EventArgs e) { try { CategoryName.Reset(); CategoryContent.Reset(); } catch (Exception ex) { publicmethod.SaveError(ex, this.Request); } }
public void EnterDetails() { CategoryName.SendKeys("NEW Category" + RandomString(20)); var Section = driver.FindElement(By.Name("Section")); //create select element object var selectElement = new SelectElement(Section); //select by value selectElement.SelectByValue("Sales"); // select by text selectElement.SelectByText("Technical"); }
public async Task CategoryLockRenameTestAsync() { var newName = RandomUtility.NextIdentifier(); var parentPath = category.Parent.Path; var categoryPath = new CategoryName(parentPath, newName); await category.LockAsync(authentication, string.Empty); await category.RenameAsync(authentication, newName); Assert.AreEqual(categoryPath, category.Path); Assert.AreEqual(newName, category.Name); }
public override void OnValidateMove(IAuthentication authentication, object target, string oldPath, string newPath) { base.OnValidateMove(authentication, target, oldPath, newPath); if (this.templateList.Any() == true) { throw new InvalidOperationException(Resources.Exception_CannotMoveOnCreateType); } this.ValidateUsingTables(authentication); var categoryName = new CategoryName(Regex.Replace(this.Path, $"^{oldPath}", newPath)); this.Context.ValidateCategoryPath(categoryName); }
public bool Equals(CategoryNode C) { if (ReferenceEquals(null, C)) { return(false); } if (ReferenceEquals(this, C)) { return(true); } return(CategoryName.Equals(C.CategoryName)); }
public static MvcHtmlString CategoryLink(this HtmlHelper help, CategoryName category) { return(help.ActionLink(category.Name, "Category", "Blognew", new { category = category.UrlName }, new { title = string.Format("See All Posts in {0}", category.Name) })); }
public void SetCategoryTitle(string cat) { try { CategoryName enumerable = (CategoryName)System.Enum.Parse(typeof(CategoryName), cat); titleText.text = ArabicFixer.Fix(categoryNamesArabic[(int)enumerable]); //Foo(enumerable); //Now you have your enum, do whatever you want. } catch (System.Exception) { Debug.LogErrorFormat("Parse: Can't convert {0} to int, please check the spell.", cat); } }
public async Task <ResultBase> NewUserCategoryAsync(Guid authenticationToken, string categoryPath) { var authentication = this.peer[authenticationToken]; var result = new ResultBase(); var categoryName = new CategoryName(categoryPath); var parent = await this.GetCategoryAsync(categoryName.ParentPath); var category = await parent.AddNewCategoryAsync(authentication, categoryName.Name); result.TaskID = category.Guid; result.SignatureDate = authentication.SignatureDate; return(result); }
public override int GetHashCode() { unchecked { var hashCode = (SystemId != null ? SystemId.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (StoreName != null ? StoreName.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (CategoryName != null ? CategoryName.GetHashCode() : 0); hashCode = (hashCode * 397) ^ StartDate.GetHashCode(); hashCode = (hashCode * 397) ^ EndDate.GetHashCode(); hashCode = (hashCode * 397) ^ DiscountAmount; return(hashCode); } }
public void Log <TState>(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func <TState, Exception, string> formatter) { if (IsEnabled(logLevel)) { lock (_lockObj) { Console.ForegroundColor = LogLevelColors[logLevel]; Console.Write($"[{CategoryName.Split('.').Last()}] "); Console.ForegroundColor = ConsoleColor.Gray; Console.WriteLine(formatter(state, exception)); } } }
public TypeCategory AddNew(Authentication authentication, string name, string parentPath) { this.DataBase.ValidateBeginInDataBase(authentication); var categoryName = new CategoryName(parentPath, name); var result = this.Service.NewTypeCategory(categoryName); result.Validate(authentication); var category = this.Prepare(categoryName.Path); var items = EnumerableUtility.One(category).ToArray(); this.InvokeCategoriesCreatedEvent(authentication, items); return(category); }
public string GetListPhoto() { if (string.IsNullOrEmpty(Photo)) { return(string.Empty); } string[] splitedPhotos = Photo.Split(new[] { "," }, StringSplitOptions.RemoveEmptyEntries); string extension; string name = GetName(splitedPhotos[0], out extension); return(string.Format("{0}/{1}{2}", CategoryName.ToLower(), name, extension)); }
public async Task Indexer_Arg0_Nonexistent_FailTestAsync() { var categoryFilter = new UserCategoryFilter() { HasParent = true }; var category = await categoryFilter.GetUserCategoryAsync(app); var name = await category.GenerateNewCategoryNameAsync(); var categoryName = new CategoryName(category.Path, name); await userCategoryCollection.Dispatcher.InvokeAsync(() => userCategoryCollection[categoryName]); }
public async Task <LocalizedCategoryBM> GetAsync(CategoryIdBM id, string languageCode) { Category category = await context.Category.SingleAsync(x => x.Id == id.Value); CategoryName name = await context.CategoryName.SingleAsync(x => x.CategoryId == id.Value && x.LanguageCode == languageCode); return(new LocalizedCategoryBM( categoryId: category.Id, languageCode: name.LanguageCode, localizedName: name.LocalizedName, parentCategoryId: category.ParentId )); }
public override bool Equals(object obj) { if (obj != null) { Category c = obj as Category; if (CategoryName.Equals(c.CategoryName)) { return(true); } } return(false); }
public ActionResult Create([Bind(Include = "Category_Name")] CategoryName categoryName) { if (ModelState.IsValid) { if (categoryName.CategoryNameValidator(categoryName.Category_Name)) { db.CategoryNames.Add(categoryName); db.SaveChanges(); } return(RedirectToAction("Index")); } return(View(categoryName)); }
public CategoryNameEntity(CategoryName CategoryName, params object[] args) : base(CategoryName) { foreach (object arg in args) { if (arg is Category Category) { CategoryEntity = new CategoryEntity(Category); } if (arg is Language Language) { LanguageEntity = new LanguageEntity(Language); } } }
// Helper Methods public void GoToGame(string cat) { try { CategoryName enumerable = (CategoryName)System.Enum.Parse(typeof(CategoryName), cat); GameData.GAME_CATEGORY = enumerable; SceneManager.LoadScene(1); //Foo(enumerable); //Now you have your enum, do whatever you want. } catch (System.Exception) { Debug.LogErrorFormat("Parse: Can't convert {0} to enum, please check the spell.", cat); } }
public void InsertCategoryName(CategoryName categoryName) { if (categoryName != null) { if (categoryName.EntityState != EntityState.Detached) { this.ObjectContext.ObjectStateManager.ChangeObjectState(categoryName, EntityState.Added); } else { this.ObjectContext.CategoryNames.AddObject(categoryName); } } }
public UserCategoryDeleteArguments(UserCategory userCategory) { var items = EnumerableUtility.One(userCategory).ToArray(); var oldPaths = items.Select(item => item.Path).ToArray(); var path = userCategory.Path; var targetName = new CategoryName(path); var(userPaths, lockPaths) = GetPathForData(userCategory, targetName); this.CategoryPath = userCategory.Path; this.Items = items; this.OldPaths = oldPaths; this.UserPaths = userPaths; this.LockPaths = lockPaths; }
// GET: CategoryName/Delete/5 public ActionResult Delete(string id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } CategoryName categoryName = db.CategoryNames.Find(id); if (categoryName == null) { return(HttpNotFound()); } return(View(categoryName)); }