Exemplo n.º 1
0
        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);
                }
            }
        }
Exemplo n.º 2
0
 public void Remove(SymbolIndex index)
 {
     _partIndexs.Remove(index);
     if (PartRemoving != null)
     {
         PartRemoving(this, new PartEventArgs(Database.ImagePartTable[index]));
     }
 }
Exemplo n.º 3
0
 public void Add(SymbolIndex index)
 {
     _partIndexs.Add(index);
     if (PartAdding != null)
     {
         PartAdding(this, new PartEventArgs(Database.ImagePartTable[index]));
     }
 }
Exemplo n.º 4
0
 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();
 }
Exemplo n.º 6
0
 internal void Redirect(SymbolIndex index, SymbolIndex newIndex)
 {
     _partIndexs.Remove(index);
     _partIndexs.Add(newIndex);
 }
Exemplo n.º 7
0
 public void Remove(SymbolIndex index)
 {
     Folder.Remove(index);
     UpdateSize(false);
 }
Exemplo n.º 8
0
 /// <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];
     }
 }