public void CreateIndex(string inIndexName, IndexTypes inIndexType) { StockIndex stockIndex; if (IndexExists(inIndexName)) { throw new StockExchangeException("Index with that name already exist!"); } switch (inIndexType) { case (IndexTypes.AVERAGE): stockIndex = new AverageStockIndex(inIndexName); break; case (IndexTypes.WEIGHTED): stockIndex = new WeightedStockIndex(inIndexName); break; default: throw new StockExchangeException("Index Type doeesn't exist!"); } this.stockIndexes.Add(inIndexName, stockIndex); }
/// <summary> /// 创建索引 /// </summary> /// <returns></returns> public virtual void FromDocument(Document document) { this.Index = document.Get(nameof(IIndexModel.Index)); this.Description = document.Get(nameof(IIndexModel.Description)); this.Path = document.Get(nameof(IIndexModel.Path)); this.IndexType = Enum.TryParse <IndexTypes>(document.Get(nameof(IIndexModel.IndexType)), out var result) ? result : IndexTypes.Common; }
public void closeFile() { setText(""); filename = ""; type = IndexTypes.Folder; label = ""; }
public TreeIndex(IndexTypes _type, String _label, List <TreeIndex> _content, TreeIter _iter, TreeIndex _parent, String _path, String _tree_path) { type = _type; label = _label; content = _content; iter = _iter; parent = _parent; path = _path; tree_path = _tree_path; }
public override string GetIndexType(IndexTypes indexTypes) { switch (indexTypes) { case IndexTypes.UniqueNonClustered: return "UNIQUE"; default: return string.Empty; } }
public void addIndex(string name, IndexTypes type) { if (checkIfIndexExists(name)) { throw new StockExchangeException("Index with name " + name + " already exists"); } indexes.Add( new Index(name, type) ); }
public void CreateIndex(string inIndexName, IndexTypes inIndexType) { if (IndexExists(inIndexName)) { throw new StockExchangeException("Index s tim imenom već postoji!"); } if (inIndexType != IndexTypes.AVERAGE && inIndexType != IndexTypes.WEIGHTED) { throw new StockExchangeException("Nedopušteni tip indeksa!"); } Index newIndex = new Index(inIndexName, inIndexType); listIndices.Add(inIndexName.ToLower(), newIndex); }
public TreeIndex addNode(String path, String name, IndexTypes type, String filename) { String fname = ""; switch (type) { case IndexTypes.Page: { fname = AppDomain.CurrentDomain.BaseDirectory + Path.DirectorySeparatorChar + "SmallPage.png"; break; } case IndexTypes.Module: { fname = AppDomain.CurrentDomain.BaseDirectory + Path.DirectorySeparatorChar + "SmallModule.png"; break; } case IndexTypes.Function: { fname = AppDomain.CurrentDomain.BaseDirectory + Path.DirectorySeparatorChar + "SmallFunction.png"; break; } case IndexTypes.Class: { fname = AppDomain.CurrentDomain.BaseDirectory + Path.DirectorySeparatorChar + "SmallClass.png"; break; } case IndexTypes.Folder: { fname = AppDomain.CurrentDomain.BaseDirectory + Path.DirectorySeparatorChar + "SmallFolder.png"; break; } } log.info($"Adding node at path {filename}"); TreeIndex parent = getIndexAtPath(path); if (!active) { TreeIndex ndex = new TreeIndex(type, name, new List <TreeIndex>(), new TreeIter(), parent, filename, path + "/" + name); log.info($"Node path from TreeIndex: {ndex.path}"); parent.content.Add(ndex); return(ndex); } Gdk.Pixbuf icon = new Gdk.Pixbuf(System.IO.File.ReadAllBytes(fname)); icon = icon.ScaleSimple(26, 26, Gdk.InterpType.Bilinear); TreeIter iter = fileTree.AppendValues(parent.iter, icon, name); TreeIndex index = new TreeIndex(type, name, new List <TreeIndex>(), iter, parent, filename, path + "/" + name); log.info($"Node path from TreeIndex: {index.path}"); parent.content.Add(index); return(index); }
public virtual string GetIndexType(IndexTypes indexTypes) { string indexType; if (indexTypes == IndexTypes.Clustered) { indexType = "CLUSTERED"; } else { indexType = indexTypes == IndexTypes.NonClustered ? "NONCLUSTERED" : "UNIQUE NONCLUSTERED"; } return(indexType); }
public override string GetIndexType(IndexTypes indexTypes) { string indexType; //NOTE Sql Ce doesn't support clustered indexes if (indexTypes == IndexTypes.Clustered) { indexType = "NONCLUSTERED"; } else { indexType = indexTypes == IndexTypes.NonClustered ? "NONCLUSTERED" : "UNIQUE NONCLUSTERED"; } return(indexType); }
public void openFile(String _filename, String _label, IndexTypes _type) { saveFile(); setText(""); filename = _filename; type = _type; label = _label; switch (type) { case IndexTypes.Page: { String content = File.ReadAllText(filename); setText(content); break; } case IndexTypes.Module: { parser = new FuncParser(filename); setText(parser.head); break; } case IndexTypes.Class: { parser = new FuncParser(filename); setText(parser.head); break; } case IndexTypes.Function: { parser = new FuncParser(filename); setText(parser.functions[label]); break; } } }
/// <summary> /// 创建索引模型 /// </summary> /// <param name="address"></param> /// <returns></returns> public static IIndexModel CreateIndexModel(Document document) { var field = document.Get(nameof(IIndexModel.IndexType)); IndexTypes indexType = Enum.TryParse(field, out indexType) ? indexType : IndexTypes.Common; IIndexModel indexModel; switch (indexType) { case IndexTypes.Exe: { indexModel = new EXEIndexModel(); break; } case IndexTypes.Dll: { indexModel = new DLLIndexModel(); break; } case IndexTypes.Image: { indexModel = new ImageIndexModel(); break; } case IndexTypes.Common: default: { indexModel = new CommonIndexModel(); break; } } indexModel.FromDocument(document); return(indexModel); }
public Index(string inIndexName, IndexTypes inIndexType) { this.type = inIndexType; this.name = inIndexName; this.listIndexStocks = new Dictionary <string, Stock>(); }
public Index(string name, IndexTypes type) { this.name = name; this.type = type; this.stocks = new List <Stock>(); }
public bool IsIndexType(IndexTypes index) { return((IndexType & index) == index); }
public IndexAttribute(IndexTypes indexType) { IndexType = indexType; }
public void CreateIndex(string inIndexName, IndexTypes inIndexType) { currentIndexes.addIndex(inIndexName, inIndexType); }
public IndexAttribute(IndexTypes indexType) => IndexType = indexType;
public void CreateIndex(string inIndexName, IndexTypes inIndexType) { throw new NotImplementedException(); }