Exemple #1
0
        private bool IsSaveable()
        {
            if (this.cboTargetLayer.Items.Count == 0)
            {
                return(false);
            }

            ILayer        layer        = _utilitiesArcmap.Layer(this.cboTargetLayer.Text);
            IFeatureLayer featurelayer = layer as IFeatureLayer;

            if (!(featurelayer == null))
            {
                IFeatureClass   featureclass  = featurelayer.FeatureClass;
                IWorkspace2     workspace     = ((IDataset)featureclass).Workspace as IWorkspace2;
                IWorkspaceEdit2 workspaceedit = (IWorkspaceEdit2)workspace;

                if (!workspaceedit.IsBeingEdited())
                {
                    return(false);
                }

                bool hasedits = false;
                workspaceedit.HasEdits(ref hasedits);
                if (!hasedits)
                {
                    return(false);
                }

                if (workspaceedit.IsInEditOperation)
                {
                    return(false);
                }
            }
            return(true);
        }