public BlankConfig Get(BlankType blankType, SheetType sheetType)
 {
     return
         (BlankConfig) BaseGet(GetKey(blankType, sheetType))
         ??
         (BlankConfig) BaseGet(GetKey(blankType, SheetType.Undefined));
 }
 public BlankConfig Get(BlankType blankType, SheetType sheetType)
 {
     return
         ((BlankConfig)BaseGet(GetKey(blankType, sheetType))
          ??
          (BlankConfig)BaseGet(GetKey(blankType, SheetType.Undefined)));
 }
Exemple #3
0
        protected virtual void OnConverting(BlankType targetType)
        {
            var h = Converting;

            if (h != null)
            {
                h(this, new BlankTypeEventArgs(targetType));
            }
        }
Exemple #4
0
 public VoteKey(BlankType? type, 
     VotingMode? mode, 
     int? scannerSerial, 
     string candidate, 
     string election, 
     string blankId)
 {
     BlankType = type;
     VotingMode = mode;
     ScannerSerialNumber = scannerSerial;
     CandidateId = candidate;
     ElectionNum = election;
     BlankId = blankId;
 }
Exemple #5
0
 public VotingResult( 
     BlankType blankType, 
     int bulletinNumber, 
     string stampNumber, 
     string badBulletinReason, 
     string badStampReason, 
     int[][] sectionsMarks, 
     bool[] sectionsValidity)
 {
     BlankType = blankType;
     BulletinNumber = bulletinNumber;
     StampNumber = stampNumber;
     BadBulletinReason = badBulletinReason;
     BadStampReason = badStampReason;
     SectionsMarks = sectionsMarks;
     SectionsValidity = sectionsValidity;
 }
Exemple #6
0
 public VotingResult(
     BlankType blankType,
     int bulletinNumber,
     string stampNumber,
     string badBulletinReason,
     string badStampReason,
     int[][] sectionsMarks,
     bool[] sectionsValidity)
 {
     BlankType         = blankType;
     BulletinNumber    = bulletinNumber;
     StampNumber       = stampNumber;
     BadBulletinReason = badBulletinReason;
     BadStampReason    = badStampReason;
     SectionsMarks     = sectionsMarks;
     SectionsValidity  = sectionsValidity;
 }
        public void AddFromEditor(BlankType type)
        {
            switch (type)
            {
            case BlankType.Measure:
                OpenMeasureEditor(null, null, (m) =>
                {
                    AddTag(m);
                });
                break;

            case BlankType.Icd:
                OpenIcdSelector(null, null, (i) =>
                {
                    AddTag(i);
                });
                break;

            default:
                AddLastTag();
                break;
            }
            StartEdit();
        }
Exemple #8
0
        /// <summary>
        /// This function blanks a portion of the CD or DVD that is in the drive.
        /// </summary>
        /// <param name="immd"></param>If true, this function returns immediately and the blanking
        /// happens in the backgroun.  If false, this funtion does not return until the blanking operation
        /// is complete
        /// <param name="t"></param>The type of blanking operation
        /// <param name="addr"></param>The address for the blanking operation if an address is required
        /// <returns>
        /// Success - the command complete sucessfully
        /// IoctlFailed - the windows DeviceIoControl failed, LastError give the Win32 error code
        /// DeviceFailed - the device failed the command, the sense information has more data
        /// </returns>
        public CommandStatus Blank(bool immd, BlankType t, int addr)
        {
            if (m_logger != null)
            {
                string args = immd.ToString() + ", " + t.ToString() + ", " + addr.ToString();
                m_logger.LogMessage(new UserMessage(UserMessage.Category.Debug, 8, "Bwg.Scsi.Device.Blank(" + args + ")"));
            }

            using (Command cmd = new Command(ScsiCommandCode.Blank, 12, 0, Command.CmdDirection.None, 60*30))
            {
                byte b = (byte)t;
                if (immd)
                    b |= (1 << 4);
                cmd.SetCDB8(1, b);

                cmd.SetCDB32(2, addr);
                CommandStatus st = SendCommand(cmd);
                if (st != CommandStatus.Success)
                    return st;
            }

            return CommandStatus.Success;
        }
Exemple #9
0
 public Blank(BlankType b, byte n)
     : base(n)
 {
     _blank = b;
 }
Exemple #10
0
        /// <summary>
        /// Изменяет сущность тега с одной на другую.
        /// Может быть создан пустой коммент/слово, которые не должны сохраняться.
        /// </summary>
        public void ConvertBlank(TagViewModel tag, BlankType toType, Action onConverted)
        {
            if (tag.BlankType == toType)
            {
                throw new ArgumentException();
            }
            if (toType == BlankType.None)
            {
                throw new ArgumentException();
            }
            if (onConverted == null)
            {
                throw new ArgumentException();
            }
            Contract.Ensures(tag.BlankType == toType || tag.BlankType == Contract.OldValue(tag.BlankType)); // можно отменить to icd/measure
            Contract.EndContractBlock();

            string queryOrMeasureWordTitle;

            if (tag.BlankType == BlankType.Measure)
            {
                var w = (tag.Blank as Measure).Word;
                Contract.Assume(w != null); // измерение без слова в теге не бывает
                queryOrMeasureWordTitle = w.Title;
            }
            else
            {
                queryOrMeasureWordTitle = tag.Query; // == "" if initial or after clear query
            }
            Contract.Assume(queryOrMeasureWordTitle != null);

            switch (toType)
            {
            case BlankType.Comment:
                Contract.Assume(tag.Query != null);
                tag.Blank = new Comment(tag.Query);
                onConverted();
                break;

            case BlankType.Word:
                tag.Blank = FirstMatchingOrNewWord(queryOrMeasureWordTitle);
                onConverted();
                break;

            case BlankType.Measure:     // слово
                Word w = null;
                if (!queryOrMeasureWordTitle.IsNullOrEmpty())
                {
                    w = FirstMatchingOrNewWord(queryOrMeasureWordTitle);
                }
                OpenMeasureEditor(null, w, (m) =>
                {
                    tag.Blank = m;
                    onConverted();
                });
                break;

            case BlankType.Icd:     // слово/коммент в поисковый запрос
                OpenIcdSelector(null, queryOrMeasureWordTitle, (i) =>
                {
                    tag.Blank = i;
                    onConverted();
                });
                break;
            }
        }
 private static object GetKey(BlankType blankType, SheetType sheetType)
 {
     return ((int)blankType) * 1000 + (int)sheetType;
 }
Exemple #12
0
 public void SetBlankMarking(BlankType blankType, BlankMarking marking)
 {
     var blankConfig = _config.Blanks.Get(blankType, SheetType.Normal);
     if (blankConfig == null)
         return;
     var oldValue = blankConfig.Marking;
     blankConfig.Marking = marking;
     RaiseConfigUpdatedEvent(
         new ConfigUpdatedEventArgs(Name, blankType + "BlankMarking", oldValue, marking));
 }
 public BlankConfig Get(BlankType blankType)
 {
     return(Get(blankType, SheetType.Undefined));
 }
 public virtual Signalizations Validate(BlankType tagBt)
 {
     return(Signalizations.None);
 }
 public override Signalizations Validate(BlankType tagBt)
 {
     return(!convertTo.Contains(tagBt)
         ? Signalizations.Forbidden
         : Signalizations.None);
 }
 public bool WithConvertTo(BlankType type)
 {
     return(convertTo.Contains(type));
 }
 private static object GetKey(BlankType blankType, SheetType sheetType)
 {
     return(((int)blankType) * 1000 + (int)sheetType);
 }
Exemple #18
0
 public BlankTypeEventArgs(BlankType type)
 {
     this.type = type;
 }
 public BlankConfig Get(BlankType blankType)
 {
     return Get(blankType, SheetType.Undefined);
 }
Exemple #20
0
 public BlankMarking GetBlankMarking(BlankType blankType)
 {
     var blankConfig = _config.Blanks.Get(blankType, SheetType.Normal);
     return blankConfig != null
                ? blankConfig.Marking
                : BlankMarking.DropWithoutMark;
 }