Exemplo n.º 1
0
 public void processingDelegateStructure(string rawString)
 {
     if (this.groupListControl1.InvokeRequired)
     {
         ProcessingCallback d = new ProcessingCallback(processingDelegateStructure);
         this.Invoke(d, new object[] { rawString });
     }
     else
     {
         process(rawString);
     }
 }
Exemplo n.º 2
0
 public void Load(FlxBasic objectOrGroup1, FlxBasic objectOrGroup2 = null, NotifyCallback notifyCallback = null, ProcessingCallback processingCallback = null)
 {
     Add(objectOrGroup1, A_LIST);
     if (objectOrGroup2 != null)
     {
         Add(objectOrGroup2, B_LIST);
         _useBothLists = true;
     }
     else
     {
         _useBothLists = false;
     }
     _notifyCallback     = notifyCallback;
     _processingCallback = processingCallback;
 }
Exemplo n.º 3
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (Id.Length != 0)
            {
                hash ^= Id.GetHashCode();
            }
            if (Name.Length != 0)
            {
                hash ^= Name.GetHashCode();
            }
            if (ProcessingCallback.Length != 0)
            {
                hash ^= ProcessingCallback.GetHashCode();
            }
            hash ^= inputFormats_.GetHashCode();
            hash ^= outputFormats_.GetHashCode();
            if (OnCreated.Length != 0)
            {
                hash ^= OnCreated.GetHashCode();
            }
            if (ProcessFrequency != 0F)
            {
                hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(ProcessFrequency);
            }
            hash ^= authors_.GetHashCode();
            hash ^= tags_.GetHashCode();
            if (Description.Length != 0)
            {
                hash ^= Description.GetHashCode();
            }
            if (Status != 0)
            {
                hash ^= Status.GetHashCode();
            }
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
Exemplo n.º 4
0
 public void ShowProgressBar(int value, int max)
 {
     if (progressBar1.InvokeRequired)
     {
         ProcessingCallback d = new ProcessingCallback(ShowProgressBar);
         this.Invoke(d, new object[] { value, max });
     }
     else
     {
         progressBar1.Visible = true;
         progressBar1.Maximum = max;
         if (value > max)
         {
             progressBar1.Visible = false;
         }
         else
         {
             progressBar1.Value = value;
         }
     }
 }
Exemplo n.º 5
0
 private void WriteLog(string str)
 {
     if (Form.downloadLog.InvokeRequired)
     {
         ProcessingCallback d = new ProcessingCallback(WriteLog);
         Form.Invoke(d, new object[] { str });
     }
     else
     {
         Form.downloadLog.Items.Add(str);
         if (!Form.threadIsEnd[ThreadID] && !Form.isPause)
         {
             int tempValue = 0;
             for (int i = 0; i < Form.threadNum; i++)
             {
                 tempValue += Form.hasReceived[i];
             }
             Form.progressBar.Value = tempValue;
             Form.progress.Text     = (int)((float)Form.progressBar.Value / (float)Form.progressBar.Maximum * 100) + "%";
         }
     }
 }
Exemplo n.º 6
0
        public void Dispose()
        {
            _headA = null;
            _headB = null;

            _tailA = null;
            _tailB = null;

            _northWestTree = null;
            _northEastTree = null;

            _southEastTree = null;
            _southWestTree = null;

            _object             = null;
            _processingCallback = null;
            _notifyCallback     = null;

            Exists = false;

            next             = _cachedTreesHead;
            _cachedTreesHead = this;
            _NUM_CACHED_QUAD_TREES++;
        }
Exemplo n.º 7
0
 private void WriteEndLog(string str)
 {
     if (downloadLog.InvokeRequired)
     {
         ProcessingCallback d = new ProcessingCallback(WriteEndLog);
         Invoke(d, new object[] { str });
     }
     else
     {
         downloadLog.Items.Add(str);
         downloadLog.Items.Add("");
         downloadLog.Items.Add("");
         downloadButton.Text     = "下载";
         downloadButton.Visible  = true;
         downloadButton.Enabled  = true;
         pauseButton.Visible     = false;
         pauseButton.Enabled     = false;
         progressBar.Value       = 0;
         progress.Text           = "0%";
         downloadFileURI.Enabled = true;
         saveFileName.Enabled    = true;
         first = true;
     }
 }
Exemplo n.º 8
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (Id.Length != 0)
            {
                hash ^= Id.GetHashCode();
            }
            if (Name.Length != 0)
            {
                hash ^= Name.GetHashCode();
            }
            if (ProcessingCallback.Length != 0)
            {
                hash ^= ProcessingCallback.GetHashCode();
            }
            hash ^= inputFormats_.GetHashCode();
            hash ^= outputFormats_.GetHashCode();
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
Exemplo n.º 9
0
        /// <summary> Update processing display </summary>
        /// <param name="text">Text to display in status bar</param>
        /// <remarks>Invoked from threaded process</remarks>
        private void ProcessingEvent(string text)
        {
            var callBack = new ProcessingCallback(Processing);

            Invoke(callBack, new object[] { text });
        }
Exemplo n.º 10
0
        /// <summary> Update processing display </summary>
        /// <param name="text">Text to display</param>
        /// <remarks>Invoked from threaded process</remarks>
        private void ProcessingEvent(string text)
        {
            var callBack = new ProcessingCallback(Processing);

            Invoke(callBack, text);
        }
Exemplo n.º 11
0
        /// <summary> Update processing display </summary>
        /// <param name="text">Text to display</param>
        /// <param name="progressAmount">The new progress amount</param>
        /// <remarks>Invoked from threaded process</remarks>
        private void ProcessingEvent(string text, int progressAmount)
        {
            var callBack = new ProcessingCallback(Processing);

            Invoke(callBack, text, progressAmount);
        }
Exemplo n.º 12
0
        /// <summary>
        /// Call this function to see if one `FlxObject` overlaps another within `FlxG.worldBounds`.
        /// Can be called with one object and one group, or two groups, or two objects,
        /// whatever floats your boat! For maximum performance try bundling a lot of objects
        /// together using a `FlxGroup` (or even bundling groups together!).
        ///
        /// NOTE: does NOT take objects' `scrollFactor` into account, all overlaps are checked in world space.
        ///
        /// NOTE: this takes the entire area of `FlxTilemap`s into account (including "empty" tiles).
        ///       Use `FlxTilemap#overlaps()` if you don't want that.
        /// </summary>
        /// <param name="objectOrGroup1">The first object or group you want to check.</param>
        /// <param name="objectOrGroup2">The second object or group you want to check. If it is the same as the first,Flixel knows to just do a comparison within that group.</param>
        /// <param name="notifyCallback">A function with two `FlxObject` parameters -e.g. `onOverlap(object1:FlxObject, object2:FlxObject)` -that is called if those two objects overlap.</param>
        /// <param name="processingCallback">A function with two `FlxObject` parameters -e.g. `onOverlap(object1:FlxObject, object2:FlxObject)` -that is called if those two objects overlap.If a `ProcessCallback` is provided, then `NotifyCallback`will only be called if `ProcessCallback` returns true for those objects!</param>
        /// <returns>Whether any overlaps were detected.</returns>
        public static bool Overlap(FlxBasic objectOrGroup1 = null, FlxBasic objectOrGroup2 = null, NotifyCallback notifyCallback = null, ProcessingCallback processingCallback = null)
        {
            if (objectOrGroup1 == null)
            {
                objectOrGroup1 = Game.CurrentState;
            }
            if (objectOrGroup1 == objectOrGroup2)
            {
                objectOrGroup2 = null;
            }
            FlxQuadTree.Divisions = WorldDivisions;
            FlxQuadTree quadTree = FlxQuadTree.Recycle(WorldBounds.X, WorldBounds.Y, WorldBounds.Width, WorldBounds.Height);

            quadTree.Load(objectOrGroup1, objectOrGroup2, notifyCallback, processingCallback);
            bool result = quadTree.Execute();

            quadTree.Dispose();
            return(result);
        }