/// <inheritdoc/>
 public override int GetHashCode()
 => Role.GetHashCode() ^
 Name.GetHashCode() ^
 Value.GetHashCode() ^
 Description.GetHashCode() ^
 KeyShortcuts.GetHashCode() ^
 RoleDescription.GetHashCode() ^
 ValueText.GetHashCode() ^
 AutoComplete.GetHashCode() ^
 HasPopup.GetHashCode() ^
 Orientation.GetHashCode() ^
 Disabled.GetHashCode() ^
 Expanded.GetHashCode() ^
 Focused.GetHashCode() ^
 Modal.GetHashCode() ^
 Multiline.GetHashCode() ^
 Multiselectable.GetHashCode() ^
 Readonly.GetHashCode() ^
 Required.GetHashCode() ^
 Selected.GetHashCode() ^
 Pressed.GetHashCode() ^
 Checked.GetHashCode() ^
 Level.GetHashCode() ^
 ValueMin.GetHashCode() ^
 ValueMax.GetHashCode() ^
 Children.GetHashCode();
 /// <inheritdoc/>
 public override int GetHashCode()
 => (Role ?? string.Empty).GetHashCode() ^
 (Name ?? string.Empty).GetHashCode() ^
 (Value ?? string.Empty).GetHashCode() ^
 (Description ?? string.Empty).GetHashCode() ^
 (Keyshortcuts ?? string.Empty).GetHashCode() ^
 (Roledescription ?? string.Empty).GetHashCode() ^
 (Valuetext ?? string.Empty).GetHashCode() ^
 Disabled.GetHashCode() ^
 Expanded.GetHashCode() ^
 Focused.GetHashCode() ^
 Modal.GetHashCode() ^
 Multiline.GetHashCode() ^
 Multiselectable.GetHashCode() ^
 Readonly.GetHashCode() ^
 Required.GetHashCode() ^
 Selected.GetHashCode() ^
 Checked.GetHashCode() ^
 Pressed.GetHashCode() ^
 Level.GetHashCode() ^
 Valuemin.GetHashCode() ^
 Valuemax.GetHashCode() ^
 (Autocomplete ?? string.Empty).GetHashCode() ^
 (Haspopup ?? string.Empty).GetHashCode() ^
 (Invalid ?? string.Empty).GetHashCode() ^
 (Orientation ?? string.Empty).GetHashCode() ^
 Children.GetHashCode();
예제 #3
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (filters_ != null)
            {
                hash ^= Filters.GetHashCode();
            }
            if (Mode.Length != 0)
            {
                hash ^= Mode.GetHashCode();
            }
            hash ^= providers_.GetHashCode();
            if (Rundiscoveryoninit != false)
            {
                hash ^= Rundiscoveryoninit.GetHashCode();
            }
            if (transforms_ != null)
            {
                hash ^= Transforms.GetHashCode();
            }
            if (Vadaperspective != false)
            {
                hash ^= Vadaperspective.GetHashCode();
            }
            if (Readonly != false)
            {
                hash ^= Readonly.GetHashCode();
            }
            if (context_ != null)
            {
                hash ^= Context.GetHashCode();
            }
            return(hash);
        }
예제 #4
0
 /// <summary>
 ///
 /// </summary>
 internal static void DisposeStates()
 {
     Default.Dispose();
     Readonly.Dispose();
     None.Dispose();
     LightMark.Dispose();
     LightPass.Dispose();
     Sky.Dispose();
 }
예제 #5
0
        public static void Mediator()
        {
            ChatRoomMediator mediator  = new ChatRoomMediator();
            Writeonly        writeonly = new Writeonly("Bob");
            Readonly         readonlyp = new Readonly("Bob2");

            mediator.Register(writeonly);
            mediator.Register(readonlyp);
            mediator.Send("Bob", "Bob2", "Message");
            mediator.Send("Bob2", "Bob", "Text message.");
        }
예제 #6
0
        /// <summary>
        /// Return the HashCode of this object.
        /// </summary>
        /// <returns>The HashCode of this object.</returns>
        public override Int32 GetHashCode()
        {
            unchecked
            {
                return(Key.GetHashCode() * 7 ^
                       Readonly.GetHashCode() * 5 ^

                       (Value != null
                            ? Value.GetHashCode()
                            : 0));
            }
        }
예제 #7
0
        public override int GetHashCode()
        {
            var hash = base.GetHashCode();

            hash ^= Readonly.GetHashCode();
            hash ^= IntId.GetHashCode();
            hash ^= UIntId.GetHashCode();
            hash ^= LongId.GetHashCode();
            hash ^= ULongId.GetHashCode();
            hash ^= ShortId.GetHashCode();
            hash ^= UShortId.GetHashCode();
            hash ^= DoulbeId.GetHashCode();
            hash ^= ByteId.GetHashCode();
            hash ^= CharId.GetHashCode();
            hash ^= SByteId.GetHashCode();
            hash ^= CharRef.GetHashCode();
            hash ^= ByteRef.GetHashCode();
            hash ^= SByteRef.GetHashCode();
            hash ^= Int16Id.GetHashCode();
            hash ^= UInt16Id.GetHashCode();
            hash ^= Int32Id.GetHashCode();
            hash ^= UInt32Id.GetHashCode();
            hash ^= Int64Id.GetHashCode();
            hash ^= UInt64Id.GetHashCode();
            hash ^= DateTime.GetHashCode();
            hash ^= TitleEnum.GetHashCode();
            hash ^= ATitleEnum.GetHashCode();
            hash ^= FirstName.GetHashCode();
            hash ^= LastName.GetHashCode();
            hash ^= Bool.GetHashCode();
            hash ^= BoolRef.GetHashCode();
            if (Array != null)
            {
                hash ^= Array.GetHashCode();
            }
            if (Enumerable != null)
            {
                hash ^= Enumerable.GetHashCode();
            }
            if (Father != null)
            {
                hash ^= Father.GetHashCode();
            }
            if (Mother != null)
            {
                hash ^= Mother.GetHashCode();
            }
            if (Hidden != null)
            {
                hash ^= Hidden.GetHashCode();
            }
            return(hash);
        }
예제 #8
0
파일: Field.cs 프로젝트: xlfj5211/esb
        protected override void OnAjaxPreRender()
        {
            base.OnAjaxPreRender();

            StringBuilder sb = new StringBuilder();

            if (PropertyModified("Readonly"))
            {
                sb.AppendFormat("{0}.setReadOnly({1});", XID, Readonly.ToString().ToLower());
            }

            AddAjaxScript(sb);
        }
예제 #9
0
        /// <summary>
        /// Compares two configuration key value pairs for equality.
        /// </summary>
        /// <param name="KeyValue">An configuration key value pair to compare with.</param>
        /// <returns>True if both match; False otherwise.</returns>
        public Boolean Equals(KeyValue KeyValue)
        {
            if ((Object)KeyValue == null)
            {
                return(false);
            }

            return(Key.Equals(KeyValue.Key) &&
                   Readonly.Equals(KeyValue.Readonly) &&

                   ((Value == null && KeyValue.Value == null) ||
                    (Value != null && KeyValue.Value != null && Value.Equals(KeyValue.Value))));
        }
예제 #10
0
        private void CheckItemValues(Dictionary <string, Constraint> elementsList)
        {
            var form = Actor.AsksFor(ItemPageContent.Form);

            Actor.ChecksThat(Readonly.Of(BaseFormElements.InputOfField(woodTypeProperty, form)),
                             elementsList[woodTypeProperty]);

            Actor.ChecksThat(Enabled.Of(BaseFormElements.SelectOfField(paintColorProperty, form)),
                             elementsList[paintColorProperty]);

            Actor.ChecksThat(Enabled.Of(BaseFormElements.InputOfField(dateCreatedProperty, form)),
                             elementsList[dateCreatedProperty]);

            Actor.ChecksThat(Readonly.Of(BaseFormElements.InputOfField(chairNumberProperty, form)),
                             elementsList[chairNumberProperty]);
        }
예제 #11
0
파일: Field.cs 프로젝트: proson/Fine-UI
        /// <summary>
        /// 渲染 HTML 之前调用(AJAX回发)
        /// </summary>
        protected override void OnAjaxPreRender()
        {
            base.OnAjaxPreRender();

            StringBuilder sb = new StringBuilder();

            if (PropertyModified("Readonly"))
            {
                sb.AppendFormat("{0}.setReadOnly({1});", XID, Readonly.ToString().ToLower());
            }

            if (PropertyModified("Label"))
            {
                string newLabel = Label;
                if (ShowRedStar)
                {
                    newLabel += GetRedStarHtml();
                }
                //newLabel += LabelSeparator;
                sb.AppendFormat("{0}.f_setLabel({1});", XID, JsHelper.Enquote(newLabel));
            }

            AddAjaxScript(sb);
        }
예제 #12
0
 public static DefineReadonly <T> Define <T>(out Readonly <T> name, Func <T> func) => new DefineReadonly <T>(out name, func);
예제 #13
0
 public CatchBlock <T> Catch <T>(out Readonly <T> exception) where T : Exception
 {
     exception = new Readonly <T>(() => (T)this.Exception);
     return(new CatchBlock <T>(this, exception));
 }
예제 #14
0
 public Foreach(out Readonly <T> item, IEnumerable <T> collection) :
     this(out item, new Const <IEnumerable <T> >(collection))
 {
 }
예제 #15
0
 public Foreach(out Readonly <T> item, IValue <IEnumerable <T> > collection)
 {
     _collection = collection;
     item        = new Readonly <T>(() => this._itemValue);
     _item       = item;
 }
예제 #16
0
        public void S_1_012_CreateNewItemsTest()
        {
            var today = DateTime.Today;

            const string greenColor = "#1A8804";
            const string blueColor  = "#1908EF";
            const string redColor   = "#EF0808";

            //2
            Actor.AttemptsTo(
                Open.NavigationPanel,
                Pin.NavigationPanel
                );

            //3.a

            Actor.AttemptsTo(Create.Item.OfItemType(itemTypeName).ByContextMenu);

            //3.b
            var form = Actor.AsksFor(ItemPageContent.Form);

            FillItemValues(oakTypeValue, redColorValue, today);
            Actor.ChecksThat(Readonly.Of(BaseFormElements.InputOfField(chairNumberProperty, form)), Is.True);

            //3.c
            Actor.AttemptsTo(
                Save.OpenedItem.ByDoneButton(),
                Close.ActiveItemPage.ByCloseButton
                );

            //3.d
            Actor.AttemptsTo(Open.SearchPanel.OfTocItemWithPath(itemTypeName).ByContextMenu);

            //3.e
            Actor.AttemptsTo(
                Search.Simple.InMainGrid.With(new Dictionary <string, string>()
            {
                [columnLabel] = oakTypeValue
            }),
                Open.Item.InMainGrid.WithRowNumber(1).ByContextMenu.ForView
                );

            var firstChairNumber = FormattableString.Invariant($"1{sequencePadWith}3A");

            form = Actor.AsksFor(ItemPageContent.Form);
            Actor.ChecksThat(Value.Of(BaseFormElements.InputOfField(woodTypeProperty, form)), Is.EqualTo(oakTypeValue));
            Actor.ChecksThat(SelectedOptionName.Of(BaseFormElements.SelectOfField(paintColorProperty, form)), Is.EqualTo(redColorValue));
            Actor.ChecksThat(Value.Of(BaseFormElements.InputOfField(chairNumberProperty, form)), Is.EqualTo(firstChairNumber));

            var dropdownParent = Actor.AsksFor(Parent.Of(BaseFormElements.SelectOfField(paintColorProperty, form)));

            Actor.ChecksThat(ColorValue.Of(dropdownParent).AndTheProperty("background-color"), Is.EqualTo(ColorTranslator.FromHtml(redColor)));
            CheckPaintColorOption(blueColorValue, blueColor);
            CheckPaintColorOption(greenColorValue, greenColor);

            Actor.ChecksThat(Value.Of(BaseFormElements.InputOfField(dateCreatedProperty, form)), Is.EqualTo(today.ToString("d", Settings.CultureInfo)));

            //3.f
            Actor.AttemptsTo(
                Close.ActiveItemPage.ByCloseButton,
                Close.ActiveItemPage.ByCloseButton
                );

            //3.g - 3.h
            Actor.AttemptsTo(Create.Item.OfItemType(itemTypeName).BySecondaryMenu());

            //3.i
            FillItemValues(birchTypeValue, blueColorValue, today.AddDays(7));

            //3.j
            Actor.AttemptsTo(
                Save.OpenedItem.ByDoneButton(),
                Close.ActiveItemPage.ByCloseButton
                );

            //3.k
            Actor.AttemptsTo(Create.Item.OfItemType(itemTypeName).BySecondaryMenu());

            //3.l
            FillItemValues(cellValue, greenColorValue, today.AddDays(-7));

            //3.m
            Actor.AttemptsTo(
                Save.OpenedItem.ByDoneButton(),
                Close.ActiveItemPage.ByCloseButton
                );

            //4.a
            Actor.AttemptsTo(
                Open.SearchPanel.OfTocItemWithPath(itemTypeName).BySecondaryMenu,
                Search.WithCurrentSearchCriteria.InMainGrid
                );

            //4.b
            Actor.AttemptsTo(Open.Item.InMainGrid.WithValueInCell(columnLabel, cellValue).ByDoubleClick);

            CheckItemValues(new Dictionary <string, Constraint>
            {
                { woodTypeProperty, Is.True },
                { paintColorProperty, Is.False },
                { dateCreatedProperty, Is.False },
                { chairNumberProperty, Is.True }
            });

            //4.c
            Actor.AttemptsTo(Close.ActiveItemPage.ByCloseButton);

            //4.d
            Actor.AttemptsTo(Open.Item.InMainGrid.WithValueInCell(columnLabel, cellValue).ByContextMenu);
            Actor.AttemptsTo(Edit.OpenedItem.ByButton);

            CheckItemValues(new Dictionary <string, Constraint>
            {
                { woodTypeProperty, Is.False },
                { paintColorProperty, Is.True },
                { dateCreatedProperty, Is.True },
                { chairNumberProperty, Is.True }
            });

            //4.e
            Actor.AttemptsTo(Save.OpenedItem.BySaveButton);
            Actor.AttemptsTo(Close.ActiveItemPage.ByCloseButton);

            //5.a
            Actor.AttemptsTo(Search.WithCurrentSearchCriteria.InMainGrid);

            //5.a.i
            columnLabel = Actor.AsksFor(LocaleState.LabelOf.GridColumn(itemTypeName, chairNumberProperty));
            Actor.ChecksThat(MainGridState.Unfrozen.HasItemWithValueInColumn(firstChairNumber, columnLabel), Is.True);
            Actor.ChecksThat(MainGridState.Unfrozen.HasItemWithValueInColumn(FormattableString.Invariant($"1{sequencePadWith}6A"), columnLabel), Is.True);
            Actor.ChecksThat(MainGridState.Unfrozen.HasItemWithValueInColumn(FormattableString.Invariant($"1{sequencePadWith}9A"), columnLabel), Is.True);
        }
예제 #17
0
 public CatchBlock(Try @try, Readonly <T> exception)
 {
     _try       = @try;
     _exception = exception;
 }
예제 #18
0
 public static Foreach <T> Foreach <T>(out Readonly <T> item, IEnumerable <T> collection)
 => new Foreach <T>(out item, collection);
예제 #19
0
 public DefineReadonly(out Readonly <T> name, Func <T> func)
 {
     _value = new Readonly <T>(func);
     name   = _value;
 }
예제 #20
0
 public CatchDo(Readonly <T> exception, IStep catchBody)
 {
     _exception = exception;
     _catchBody = catchBody;
 }