示例#1
0
        private void CheckinProcess()
        {
            try
            {
                if (_fcs == null || _fcs.Count == 0)
                {
                    return;
                }

                string errMsg = String.Empty;
                foreach (IFeatureClass fc in _fcs)
                {
                    _resultString = new StringBuilder();
                    _inserted     = 0; _updated = 0; _deleted = 0; _conflicts = 0;
                    _processedFc  = fc;
                    SetListItemImage(fc, 1);

                    IFeatureClass parentFc = Replication.FeatureClassParentFc(fc, out errMsg);
                    if (parentFc == null)
                    {
                        SetItemText(fc, errMsg, true, true);
                        SetListItemImage(fc, 3);
                        continue;
                    }

                    Replication repl = new Replication();
                    repl.CheckIn_FeatureInserted  += new Replication.CheckIn_FeatureInsertedEventHandler(repl_CheckIn_FeatureInserted);
                    repl.CheckIn_FeatureUpdated   += new Replication.CheckIn_FeatureUpdatedEventHandler(repl_CheckIn_FeatureUpdated);
                    repl.CheckIn_FeatureDeleted   += new Replication.CheckIn_FeatureDeletedEventHandler(repl_CheckIn_FeatureDeleted);
                    repl.CheckIn_ConflictDetected += new Replication.CheckIn_ConflictDetectedEventHandler(repl_CheckIn_ConflictDetected);
                    repl.CheckIn_BeginPost        += new Replication.CheckIn_BeginPostEventHandler(repl_CheckIn_BeginPost);
                    repl.CheckIn_Message          += new Replication.CheckIn_MessageEventHandler(repl_CheckIn_Message);
                    SetItemText(fc, "", true, true);
                    SetItemText(fc, "Checkin:", true, true);
                    Replication.ProcessType type = Replication.ProcessType.Reconcile;
                    if (!repl.Process(parentFc, fc, type, out errMsg))
                    {
                        SetItemText(fc, errMsg, true, true);
                        SetListItemImage(fc, 3);
                    }
                    else
                    {
                        _resultString.Append("Reconcile:\t" + _inserted + "\t" + _updated + "\t" + _deleted + "\t" + _conflicts);
                        SetItemText(fc, _resultString.ToString(), false, false);
                        SetListItemImage(fc, 2);
                    }
                }
            }
            catch
            {
            }
            finally
            {
                ThreadFinished();
                _thread = null;
            }
        }
示例#2
0
        public void ShowDialog(gView.Framework.Data.IFeatureClass fc)
        {
            _childFc = fc;
            string errMsg;

            _parentFc = Replication.FeatureClassParentFc(_childFc, out errMsg);
            if (_parentFc == null || _parentFc.Dataset == null)
            {
                MessageBox.Show("ERROR: " + errMsg);
            }
            else
            {
                txtDatasetName.Text     = _parentFc.Dataset.GetType().ToString();
                txtDatasetLocation.Text = _parentFc.Dataset.ConnectionString;
                txtTargetClass.Text     = _parentFc.Name;

                this.ShowDialog();
            }
        }