Ejemplo n.º 1
0
        //# __________ PROTOCOL :: PUBLIC __________ #//
        public bool ValidateControls()
        {
            JwList<JwValidationError> all = new JwList<JwValidationError>();
            foreach( JwInputControlModel o in _controls)
            {
                if( ! o.ShouldValidate() ) continue;
                JwList<JwValidationError> v = o.Validate();
                o.ValidationErrors = v;
                o.ValidationVisibilityWrapper.LayoutVisibility = o.HasErrors();
                all.AddRange(v);
            }
            if( all.IsNotEmpty() )
            {
                FocusOnFirstError();
                JwValidationErrorFormatter formatter = new JwValidationErrorFormatter();
                String message = formatter.Format(all, "<BR>");
                _showErrorDelegate(message);
                JwUtility.PlayAlertSound(
                    _audioTonePath,
                    _audioToneRepeatCount,
                    _audioToneSleepMillis);
            }

            return all.IsEmpty();
        }
Ejemplo n.º 2
0
        //# __________ PROTOCOL :: (PRIVATE) HANDLE CHUNKED UPLOAD __________ #//
        public void _HandleChunkedUpload()
        {
            _uploads = _manager.GetChunkedScheduledUploads();
            ComputeTotalBytes(_uploads);

            VmScheduledUpload upload = null;
            long currentIndex = 0;

            while( ! _uploads.IsEmpty() )
            {
                VmScheduledUpload temp = _uploads.RemoveFirst();

                if( currentIndex + temp.SizeInBytes > _lastByteSent )
                {
                    upload = temp;
                    break;
                }
                currentIndex += temp.SizeInBytes;

            }

            if( upload == null )
            {
                System.Windows.Forms.MessageBox.Show("Unexpected case! The server still thinks that session " + _manager.GetSessionCookie() + " is uploading even though all files have been sent.  Please contact an administrator.");
                Monitor("... Complete!");
                return;
            }

            StringBuilder sb = new StringBuilder();

            long lastByteIndex =  _lastByteSent - currentIndex;

            UploadChunk(sb, upload, lastByteIndex);
        }
Ejemplo n.º 3
0
        //# __________ PROTOCOL :: EVENT MANAGER RESOLUTION __________ #//
        public VmEventManagerIF GetMostRecentlyUsedEventManager()
        {
            JwList<VmEventManagerIF> v = new JwList<VmEventManagerIF>();
            AddIfBeingUsed(v, ItemEventManager);
            AddIfBeingUsed(v, NestEventManager);
            AddIfBeingUsed(v, AliasEventManager);

            if( v.IsEmpty() ) return null;

            v.Sort( new VmEventManagerMostRecentlyUsedComparer());
            return v.GetLast();
        }