public void Rename(ImagePart part, string newName) { var index = part.Index; if (Folder.PartIndexs.Contains(index)) { if (Database.ImagePartTable[index.DictionaryName].Has(newName)) { MessageBox.Show( string.Format("无法重命名\"{0}\":与现有元件重名", newName), "重命名时出错"); } else { SymbolIndex oldid = part.Index; SymbolIndex newid = new SymbolIndex(newName, part.Standard, part.No); if (!index.Equals(newid)) { Database.ImagePartTable.Redirect(part, newid); Folder.Redirect(oldid, newid); } part.Rename(newName); } } }
public void Remove(SymbolIndex index) { _partIndexs.Remove(index); if (PartRemoving != null) { PartRemoving(this, new PartEventArgs(Database.ImagePartTable[index])); } }
public void Add(SymbolIndex index) { _partIndexs.Add(index); if (PartAdding != null) { PartAdding(this, new PartEventArgs(Database.ImagePartTable[index])); } }
public bool HasPartIndex(SymbolIndex index) { foreach (var i in _partIndexs) { if (i.Equals(index)) { return(true); } } return(false); }
private void Setup() { FileSystem = Substitute.For <IFileSystem>(); SymbolIndex = new SymbolIndex(FileSystem, _pythonLanguageVersion); SetupRootDir(); }
internal void Redirect(SymbolIndex index, SymbolIndex newIndex) { _partIndexs.Remove(index); _partIndexs.Add(newIndex); }
public void Remove(SymbolIndex index) { Folder.Remove(index); UpdateSize(false); }
/// <summary>Gets the key symbol associated with a key modifier state.</summary> /// <param name="index">The key modifier state.</param> /// <returns>The associated key symbol.</returns> public KeySymbol this[SymbolIndex index] { get { return this.Symbols[(int)index]; } }