當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。