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


C# Vector.Get方法代码示例

本文整理汇总了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");
        }
开发者ID:jerviscui,项目名称:DataStructureByCS,代码行数:7,代码来源:VectorTests.cs

示例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);
		}
	}
开发者ID:JnS-Software-LLC,项目名称:npoi,代码行数:45,代码来源:Slide.cs

示例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;
    }
开发者ID:ctddjyds,项目名称:npoi,代码行数:24,代码来源:Sheet.cs

示例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);
        }
开发者ID:jerviscui,项目名称:DataStructureByCS,代码行数:7,代码来源:VectorTests.cs


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