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


C# Assignment类代码示例

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


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

示例1: AddAssignmentGroup

    //添加对应的作业-组信息
    protected void AddAssignmentGroup(Control topctrl, Assignment EditAssignment, int assignmentID)
    {
        foreach (Control c in topctrl.Controls)
        {
            if (c.GetType().ToString().Equals("System.Web.UI.WebControls.CheckBoxList"))
            {
                CheckBoxList cb = (CheckBoxList)c;

                //从1开始,因为第0项是班级
                for (int i = 1; i < cb.Items.Count; i++)
                {
                    if (cb.Items[i].Selected == true)
                    {
                        //new AssignmentGroupInfo对象
                        AssignmentGroupInfo newAssignmentGroupInfo = new AssignmentGroupInfo();
                        //初始化newAssignmentGroupInfo
                        newAssignmentGroupInfo.IAssignmentId = assignmentID;
                        //Items[i].Value保存的是组的ID,这是在动态生成的时候绑定的
                        newAssignmentGroupInfo.IGroupId = Convert.ToInt32(cb.Items[i].Value);
                        newAssignmentGroupInfo.INewMsgNum = 0;
                        newAssignmentGroupInfo.IState = 0;
                        //添加相应的组
                        EditAssignment.AddAssignmentGroup(newAssignmentGroupInfo);
                    }
                }
            }
            if (c.HasControls())
            {
                AddAssignmentGroup(c, EditAssignment, assignmentID);
            }
        }
    }
开发者ID:dalinhuang,项目名称:my-project-step,代码行数:33,代码来源:AssignmentEdit.aspx.cs

示例2: FinalizeAssignment

    /// <summary>
    /// Saves the assignment data in a hashtable and creates a new assignment and adds it to the AssignmentObject.
    /// </summary>
	public override void FinalizeAssignment () {
		Hashtable h = new Hashtable ();
		h.Add ("photosNeeded", Int32.Parse(assignmentMaker.typeInputField.text));
		h.Add ("missionDescription", assignmentMaker.descriptionField.text + ". " + assignmentMaker.assignmentExplanation.text);
		Assignment newCameraAssignment = new Assignment (0,"Camera", h);
		assignmentMaker.assignmentObject.AddAssignment(newCameraAssignment);
	}
开发者ID:Solestis,项目名称:SpyGameUnity5,代码行数:10,代码来源:CameraAssignmentConfig.cs

示例3: InitAssignment

    /// <summary>
    /// Initializes the assignment by retrieving the active Assignment from MissionControl, then configuring the scene with Assignment data if assignmentState = STATE_NEW.
    /// </summary>
    private void InitAssignment()
    {
        if (MissionControl.pObject.activeMission != null && MissionControl.pObject.activeAssignment != null)
        {
            walkAssignment = MissionControl.pObject.activeMission.activeAssignment;
        }
        else
        {
            print("Creating test assignment");
            walkAssignment = new Assignment(0, "Walk");
            Vector2 newPosition = UnityEngine.Random.insideUnitCircle * 300;
            targetLocation = new Vector3(newPosition.x, 0, newPosition.y);
        }
        if (walkAssignment.assignmentState == Assignment.STATE_NEW)
        {
            object value;
            if (walkAssignment.typeData.TryGetValue("targetLocation", out value))
            {
                targetLocation = (Vector3)value;
                Debug.Log("targetLocation: " + targetLocation);
            }
            else
            {
                Debug.Log("No target location found!");
            }

            walkAssignment.Start();
        }
        targetObject.transform.position = targetLocation;
        background.SetActive(false);
        backgroundGrid.SetActive(true);
    }
开发者ID:Solestis,项目名称:SpyGameUnity5,代码行数:35,代码来源:UIWalkAssignment.cs

示例4: Assignment_SelectAddSelectDeleteSelect_OK

        public void Assignment_SelectAddSelectDeleteSelect_OK()
        {
            using (System.Transactions.TransactionScope updateTransaction =
             new System.Transactions.TransactionScope())
            {
                string connectionString = GetConnectionstring();
                DataAccess d2 = new DataAccess(connectionString);

                List<Assignment> assignmentsBefore = d2.GetAssignments();

                Assignment assignment = new Assignment();
                assignment.AssignmentId = -1;
                assignment.AssignmentName = "asfdasfasdfsaf";

                Assignment assignmentAfterSave = d2.SaveAssignment(assignment);

                Assignment assignmentGetById = d2.GetAssignmentByID(assignment.AssignmentId);

                Assert.AreNotEqual(assignment.AssignmentId, -1);
                Assert.AreEqual(assignment.AssignmentName, assignmentGetById.AssignmentName);

                List<Assignment> assignmentsAfterSave = d2.GetAssignments();

                Assert.AreEqual(assignmentsAfterSave.Count, assignmentsBefore.Count + 1);

                d2.DeleteAssignment(assignment.AssignmentId);

                List<Assignment> assignmentsAfterDelete = d2.GetAssignments();

                Assert.AreEqual(assignmentsBefore.Count, assignmentsAfterDelete.Count);

            }
        }
开发者ID:ruudkok,项目名称:MoCS,代码行数:33,代码来源:DataAccessTests.cs

示例5: ShouldParseSimpleAssignment

 public void ShouldParseSimpleAssignment()
 {
     var assignment = new Assignment(new[] {new Variable("a")},
         new[] {new ConstantExpression(Constants.One)}, false);
     var expected = new StatementBlock(assignment);
     Assert.AreEqual(expected, SyntaxParser.Parse("a = 1"));
 }
开发者ID:DarkWanderer,项目名称:DW.Lua,代码行数:7,代码来源:AssignmentStatementParserTests.cs

示例6: GetTimePhaseData

        /// <summary>
        /// Gets the time phase data.
        /// </summary>
        /// <param name="assignment">The assignment.</param>
        /// <param name="type">The type.</param>
        /// <returns></returns>
        public static IEnumerable<TimePhasedDataType> GetTimePhaseData(Assignment.Assignment assignment, TimePhasedDataType.TimePhaseType type)
        {
            if(assignment == null)
                throw new ArgumentException("assignment");

            //определяем величину дискретизации для генератора интервалов.
            //Если ее определить слишком маленькую то будет много TimePhases елементов
            //Для плоского распределения трудозатрат использовать ДЕНЬ для нелинейных функций использовать ЧАС
            long groupIntervalValue = assignment.CurrentContour.ContourType == ContourTypes.Flat ? CalendarHelper.MilisPerDay() : CalendarHelper.MilisPerHour();

            long start = type == TimePhasedDataType.TimePhaseType.AssignmentActualWork ? assignment.Start : assignment.Stop;
            long stop = type == TimePhasedDataType.TimePhaseType.AssignmentActualWork ? assignment.Stop : assignment.End;
            Query<Interval> query = new Query<Interval>();
            AssignmentBaseFunctor<double> workFunctor = assignment.GetWorkFunctor();

            GroupingIntervalGenerator groupGen = new GroupingIntervalGenerator(start, stop, groupIntervalValue,
                                                                              workFunctor.CountourGenerator);
            TimePhaseDataGetter timePhaseGetter = new TimePhaseDataGetter(type, TimePhasedDataType.TimePhaseUnit.Day,
                                                                          TimePhasedDataType.TimePhaseUnit.Minute, workFunctor);
            WhereInRangePredicate whereInRange = new WhereInRangePredicate(start, stop);

            query.Select(timePhaseGetter).From(groupGen).Where(whereInRange.Evaluate).Execute();

            return timePhaseGetter.Value;
        }
开发者ID:0anion0,项目名称:IBN,代码行数:31,代码来源:TimePhasedService.cs

示例7: ShouldParseMultipleAssignments

 public void ShouldParseMultipleAssignments()
 {
     var assignment = new Assignment(new[] { new Variable("a"), new Variable("b") },
         new[] { new ConstantExpression(Constants.One) }, true);
     var expected = new StatementBlock(assignment);
     Assert.AreEqual(expected, SyntaxParser.Parse("local a,b = 1"));
 }
开发者ID:DarkWanderer,项目名称:DW.Lua,代码行数:7,代码来源:AssignmentStatementParserTests.cs

示例8: AdjustValue

 public void AdjustValue()
 {
     esp = Tmp32("esp");
     CreateSymbolicEvaluator(frame);
     var ass = new Assignment(esp, new BinaryExpression(BinaryOperator.IAdd, esp.DataType, esp, Constant.Word32(4)));
     se.Evaluate(ass);
     Assert.AreEqual("fp + 0x00000004", ctx.TemporaryState[esp.Storage].ToString());
 }
开发者ID:nemerle,项目名称:reko,代码行数:8,代码来源:SymbolicEvaluatorTests.cs

示例9: OnSynchronize

 protected override void OnSynchronize(Assignment delta)
 {
   sum_ = 0;
   for (int index = 0; index < Size(); ++index)
   {
     sum_ += Value(index);
   }
 }
开发者ID:RickOne16,项目名称:or-tools,代码行数:8,代码来源:csls_api.cs

示例10: ShouldParseLocalAssignment

 public void ShouldParseLocalAssignment()
 {
     var assignment = new Assignment(new[] {new Variable("a")},
         new[] {new ConstantExpression(Constants.One)}, true);
     var expected = new StatementBlock(assignment);
     var actual = SyntaxParser.Parse("local a = 1");
     Assert.AreEqual(expected, actual);
 }
开发者ID:DarkWanderer,项目名称:DW.Lua,代码行数:8,代码来源:AssignmentStatementParserTests.cs

示例11: AddAssignment

 internal void AddAssignment(Guid id, Assignment a, string action)
 {
     // Make sure there isn't one already here
     _object.Remove(id);
     _action.Remove(id);
     _object.Add(id, a);
     _action.Add(id, action);
 }
开发者ID:yinqunjun,项目名称:WorkflowFoundation.40.45.Development,代码行数:8,代码来源:PersistAssignment.cs

示例12: FinalizeAssignment

 /// <summary>
 /// Saves the assignment data in a hashtable and creates a new assignment and adds it to the AssignmentObject.
 /// </summary>
 public override void FinalizeAssignment()
 {
     Debug.Log("Finishing Assignment");
     Hashtable h = new Hashtable();
     h.Add("missionDescription", assignmentMaker.descriptionField.text + ". " + assignmentMaker.assignmentExplanation.text);
     Assignment newAssignment = new Assignment(0, "Scan", h);
     assignmentMaker.assignmentObject.AddAssignment(newAssignment);
 }
开发者ID:Solestis,项目名称:SpyGameUnity5,代码行数:11,代码来源:ScanAssignmentConfig.cs

示例13: create

 public bool create(Assignment thisAssignment)
 {
     // ������ҵ
     DataClassesDataContext da = new DataClassesDataContext();
     da.Assignment.InsertOnSubmit(thisAssignment);
     da.SubmitChanges();
     return true;
 }
开发者ID:Chang3,项目名称:HelloWorld2,代码行数:8,代码来源:AssignmentManager.cs

示例14: Test2

 public void Test2()
 {
     BinaryExpression b = m.IAdd(id, m.UMul(id, 5));
     Assignment ass = new Assignment(x, b);
     var rule = new Add_mul_id_c_id_Rule(new SsaEvaluationContext(null, ssaIds));
     Assert.IsTrue(rule.Match(b));
     ass.Src = rule.Transform();
     Assert.AreEqual("x = id *u 0x00000006", ass.ToString());
 }
开发者ID:relaxar,项目名称:reko,代码行数:9,代码来源:Add_id_c_id_Rule.cs

示例15: ShouldParseSequentialAssignments

 public void ShouldParseSequentialAssignments()
 {
     var assignment1 = new Assignment(new[] { new Variable("a") },
         new[] { new ConstantExpression(Constants.One) }, true);
     var assignment2 = new Assignment(new[] { new Variable("b") },
         new[] { new ConstantExpression(Constants.Two) }, true);
     var expected = new StatementBlock(assignment1, assignment2);
     Assert.AreEqual(expected, SyntaxParser.Parse("local a = 1\nlocal b = 2"));
 }
开发者ID:DarkWanderer,项目名称:DW.Lua,代码行数:9,代码来源:AssignmentStatementParserTests.cs


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