本文整理汇总了C#中Vector.Get方法的典型用法代码示例。如果您正苦于以下问题:C# Vector.Get方法的具体用法?C# Vector.Get怎么用?C# Vector.Get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Vector
的用法示例。
在下文中一共展示了Vector.Get方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetTest
public void GetTest()
{
Vector<int> intVector = new Vector<int>(new int[] { 1, 1, 1, 1, 1, 10 }, 0, 6);
Assert.IsTrue(intVector.Get(0) == 1, "0");
Assert.IsTrue(intVector.Get(5) == 10, "10");
}
示例2: Slide
private Notes _notes; // usermodel needs to Set this
/**
* Constructs a Slide from the Slide record, and the SlideAtomsSet
* Containing the text.
* Initialises TextRuns, to provide easier access to the text
*
* @param slide the Slide record we're based on
* @param notes the Notes sheet attached to us
* @param atomSet the SlideAtomsSet to Get the text from
*/
public Slide(NPOI.HSLF.record.Slide slide, Notes notes, SlideAtomsSet atomSet, int slideIdentifier, int slideNumber) {
base(slide, slideIdentifier);
_notes = notes;
_atomSet = atomSet;
_slideNo = slideNumber;
// Grab the TextRuns from the PPDrawing
TextRun[] _otherRuns = FindTextRuns(getPPDrawing());
// For the text coming in from the SlideAtomsSet:
// Build up TextRuns from pairs of TextHeaderAtom and
// one of TextBytesAtom or TextCharsAtom
Vector textRuns = new Vector();
if(_atomSet != null) {
FindTextRuns(_atomSet.GetSlideRecords(),textRuns);
} else {
// No text on the slide, must just be pictures
}
// Build an array, more useful than a vector
_Runs = new TextRun[textRuns.Count+_otherRuns.Length];
// Grab text from SlideListWithTexts entries
int i=0;
for(i=0; i<textRuns.Count; i++) {
_Runs[i] = (TextRun)textRuns.Get(i);
_Runs[i].SetSheet(this);
}
// Grab text from slide's PPDrawing
for(int k=0; k<_otherRuns.Length; i++, k++) {
_Runs[i] = _otherRuns[k];
_Runs[i].SetSheet(this);
}
}
示例3: FindTextRuns
/**
* For a given PPDrawing, grab all the TextRuns
*/
public static TextRun[] FindTextRuns(PPDrawing ppdrawing) {
Vector RunsV = new Vector();
EscherTextboxWrapper[] wrappers = ppdrawing.GetTextboxWrappers();
for (int i = 0; i < wrappers.Length; i++) {
int s1 = RunsV.Count;
// propagate parents to parent-aware records
RecordContainer.handleParentAwareRecords(wrappers[i]);
FindTextRuns(wrappers[i].GetChildRecords(), RunsV);
int s2 = RunsV.Count;
if (s2 != s1){
TextRun t = (TextRun) RunsV.Get(RunsV.Count-1);
t.SetShapeId(wrappers[i].GetShapeId());
}
}
TextRun[] Runs = new TextRun[RunsV.Count];
for (int i = 0; i < Runs.Length; i++) {
Runs[i] = (TextRun) RunsV.Get(i);
}
return Runs;
}
示例4: PutTest
public void PutTest()
{
Vector<int> intVector = new Vector<int>(new int[] { 1, 1, 1, 1, 1, 10 }, 0, 6);
intVector.Put(0, 20);
Assert.IsTrue(intVector.Get(0) == 20);
}