예제 #1
0
        public void Disconnect(IComponentBase component)
        {
            var soughtforPin = pins.First(pin => pin.ConnectedComponent.Equals(component));

            soughtforPin.Disconnect();
            pins.Remove(soughtforPin);
        }
예제 #2
0
 public override void SetComponent(ComponentType type, IComponentBase component)
 {
     if (type <= ComponentType.ReportManager)
     {
         if (type == ComponentType.MarketManager)
         {
             base.MarketManager = (component as MarketManager);
             return;
         }
         if (type == ComponentType.ReportManager)
         {
             base.ReportManager = (component as ReportManager);
             return;
         }
     }
     else
     {
         if (type == ComponentType.ATSComponent)
         {
             this.ATSComponent = (component as ATSComponent);
             return;
         }
         if (type == ComponentType.ATSCrossComponent)
         {
             this.ATSCrossComponent = (component as ATSCrossComponent);
             return;
         }
     }
     throw new InvalidOperationException("Invalid strategy1 component type");
 }
예제 #3
0
 // Token: 0x06003FE7 RID: 16359 RVA: 0x00128604 File Offset: 0x00126804
 private void OnRemove(IComponentBase component)
 {
     component.DeInit();
     this.m_components.Remove(component.GetName());
     this.m_type2Name.Remove(component.GetType());
     this.m_tickableComponents.Remove(component.GetType());
 }
예제 #4
0
        public void SetComponent(int index, IComponentBase data)
        {
            var world      = this.world;
            var components = world.GetStructComponents();
            var registries = components.GetAllRegistries();

            registries.arr[index].SetObject(this.entity, data, StorageType.Default);
        }
예제 #5
0
        public void SetSharedComponent(int index, IComponentBase data, uint groupId)
        {
            var world      = this.world;
            var components = world.GetStructComponents();
            var registries = components.GetAllRegistries();

            registries.arr[index].SetSharedObject(this.entity, data, groupId);
        }
        public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
        {
            IComponentBase componentBase = value as IComponentBase;

            if (componentBase != null)
            {
                return(componentBase.Name);
            }
            return("(none)");
        }
예제 #7
0
 public void Process(IComponentBase component)
 {
     this.Validate(component);
     for (int i = 0; i < this.boxVars.Length; ++i)
     {
         if (this.boxVars[i] != null)
         {
             this.boxVars[i].Save(this, i);
         }
     }
 }
예제 #8
0
        protected override List <KeyValuePair <string, object> > GetItems()
        {
            List <KeyValuePair <string, object> > list = new List <KeyValuePair <string, object> >();

            foreach (ComponentRecord componentRecord in StrategyComponentManager.GetComponentList(this.componentType))
            {
                IComponentBase component = StrategyComponentManager.GetComponent(componentRecord.GUID, this.instance);
                list.Add(new KeyValuePair <string, object>(component.Name, component));
            }
            return(list);
        }
예제 #9
0
        public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
        {
            IComponentBase componentBase = value as IComponentBase;

            if (componentBase != null)
            {
                return((object)componentBase.Name);
            }
            else
            {
                return((object)USaG3GpjZagj1iVdv4u.Y4misFk9D9(2260));
            }
        }
예제 #10
0
        public void Apply(ref IComponentBase component)
        {
            var fields = component.GetType().GetCachedFields();

            for (int i = 0; i < this.boxVars.Length; ++i)
            {
                if (this.boxVars[i] != null)
                {
                    var boxVarValue = this.boxVars[i].Load();
                    fields[i].SetValue(component, boxVarValue);
                }
            }
        }
예제 #11
0
        public static IComponentBase GetComponent(Guid guid, object issuer)
        {
            ComponentRecord record1 = StrategyComponentManager.wcrRFbhwry.FindRecord(guid);

            if (record1 == null)
            {
                return((IComponentBase)null);
            }
            if (record1.IsChanged)
            {
                StrategyComponentManager.gLhRsqD2VZ.Remove((object)record1);
                CompilerResults compilerResults = CompilingService.Compile(record1.File.FullName, false);
                if (compilerResults.Errors.HasErrors)
                {
                    record1.HrjA5j3PaA(compilerResults.Errors);
                    return((IComponentBase)null);
                }
                else
                {
                    record1.VnhAiVxt7S(false);
                    foreach (Type type in compilerResults.CompiledAssembly.GetTypes())
                    {
                        ComponentRecord componentRecord = StrategyComponentManager.cN2R9Xa8LN(type, record1.File);
                        if (componentRecord != null)
                        {
                            record1.X8yAQiuh7R(componentRecord.RuntimeType);
                            break;
                        }
                    }
                }
            }
            Hashtable hashtable = StrategyComponentManager.gLhRsqD2VZ[(object)record1] as Hashtable;

            if (hashtable == null)
            {
                hashtable = new Hashtable();
                StrategyComponentManager.gLhRsqD2VZ.Add((object)record1, (object)hashtable);
            }
            IComponentBase componentBase = hashtable[issuer] as IComponentBase;

            if (componentBase == null)
            {
                ComponentRecord record2 = StrategyComponentManager.wcrRFbhwry.FindRecord(guid);
                componentBase             = Activator.CreateInstance(record2.RuntimeType) as IComponentBase;
                componentBase.Name        = record2.Name;
                componentBase.Description = record2.Description;
                hashtable.Add(issuer, (object)componentBase);
            }
            return(componentBase);
        }
예제 #12
0
        public void Validate(IComponentBase component)
        {
            var fields = component.GetType().GetCachedFields();

            if (this.data == null || this.data.Length != fields.Length)
            {
                this.data = new FieldData[fields.Length];
            }
            if (this.captions == null || this.captions.Length != this.data.Length)
            {
                this.captions = new string[this.data.Length];
            }
            if (this.boxVars == null)
            {
                this.boxVars = new BoxVariable[this.data.Length];
            }
            if (this.boxVars.Length != this.data.Length)
            {
                System.Array.Resize(ref this.boxVars, this.data.Length);
            }

            for (int i = 0; i < this.data.Length; ++i)
            {
                this.captions[i] = fields[i].Name;
                var         val  = fields[i].GetValue(component);
                System.Type type = null;
                if (val == null)
                {
                    type = fields[i].FieldType;
                }
                else
                {
                    type = val.GetType();
                }

                if (type.IsArray == true)
                {
                    this.data[i].value    = null;
                    this.data[i].valueArr = ((System.Collections.IList)val).Cast <object>().ToArray();
                    this.data[i].isArray  = true;
                }
                else
                {
                    this.data[i].value    = val;
                    this.data[i].valueArr = null;
                    this.data[i].isArray  = false;
                }
            }
        }
        public static IComponentBase GetComponent(Guid guid, object issuer)
        {
            ComponentRecord componentRecord = StrategyComponentManager.components.FindRecord(guid);

            if (componentRecord == null)
            {
                return(null);
            }
            if (componentRecord.IsChanged)
            {
                StrategyComponentManager.componentCache.Remove(componentRecord);
                CompilerResults compilerResults = CompilingService.Compile(componentRecord.File.FullName, false);
                if (compilerResults.Errors.HasErrors)
                {
                    componentRecord.SetErrors(compilerResults.Errors);
                    return(null);
                }
                componentRecord.SetIsChanged(false);
                Type[] types = compilerResults.CompiledAssembly.GetTypes();
                for (int i = 0; i < types.Length; i++)
                {
                    Type            type             = types[i];
                    ComponentRecord componentRecord2 = StrategyComponentManager.CreateRecord(type, componentRecord.File);
                    if (componentRecord2 != null)
                    {
                        componentRecord.SetRuntimeType(componentRecord2.RuntimeType);
                        break;
                    }
                }
            }
            Hashtable hashtable = StrategyComponentManager.componentCache[componentRecord] as Hashtable;

            if (hashtable == null)
            {
                hashtable = new Hashtable();
                StrategyComponentManager.componentCache.Add(componentRecord, hashtable);
            }
            IComponentBase componentBase = hashtable[issuer] as IComponentBase;

            if (componentBase == null)
            {
                ComponentRecord componentRecord3 = StrategyComponentManager.components.FindRecord(guid);
                componentBase             = (Activator.CreateInstance(componentRecord3.RuntimeType) as IComponentBase);
                componentBase.Name        = componentRecord3.Name;
                componentBase.Description = componentRecord3.Description;
                hashtable.Add(issuer, componentBase);
            }
            return(componentBase);
        }
예제 #14
0
 public void Add(IComponentBase component)
 {
     if (component is Node)
     {
         Node_2 = component as Node;
         FindDirection();
         return;
     }
     AllComponentsInBrunch.Add(component);
     if (component is ICurrentSource)
     {
         CurrentSources.Add(component as ICurrentSource);
     }
     if (component is IVoltageSource)
     {
         VoltageSources.Add(component as IVoltageSource);
     }
 }
예제 #15
0
        private Node FillBranches(Branch branch, IComponentBase previousComponent, IComponentBase component, List <IComponentBase> passedComponents)
        {
            branch.Add(component);
            passedComponents.Add(component);

            Pin pin = (component[0].ConnectedComponent.Equals(previousComponent)) ? component[1] : component[0];

            if (pin.ConnectedComponent is Node)
            {
                branch.Add(pin.ConnectedComponent);
                return(pin.ConnectedComponent as Node);
            }
            else
            {
                return(FillBranches(branch, component, pin.ConnectedComponent, passedComponents));
            }
            throw new InvalidOperationException(); // Схема не замкнута?
        }
예제 #16
0
        public override void SetComponent(ComponentType type, IComponentBase component)
        {
            switch (type)
            {
            case ComponentType.CrossEntry:
                this.CrossEntry = component as CrossEntry;
                break;

            case ComponentType.CrossExit:
                this.CrossExit = component as CrossExit;
                break;

            case ComponentType.MarketManager:
                this.MarketManager = component as MarketManager;
                break;

            case ComponentType.ReportManager:
                this.ReportManager = component as ReportManager;
                break;

            case ComponentType.MoneyManager:
                this.MoneyManager = component as MoneyManager;
                break;

            case ComponentType.RiskManager:
                this.RiskManager = component as RiskManager;
                break;

            case ComponentType.Entry:
                this.Entry = component as Entry;
                break;

            case ComponentType.Exit:
                this.Exit = component as Exit;
                break;

            case ComponentType.ExposureManager:
                this.ExposureManager = component as ExposureManager;
                break;

            default:
                throw new InvalidOperationException();
            }
        }
예제 #17
0
 public override void SetComponent(ComponentType type, IComponentBase component)
 {
     if (type == ComponentType.MetaExposureManager)
     {
         this.MetaExposureManager = (component as MetaExposureManager);
         return;
     }
     if (type == ComponentType.ExecutionManager)
     {
         this.ExecutionManager = (component as ExecutionManager);
         return;
     }
     if (type != ComponentType.MetaRiskManager)
     {
         base.SetComponent(type, component);
         return;
     }
     this.MetaRiskManager = (component as MetaRiskManager);
 }
예제 #18
0
        public override void SetComponent(ComponentType type, IComponentBase component)
        {
            switch (type)
            {
            case ComponentType.MetaExposureManager:
                this.MetaExposureManager = component as MetaExposureManager;
                break;

            case ComponentType.ExecutionManager:
                this.ExecutionManager = component as ExecutionManager;
                break;

            case ComponentType.MetaRiskManager:
                this.MetaRiskManager = component as MetaRiskManager;
                break;

            default:
                base.SetComponent(type, component);
                break;
            }
        }
예제 #19
0
        public override void SetComponent(ComponentType type, IComponentBase component)
        {
            switch (type)
            {
            case ComponentType.ATSComponent:
                this.ATSComponent = component as ATSComponent;
                break;

            case ComponentType.ATSCrossComponent:
                this.ATSCrossComponent = component as ATSCrossComponent;
                break;

            case ComponentType.MarketManager:
                this.MarketManager = component as MarketManager;
                break;

            case ComponentType.ReportManager:
                this.ReportManager = component as ReportManager;
                break;

            default:
                throw new InvalidOperationException("");
            }
        }
예제 #20
0
 public PlotChannelBaseCollection(IComponentBase componentBase)
     : base(componentBase)
 {
     this.Initialize();
 }
예제 #21
0
 public override void SetComponent(ComponentType type, IComponentBase component)
 {
   switch (type)
   {
     case ComponentType.MetaExposureManager:
       this.MetaExposureManager = component as MetaExposureManager;
       break;
     case ComponentType.ExecutionManager:
       this.ExecutionManager = component as ExecutionManager;
       break;
     case ComponentType.MetaRiskManager:
       this.MetaRiskManager = component as MetaRiskManager;
       break;
     default:
       base.SetComponent(type, component);
       break;
   }
 }
예제 #22
0
 public PlotLegendBaseCollection(IComponentBase componentBase)
     : base(componentBase)
 {
     this.Initialize();
 }
예제 #23
0
 public abstract void SetComponent(ComponentType type, IComponentBase component);
예제 #24
0
 public GradientColorCollection(IComponentBase componentBase)
     : base(componentBase)
 {
 }
예제 #25
0
파일: ATSStrategy.cs 프로젝트: heber/FreeOQ
		public override void SetComponent(ComponentType type, IComponentBase component)
		{
			switch (type)
			{
				case ComponentType.ATSComponent:
					this.ATSComponent = component as ATSComponent;
					break;
				case ComponentType.ATSCrossComponent:
					this.ATSCrossComponent = component as ATSCrossComponent;
					break;
				case ComponentType.MarketManager:
					this.MarketManager = component as MarketManager;
					break;
				case ComponentType.ReportManager:
					this.ReportManager = component as ReportManager;
					break;
				default:
					throw new InvalidOperationException("");
			}
		}
예제 #26
0
 protected CollectionBase(IComponentBase componentBase)
 {
     this.ComponentBase = componentBase;
     this.AllowEdit     = true;
 }
예제 #27
0
 public PlotXAxisCollection(IComponentBase componentBase)
     : base(componentBase)
 {
     this.Initialize();
 }
예제 #28
0
 public PlotDataViewCollection(IComponentBase componentBase)
     : base(componentBase)
 {
     this.Initialize();
 }
예제 #29
0
 public ColorSectionCollection(IComponentBase componentBase)
     : base(componentBase)
 {
 }
예제 #30
0
		public virtual void SetComponent(ComponentType type, IComponentBase component)
		{
			switch (type)
			{
				case ComponentType.MetaMoneyManager:
					this.MetaMoneyManager = component as MetaMoneyManager;
					break;
				case ComponentType.ReportManager:
					this.ReportManager = component as ReportManager;
					break;
				case ComponentType.OptimizationManager:
					this.OptimizationManager = component as OptimizationManager;
					break;
				case ComponentType.SimulationManager:
					this.SimulationManager = component as SimulationManager;
					break;
				default:
					throw new InvalidOperationException();
			}
		}
예제 #31
0
        public override void SetComponent(ComponentType type, IComponentBase component)
        {
            if (type <= ComponentType.RiskManager)
            {
                if (type <= ComponentType.ExposureManager)
                {
                    switch (type)
                    {
                    case ComponentType.Entry:
                        this.Entry = (component as Entry);
                        return;

                    case (ComponentType)3:
                        break;

                    case ComponentType.Exit:
                        this.Exit = (component as Exit);
                        return;

                    default:
                        if (type == ComponentType.ExposureManager)
                        {
                            this.ExposureManager = (component as ExposureManager);
                            return;
                        }
                        break;
                    }
                }
                else
                {
                    if (type == ComponentType.MoneyManager)
                    {
                        this.MoneyManager = (component as MoneyManager);
                        return;
                    }
                    if (type == ComponentType.RiskManager)
                    {
                        this.RiskManager = (component as RiskManager);
                        return;
                    }
                }
            }
            else if (type <= ComponentType.ReportManager)
            {
                if (type == ComponentType.MarketManager)
                {
                    base.MarketManager = (component as MarketManager);
                    return;
                }
                if (type == ComponentType.ReportManager)
                {
                    base.ReportManager = (component as ReportManager);
                    return;
                }
            }
            else
            {
                if (type == ComponentType.CrossEntry)
                {
                    this.CrossEntry = (component as CrossEntry);
                    return;
                }
                if (type == ComponentType.CrossExit)
                {
                    this.CrossExit = (component as CrossExit);
                    return;
                }
            }
            throw new InvalidOperationException("Invalid strategy1 component type");
        }
예제 #32
0
파일: Strategy.cs 프로젝트: heber/FreeOQ
 public override void SetComponent(ComponentType type, IComponentBase component)
 {
   switch (type)
   {
     case ComponentType.CrossEntry:
       this.CrossEntry = component as CrossEntry;
       break;
     case ComponentType.CrossExit:
       this.CrossExit = component as CrossExit;
       break;
     case ComponentType.MarketManager:
       this.MarketManager = component as MarketManager;
       break;
     case ComponentType.ReportManager:
       this.ReportManager = component as ReportManager;
       break;
     case ComponentType.MoneyManager:
       this.MoneyManager = component as MoneyManager;
       break;
     case ComponentType.RiskManager:
       this.RiskManager = component as RiskManager;
       break;
     case ComponentType.Entry:
       this.Entry = component as Entry;
       break;
     case ComponentType.Exit:
       this.Exit = component as Exit;
       break;
     case ComponentType.ExposureManager:
       this.ExposureManager = component as ExposureManager;
       break;
     default:
       throw new InvalidOperationException();
   }
 }
예제 #33
0
 public Pin(IComponentBase component)
 {
     this.Component = component;
 }
 public PlotLegendMultiColumnItemCollection(IComponentBase componentBase)
     : base(componentBase)
 {
 }
예제 #35
0
 public abstract void SetComponent(ComponentType type, IComponentBase component);