예제 #1
0
 // constructor 3
 public DbDefSource(IDatabaseStructure db, ReadOnly flag)
 {
     m_readOnlyStructure = new DatabaseStructure(db);
     m_readOnlyStructure.MarkAllFilled();
     m_openedReadOnly = true;
     m_conn           = new DbDefConnection(m_readOnlyStructure);
 }
예제 #2
0
        public void MergeFrom(TransactionOptions other)
        {
            if (other == null)
            {
                return;
            }
            switch (other.ModeCase)
            {
            case ModeOneofCase.ReadOnly:
                if (ReadOnly == null)
                {
                    ReadOnly = new global::Google.Cloud.Firestore.V1.TransactionOptions.Types.ReadOnly();
                }
                ReadOnly.MergeFrom(other.ReadOnly);
                break;

            case ModeOneofCase.ReadWrite:
                if (ReadWrite == null)
                {
                    ReadWrite = new global::Google.Cloud.Firestore.V1.TransactionOptions.Types.ReadWrite();
                }
                ReadWrite.MergeFrom(other.ReadWrite);
                break;
            }

            _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
        }
예제 #3
0
        public static IList <IBlock> Parse(string text)
        {
            IList <IBlock> blocks = new List <IBlock>();

            for (int index = 0; index < text.Length;)
            {
                string subText = text.Substring(index);

                using (ReadOnlyValue <int> currentIndex = ReadOnly <int> .Register(index))
                {
                    foreach (var parser in Parsers)
                    {
                        if (TryParse(text.Substring(index), parser, out IBlock block))
                        {
                            index += block.Content.Length;

                            if (0 < block.Content.Length)
                            {
                                blocks.Add(block);
                            }

                            block = BlockBase.Null;
                        }
                    }

                    if (currentIndex.Value == index)
                    {
                        break;
                    }
                }
            }

            return(blocks);
        }
예제 #4
0
        public async Task Update_Read_Only_Column(Type dataContextType)
        {
            // Arrange
            using IDataContext dataContext = DataContextTestHelper.SetupDataContext(dataContextType);

            // a value must be provided for the read-only property when used with an in memory
            // data context, SQL based implementations will take the value from the columns
            // default value
            ReadOnly readOnly = await dataContext.Create <ReadOnly>(new ReadOnly()
            {
                Editable         = "Hello",
                ReadOnlyProperty = "Default"
            });

            // Act
            readOnly = await dataContext.Update <ReadOnly>(new
            {
                readOnly.SequentialId,
                Editable         = "Goodbye",
                ReadOnlyProperty = "Yesterday"
            });

            // Assert
            Assert.AreEqual("Goodbye", readOnly.Editable);
            Assert.AreEqual("Default", readOnly.ReadOnlyProperty);
        }
        public override int GetHashCode()
        {
            unchecked
            {
                var hash = 17;

                hash = hash * 23 + Fields.GetHashCode();
                hash = hash * 23 + Properties.GetHashCode();
                hash = hash * 23 + Methods.GetHashCode();
                hash = hash * 23 + Constructors.GetHashCode();
                hash = hash * 23 + Gettable.GetHashCode();
                hash = hash * 23 + Settable.GetHashCode();
                hash = hash * 23 + Indexers.GetHashCode();
                hash = hash * 23 + Events.GetHashCode();

                hash = hash * 23 + Inherited.GetHashCode();
                hash = hash * 23 + Targeted.GetHashCode();
                hash = hash * 23 + NonTargeted.GetHashCode();
                hash = hash * 23 + Public.GetHashCode();
                hash = hash * 23 + NonPublic.GetHashCode();
                hash = hash * 23 + ReadOnly.GetHashCode();
                hash = hash * 23 + WriteOnly.GetHashCode();
                hash = hash * 23 + Extensions.GetHashCode();
                hash = hash * 23 + Operators.GetHashCode();
                hash = hash * 23 + Conversions.GetHashCode();
                hash = hash * 23 + Parameters.GetHashCode();
                hash = hash * 23 + Obsolete.GetHashCode();
                hash = hash * 23 + OpenConstructedGeneric.GetHashCode();
                hash = hash * 23 + TypeInitializers.GetHashCode();

                return(hash);
            }
        }
예제 #6
0
        private void button1_Click(object sender, EventArgs e)
        {
            FormHelper.FormuTemizle(this);

            ReadOnly.UndoReadOnly(this);

            txtPackageBarcode.Visible = true;
            PrintDocument doc = new PrintDocument();

            MarketOtomasyonu.WFA.Barcode.Ean13 barkod = new MarketOtomasyonu.WFA.Barcode.Ean13();

            barkod.Height   = 20f;
            barkod.Width    = 50f;
            barkod.FontSize = 12f;
            //bu kod barkodun ilk 2 hanesi -ülke kodu
            barkod.CountryCode = "90";
            //Bu kod üretici-imalatçı numarası -bu kısımın legal illegal gibi durumları da var
            barkod.ManufacturerCode = "95525";
            //Bu kod ürün kodu
            barkod.ProductCode = UrunKodu();
            //Bu kısım boş geçilsede birşey değişmiyor EAN-13 te zaten 12 veri okuyorsunuz ,bu sayı  barkodun sonunda oluyor. kontrol kodu
            barkod.ChecksumDigit   = "0";
            pbPackageBarcode.Image = barkod.CreateBitmap();
            txtPackageBarcode.Text = barkod.ToString();
            this.ActiveControl     = txtPackageBarcode;
            txtPackageBarcode.Focus();
            txtPackageBarcode.Select(0, 0);
            txtPackageBarcode.SelectionStart = txtPackageBarcode.MaxLength;

            cmbPackageProduct.SelectedIndex = -1;
        }
예제 #7
0
        public override int GetHashCode()
        {
            unchecked
            {
                var hashCode = Context != null?Context.GetHashCode() : 0;

                hashCode = (hashCode * 397) ^ (DefaultValue != null ? DefaultValue.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (Description != null ? Description.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (Label != null ? Label.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (Name != null ? Name.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ Required.GetHashCode();
                hashCode = (hashCode * 397) ^ (Type != null ? Type.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ Min;
                hashCode = (hashCode * 397) ^ Max;
                hashCode = (hashCode * 397) ^ Stepsize;
                hashCode = (hashCode * 397) ^ (Pattern != null ? Pattern.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ ReadOnly.GetHashCode();
                hashCode = (hashCode * 397) ^ Multiple.GetHashCode();
                hashCode = (hashCode * 397) ^ MultipleLimit;
                hashCode = (hashCode * 397) ^ (GroupName != null ? GroupName.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ Advanced.GetHashCode();
                hashCode = (hashCode * 397) ^ Verify.GetHashCode();
                hashCode = (hashCode * 397) ^ LimitToOptions.GetHashCode();
                hashCode = (hashCode * 397) ^ (Unit != null ? Unit.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (UnitLabel != null ? UnitLabel.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (Options != null ? Options.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (FilterCriteria != null ? FilterCriteria.GetHashCode() : 0);
                return(hashCode);
            }
        }
예제 #8
0
 /// <summary>
 /// Gets the hash code
 /// </summary>
 /// <returns>Hash code</returns>
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         int hashCode = 41;
         if (Minimum != null)
         {
             hashCode = hashCode * 59 + Minimum.GetHashCode();
         }
         if (Maximum != null)
         {
             hashCode = hashCode * 59 + Maximum.GetHashCode();
         }
         if (Step != null)
         {
             hashCode = hashCode * 59 + Step.GetHashCode();
         }
         if (Pattern != null)
         {
             hashCode = hashCode * 59 + Pattern.GetHashCode();
         }
         if (ReadOnly != null)
         {
             hashCode = hashCode * 59 + ReadOnly.GetHashCode();
         }
         if (Options != null)
         {
             hashCode = hashCode * 59 + Options.GetHashCode();
         }
         return(hashCode);
     }
 }
예제 #9
0
        /// <inheritdoc/>
        public override PropertyConcern CanApplyTo(IProperty property)
        {
            if (property == null)
            {
                throw new ArgumentNullException("property");
            }

            ReadOnly.Assert(true);
            var fullName   = $"{property.ClassFullName}.{property.PropertyName}";
            var joinPoints = Enum.GetValues(typeof(JoinPoint)).Cast <JoinPoint>().ToList();
            var match      = PatternMatch(fullName);
            var concern    = PropertyConcern.None;

            if ((match == PatternMatchType.WildCard && ConcernPropertyGetter && PropertyGetterMatch(property)) ||
                match == PatternMatchType.Exact)
            {
                concern = concern.ConcernGetter();
            }

            if ((match == PatternMatchType.WildCard && ConcernPropertySetter && PropertySetterMatch(property)) ||
                match == PatternMatchType.Exact)
            {
                concern = concern.ConcernSetter();
            }

            return(concern);
        }
        protected override void ProcessRecord()
        {
            var control = new PsTextBox();

            SetControlProps(control);

            control.Label        = Label;
            control.Value        = Value;
            control.Placeholder  = Placeholder;
            control.ErrorMessage = ErrorMessage;
            control.Description  = Description;
            control.Prefix       = Prefix;
            control.Suffix       = Suffix;
            control.Icon         = Icon;
            control.IconColor    = IconColor;
            control.OnChange     = OnChange;

            if (Align.HasValue)
            {
                control.Align = Align.Value;
            }

            if (Multiline.IsPresent)
            {
                control.Multiline = Multiline.ToBool();
            }

            if (Password.IsPresent)
            {
                control.Password = Password.ToBool();
            }

            if (Required.IsPresent)
            {
                control.Required = Required.ToBool();
            }

            if (ReadOnly.IsPresent)
            {
                control.ReadOnly = ReadOnly.ToBool();
            }

            if (AutoAdjustHeight.IsPresent)
            {
                control.AutoAdjustHeight = AutoAdjustHeight.ToBool();
            }

            if (Underlined.IsPresent)
            {
                control.Underlined = Underlined.ToBool();
            }

            if (Borderless.IsPresent)
            {
                control.Borderless = Borderless.ToBool();
            }

            WriteObject(control);
        }
예제 #11
0
        public void Ctor_without_args_sets_string_value_to_default()
        {
            //act.
            var sut = new ReadOnly <string>();

            //assert.
            sut.Value.Should().Be(null);
        }
예제 #12
0
        public void Ctor_without_args_sets_int_value_to_default()
        {
            //act.
            var sut = new ReadOnly <int>();

            //assert.
            sut.Value.Should().Be(0);
        }
예제 #13
0
 /// <summary>
 /// Returns a hash code for this instance.
 /// </summary>
 /// <returns>
 /// A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.
 /// </returns>
 public override int GetHashCode()
 {
     unchecked
     {
         int hashCode = 17 + AllowNull.GetHashCode() ^ ReadOnly.GetHashCode() + 31 * GetHashCode(PossibleValues);;
         return((DefaultValue == null) ? hashCode : hashCode *32 ^ DefaultValue.GetHashCode());
     }
 }
예제 #14
0
 public EFUnitOfWork(ReadOnly readOnly = ReadOnly.No)
 {
     DbContext = new DbContextT();
     if (readOnly == ReadOnly.Yes)
     {
         DbContext.MakeReadOnly();
     }
     DbContextAmbientContext <DbContextT> .PushDbContext(DbContext);
 }
예제 #15
0
        private static void AssertProtoConversion(ReadOnly expectedReadOnly, TimestampBound bound)
        {
            var expected = new TransactionOptions
            {
                ReadOnly = expectedReadOnly
            };

            Assert.Equal(expected, bound.ToTransactionOptions());
        }
 public override int GetHashCode()
 {
     unchecked
     {
         int hashCode = base.GetHashCode();
         hashCode = (hashCode * 397) ^ IndexType.GetHashCode();
         hashCode = (hashCode * 397) ^ ValueType.GetHashCode();
         hashCode = (hashCode * 397) ^ ReadOnly.GetHashCode();
         return(hashCode);
     }
 }
예제 #17
0
        public void Ctor_with_arg_sets_string_value_to_arg_null()
        {
            //arrange.
            string expectedValue = null;

            //act.
            var sut = new ReadOnly <string>(expectedValue);

            //assert.
            sut.Value.Should().Be(expectedValue);
        }
예제 #18
0
        public void Ctor_with_arg_sets_int_value_to_arg()
        {
            //arrange.
            var expectedValue = 123;

            //act.
            var sut = new ReadOnly <int>(expectedValue);

            //assert.
            sut.Value.Should().Be(expectedValue);
        }
예제 #19
0
        public void Static_value_creates_ReadOnly_by_string_value_null()
        {
            //arrange.
            string expectedValue = null;

            //act.
            var sut = ReadOnly.Value(expectedValue);

            //assert.
            sut.Value.Should().Be(expectedValue);
        }
예제 #20
0
        public void Static_value_creates_ReadOnly_by_string_value()
        {
            //arrange.
            var expectedValue = "ajkshajhs";

            //act.
            var sut = ReadOnly.Value(expectedValue);

            //assert.
            sut.Value.Should().Be(expectedValue);
        }
예제 #21
0
        public void Static_value_creates_ReadOnly_by_int_value()
        {
            //arrange.
            var expectedValue = 1616;

            //act.
            var sut = ReadOnly.Value(expectedValue);

            //assert.
            sut.Value.Should().Be(expectedValue);
        }
예제 #22
0
        static void CopySafe(ReadOnly src, int srcIndex, NativeArray <T> dst, int dstIndex, int length)
        {
            AtomicSafetyHandle.CheckReadAndThrow(src.m_Safety);
            AtomicSafetyHandle.CheckWriteAndThrow(dst.m_Safety);
            CheckCopyArguments(src.Length, srcIndex, dst.Length, dstIndex, length);

            UnsafeUtility.MemCpy(
                (byte *)dst.m_Buffer + dstIndex * UnsafeUtility.SizeOf <T>(),
                (byte *)src.m_Buffer + srcIndex * UnsafeUtility.SizeOf <T>(),
                length * UnsafeUtility.SizeOf <T>());
        }
예제 #23
0
        public ReadOnly RetrieveShuttleBusObject()
        {
            ReadOnly returnObject = new ReadOnly
            {
                Id = Id,
                RequisitionDateTime = RequisitionDateTime,
                BusLabel            = BusLabel,
                NumberOfSeats       = NumberOfSeats
            };

            return(returnObject);
        }
예제 #24
0
 private void MakeWritable()
 {
     if (!ReadOnlyMode)
     {
         return;
     }
     byte[] underlyingStorage = new byte[ReadOnly.Length];
     ReadOnly.CopyTo(underlyingStorage);
     ReadOnly     = new ReadOnlySpan <byte>(); // clear memory
     ReadOrWrite  = new Memory <byte>(underlyingStorage);
     ReadOnlyMode = false;
 }
예제 #25
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = (Name != null ? Name.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Label != null ? Label.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Type != null ? Type.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ ReadOnly.GetHashCode();
         hashCode = (hashCode * 397) ^ (Description != null ? Description.GetHashCode() : 0);
         return(hashCode);
     }
 }
예제 #26
0
        public void Conversion_gets_original_int_value()
        {
            //arrange.
            var originalValue = 321;
            var sut           = new ReadOnly <int>(originalValue);

            //act.
            int convertedValue = sut;

            //assert.
            convertedValue.Should().Be(originalValue);
        }
예제 #27
0
        public void Conversion_gets_original_string_value_null()
        {
            //arrange.
            string originalValue = null;
            var    sut           = new ReadOnly <string>(originalValue);

            //act.
            string convertedValue = sut;

            //assert.
            convertedValue.Should().Be(originalValue);
        }
예제 #28
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = Minimum;
         hashCode = (hashCode * 397) ^ Maximum;
         hashCode = (hashCode * 397) ^ ReadOnly.GetHashCode();
         hashCode = (hashCode * 397) ^ (Options != null ? Options.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ Step.GetHashCode();
         hashCode = (hashCode * 397) ^ (Pattern != null ? Pattern.GetHashCode() : 0);
         return(hashCode);
     }
 }
예제 #29
0
        public ReadOnly RetrieveShuttlePassengerObject()
        {
            ReadOnly returnObject = new ReadOnly
            {
                Id = Id,
                TransactionDateTime = TransactionDateTime,
                ShuttleScheduleId   = ShuttleScheduleId,
                ShuttleBusId        = ShuttleBusId,
                PassengerIndex      = PassengerIndex
            };

            return(returnObject);
        }
예제 #30
0
        /// <inheritdoc/>
        public override bool CanApplyTo(IMethod method)
        {
            if (method == null)
            {
                throw new ArgumentNullException("method");
            }

            ReadOnly.Assert(true);
            var fullName   = $"{method.ClassFullName}.{method.MethodName}";
            var joinPoints = Enum.GetValues(typeof(JoinPoint)).Cast <JoinPoint>().ToList();
            var match      = PatternMatch(fullName);

            return((match == PatternMatchType.WildCard && ConcernMethod && MethodMatch(method)) || match == PatternMatchType.Exact);
        }
예제 #31
0
파일: TagInput.cs 프로젝트: bzure/BSA.Net
        /// <summary>Assigns all needed attributes to the tag</summary>
        /// <returns>This instance downcasted to base class</returns>
        public virtual IndexedTag attr(
            InputType? type = null,
            string name = null,
            string value = null,
            Checked? @checked = null,
            Disabled? disabled = null,
            ReadOnly? @readonly = null,
            int? size = null,
            int? maxlength = null,
            string src = null,
            string alt = null,
            string usemap = null,
            IsMap? ismap = null,
            string onselect = null,
            string onchange = null,
            MimeType[] accept = null,
            string id = null,
            string @class = null,
            string style = null,
            string title = null,
            LangCode lang = null,
            string xmllang = null,
            Dir? dir = null,
            string onclick = null,
            string ondblclick = null,
            string onmousedown = null,
            string onmouseup = null,
            string onmouseover = null,
            string onmousemove = null,
            string onmouseout = null,
            string onkeypress = null,
            string onkeydown = null,
            string onkeyup = null,
            char? accesskey = null,
            int? tabindex = null,
            string onfocus = null,
            string onblur = null
        )
        {
            Type = type;
            Name = name;
            Value = value;
            Checked = @checked;
            Disabled = disabled;
            ReadOnly = @readonly;
            Size = size;
            MaxLength = maxlength;
            Src = src;
            Alt = alt;
            UseMap = usemap;
            IsMap = ismap;
            OnSelect = onselect;
            OnChange = onchange;
            Accept = accept;
            Id = id;
            Class = @class;
            Style = style;
            Title = title;
            Lang = lang;
            XmlLang = xmllang;
            Dir = dir;
            OnClick = onclick;
            OnDblClick = ondblclick;
            OnMouseDown = onmousedown;
            OnMouseUp = onmouseup;
            OnMouseOver = onmouseover;
            OnMouseMove = onmousemove;
            OnMouseOut = onmouseout;
            OnKeyPress = onkeypress;
            OnKeyDown = onkeydown;
            OnKeyUp = onkeyup;
            AccessKey = accesskey;
            TabIndex = tabindex;
            OnFocus = onfocus;
            OnBlur = onblur;

            return this;
        }
예제 #32
0
 public static TagTextArea @readonly(this TagTextArea tag, ReadOnly value) { tag.ReadOnly = value; return tag; }
예제 #33
0
 public static TagInput @readonly(this TagInput tag, ReadOnly value) { tag.ReadOnly = value; return tag; }
예제 #34
0
        /// <summary>Assigns all needed attributes to the tag</summary>
        /// <returns>This instance downcasted to base class</returns>
        public virtual IndexedTag attr(
            string name = null,
            int? rows = null,
            int? cols = null,
            Disabled? disabled = null,
            ReadOnly? @readonly = null,
            string onselect = null,
            string onchange = null,
            string id = null,
            string @class = null,
            string style = null,
            string title = null,
            LangCode lang = null,
            string xmllang = null,
            Dir? dir = null,
            string onclick = null,
            string ondblclick = null,
            string onmousedown = null,
            string onmouseup = null,
            string onmouseover = null,
            string onmousemove = null,
            string onmouseout = null,
            string onkeypress = null,
            string onkeydown = null,
            string onkeyup = null,
            char? accesskey = null,
            int? tabindex = null,
            string onfocus = null,
            string onblur = null
        )
        {
            Name = name;
            Rows = rows;
            Cols = cols;
            Disabled = disabled;
            ReadOnly = @readonly;
            OnSelect = onselect;
            OnChange = onchange;
            Id = id;
            Class = @class;
            Style = style;
            Title = title;
            Lang = lang;
            XmlLang = xmllang;
            Dir = dir;
            OnClick = onclick;
            OnDblClick = ondblclick;
            OnMouseDown = onmousedown;
            OnMouseUp = onmouseup;
            OnMouseOver = onmouseover;
            OnMouseMove = onmousemove;
            OnMouseOut = onmouseout;
            OnKeyPress = onkeypress;
            OnKeyDown = onkeydown;
            OnKeyUp = onkeyup;
            AccessKey = accesskey;
            TabIndex = tabindex;
            OnFocus = onfocus;
            OnBlur = onblur;

            return this;
        }