Пример #1
0
        ///// <summary>
        ///// Helper method allows to retrieve application entry assembly as well as its referenced (static and runtime) assemblies.
        ///// </summary>
        //static public List<Assembly> GetApplicationEntryAssemblyAndReferencedAssemblies()
        //{
        //}

        /// <summary>
        /// Helper method allows to retrieve initial assembly and it referenced (static and runtime) assemblies.
        /// </summary>
        static public ListUnique <Assembly> GetReferencedAndInitialAssembly(Assembly initialAssembly)
        {
            ListUnique <Assembly> assemblies = GetReferencedAssemblies(initialAssembly);

            assemblies.Add(initialAssembly);
            return(assemblies);
        }
Пример #2
0
 void UpdateSelectedObjects()
 {
     _selectedDynamicCustomObjects.Clear();
     foreach (DynamicCustomObject dynamicObject in _dynamicCustomObjects)
     {
         if (dynamicObject.Selected)
         {
             _selectedDynamicCustomObjects.Add(dynamicObject);
         }
     }
 }
        ResponseMessage Receive(SubscribeToSourceAccountsUpdatesMessage message)
        {
            lock (this)
            {
                if (message.Subscribe)
                {
                    _subscribers.Add(message.TransportInfo);
                }
                else
                {
                    _subscribers.Remove(message.TransportInfo);
                }
            }

            return(new ResponseMessage(true));
        }
Пример #4
0
        public bool Add(CustomObject customObject)
        {
            if (customObject.IsInitialized == false && customObject.Initialize(this) == false)
            {
                return(false);
            }

            if (customObject is DynamicCustomObject)
            {
                _dynamicCustomObjects.Add((DynamicCustomObject)customObject);
            }
            else
            {
                _staticCustomObjects.Add(customObject);
            }

            _pane.Invalidate();
            return(true);
        }
Пример #5
0
        /// <summary>
        /// Helper method allows to retrieve initial assembly referenced (static and runtime) assemblies.
        /// </summary>
        static public ListUnique <Assembly> GetReferencedAssemblies(Assembly initialAssembly)
        {
            ListUnique <Assembly> result = new ListUnique <Assembly>();

            AssemblyName[] names = initialAssembly.GetReferencedAssemblies();
            for (int i = 0; i < names.Length; i++)
            {
                result.Add(Assembly.Load(names[i]));
            }

            lock (_dynamicReferencedAssemblies)
            {
                if (_dynamicReferencedAssemblies.ContainsKey(initialAssembly))
                {
                    result.AddRange(_dynamicReferencedAssemblies[initialAssembly]);
                }
            }

            return(result);
        }
Пример #6
0
        /// <summary>
        /// Add a new indicator.
        /// </summary>
        /// <param name="indicator"></param>
        /// <returns></returns>
        public bool AddIndicator(Indicator indicator)
        {
            if (indicator.Initialize(_dataBarProvider) == false)
            {
                indicator.Dispose();
                return(false);
            }

            indicator.Calculate(true, null);
            bool addResult;

            lock (this)
            {
                addResult = _indicators.Add(indicator);
            }

            if (addResult && IndicatorAddedEvent != null)
            {
                IndicatorAddedEvent(this, indicator);
            }

            return(true);
        }