/// <summary> /// 启动线程 /// </summary> /// <param name="param">参数</param> private void createThread(object param) { FCScript indicator = CreateScript(FCHttpMonitor.MainMonitor.Script, m_native); indicator.callFunction(param.ToString()); indicator.delete(); }
/// <summary> /// 销毁方法 /// </summary> public virtual void delete() { if (!m_deleted) { if (m_script != null) { m_script.delete(); } m_deleted = true; } }
/// <summary> /// 删除指标 /// </summary> /// <param name="id">指标ID</param> public static void deleteIndicatorExtern(int id) { if (m_indicators.ContainsKey(id)) { FCScript indicator = m_indicators[id]; m_indicators.Remove(id); indicator.clear(); indicator.DataSource.delete(); indicator.DataSource = null; indicator.delete(); } }
/// <summary> /// 检查脚本 /// </summary> public void checkScript() { String newScript = ""; FCFile.read(m_fileName, ref newScript); if (m_script != newScript) { Console.WriteLine("检测到脚本被修改..."); m_script = newScript; lock (m_indicators) { while (true) { try { FCScript indicator = m_indicators.Pop(); indicator.delete(); } catch { break; } } } } }