本文整理汇总了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;
}
示例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}");
}
示例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());
}
示例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);
}
}
示例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);
}
示例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;
}
示例7: Leg
public Leg(Instrument instrument, double weight = 1.0)
{
this.instrument = instrument;
Weight = weight;
InstrumentId = instrument.Id;
this.framework = instrument.Framework;
}
示例8: TestItemOnAV
public TestItemOnAV(Instrument.SwitchSetting ss,
string channelID)
: base(ss)
{
this.ChannelID = channelID;
this.Values = new List<string>();
}
示例9: InstrumentNode
public InstrumentNode(Instrument instrument)
{
eX4XcIhHpDXt70u2x3N.k8isAcYzkUOGF();
// ISSUE: explicit constructor call
base.\u002Ector(instrument.Symbol, 1, 1);
this.ijdxXmDIwH = instrument;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
}
}
示例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);
}
示例15: PriceDataService
public PriceDataService(Instrument instrument, TimeFrame timeframe, DateTime startDate, DateTime endDate)
{
_instrument = instrument;
_timeframe = timeframe;
_startDate = startDate;
_endDate = endDate;
}