Inheritance: MonoBehaviour
コード例 #1
0
ファイル: YesNoBox.cs プロジェクト: Zhomart/DotNetTerminal
        public void run()
        {
            Console.CursorVisible = false;

            current = YesNo.YES;
            Running = true;

            draw();
            while (Running)
            {
                var key_info = app.readKey();
                var key = key_info.Key;

                if (key == ConsoleKey.Escape) break;

                switch (key)
                {
                    case ConsoleKey.LeftArrow:
                        current = YesNo.YES;
                        drawYesNo();
                        break;
                    case ConsoleKey.RightArrow:
                        current = YesNo.NO;
                        drawYesNo();
                        break;
                    case ConsoleKey.Enter:
                        Running = false;
                        action(key_info);
                        break;
                }

            }
            app.DrawPanels();
            Console.CursorVisible = true;
        }
コード例 #2
0
ファイル: Result.cs プロジェクト: pdg6868/SecurityTool
        public Result(Age a, Sex s, Profession p, Education e, YesNo cit, 
		               List<Technology> tech, Frequency pub, Frequency home,
		               NumPass single, List<PassType> passType, Frequency pChange,
		               YesNo sharePass,YesNo pSecure, YesNo passHome,YesNo pMobile, 
		               YesNo hWifiPass, YesNo hWifiFire, YesNo hVirusSoftware, YesNo softUpdate, 
		               SecureLevel sLevel, SharePersonalInfo postPersonal, Frequency pWifi)
        {
            m_age = a;
            m_sex = s;
            m_profession = p;
            m_education = e;
            m_usCitizen = cit;
            m_technologyList = tech;
            m_publicComputer = pub;
            m_homeComputer = home;
            m_singlePass = single;
            m_passType = passType;
            m_passChangeFreq = pChange;
            m_sharePassword = sharePass;
            m_passSecure = pSecure;
            m_passHomePC = passHome;
            m_passForMobile = pMobile;
            m_homeWifiPass = hWifiPass;
            m_homeWifiFirewall = hWifiFire;
            m_homeVirusSoftware = hVirusSoftware;
            m_softwareUpdates = softUpdate;
            m_securityLevel = sLevel;
            m_postPersonalInfo = postPersonal;
            m_publicWifi = pWifi;
        }
コード例 #3
0
 public static YesNo ReverseYesNo( YesNo yn )
 {
     switch ( yn ) {
         case YesNo.Yes: return YesNo.No;
         case YesNo.No: return YesNo.Yes;
         default: return yn;  //Don't modify the other values.
     }
 }
コード例 #4
0
 public static MarkerEvidence BabyDaddyAsthma( YesNo asthma1, YesNo asthma2 )
 {
     switch ( asthma1 ) {
         /////////////////
         case YesNo.Yes:
             switch ( asthma2 ) {
                 case YesNo.Yes:
                     return MarkerEvidence.Consistent;
                 case YesNo.No:
                     return MarkerEvidence.Unlikely;
                 case YesNo.DoNotKnow:
                 case YesNo.Refusal:
                 case YesNo.InvalidSkip:
                     return MarkerEvidence.Ambiguous;
                 case YesNo.ValidSkipOrNoInterviewOrNotInSurvey:
                     return MarkerEvidence.Missing;
                 default:
                     throw new ArgumentOutOfRangeException("asthma2", asthma2, "The enum value for asthma2 is not recognized.");
             }
         /////////////////
         case YesNo.No:
             switch ( asthma2 ) {
                 case YesNo.Yes:
                     return MarkerEvidence.Unlikely;
                 case YesNo.No:
                     return MarkerEvidence.Consistent;
                 case YesNo.DoNotKnow:
                 case YesNo.Refusal:
                 case YesNo.InvalidSkip:
                     return MarkerEvidence.Ambiguous;
                 case YesNo.ValidSkipOrNoInterviewOrNotInSurvey:
                     return MarkerEvidence.Missing;
                 default:
                     throw new ArgumentOutOfRangeException("asthma2", asthma2, "The enum value for asthma2 is not recognized.");
             }
         /////////////////
         case YesNo.DoNotKnow:
         case YesNo.Refusal:
         case YesNo.InvalidSkip:
             return MarkerEvidence.Ambiguous;
         case YesNo.ValidSkipOrNoInterviewOrNotInSurvey:
             return MarkerEvidence.Missing;
         default:
             throw new ArgumentOutOfRangeException("asthma1", asthma1, "The enum value for asthma1 is not recognized.");
     }
 }
コード例 #5
0
        public FilterObjectFeature(ObjectSearchCriteria criteria, int type)
        {
            InitializeComponent();

            _criteria = criteria;
            _criteriaBindingSource.DataSource = _criteria;

            _yesNo = new YesNo(CheckState.Unchecked, string.Empty, "+", string.Empty);

            _seriesComboBox.DataSource = new Series();
            _pravaComboBox.DataSource = new Prava();
            _flourComboBox.DataSource = new FlourCriteria();
            _balconyComboBox.DataSource = new Balcony();
            _wcComboBox.DataSource = new WCCriteria();
            _objectTypeComboBox.DataSource = new NoresidentObjectType(true);

            switch (type)
            {
                case 1:
                    _electricityheckBox.Visible =
                    _waterCheckBox.Visible =
                    _heatCheckBox.Visible =
                    _mebel2CheckBox.Visible =
                    _pravaLabel.Visible =
                    _pravaComboBox.Visible =
                    _sqLandLabel.Visible =
                    _sqLandTextBox.Visible =
                    _objectTypeLabel.Visible =
                    _objectTypeComboBox.Visible = false;

                    break;
                case 2:
                    _seriesLabel.Visible =
                    _seriesComboBox.Visible =
                    _flourLabel.Visible =
                    _flourComboBox.Visible =
                    _electricityheckBox.Visible =
                    _waterCheckBox.Visible =
                    _heatCheckBox.Visible =
                    _mebel2CheckBox.Visible =
                    label5.Visible =
                    _sqKitchTextBox.Visible =
                    _objectTypeLabel.Visible =
                    _objectTypeComboBox.Visible =
                    _balconyLabel.Visible =
                    _balconyComboBox.Visible = false;
                    break;
                case 3:
                    Utils.VisitChildren(tableLayoutPanel1, delegate(Control ctl)
                    {
                        ctl.Visible = false;
                    });
                    _sqLandLabel.Visible =
                    _sqLandTextBox.Visible =
                    _pravaLabel.Visible =
                    _pravaComboBox.Visible = true;
                    break;
                default:
                    _seriesLabel.Visible =
                    _seriesComboBox.Visible =
                    _flourLabel.Visible =
                    _flourComboBox.Visible =
                    _balconyLabel.Visible =
                    _balconyComboBox.Visible =
                    label1.Visible =
                    _flatsTextBox.Visible =
                    label12.Visible =
                    _sqHomeTextBox.Visible =
                    label5.Visible =
                    _sqKitchTextBox.Visible =
                    label8.Visible =
                    _wcComboBox.Visible = false;
                    break;
            }

            Utils.VisitChildren(this, delegate(Control ctl)
                                                  {
                                                      if (ctl.DataBindings.Count == 0)
                                                          return;

                                                      Binding binding = ctl.DataBindings[0];

                                                      object o = typeof(ObjectSearchCriteria).GetProperty(binding.BindingMemberInfo.BindingMember).GetValue(_criteria, null);

                                                      if ((o as ICriteria) == null) return;
                                                      {
                                                          ctl.DataBindings.Remove(binding);
                                                          ctl.DataBindings.Add(new Binding(binding.PropertyName, binding.DataSource
                                                                                           , string.Concat(binding.BindingMemberInfo.BindingMember, ".Value"), binding.FormattingEnabled
                                                                                           , binding.DataSourceUpdateMode, binding.NullValue));
                                                      }
                                                  });
        }
コード例 #6
0
 /// <summary>
 /// Sets the value of the <c>&lt;SIF_MorePackets&gt;</c> element.
 /// </summary>
 /// <param name="val">A YesNo object</param>
 /// <remarks>
 /// <para>The SIF specification defines the meaning of this element as: "This element provides an indication as to whether there are more packets besides this one to make up a complete response."</para>
 /// <para>Version: 2.6</para>
 /// <para>Since: 1.1</para>
 /// </remarks>
 public void SetSIF_MorePackets(YesNo val)
 {
     SetField(InfraDTD.SIF_RESPONSE_SIF_MOREPACKETS, val);
 }
コード例 #7
0
ファイル: SIF_SIFNode.cs プロジェクト: rubitek/OpenADK-csharp
 /// <summary>
 /// Constructor that accepts values for all mandatory fields
 /// </summary>
 ///<param name="type">The type of node ("Agent" or "ZIS")</param>
 ///<param name="sifName">The descriptive name of the SIF node (i.e. Ramsey Food Services).</param>
 ///<param name="sifSourceId">The agent or ZIS identifier. This is the same value that the SIF node would place in any SIF_Header that it would create.</param>
 ///<param name="sifMode">Specifies the communication mode (Pull or Push) as chosen by the message sender.</param>
 ///<param name="sifMaxBufferSize">Specifies that the ZIS should never send packets larger than this value. Query responses from other providers are controlled by the SIF_MaxBufferSize attribute in the SIF_Request message.</param>
 ///<param name="sifSleeping">This element shows whether the SIF node is ready to process messages.</param>
 ///
 public SIF_SIFNode(SIF_SIFNodeType type, string sifName, string sifSourceId, SIFMode sifMode, int?sifMaxBufferSize, YesNo sifSleeping) : base(InfraDTD.SIF_SIFNODE)
 {
     this.SetType(type);
     this.SIF_Name     = sifName;
     this.SIF_SourceId = sifSourceId;
     this.SetSIF_Mode(sifMode);
     this.SIF_MaxBufferSize = sifMaxBufferSize;
     this.SetSIF_Sleeping(sifSleeping);
 }
コード例 #8
0
        /// <summary>
        ///     On No click
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void cancelBtn_Click(object sender, EventArgs e)
        {
            yesno = YesNo.No;

            Close();
        }
コード例 #9
0
ファイル: Sample03.cs プロジェクト: lanicon/iPdfWriter
        // Generates document
        public static void Generate(ILogger logger, YesNo useTestMode = YesNo.No)
        {
            #region Initialize timer
            var sw = new Stopwatch();
            sw.Start();
            #endregion

            #region page-1

            var page1 = new PdfInput
            {
                AutoUpdateChanges = true,
                Input             = "~/Resources/Sample-03/file-sample-1.pdf"
            };

            // Inserts report title
            page1.Replace(new ReplaceText(
                              new WithTextObject
            {
                Text           = "#TITLE#",
                NewText        = "Lorem ipsum",
                UseTestMode    = useTestMode,
                TextOffset     = PointF.Empty,
                Style          = TextStylesTable["ReportTitle"],
                ReplaceOptions = ReplaceTextOptions.AccordingToMargins
            }));


            // Inserts bar-chart image
            using (var barGraph = PdfImage.FromFile("~/Resources/Sample-03/Images/bar-chart.png"))
            {
                page1.Replace(new ReplaceText(
                                  new WithImageObject
                {
                    Text           = "#BAR-CHART#",
                    UseTestMode    = useTestMode,
                    ImageOffset    = PointF.Empty,
                    Style          = ImagesStylesTable["Default"],
                    ReplaceOptions = ReplaceTextOptions.AccordingToMargins,
                    Image          = barGraph
                }));
            }

            #endregion

            #region page-2

            var page2 = new PdfInput
            {
                AutoUpdateChanges = true,
                Input             = "~/Resources/Sample-03/file-sample-2.pdf"
            };

            // Inserts html table
            page2.Replace(new ReplaceText(
                              new WithTableObject
            {
                Text           = "#DATA-TABLE#",
                UseTestMode    = useTestMode,
                TableOffset    = PointF.Empty,
                Style          = PdfTableStyle.Default,
                ReplaceOptions = ReplaceTextOptions.FromPositionToRightMargin,
                Table          = PdfTable.CreateFromHtml(GenerateHtmlDatatable(), config: new PdfTableConfig {
                    HeightStrategy = TableHeightStrategy.Exact
                })
            }));

            #endregion

            #region page-3

            var page3 = new PdfInput
            {
                AutoUpdateChanges = true,
                Input             = "~/Resources/Sample-03/file-sample-3.pdf"
            };

            #endregion

            #region page-4

            var page4 = new PdfInput
            {
                AutoUpdateChanges = true,
                Input             = "~/Resources/Sample-03/file-sample-4.pdf"
            };

            // Inserts image
            using (var image = PdfImage.FromFile("~/Resources/Sample-03/Images/image-1.jpg"))
            {
                page4.Replace(new ReplaceText(
                                  new WithImageObject
                {
                    Text           = "#IMAGE1#",
                    UseTestMode    = useTestMode,
                    ImageOffset    = PointF.Empty,
                    Style          = ImagesStylesTable["Center"],
                    ReplaceOptions = ReplaceTextOptions.AccordingToMargins,
                    Image          = image
                }));
            }

            #endregion

            #region merge

            var files = new PdfObject
            {
                Items = new List <PdfInput>
                {
                    new PdfInput {
                        Index = 0, Input = page1
                    },
                    new PdfInput {
                        Index = 1, Input = page2
                    },
                    new PdfInput {
                        Index = 2, Input = page3
                    },
                    new PdfInput {
                        Index = 3, Input = page4
                    },
                }
            };

            var mergeResult = files.TryMergeInputs();
            if (!mergeResult.Success)
            {
                logger.Info("   > Error creating merge result");
                logger.Info($"     > Error: {mergeResult.Errors.AsMessages().ToStringBuilder()}");
                return;
            }

            #endregion

            #region save

            var saveResult = mergeResult.Result.Action(new SaveToFile {
                OutputPath = "~/Output/Sample03/Sample-03"
            });
            var ts = sw.Elapsed;
            sw.Stop();

            if (!saveResult.Success)
            {
                logger.Info("   > Error while saving to disk");
                logger.Info($"     > Error: {saveResult.Errors.AsMessages().ToStringBuilder()}");
                logger.Info($"   > Elapsed time: { ts.Hours:00}:{ ts.Minutes:00}:{ ts.Seconds:00}.{ ts.Milliseconds / 10:00}");
                return;
            }

            logger.Info("   > Saved to disk correctly");
            logger.Info("     > Path: ~/Output/Sample03/Sample-03.pdf");
            logger.Info($"   > Elapsed time: { ts.Hours:00}:{ ts.Minutes:00}:{ ts.Seconds:00}.{ ts.Milliseconds / 10:00}");

            #endregion
        }
コード例 #10
0
ファイル: EventScore.cs プロジェクト: mnedelman/scorer
        public ScoreInfo ScoreTree(bool zero)
        {
            if (zero) {
            TreePos = YesNo.No;
            TreeUpright = YesNo.No;
            }
            if (TreePos == YesNo.Unknown)
            return new ScoreInfo("Input required: Tree branch closer to mat than cables?");
            if (TreeUpright == YesNo.Unknown)
            return new ScoreInfo("Input required: Tree and cables upright and touching mat?");

            if (TreePos == YesNo.Yes && TreeUpright == YesNo.Yes) return new ScoreInfo(30);
            return new ScoreInfo(0);
        }
コード例 #11
0
        //private static YesNo DetermineBiodadAsthma ( Int16 surveyYear, Int32 motherTag, byte childLoopIndex, LinksDataSet.tblResponseDataTable dtMother ) {
        //   if ( SurveyYears.FatherOfGen2Asthma.Contains(surveyYear) ) {
        //      const Item item = Item.FatherOfGen2HasAsthmaGen1;
        //      Int32? response = Retrieve.ResponseNullPossible(surveyYear, item, motherTag, childLoopIndex, dtMother);
        //      if ( response.HasValue )
        //         return (YesNo)response;
        //      else
        //         return YesNo.ValidSkipOrNoInterviewOrNotInSurvey;
        //   }
        //   else {
        //      return YesNo.ValidSkipOrNoInterviewOrNotInSurvey;
        //   }
        //}
        private void AddRow( Int32 subjectTag, Int16 surveyYear, YesNo biodadInHH, YesNo biodadAlive, Int16? biodadDistanceFromHH, YesNo biodadAsthma )
        {
            lock ( _ds.tblFatherOfGen2 ) {
                LinksDataSet.tblFatherOfGen2Row drNew = _ds.tblFatherOfGen2.NewtblFatherOfGen2Row();
                drNew.SubjectTag = subjectTag;
                drNew.SurveyYear = surveyYear;
                drNew.BiodadInHH = (Int16)biodadInHH;
                drNew.BiodadAlive = (Int16)biodadAlive;

                if ( biodadDistanceFromHH.HasValue ) drNew.BiodadDistanceFromHH = biodadDistanceFromHH.Value;
                else drNew.SetBiodadDistanceFromHHNull();

                drNew.BiodadAsthma = (Int16)biodadAsthma;

                _ds.tblFatherOfGen2.AddtblFatherOfGen2Row(drNew);
            }
        }
コード例 #12
0
 /// <summary>
 /// Constructor that accepts values for all mandatory fields
 /// </summary>
 ///<param name="reportDate">Date that report snapshot was generated</param>
 ///<param name="schoolYear">School year for which the information is applicable, expressed as the four-digit year in which the school year ends (e.g., "2004" for the 2003-04 school year).</param>
 ///<param name="stateProvinceId">State assigned reporting unit number</param>
 ///<param name="ssn">Employee social security number</param>
 ///<param name="name">Name of employee.</param>
 ///<param name="race">Primary employee's race</param>
 ///<param name="certifications">Employee certification area information</param>
 ///<param name="salary">Employee's salary</param>
 ///<param name="status">A Status</param>
 ///<param name="leave">Is this employee on leave this year?</param>
 ///<param name="totalYears">Total number of years employee has been in a professional position</param>
 ///<param name="unitYears">Total number of years at current LEA</param>
 ///<param name="education">Highest level of education attained by employee.</param>
 ///
 public EmployeeCredential(DateTime?reportDate, int?schoolYear, string stateProvinceId, string ssn, Name name, RaceType race, Certifications certifications, MonetaryAmount salary, EmploymentStatus status, YesNo leave, decimal?totalYears, decimal?unitYears, TeachingCredentialBasis education) : base(Adk.SifVersion, ProfdevDTD.EMPLOYEECREDENTIAL)
 {
     this.ReportDate      = reportDate;
     this.SchoolYear      = schoolYear;
     this.StateProvinceId = stateProvinceId;
     this.SSN             = ssn;
     this.Name            = name;
     this.SetRace(race);
     this.Certifications = certifications;
     this.Salary         = salary;
     this.SetStatus(status);
     this.SetLeave(leave);
     this.TotalYears = totalYears;
     this.UnitYears  = unitYears;
     this.SetEducation(education);
 }
コード例 #13
0
 /// <summary>
 /// Sets the value of the <c>&lt;AtCurrentSchool&gt;</c> element.
 /// </summary>
 /// <param name="val">A YesNo object</param>
 /// <remarks>
 /// <para>The SIF specification defines the meaning of this element as: "Indicates if the learner has ever been in care while at this school. CBDS: 100040"</para>
 /// <para>Version: 2.6</para>
 /// <para>Since: 2.0</para>
 /// </remarks>
 public void SetAtCurrentSchool(YesNo val)
 {
     SetField(LearnerDTD.INCARE_ATCURRENTSCHOOL, val);
 }
コード例 #14
0
 /// <summary>
 /// Sets the value of the <c>&lt;Hispanic&gt;</c> element.
 /// </summary>
 /// <param name="val">A YesNo object</param>
 /// <remarks>
 /// <para>The SIF specification defines the meaning of this element as: "Is this employee Hispanic or Latino?"</para>
 /// <para>Version: 2.6</para>
 /// <para>Since: 1.5r1</para>
 /// </remarks>
 public void SetHispanic(YesNo val)
 {
     SetField(ProfdevDTD.EMPLOYEECREDENTIAL_HISPANIC, val);
 }
コード例 #15
0
 /// <summary>
 /// Sets the value of the <c>&lt;Leave&gt;</c> element.
 /// </summary>
 /// <param name="val">A YesNo object</param>
 /// <remarks>
 /// <para>The SIF specification defines the meaning of this element as: "Is this employee on leave this year?"</para>
 /// <para>Version: 2.6</para>
 /// <para>Since: 1.5r1</para>
 /// </remarks>
 public void SetLeave(YesNo val)
 {
     SetField(ProfdevDTD.EMPLOYEECREDENTIAL_LEAVE, val);
 }
コード例 #16
0
 private void InitViewBag(Brand info)
 {
     ViewBag.YseNoList =
         new SelectList(YesNo.GetAll(), "value", "Text", info?.Activate);
 }
コード例 #17
0
 /// <summary>
 /// Sets the value of the <c>&lt;Appeal&gt;</c> element.
 /// </summary>
 /// <param name="val">A YesNo object</param>
 /// <remarks>
 /// <para>The SIF specification defines the meaning of this element as: "Is there an appeal against permanent exclusion? CBDS: 100094"</para>
 /// <para>Version: 2.6</para>
 /// <para>Since: 2.0</para>
 /// </remarks>
 public void SetAppeal(YesNo val)
 {
     SetField(LearnerDTD.LEARNEREXCLUSION_APPEAL, val);
 }
コード例 #18
0
ファイル: Language.cs プロジェクト: rubitek/OpenADK-csharp
 /// <summary>
 /// Sets the value of the <c>&lt;StudyOther&gt;</c> element.
 /// </summary>
 /// <param name="val">A YesNo object</param>
 /// <remarks>
 /// <para>The SIF specification defines the meaning of this element as: "Indicates whether the learner studies subjects in this language at school separate from studying the language itself. SOURCE: 190054, P163"</para>
 /// <para>Version: 2.6</para>
 /// <para>Since: 2.0</para>
 /// </remarks>
 public void SetStudyOther(YesNo val)
 {
     SetField(CommonDTD.LANGUAGE_STUDYOTHER, val);
 }
コード例 #19
0
ファイル: Language.cs プロジェクト: rubitek/OpenADK-csharp
 /// <summary>
 /// Sets the value of the <c>&lt;Fluent&gt;</c> element.
 /// </summary>
 /// <param name="val">A YesNo object</param>
 /// <remarks>
 /// <para>The SIF specification defines the meaning of this element as: "Indicates that the person is fluent in this language. SOURCE: 190050"</para>
 /// <para>Version: 2.6</para>
 /// <para>Since: 2.0</para>
 /// </remarks>
 public void SetFluent(YesNo val)
 {
     SetField(CommonDTD.LANGUAGE_FLUENT, val);
 }
コード例 #20
0
 /// <summary>
 /// Sets the value of the <c>&lt;PersonalEducationPlan&gt;</c> element.
 /// </summary>
 /// <param name="val">A YesNo object</param>
 /// <remarks>
 /// <para>The SIF specification defines the meaning of this element as: "Indicates if the learner in care has a personal education plan. CBDS: 100041"</para>
 /// <para>Version: 2.6</para>
 /// <para>Since: 2.0</para>
 /// </remarks>
 public void SetPersonalEducationPlan(YesNo val)
 {
     SetField(LearnerDTD.INCARE_PERSONALEDUCATIONPLAN, val);
 }
コード例 #21
0
ファイル: EventScore.cs プロジェクト: mnedelman/scorer
        public ScoreInfo ScoreRunway(bool zero)
        {
            if (zero) {
            Runway = YesNo.No;
            }
            if (Runway == YesNo.Unknown)
            return new ScoreInfo("Input required: Nothing touching runway except waves/plane?");

            if (Runway == YesNo.Yes) return new ScoreInfo(30);
            return new ScoreInfo(0);
        }
コード例 #22
0
 ///<summary>Adds the value of the <c>&lt;ScheduleInfoOverride&gt;</c> element.</summary>
 /// <param name="Override">Designates whether or not scheduling information has been overridden with different values for this student.</param>
 /// <param name="TermInfoRefId">The ID (GUID) of the term to which this override information relates for this student.</param>
 ///<remarks>
 /// <para>This form of <c>setScheduleInfoOverride</c> is provided as a convenience method
 /// that is functionally equivalent to the method <c>AddScheduleInfoOverride</c></para>
 /// <para>Version: 2.6</para>
 /// <para>Since: 1.1</para>
 /// </remarks>
 public void AddScheduleInfoOverride(YesNo Override, string TermInfoRefId)
 {
     AddChild(StudentDTD.SCHEDULEINFOOVERRIDELIST_SCHEDULEINFOOVERRIDE, new ScheduleInfoOverride(Override, TermInfoRefId));
 }
コード例 #23
0
ファイル: EventScore.cs プロジェクト: mnedelman/scorer
        public ScoreInfo ScoreWaves(bool zero)
        {
            if (zero) {
            Waves = YesNo.No;
            }
            if (Waves == YesNo.Unknown)
            return new ScoreInfo("Input required: Three waves touching mat?");

            if (Waves == YesNo.Yes) return new ScoreInfo(20);
            return new ScoreInfo(0);
        }
コード例 #24
0
        private void AddRow( Int32 subjectTag, byte childLoopIndex, Int16 surveyYear, YesNo biodadInHH, YesNo biodadAlive, YesNo biodadEverLiveInHH, DateTime? biodadLeftHHDate, DateTime? biodadDeathDate, Int16? biodadDistanceFromHH, YesNo biodadAsthma )
        {
            lock ( _ds.tblBabyDaddy ) {
                LinksDataSet.tblBabyDaddyRow drNew = _ds.tblBabyDaddy.NewtblBabyDaddyRow();
                drNew.SubjectTag = subjectTag;
                drNew.ChildLoopIndex = childLoopIndex;
                drNew.SurveyYear = surveyYear;
                drNew.BiodadInHH = (Int16)biodadInHH;
                drNew.BiodadAlive = (Int16)biodadAlive;
                drNew.BiodadEverLiveInHH = (Int16)biodadEverLiveInHH;

                if ( biodadLeftHHDate.HasValue ) drNew.BiodadLeftHHDate = biodadLeftHHDate.Value;
                else drNew.SetBiodadLeftHHDateNull();

                if ( biodadDeathDate.HasValue ) drNew.BiodadDeathDate = biodadDeathDate.Value;
                else drNew.SetBiodadDeathDateNull();

                if ( biodadDistanceFromHH.HasValue ) drNew.BiodadDistanceFromHH = biodadDistanceFromHH.Value;
                else drNew.SetBiodadDistanceFromHHNull();

                drNew.BiodadAsthma = (Int16)biodadAsthma;

                _ds.tblBabyDaddy.AddtblBabyDaddyRow(drNew);
            }
        }
コード例 #25
0
 public static Tristate TranslateYesNo( YesNo yn )
 {
     switch ( yn ) {
         case YesNo.Yes: return  Tristate.Yes;
         case YesNo.No: return Tristate.No;
         default: return Tristate.DoNotKnow;
     }
 }
コード例 #26
0
 public void TestValueYesNoException()
 {
     YesNo val = ValueYesNo;
 }
コード例 #27
0
 /// <summary>
 /// Sets the value of the <c>&lt;CoreAcademicCourse&gt;</c> element.
 /// </summary>
 /// <param name="val">A YesNo object</param>
 /// <remarks>
 /// <para>The SIF specification defines the meaning of this element as: "Does the course meet the state definition of a core academic course?"</para>
 /// <para>Version: 2.6</para>
 /// <para>Since: 1.5r1</para>
 /// </remarks>
 public void SetCoreAcademicCourse(YesNo val)
 {
     SetField(StudentDTD.SCHOOLCOURSEINFO_COREACADEMICCOURSE, val);
 }
コード例 #28
0
        /// <summary>
        /// Gets an enumerator to a list of fields that has visible headers.
        /// </summary>
        /// <param name="visibleHeaders">Table position</param>
        /// <returns>
        /// Enumerator that contains list of fields that has visible headers.
        /// </returns>
        public IEnumerable <BaseDataFieldModel> GetRange(YesNo visibleHeaders)
        {
            SentinelHelper.IsEnumValid(visibleHeaders);

            return(this.Where(field => field.Header.Show == YesNo.Yes).ToList());
        }
コード例 #29
0
        // Generates document
        public static void Generate(ILogger logger, YesNo useTestMode = YesNo.No)
        {
            #region Initialize timer
            var sw = new Stopwatch();
            sw.Start();
            #endregion

            #region page-1

            var page1 = new PdfInput
            {
                AutoUpdateChanges = true,
                Input             = "~/Resources/Sample-06/file-sample-1.pdf"
            };

            // Inserts report title
            page1.Replace(new ReplaceText(
                              new WithTextObject
            {
                Text           = "#TITLE#",
                NewText        = "Lorem ipsum",
                UseTestMode    = useTestMode,
                TextOffset     = PointF.Empty,
                Style          = TextStylesTable["ReportTitle"],
                ReplaceOptions = ReplaceTextOptions.AccordingToMargins
            }));


            // Inserts bar-chart image
            using (var barGraph = PdfImage.FromFile("~/Resources/Sample-06/Images/bar-chart.png"))
            {
                page1.Replace(new ReplaceText(
                                  new WithImageObject
                {
                    Text           = "#BAR-CHART#",
                    UseTestMode    = useTestMode,
                    ImageOffset    = PointF.Empty,
                    Style          = PdfImageStyle.Center,
                    ReplaceOptions = ReplaceTextOptions.AccordingToMargins,
                    Image          = barGraph
                }));
            }

            #endregion

            #region page-2

            var page2 = new PdfInput
            {
                AutoUpdateChanges = true,
                Input             = "~/Resources/Sample-06/file-sample-2.pdf"
            };

            // Inserts html table
            page2.Replace(new ReplaceText(
                              new WithTableObject
            {
                Text           = "#DATA-TABLE#",
                UseTestMode    = useTestMode,
                TableOffset    = PointF.Empty,
                Style          = PdfTableStyle.Default,
                ReplaceOptions = ReplaceTextOptions.FromPositionToNextElement,
                Table          = PdfTable.CreateFromHtml(GenerateHtmlDatatable(), config: new PdfTableConfig {
                    HeightStrategy = TableHeightStrategy.Exact
                })
            }));

            #endregion

            #region page-3

            var page3 = new PdfInput
            {
                AutoUpdateChanges = true,
                Input             = "~/Resources/Sample-06/file-sample-3.pdf"
            };

            #endregion

            #region page-4

            var page4 = new PdfInput
            {
                AutoUpdateChanges = true,
                Input             = "~/Resources/Sample-06/file-Sample-4.pdf"
            };

            // Inserts image
            using (var image = PdfImage.FromFile("~/Resources/Sample-06/Images/image-1.jpg"))
            {
                page4.Replace(new ReplaceText(
                                  new WithImageObject
                {
                    Text           = "#IMAGE1#",
                    UseTestMode    = useTestMode,
                    ImageOffset    = PointF.Empty,
                    Style          = PdfImageStyle.Default,
                    ReplaceOptions = ReplaceTextOptions.AccordingToMargins,
                    Image          = image
                }));
            }

            #endregion

            #region merge

            // Defines system tags to replace > page number
            var systemTags = new SystemTagsCollection
            {
                new PageNumberSystemTag
                {
                    UseTestMode    = useTestMode,
                    TextOffset     = PointF.Empty,
                    Style          = TextStylesTable["PageNumber"],
                    ReplaceOptions = ReplaceTextOptions.FromPositionToRightMargin
                }
            };

            // Defines global text replacements to replace > header text
            var globalReplacements = new GlobalReplacementsCollection
            {
                new WithTextObject
                {
                    Text           = "#HEADER-TEXT#",
                    NewText        = "Report Name - Lorem ipsum dolor",
                    Style          = TextStylesTable["Header"],
                    ReplaceOptions = ReplaceTextOptions.FromLeftMarginToNextElement,
                    UseTestMode    = useTestMode,
                    TextOffset     = PointF.Empty
                }
            };

            // Defines merge configuration, includes tags, global replacements and allow compress the merged output
            var files = new PdfObject(new PdfObjectConfig {
                Tags = systemTags, GlobalReplacements = globalReplacements
            })
            {
                Items = new List <PdfInput>
                {
                    new PdfInput {
                        Index = 0, Input = page1
                    },
                    new PdfInput {
                        Index = 1, Input = page2
                    },
                    new PdfInput {
                        Index = 2, Input = page3
                    },
                    new PdfInput {
                        Index = 3, Input = page4
                    },
                }
            };

            var mergeResult = files.TryMergeInputs();
            if (!mergeResult.Success)
            {
                logger.Info("   > Error creating output merge result");
                logger.Info($"     > Error: {mergeResult.Errors.AsMessages().ToStringBuilder()}");
                return;
            }

            #endregion

            #region save

            // Saves merged result to disk
            var saveResult = mergeResult.Result.Action(new SaveToFile {
                OutputPath = "~/Output/Sample06/Sample-06"
            });
            var ts = sw.Elapsed;
            sw.Stop();

            if (!saveResult.Success)
            {
                logger.Info("   > Error while saving to disk");
                logger.Info($"     > Error: {saveResult.Errors.AsMessages().ToStringBuilder()}");
                logger.Info($"   > Elapsed time: { ts.Hours:00}:{ ts.Minutes:00}:{ ts.Seconds:00}.{ ts.Milliseconds / 10:00}");
                return;
            }

            logger.Info("   > Saved to disk correctly");
            logger.Info("     > Path: ~/Output/Sample06/Sample-06.pdf");
            logger.Info($"   > Elapsed time: { ts.Hours:00}:{ ts.Minutes:00}:{ ts.Seconds:00}.{ ts.Milliseconds / 10:00}");

            #endregion
        }
コード例 #30
0
ファイル: EventScore.cs プロジェクト: mnedelman/scorer
        public ScoreInfo ScoreAmbulance(bool zero)
        {
            if (zero) {
            Ambulance = YesNo.No;
            }
            if (Ambulance == YesNo.Unknown)
            return new ScoreInfo("Input required: Ambulance in yellow and wheels touch mat?");

            if (Ambulance == YesNo.Yes) return new ScoreInfo(25);
            return new ScoreInfo(0);
        }
コード例 #31
0
ファイル: SIF_SIFNode.cs プロジェクト: rubitek/OpenADK-csharp
 ///<summary>Sets the value of the <c>&lt;SIF_Protocol&gt;</c> element.</summary>
 /// <param name="Type">Identifies the type being used (e.g. "HTTP", "HTTPS", "MSMQ", etc.)</param>
 /// <param name="Secure">Indicates if the protocol provides a secure channel</param>
 ///<remarks>
 /// <para>This form of <c>setSIF_Protocol</c> is provided as a convenience method
 /// that is functionally equivalent to the <c>SIF_Protocol</c></para>
 /// <para>Version: 2.6</para>
 /// <para>Since: 1.1</para>
 /// </remarks>
 public void SetSIF_Protocol(string Type, YesNo Secure)
 {
     RemoveChild(InfraDTD.SIF_SIFNODE_SIF_PROTOCOL);
     AddChild(InfraDTD.SIF_SIFNODE_SIF_PROTOCOL, new SIF_Protocol(Type, Secure));
 }
コード例 #32
0
ファイル: EventScore.cs プロジェクト: mnedelman/scorer
        public ScoreInfo ScoreGray(bool zero)
        {
            if (zero) {
            Gray = YesNo.No;
            }
            if (Gray == YesNo.Unknown)
            return new ScoreInfo("Input required: No gray building units in LT green region?");

            if (Gray == YesNo.Yes) return new ScoreInfo(20);
            return new ScoreInfo(0);
        }
コード例 #33
0
 /// <summary>
 /// Sets the value of the <c>&lt;HispanicLatino&gt;</c> element.
 /// </summary>
 /// <param name="val">A YesNo object</param>
 /// <remarks>
 /// <para>Version: 2.6</para>
 /// <para>Since: 2.2</para>
 /// </remarks>
 public void SetHispanicLatino(YesNo val)
 {
     SetField(AssessmentDTD.ASSESSMENTSTUDENTSNAPSHOT_HISPANICLATINO, val);
 }
コード例 #34
0
ファイル: EventScore.cs プロジェクト: mnedelman/scorer
        public ScoreInfo ScorePink(bool zero)
        {
            if (zero) {
            PinkCount = 0;
            PinkCorrect = YesNo.No;
            }
            if (PinkCount == -1)
            return new ScoreInfo("Input required: # segments in pink region building");
            if (PinkCorrect == YesNo.Unknown)
            return new ScoreInfo("Input required: Building only uses building segments?");

            if (PinkCorrect == YesNo.Yes) return new ScoreInfo(5 * PinkCount);
            return new ScoreInfo(0);
        }
コード例 #35
0
ファイル: TextMatchFilter.cs プロジェクト: flom/caldavclient
 public TextMatchFilter(string value = "", string collation = "i;ascii-casemap", YesNo negateCondition = YesNo.no)
 {
   this.value = value;
   this.collation = collation;
   this.negateCondition = negateCondition;
 }
コード例 #36
0
 /// <summary>
 /// Sets the value of the <c>&lt;GraduationRequirement&gt;</c> element.
 /// </summary>
 /// <param name="val">A YesNo object</param>
 /// <remarks>
 /// <para>The SIF specification defines the meaning of this element as: "Does the state require that the course be completed for graduation?"</para>
 /// <para>This element is known by more than one tag name depending on the version of SIF in use.
 /// The ADK will use the tag names shown below when parsing and rendering elements of this kind.</para>
 /// <list type="table"><listheader><term>Version</term><description>Tag</description></listheader>;
 /// <item><term>2.0 (and greater)</term><description>&lt;GraduationRequirement&gt;</description></item>
 /// </list>
 /// <para>Version: 2.6</para>
 /// <para>Since: 1.5r1</para>
 /// </remarks>
 public void SetGraduationRequirement(YesNo val)
 {
     SetField(StudentDTD.SCHOOLCOURSEINFO_GRADUATIONREQUIREMENT, val);
 }
コード例 #37
0
ファイル: EventScore.cs プロジェクト: mnedelman/scorer
        public ScoreInfo ScoreEvacuation(bool zero)
        {
            if (zero) {
            Evacuation = YesNo.No;
            }
            if (Evacuation == YesNo.Unknown)
            return new ScoreInfo("Input required: Evacuation sign upright and no contact?");

            if (Evacuation == YesNo.Yes) return new ScoreInfo(30);
            return new ScoreInfo(0);
        }
コード例 #38
0
ファイル: Sample07.cs プロジェクト: lanicon/iPdfWriter
        // Generates document
        public static void Generate(ILogger logger, YesNo useTestMode = YesNo.No)
        {
            #region Initialize timer
            var sw = new Stopwatch();
            sw.Start();
            #endregion

            #region Creates pdf file reference

            var doc = new PdfInput
            {
                AutoUpdateChanges = true,
                Input             = "~/Resources/Sample-07/file-sample.pdf"
            };

            #endregion

            #region Replace actions

            // Inserts report title
            doc.Replace(new ReplaceText(
                            new WithTextObject
            {
                Text           = "#TITLE#",
                NewText        = "Lorem ipsum",
                UseTestMode    = useTestMode,
                TextOffset     = PointF.Empty,
                Style          = TextStylesTable["ReportTitle"],
                ReplaceOptions = ReplaceTextOptions.AccordingToMargins
            }));


            // Inserts bar-chart image
            using (var barGraph = PdfImage.FromFile("~/Resources/Sample-07/Images/bar-chart.png"))
            {
                doc.Replace(new ReplaceText(
                                new WithImageObject
                {
                    Text           = "#BAR-CHART#",
                    UseTestMode    = useTestMode,
                    ImageOffset    = PointF.Empty,
                    Style          = ImagesStylesTable["Default"],
                    ReplaceOptions = ReplaceTextOptions.Default,
                    Image          = barGraph
                }));
            }

            // Inserts image
            using (var image = PdfImage.FromFile("~/Resources/Sample-07/Images/image-1.jpg"))
            {
                doc.Replace(new ReplaceText(
                                new WithImageObject
                {
                    Text           = "#IMAGE1#",
                    UseTestMode    = useTestMode,
                    ImageOffset    = PointF.Empty,
                    Style          = ImagesStylesTable["Center"],
                    ReplaceOptions = ReplaceTextOptions.AccordingToMargins,
                    Image          = image
                }));
            }

            #endregion

            #region Create output result

            var result = doc.CreateResult(new OutputResultConfig {
                Filename = "Sample-07.pdf", Zipped = true
            });
            if (!result.Success)
            {
                logger.Info("   > Error creating output result");
                logger.Info($"     > Error: {result.Errors.AsMessages().ToStringBuilder()}");
                return;
            }

            #endregion

            #region Saves output result

            var saveResult = result.Result.Action(new SaveToFile {
                OutputPath = $"~/Output/Sample07/Sample-07"
            });
            var ts = sw.Elapsed;
            sw.Stop();

            if (!saveResult.Success)
            {
                logger.Info("   > Error while saving to disk");
                logger.Info($"     > Error: {saveResult.Errors.AsMessages().ToStringBuilder()}");
                logger.Info($"   > Elapsed time: { ts.Hours:00}:{ ts.Minutes:00}:{ ts.Seconds:00}.{ ts.Milliseconds / 10:00}");
                return;
            }

            logger.Info("   > Saved to disk correctly");
            logger.Info("     > Path: ~/Output/Sample07/Sample-07.zip");
            logger.Info($"   > Elapsed time: { ts.Hours:00}:{ ts.Minutes:00}:{ ts.Seconds:00}.{ ts.Milliseconds / 10:00}");

            #endregion
        }
コード例 #39
0
ファイル: EventScore.cs プロジェクト: mnedelman/scorer
        public ScoreInfo ScoreHouse(bool zero)
        {
            if (zero) {
            House = YesNo.No;
            }
            if (House == YesNo.Unknown)
            return new ScoreInfo("Input required: House locked in high position?");

            if (House == YesNo.Yes) return new ScoreInfo(25);
            return new ScoreInfo(0);
        }
コード例 #40
0
ファイル: MultipleRest.cs プロジェクト: nanase/MusicXMLUtils
 public MultipleRest(string value, YesNo useSymbols)
 {
     this.Value = value;
     this.UseSymbols = useSymbols;
     this.UseSymbolsSpecified = true;
 }
コード例 #41
0
ファイル: EventScore.cs プロジェクト: mnedelman/scorer
        public ScoreInfo ScoreRobot(bool zero)
        {
            if (zero) {
            Robot = YesNo.No;
            }
            if (Robot == YesNo.Unknown)
            return new ScoreInfo("Input required: Robot in red region?");

            if (Robot == YesNo.Yes) return new ScoreInfo(25);
            return new ScoreInfo(0);
        }
コード例 #42
0
ファイル: WithTableObject.cs プロジェクト: lanicon/iPdfWriter
        private static ReplaceResult ReplaceImpl(IInput context, Stream input, string oldText, ReplaceTextOptions options, PdfTable table, float fixedWidth, PointF tableOffset, PdfTableStyle style, YesNo useTestMode)
        {
            var outputStream = new MemoryStream();

            try
            {
                using (var reader = new PdfReader(input))
                    using (var stamper = new PdfStamper(reader, outputStream))
                    {
                        var pages = reader.NumberOfPages;
                        for (var page = 1; page <= pages; page++)
                        {
                            var strategy = new CustomLocationTextExtractionStrategy();
                            var cb       = stamper.GetOverContent(page);

                            // Send some data contained in PdfContentByte, looks like the first is always cero for me and the second 100,
                            // but i'm not sure if this could change in some cases.
                            strategy.UndercontentCharacterSpacing  = cb.CharacterSpacing;
                            strategy.UndercontentHorizontalScaling = cb.HorizontalScaling;

                            // It's not really needed to get the text back, but we have to call this line ALWAYS,
                            // because it triggers the process that will get all chunks from PDF into our strategy Object
                            var allStrings   = PdfTextExtractor.GetTextFromPage(reader, page, strategy);
                            var stringsArray = allStrings.Split(new[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries);

                            // The real getter process starts in the following line
                            var textMatchesFound = strategy.GetExtendedTextLocations(oldText, options).ToList();

                            // MatchesFound contains all text with locations
                            foreach (var match in textMatchesFound)
                            {
                                // Delete tag
                                var bColor = BaseColor.WHITE;
                                cb.SetColorFill(bColor);
                                cb.Rectangle(match.Rect.Left, match.Rect.Bottom, match.Rect.Width, match.Rect.Height);
                                cb.Fill();

                                // Calculates new rectangle
                                var deltaY     = CalculatesVerticalDelta(options, match.Rect);
                                var cellHeight = CalculatesCellHeight(match, oldText, strategy, cb, (string[])stringsArray.Clone(), options, deltaY);
                                var r          = BuildRectangleByStrategies(match, oldText, strategy, cb, (string[])stringsArray.Clone(), options);

                                // Width strategy to use
                                var safeFixedWidth = fixedWidth;
                                var useFixedWidth  = !fixedWidth.Equals(DefaultFixedWidth);
                                if (useFixedWidth)
                                {
                                    if (fixedWidth > r.Width)
                                    {
                                        safeFixedWidth = r.Width;
                                    }
                                }
                                else
                                {
                                    safeFixedWidth = r.Width;
                                }

                                // Creates aligned table by horizontal alignment value (this table contains the user table parameter)
                                var outerBorderTable = new PdfPTable(1)
                                {
                                    TotalWidth          = safeFixedWidth,
                                    HorizontalAlignment = Element.ALIGN_LEFT
                                };

                                var outerCell = PdfHelper.CreateEmptyWithBorderCell(style.Borders);
                                outerCell.MinimumHeight     = cellHeight;
                                outerCell.VerticalAlignment = style.Alignment.Vertical.ToVerticalTableAlignment();
                                outerCell.BackgroundColor   = new BaseColor(ColorHelper.GetColorFromString(style.Content.Color));

                                //table.Table.HorizontalAlignment = Element.ALIGN_LEFT;
                                table.Table.TotalWidth  = safeFixedWidth - (outerCell.EffectivePaddingRight + outerCell.EffectivePaddingLeft) * 2;
                                table.Table.LockedWidth = true; // options.StartStrategy.Equals(StartLocationStrategy.LeftMargin) && options.EndStrategy.Equals(EndLocationStrategy.RightMargin);
                                outerCell.AddElement(table.Table);
                                outerBorderTable.AddCell(outerCell);

                                // Creates strategy table (for shows testmode rectangle)
                                var useTestModeTable = new PdfPTable(1)
                                {
                                    TotalWidth = safeFixedWidth
                                };
                                var useTestCell = PdfHelper.CreateEmptyCell(useTestMode);

                                if (table.Configuration.HeightStrategy == TableHeightStrategy.Exact)
                                {
                                    useTestCell.FixedHeight = table.Table.TotalHeight;
                                }

                                useTestCell.AddElement(outerBorderTable);
                                useTestModeTable.AddCell(useTestCell);
                                useTestModeTable.WriteSelectedRows(-1, -1, r.X + tableOffset.X, r.Y - tableOffset.Y - deltaY, cb);

                                cb.Fill();
                            }

                            cb.Stroke();
                        }

                        stamper.Close();
                        reader.Close();
                    }

                return(ReplaceResult.CreateSuccessResult(new ReplaceResultData
                {
                    Context = context,
                    InputStream = input,
                    OutputStream = new MemoryStream(outputStream.GetBuffer())
                }));
            }
            catch (Exception ex)
            {
                return(ReplaceResult.FromException(
                           ex,
                           new ReplaceResultData
                {
                    Context = context,
                    InputStream = input,
                    OutputStream = input
                }));
            }
        }
コード例 #43
0
ファイル: EventScore.cs プロジェクト: mnedelman/scorer
        public ScoreInfo ScoreTan(bool zero)
        {
            if (zero) {
            TanWest = YesNo.No;
            TanEast = YesNo.No;
            TanTouch = YesNo.No;
            }
            if (TanWest == YesNo.Unknown)
            return new ScoreInfo("Input required: West tan building not damaged?");
            if (TanEast == YesNo.Unknown)
            return new ScoreInfo("Input required: East tan building damaged?");
            if (TanTouch == YesNo.Unknown)
            return new ScoreInfo("Input required: Tan buildings only ever touched by rolling frame?");

            if (TanWest == YesNo.Yes && TanEast == YesNo.Yes && TanTouch == YesNo.Yes)
            return new ScoreInfo(30);
            return new ScoreInfo(0);
        }
コード例 #44
0
 /// <summary>
 /// Sets the value of the <c>&lt;LastSchool&gt;</c> element.
 /// </summary>
 /// <param name="val">A YesNo object</param>
 /// <remarks>
 /// <para>The SIF specification defines the meaning of this element as: "An indication of whether the described school or establishment was the last establishment the learner attended. Note that it is possible that more than one establishment can be marked as LastSchool when a learner is enroled in more than one school simultaneously."</para>
 /// <para>Version: 2.6</para>
 /// <para>Since: 2.0</para>
 /// </remarks>
 public void SetLastSchool(YesNo val)
 {
     SetField(LearnerDTD.PREVIOUSESTABLISHMENT_LASTSCHOOL, val);
 }
コード例 #45
0
ファイル: EventScore.cs プロジェクト: mnedelman/scorer
        public ScoreInfo ScoreTruck(bool zero)
        {
            if (zero) {
            Truck = YesNo.No;
            }
            if (Truck == YesNo.Unknown)
            return new ScoreInfo("Input required: Supply truck touching mat in yellow?");

            if (Truck == YesNo.Yes) return new ScoreInfo(20);
            return new ScoreInfo(0);
        }
コード例 #46
0
 /// <summary>
 /// Sets the value of the <c>&lt;ZeroTolerance&gt;</c> element.
 /// </summary>
 /// <param name="val">A YesNo object</param>
 /// <remarks>
 /// <para>The SIF specification defines the meaning of this element as: "Identifies whether or not this action was imposed as a consequence of state or local zero tolerance policies."</para>
 /// <para>Version: 2.6</para>
 /// <para>Since: 2.4</para>
 /// </remarks>
 public void SetZeroTolerance(YesNo val)
 {
     SetField(StudentDTD.INCIDENTACTION_ZEROTOLERANCE, val);
 }
コード例 #47
0
        private static YesNo DetermineBiodadAlive( YesNo biobdadInHH, Int16 surveyYear, Int32 subjectTag, LinksDataSet.tblResponseDataTable dtMother )
        {
            const Item item = Item.Gen2CFatherAlive;
            if ( biobdadInHH == YesNo.Yes ) return YesNo.Yes;

            Int32? response = Retrieve.ResponseNullPossible(surveyYear, item, subjectTag, dtMother);
            if ( !response.HasValue )
                return YesNo.ValidSkipOrNoInterviewOrNotInSurvey;
            EnumResponsesGen2.FatherOfGen2Living codedResponse = (EnumResponsesGen2.FatherOfGen2Living)response.Value;
            switch ( codedResponse ) {
                case EnumResponsesGen2.FatherOfGen2Living.InvalidSkip: return YesNo.Refusal;
                case EnumResponsesGen2.FatherOfGen2Living.DoNotKnow: return YesNo.DoNotKnow;
                case EnumResponsesGen2.FatherOfGen2Living.Refusal: return YesNo.Refusal;
                case EnumResponsesGen2.FatherOfGen2Living.No: return YesNo.No;
                case EnumResponsesGen2.FatherOfGen2Living.Yes: return YesNo.Yes;
                default: throw new InvalidOperationException("The response " + codedResponse + " was not recognized.");
            }
        }
コード例 #48
0
 /// <summary>
 /// Sets the value of the <c>&lt;PoliceNotification&gt;</c> element.
 /// </summary>
 /// <param name="val">A YesNo object</param>
 /// <remarks>
 /// <para>The SIF specification defines the meaning of this element as: "Identifies whether there was notification of local law enforcement, regardless of whether official action was taken."</para>
 /// <para>Version: 2.6</para>
 /// <para>Since: 2.4</para>
 /// </remarks>
 public void SetPoliceNotification(YesNo val)
 {
     SetField(StudentDTD.INCIDENTACTION_POLICENOTIFICATION, val);
 }
コード例 #49
0
        private void AddRow( Int32 subjectTag, YesNo alwaysLivedWithBothBioparents,
			Int16? biodadBirthYearReported, Int16? biodadBirthYearEstimated, Int16? biodadYearLastAsked, YesNo biodadAlive, Gen1BioparentDeathCause biodadDeathCause, byte? biodadDeathAge, YesNo biodadUSBorn, byte? biodadHighestGrade, YesNo biograndfatherUSBorn,
			Int16? biomomBirthYearReported, Int16? biomomBirthYearEstimated, Int16? biomomYearLastAsked, YesNo biomomAlive, Gen1BioparentDeathCause biomomDeathCause, byte? biomomDeathAge, YesNo biomomUSBorn, byte? biomomHighestGrade)
        {
            //lock ( _ds.tblFatherOfGen2 ) {
            LinksDataSet.tblParentsOfGen1CurrentRow drNew = _ds.tblParentsOfGen1Current.NewtblParentsOfGen1CurrentRow();
            drNew.SubjectTag = subjectTag;
            drNew.AlwaysLivedWithBothBioparents = Convert.ToInt16(alwaysLivedWithBothBioparents);

            //Items about biodad (and one about biograndfather)
            if ( biodadBirthYearReported.HasValue ) drNew.BiodadBirthYearReported = biodadBirthYearReported.Value;
            else drNew.SetBiodadBirthYearReportedNull();

            if ( biodadBirthYearEstimated.HasValue ) drNew.BiodadBirthYearEstimated = biodadBirthYearEstimated.Value;
            else drNew.SetBiodadBirthYearEstimatedNull();

            if ( biodadYearLastAsked.HasValue ) drNew.BiodadYearLastAsked = Convert.ToInt16(biodadYearLastAsked);
            else drNew.SetBiodadYearLastAskedNull();

            drNew.BiodadAlive = Convert.ToInt16(biodadAlive);
            drNew.BiodadDeathCause = Convert.ToInt16(biodadDeathCause);

            if ( biodadDeathAge.HasValue ) drNew.BiodadDeathAge = biodadDeathAge.Value;
            else drNew.SetBiodadDeathAgeNull();

            drNew.BiodadUSBorn = Convert.ToInt16(biodadUSBorn);

            if ( biodadHighestGrade.HasValue ) drNew.BiodadHighestGrade = biodadHighestGrade.Value;
            else drNew.SetBiodadHighestGradeNull();

            drNew.BiograndfatherUSBorn = Convert.ToInt16(biograndfatherUSBorn);

            //Items about biomom
            if ( biomomBirthYearReported.HasValue ) drNew.BiomomBirthYearReported = biomomBirthYearReported.Value;
            else drNew.SetBiomomBirthYearReportedNull();

            if ( biomomBirthYearEstimated.HasValue ) drNew.BiomomBirthYearEstimated = biomomBirthYearEstimated.Value;
            else drNew.SetBiomomBirthYearEstimatedNull();

            if ( biomomYearLastAsked.HasValue ) drNew.BiomomYearLastAsked = Convert.ToInt16(biomomYearLastAsked);
            else drNew.SetBiomomYearLastAskedNull();

            drNew.BiomomAlive = Convert.ToInt16(biomomAlive);
            drNew.BiomomDeathCause = Convert.ToInt16(biomomDeathCause);

            if ( biomomDeathAge.HasValue ) drNew.BiomomDeathAge = biomomDeathAge.Value;
            else drNew.SetBiomomDeathAgeNull();

            drNew.BiomomUSBorn = Convert.ToInt16(biomomUSBorn);

            if ( biomomHighestGrade.HasValue ) drNew.BiomomHighestGrade = biomomHighestGrade.Value;
            else drNew.SetBiomomHighestGradeNull();

            _ds.tblParentsOfGen1Current.AddtblParentsOfGen1CurrentRow(drNew);
            //}
        }
コード例 #50
0
 /// <summary>
 /// Constructor that accepts values for all mandatory fields
 /// </summary>
 ///<param name="startDate">The date on which the action begins.</param>
 ///<param name="endDate">The date through which the action is in effect, inclusive.</param>
 ///<param name="duration">Identifies the length, in school days, of the action. Note: decimal places may be used for fractions of school days.</param>
 ///<param name="zeroTolerance">Identifies whether or not this action was imposed as a consequence of state or local zero tolerance policies.</param>
 ///<param name="policeNotification">Identifies whether there was notification of local law enforcement, regardless of whether official action was taken.</param>
 ///<param name="arrest">Identifies whether there were any arrests.</param>
 ///
 public IncidentAction(DateTime?startDate, DateTime?endDate, decimal?duration, YesNo zeroTolerance, YesNo policeNotification, IncidentActionArrestType arrest) : base(StudentDTD.INCIDENTACTION)
 {
     this.StartDate = startDate;
     this.EndDate   = endDate;
     this.Duration  = duration;
     this.SetZeroTolerance(zeroTolerance);
     this.SetPoliceNotification(policeNotification);
     this.SetArrest(arrest);
 }
コード例 #51
0
 ///<summary>Adds the value of the <c>&lt;PurchaseQuantity&gt;</c> element.</summary>
 /// <param name="FoodserviceItemPortionRefId">Item portion amount</param>
 /// <param name="Earned">Identifies whether the item being purchased is earned i.e., at no cost to the buyer. It is used when FoodserviceTransaction object's TransactionType element has the value "Purchase".</param>
 /// <param name="MealType">A MealType</param>
 /// <param name="Value">A Value</param>
 ///<remarks>
 /// <para>This form of <c>setPurchaseQuantity</c> is provided as a convenience method
 /// that is functionally equivalent to the method <c>AddPurchaseQuantity</c></para>
 /// <para>Version: 2.6</para>
 /// <para>Since: 2.0</para>
 /// </remarks>
 public void AddPurchaseQuantity(string FoodserviceItemPortionRefId, YesNo Earned, MealTypes MealType, decimal?Value)
 {
     AddChild(FoodDTD.PURCHASEQUANTITIES_PURCHASEQUANTITY, new PurchaseQuantity(FoodserviceItemPortionRefId, Earned, MealType, Value));
 }
コード例 #52
0
 /// <summary>
 /// Initializes a new instance of the <see cref="T:iTin.Export.Model.BaseConditionModel" /> class.
 /// </summary>
 protected BaseConditionModel()
 {
     _active     = ActiveDefault;
     _locale     = LocaleDefault;
     _entrireRow = EntireRowDefault;
 }
コード例 #53
0
        /// <summary>
        ///     on yes click
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void restartBtn_Click(object sender, EventArgs e)
        {
            yesno = YesNo.Yes;

            Close();
        }
コード例 #54
0
 /// <summary>
 /// Sets the value of the <c>&lt;CountsTowardAttendance&gt;</c> element.
 /// </summary>
 /// <param name="val">A YesNo object</param>
 /// <remarks>
 /// <para>The SIF specification defines the meaning of this element as: "Designates whether this date should be counted toward administrator attendance."</para>
 /// <para>Version: 2.6</para>
 /// <para>Since: 2.0</para>
 /// </remarks>
 public void SetCountsTowardAttendance(YesNo val)
 {
     SetField(StudentDTD.ADMINISTRATORATTENDANCE_COUNTSTOWARDATTENDANCE, val);
 }
コード例 #55
0
ファイル: PrepProperties.cs プロジェクト: Nanook/TheGHOST
        //Handy attributes to use on properties
        //[Browsable(false)]
        //[ReadOnly(true)]
        internal void SetPreset(Presets preset)
        {
            YesNo y = YesNo.Yes;
            YesNo n = YesNo.No;

            bool full = preset == Presets.FullPrep;
            bool song = preset == Presets.OnlyAddSongs;
            bool space = preset == Presets.OnlySaveSpace;

            this.EnableAudioBlanking = (full ? y : n);
            this.BlankTierSongs = (full ? y : n);
            this.BlankBonus = (full ? y : n);
            this.BlankAddedSongs = (full ? y : n);
            this.BlankNonCareerSongs = (full ? y : n);
            this.BlankBattles = (full ? y : n);

            this.EnableTierEditing = (full || song ? y : n);
            this.TiersCount = string.Empty;
            this.TierSongsCount = string.Empty;
            this.BonusTierSongsCount = string.Empty;
            this.RemoveBossBattles = YesNo.No;

            this.UnlockSetlistTiers = (full ? y : n);
            this.CompleteTier1Song = (full ? y : n);
            this.AddNonCareerTracksToBonus = (full || song ? y : n);
            this.SetCheats = (full ? y : n);
            this.FreeStore = (full ? y : n);
            this.DefaultBonusSongArt = (full ? y : n);
            this.DefaultBonusSongInfo = (full ? y : n);
            this.DefaultBonusSongInfoText = "Custom song replaced with TheGHOST";

            this.ReplaceVideos = (full || space ? y : n);
            this.RemoveIntroVideos = (full || space ? y : n);
            this.RemoveUnusedFiles = (full || space ? y : n);
            this.RemoveOtherLanguages = (full || space ? y : n);
            this.RemoveUpdatePartition = (full || space ? y : n);
            this.ManualEditing = n;
        }
コード例 #56
0
 /// <summary>
 /// Sets the value of the <c>&lt;SIF_MorePackets&gt;</c> element.
 /// </summary>
 /// <param name="val">A YesNo object</param>
 /// <remarks>
 /// <para>The SIF specification defines the meaning of this element as: "This element provides an indication as to whether there are more packets besides this one to make up a complete response."</para>
 /// <para>Version: 2.6</para>
 /// <para>Since: 2.3</para>
 /// </remarks>
 public void SetSIF_MorePackets(YesNo val)
 {
     SetField(InfraDTD.SIF_SERVICEINPUT_SIF_MOREPACKETS, val);
 }