• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# Instrument类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: Position

 public Position(Portfolio portfolio, Instrument instrument)
 {
     Portfolio = portfolio;
     Instrument = instrument;
     PortfolioId = portfolio.Id;
     InstrumentId = instrument.Id;
 }
开发者ID:,项目名称:,代码行数:7,代码来源:


示例17: HistoricalDataRequest

 public HistoricalDataRequest(Instrument instrument, DateTime dateTime1, DateTime dateTime2, byte dataType)
 {
     Instrument = instrument;
     DateTime1 = dateTime1;
     DateTime2 = dateTime2;
     DataType = dataType;
 }
开发者ID:,项目名称:,代码行数:7,代码来源:


示例18: Delete

 public void Delete(Instrument instrument)
 {
     Instruments.Remove(instrument);
     instrument.DeleteCached = true;
     this.deletedInstruments.Add(instrument);
     Save(instrument);
     this.framework.EventServer.OnInstrumentDeleted(instrument);
 }
开发者ID:,项目名称:,代码行数:8,代码来源:


示例19: EditValue

		public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
		{
			if (context != null && context.Instance is Instrument)
			{
				this.instrument = (Instrument)context.Instance;
			}
			return base.EditValue(context, provider, value);
		}
开发者ID:houzhongxu,项目名称:OpenQuant.API,代码行数:8,代码来源:AltIDGroupListEditor.cs


示例20: Start

 // Use this for initialization
 void Start()
 {
     controlScheme = ControlManager.Instance.ControlSchemes[0];
     InstrumentInHand = ((GameObject)GameObject.Instantiate(InstrumentsInCollection.First().gameObject)).GetComponent<Instrument>();
     InstrumentInHand.gameObject.SetActive(true);
     InstrumentInHand.transform.position = transform.position;
     InstrumentInHand.transform.parent = transform;
     player = transform.parent.Find("PlayerCharacter");
 }
开发者ID:Bahamutho,项目名称:GJ01-Jazz-Climbing,代码行数:10,代码来源:InstrumentManager.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Int16类代码示例发布时间:2022-05-24
下一篇:
C# Instructor类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap