当前位置: 首页>>代码示例>>C#>>正文


C# Instrument类代码示例

本文整理汇总了C#中Instrument的典型用法代码示例。如果您正苦于以下问题:C# Instrument类的具体用法?C# Instrument怎么用?C# Instrument使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Instrument类属于命名空间,在下文中一共展示了Instrument类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: NewCompositionPanelViewModel

        public NewCompositionPanelViewModel()
        {
            EditorState.IsNewCompositionPanel = true;

            //we are reusing vectors and such, but the newcompositionpanel, needs different vector widths for some vectors, so....
            //these values are set back normal in the start and cancel button handlers below.
            Preferences.MeasureWidth = Preferences.NewComppositionPanelMeasureWidth;
            Preferences.StaffDimensionAreaWidth = Preferences.NewComppositionPanelStaffDimensionAreaWidth;
            //

            #region Set DropDowns to Default Values
            Infrastructure.Dimensions.Keys.InitializeKeys();
            Keys = (from a in Infrastructure.Dimensions.Keys.KeyList where a.Listable select a).ToList();
            SelectedKey = (from a in Infrastructure.Dimensions.Keys.KeyList where a.Name == Preferences.DefaultKey select a).Single();
            _selectedInstrument = (from a in Infrastructure.Dimensions.Instruments.InstrumentList where a.Name == Preferences.DefaultInstrument select a).Single();
            SelectedSimpleStaffConfigurationClef = (from a in Infrastructure.Dimensions.Clefs.ClefList where a.Id == Preferences.DefaultClefId select a).Single();
            SelectedGrandStaffConfigurationClef = (from a in Infrastructure.Dimensions.Clefs.ClefList where a.Id == Preferences.DefaultGrandStaffClefId select a).Single();
            SelectedTimeSignature = (from a in Infrastructure.Dimensions.TimeSignatures.TimeSignatureList where a.Id == Preferences.DefaultTimeSignatureId select a).Single();

            #endregion Set DropDowns to Default Values

            CreateNewCompositionForPanel();

            DefineCommands();
            SubscribeEvents();
            EA.GetEvent<SetProvenancePanel>().Publish(string.Empty);
            Scale = 1;
            Update();
            EA.GetEvent<SetNewCompositionTitleForeground>().Publish("#CCCCCC");
            SetMargins();
            GrandStaffConfigurationClefComboBoxVisibility = (_staffConfiguration == _Enum.StaffConfiguration.Grand) ? Visibility.Visible : Visibility.Collapsed;
            EditorState.StaffConfiguration = _staffConfiguration;
            CompositionPanelVisibility = Visibility.Visible;
        }
开发者ID:jwh5293,项目名称:Composer,代码行数:34,代码来源:NewCompositionPanelViewModel.cs

示例2: Init

 internal void Init(Framework framework)
 {
     this.framework = framework;
     this.instrument = framework.InstrumentManager.GetById(InstrumentId);
     if (this.instrument == null)
         Console.WriteLine($"{nameof(Leg)}::{nameof(Init)} Can not find leg instrument in the framework instrument manager. Id = {InstrumentId}");
 }
开发者ID:fastquant,项目名称:fastquant.dll,代码行数:7,代码来源:Leg.cs

示例3: Member

        public Member(StreamReader sr)
        {
            firstName = sr.ReadLine();
            lastName = sr.ReadLine();
            type = (MemberType)Convert.ToInt32(sr.ReadLine());
            uiStudentNumber = Convert.ToUInt32(sr.ReadLine());
            memberFaculty = (Faculty)Convert.ToInt32(sr.ReadLine());

            otherInstrument = sr.ReadLine();
            curInstrument = (Instrument)Convert.ToInt32(sr.ReadLine());

            this.bMultipleInstruments = Convert.ToBoolean(sr.ReadLine());

            // write if the member plays multiple instruments
            // write any other instruments that the member plays (or does not play)
            int numberOfInstruments = Enum.GetValues(typeof(Member.Instrument)).Length;
            if (this.bMultipleInstruments)
            {
                playsInstrument = new bool[Enum.GetValues(typeof(Member.Instrument)).Length];
                for (int j = 0; j < numberOfInstruments; j++)
                    playsInstrument[j] = Convert.ToBoolean(sr.ReadLine());
            }

            email = sr.ReadLine();
            comments = ClsStorage.ReverseCleanNewLine(sr.ReadLine());
            sID = Convert.ToInt16(sr.ReadLine());
            signupTime = new DateTime(Convert.ToInt64(sr.ReadLine()));
            size = (ShirtSize)Convert.ToInt32(sr.ReadLine());
        }
开发者ID:uwcbc,项目名称:uwcbc-marimba,代码行数:29,代码来源:member.cs

示例4: Loader

        public Loader()
        {
            _cache_mark = "";

            _slices_cache = new Hashtable();

            XmlDocument doc = new XmlDocument();

            try {
                doc.Load("config.xml");

                XmlNodeList instruments = doc.DocumentElement.ChildNodes;

                _instruments = new Queue();

                foreach (XmlNode i in instruments) {
                    Instrument instrument = new Instrument();

                    instrument.class_id = i.Attributes["class_id"].Value;
                    instrument.id = i.Attributes["id"].Value;
                    instrument.name = i.Attributes["name"].Value;

                    _instruments.Enqueue(instrument);
                }

            }
            catch (Exception ex) {
                // MessageBox.Show("Ошибка: " + ex.Message);
            }
        }
开发者ID:nalobin,项目名称:indices_master,代码行数:30,代码来源:FinamImport.cs

示例5: CreateInstruments

    void CreateInstruments()
    {
        Instrument guitar = new Instrument("rhythmGuitar", gameObject.GetComponent<AudioSource>());

        Chord[] C_Chords = new Chord[6];
        C_Chords[0] = LoadChord("C");
        C_Chords[1] = LoadChord("Dm");
        C_Chords[2] = LoadChord("Em");
        C_Chords[3] = LoadChord("F");
        C_Chords[4] = LoadChord("G");
        C_Chords[5] = LoadChord("Am");

        guitar.AddKey("C", C_Chords);

        Chord[] Am_Chords = new Chord[6];
        Am_Chords[0] = LoadChord("Am");
        Am_Chords[1] = LoadChord("C");
        Am_Chords[2] = LoadChord("Dm");
        Am_Chords[3] = LoadChord("Em");
        Am_Chords[4] = LoadChord("F");
        Am_Chords[5] = LoadChord("G");

        guitar.AddKey("Am", Am_Chords);

        m_Instruments.Add(guitar);
    }
开发者ID:Colthor,项目名称:ProcJam2015,代码行数:26,代码来源:Music.cs

示例6: getPosition

 public Position getPosition(Instrument instrument, Side orderMode)
 {
     IntPtr cPtr = ContextModulePINVOKE.NetPositions_getPosition(swigCPtr, Instrument.getCPtr(instrument), (int)orderMode);
     Position ret = (cPtr == IntPtr.Zero) ? null : new Position(cPtr, false);
     if (ContextModulePINVOKE.SWIGPendingException.Pending) throw ContextModulePINVOKE.SWIGPendingException.Retrieve();
     return ret;
 }
开发者ID:EonKid,项目名称:muTradeApi,代码行数:7,代码来源:NetPositions.cs

示例7: Leg

 public Leg(Instrument instrument, double weight = 1.0)
 {
     this.instrument = instrument;
     Weight = weight;
     InstrumentId = instrument.Id;
     this.framework = instrument.Framework;
 }
开发者ID:fastquant,项目名称:fastquant.dll,代码行数:7,代码来源:Leg.cs

示例8: TestItemOnAV

 public TestItemOnAV(Instrument.SwitchSetting ss,
     string channelID)
     : base(ss)
 {
     this.ChannelID = channelID;
     this.Values = new List<string>();
 }
开发者ID:dalinhuang,项目名称:appcollection,代码行数:7,代码来源:TestItemOnAv.cs

示例9: InstrumentNode

 public InstrumentNode(Instrument instrument)
 {
   eX4XcIhHpDXt70u2x3N.k8isAcYzkUOGF();
   // ISSUE: explicit constructor call
   base.\u002Ector(instrument.Symbol, 1, 1);
   this.ijdxXmDIwH = instrument;
 }
开发者ID:heber,项目名称:FreeOQ,代码行数:7,代码来源:InstrumentNode.cs

示例10: OnBar

        protected override void OnBar(Instrument instrument, Bar bar)
        {
            // Add bar to bar series.
            Bars.Add(bar);

            Log(bar, barsGroup);

            if (fastSMA.Count > 0)
                Log(fastSMA.Last, fastSmaGroup);

            if (slowSMA.Count > 0)
                Log(slowSMA.Last, slowSmaGroup);

            // Calculate performance.
            Portfolio.Performance.Update();

            Log(Portfolio.Value, equityGroup);

            // Check strategy logic.
            if (fastSMA.Count > 0 && slowSMA.Count > 0)
            {
                Cross cross = fastSMA.Crosses(slowSMA, bar.DateTime);

                if (cross == Cross.Above)
                    buyOnNewBlock = true;

                if (cross == Cross.Below)
                    sellOnNewBlock = true;
            }

            positionInBlock = (positionInBlock++) % BarBlockSize;
        }
开发者ID:fastquant,项目名称:fastquant.dll,代码行数:32,代码来源:Program.cs

示例11: YPitchBendCube

        public YPitchBendCube(Point3D center, double radius, 
                Pitch pitch, Instrument instrument, OutputDevice device, Channel channel)
            : base(center, radius, new InstrumentNoteAction(device, channel, pitch)) {

                outputDevice = device;
                this.channel = channel;
        }
开发者ID:probuilderz,项目名称:balloon,代码行数:7,代码来源:YPitchBendCube.cs

示例12: BarFactoryItem

 protected BarFactoryItem(Instrument instrument, BarType barType, long barSize, BarInput barInput, TimeSpan session1, TimeSpan session2, int providerId = -1)
     : this(instrument, barType, barSize, barInput, providerId)
 {
     this.sessionEnabled = true;
     this.session1 = session1;
     this.session2 = session2;
 }
开发者ID:,项目名称:,代码行数:7,代码来源:

示例13: OnBarOpen

        protected override void OnBarOpen(Instrument instrument, Bar bar)
        {
            double orderQty = Qty;

            // Set order qty if position already exist.
            if (HasPosition(Instrument))
                orderQty = Math.Abs(Position.Amount) + Qty;

            // Send trading orders if needed.
            if (positionInBlock == 0)
            {
                if (buyOnNewBlock)
                {
                    Order order = BuyOrder(Instrument, orderQty, "Reverse to Long");
                    Send(order);

                    buyOnNewBlock = false;
                }

                if (sellOnNewBlock)
                {
                    Order order = SellOrder(Instrument, orderQty, "Reverse to Short");
                    Send(order);

                    sellOnNewBlock = false;
                }
            }
        }
开发者ID:fastquant,项目名称:fastquant.dll,代码行数:28,代码来源:Program.cs

示例14: Add

        public void Add(Instrument instrument, bool save = true)
        {
            if (Contains(instrument.Symbol))
                throw new ArgumentException($"Instrument with the same symbol is already present in the framework : {instrument.Symbol}");

            var i = this.deletedInstruments.Get(instrument.Symbol);
            if (i != null)
            {
                Console.WriteLine($"InstrumentManager::Add Using deleted instrument id = {i.Id} for symbol {instrument.Symbol}");
                instrument.Id = i.Id;
                this.deletedInstruments.Remove(i);
            }
            else
            {
                instrument.Id = this.counter++;
            }
            Instruments.Add(instrument);
            if (instrument.Framework == null)
                instrument.Init(this.framework);

            if (save)
            {
                instrument.Loaded = true;
                Save(instrument);
            }
            this.framework.EventServer.OnInstrumentAdded(instrument);
        }
开发者ID:,项目名称:,代码行数:27,代码来源:

示例15: PriceDataService

 public PriceDataService(Instrument instrument, TimeFrame timeframe, DateTime startDate, DateTime endDate)
 {
     _instrument = instrument;
     _timeframe = timeframe;
     _startDate = startDate;
     _endDate = endDate;
 }
开发者ID:tanveeransari,项目名称:Migration,代码行数:7,代码来源:PriceDataService.cs


注:本文中的Instrument类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。