Exemplo n.º 1
0
 public void SetBooleanValue(string columnName, bool?value)
 {
     NullableBool tempvalue = value.HasValue ? new NullableBool(value.Value) : null;
     {
         CommonPINVOKE.DataRow_SetBooleanValue__SWIG_1(swigCPtr, columnName, NullableBool.getCPtr(tempvalue));
         if (CommonPINVOKE.SWIGPendingException.Pending)
         {
             throw CommonPINVOKE.SWIGPendingException.Retrieve();
         }
     }
 }
Exemplo n.º 2
0
        private bool GetCanSeek()
        {
            Debug.Assert(!IsClosed);
            Debug.Assert(!IsInvalid);

            NullableBool canSeek = _canSeek;

            if (canSeek == NullableBool.Undefined)
            {
                _canSeek = canSeek = Interop.Sys.LSeek(this, 0, Interop.Sys.SeekWhence.SEEK_CUR) >= 0 ? NullableBool.True : NullableBool.False;
            }

            return(canSeek == NullableBool.True);
        }
Exemplo n.º 3
0
        public void GetHashCodeNullableBool()
        {
            // ExStart
            // ExFor: NullableBool.GetHashCode
            // ExSummary: Shows how to work with <see cref="Aspose.Tasks.NullableBool" />.GetHashCode method.
            var bool1 = new NullableBool(true);
            var bool2 = new NullableBool(true, false);

            // the hash code of bools is based on 'IsDefined' and 'Value' properties
            Console.WriteLine("Bool 1: {0} Hash Code 1: {1}", bool1.ToString(), bool1.GetHashCode());
            Console.WriteLine("Bool 2: {0} Hash Code 1: {1}", bool2.ToString(), bool2.GetHashCode());

            // ExEnd
        }
Exemplo n.º 4
0
 public bool?ValueAsBoolean(string columnName)
 {
     global::System.IntPtr cPtr = CommonPINVOKE.DataRow_ValueAsBoolean__SWIG_1(swigCPtr, columnName);
     if (CommonPINVOKE.SWIGPendingException.Pending)
     {
         throw CommonPINVOKE.SWIGPendingException.Retrieve();
     }
     using (NullableBool tempValue = (cPtr == global::System.IntPtr.Zero) ? null : new NullableBool(cPtr, false)) {
         if (tempValue?.HasValue() ?? false)
         {
             return(tempValue.GetValueOrDefault());
         }
         return(null);
     }
 }
            public void onParticipantCreate(
                MamdaSubscription subscription,
                MamdaMultiParticipantManager manager,
                string participantId,
                NullableBool isPrimary)
            {
                MamdaTradeListener aTradeListener = new MamdaTradeListener();
                MamdaQuoteListener aQuoteListener = new MamdaQuoteListener();
                ComboTicker        aTicker        = new ComboTicker();

                aTradeListener.addHandler(aTicker);
                aQuoteListener.addHandler(aTicker);

                manager.addParticipantListener(aTradeListener, participantId);
                manager.addParticipantListener(aQuoteListener, participantId);
            }
Exemplo n.º 6
0
        public static bool?AsBool(this NullableBool value)
        {
            switch (value)
            {
            case NullableBool.Null:
                return(null);

            case NullableBool.True:
                return(true);

            case NullableBool.False:
                return(false);

            default:
                throw new ArgumentOutOfRangeException(nameof(value), value, null);
            }
        }
Exemplo n.º 7
0
        public void EqualsNullableBool()
        {
            // ExStart
            // ExFor: NullableBool.Equals(NullableBool)
            // ExFor: NullableBool.Equals(Object)
            // ExFor: NullableBool.op_Equality(NullableBool,NullableBool)
            // ExFor: NullableBool.op_Implicit(NullableBool)~System.Boolean
            // ExFor: NullableBool.op_Implicit(System.Boolean)~NullableBool
            // ExFor: NullableBool.op_Inequality(NullableBool,NullableBool)
            // ExSummary: Shows how to compare <see cref="Aspose.Tasks.NullableBool" /> instances.
            var bool1 = new NullableBool(true);
            var bool2 = new NullableBool(true, false);

            // the equality of bools is checked against to 'IsDefined' and 'Value' properties.
            Console.WriteLine("Nullable Bool 1: " + bool1.ToString());
            Console.WriteLine("Nullable Bool 2: " + bool2.ToString());
            Console.WriteLine("Are bools equal: " + bool1.Equals(bool2));

            // ExEnd
        }
Exemplo n.º 8
0
        public void WorkWithNullableBool()
        {
            // ExStart:WorkWithNullableBool
            // ExFor: NullableBool
            // ExFor: NullableBool.#ctor(Boolean)
            // ExFor: NullableBool.#ctor(Boolean,Boolean)
            // ExFor: NullableBool.IsDefined
            // ExFor: NullableBool.Value
            // ExFor: NullableBool.ToString
            // ExSummary: Shows how to work with <see cref="NullableBool" /> class.
            var project = new Project();

            // lets check where the <see cref="Aspose.Tasks.NullableBool" /> class is used
            // the main advantage of <see cref="Aspose.Tasks.NullableBool" /> that
            // one can set it as undefined through constructing
            var actualsInSync = new NullableBool(false, false);

            Console.WriteLine("'ActualsInSync' Value: " + actualsInSync.Value);
            Console.WriteLine("'ActualsInSync' Is Defined: " + actualsInSync.IsDefined);

            // ...
            // use nullable bool instance
            project.Set(Prj.ActualsInSync, actualsInSync);

            // ...
            var honorConstraints = new NullableBool(true);

            Console.WriteLine("'HonorConstraints' ToString: " + honorConstraints.ToString());

            // ...
            // use nullable bool instance
            project.Set(Prj.HonorConstraints, honorConstraints);

            // ...
            // ExEnd:WorkWithNullableBool
        }
Exemplo n.º 9
0
 private void OnInputMouseUp()
 {
     if (!SelectOnFocus) return;
     if (wasFocusedOnMouseDown == NullableBool.Nothing) return;
     if (wasFocusedOnMouseDown == NullableBool.No)
     {
         // NB: Delayed action avoid default textbox behavior removing the selection on mouse-up.
         DelayedAction.Invoke(0.01, Select);
     }
     wasFocusedOnMouseDown = NullableBool.Nothing;
 }
Exemplo n.º 10
0
 private void OnInputMouseDown()
 {
     if (!SelectOnFocus) return;
     wasFocusedOnMouseDown = Focus.IsFocused ? NullableBool.Yes : NullableBool.No;
 }
Exemplo n.º 11
0
 public static void SetYFHelperVisibility(FrameworkElement obj, NullableBool value)
 {
     obj.SetValue(YFHelperVisibilityProperty, value);
 }
Exemplo n.º 12
0
 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(NullableBool obj)
 {
     return((obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr);
 }