Esempio n. 1
0
        public void DoForEachBlock(BlockCallback callback)
        {
            if (callback == null)
            {
                return;
            }

            for (Int64 d = 0; d < DSize; d++)
            {
                for (Int64 v = 0; v < HVSize; v++)
                {
                    for (Int64 h = 0; h < Cluster.HVSize; h++)
                    {
                        callback.Invoke(h, v, d, GetBlockRelative(h, v, d));
                    }
                }
            }
        }
Esempio n. 2
0
        protected static bool ReadBlock(LineBuffer buffer, String title, BlockCallback callback, Object data)
        {
            String temp;
            var    start = "START_" + title;
            var    end   = "END_" + title;

            temp = buffer.GetKey();
            if (!temp.Equals(start))
            {
                MessageBox.Show(String.Format("expected: {0}, got {1}", start, temp));
                return(false);
            }

            callback(buffer, data);

            temp = buffer.GetKey();
            if (!temp.Equals(end))
            {
                MessageBox.Show(String.Format("expected: {0}, got {1}", end, temp));
                return(false);
            }
            return(true);
        }
Esempio n. 3
0
 public CallbackBlock(BlockCallback callback)
 {
     Callback = callback;
 }