public string NewOrientationPoint(string StationID, string Type, string IdentityConfidence,
                                          string Label, int PlotAtScale, double Azimuth, double Inclination, double OrientationConfidenceDegrees,
                                          string Notes, string DataSourceID, int SymbolRotation, int RuleID, IPoint Shape)
        {
            OrientationPoint newOrientationPoint = new OrientationPoint();

            sysInfo SysInfoTable = new sysInfo(m_theWorkspace);

            newOrientationPoint.OrientationPoints_ID = SysInfoTable.ProjAbbr + ".OrientationPoints." + SysInfoTable.GetNextIdValue("OrientationPoints");
            newOrientationPoint.StationID            = StationID;
            newOrientationPoint.Type = Type;
            newOrientationPoint.IdentityConfidence = IdentityConfidence;
            newOrientationPoint.Label       = Label;
            newOrientationPoint.PlotAtScale = PlotAtScale;
            newOrientationPoint.Azimuth     = Azimuth;
            newOrientationPoint.Inclination = Inclination;
            newOrientationPoint.OrientationConfidenceDegrees = OrientationConfidenceDegrees;
            newOrientationPoint.Notes          = Notes;
            newOrientationPoint.DataSourceID   = DataSourceID;
            newOrientationPoint.SymbolRotation = SymbolRotation;
            newOrientationPoint.RuleID         = RuleID;
            newOrientationPoint.Shape          = Shape;
            newOrientationPoint.RequiresUpdate = false;

            m_OrientationPointsDictionary.Add(newOrientationPoint.OrientationPoints_ID, newOrientationPoint);
            return(newOrientationPoint.OrientationPoints_ID);
        }
示例#2
0
        public string NewDescriptionOfMapUnit(string MapUnit, string Name, string FullName,
                                              string Label, string Age, string Description, string HierarchyKey, string ParagraphStyle,
                                              string AreaFillRGB, string AreaFillPatternDescription, string DescriptionSourceID,
                                              string GeneralLithology, string GeneralLithologyConfidence)
        {
            DescriptionOfMapUnit newDescriptionOfMapUnit = new DescriptionOfMapUnit();

            sysInfo SysInfoTable = new sysInfo(m_theWorkspace);

            newDescriptionOfMapUnit.DescriptionOfMapUnits_ID = SysInfoTable.ProjAbbr + ".DescriptionOfMapUnits." + SysInfoTable.GetNextIdValue("DescriptionOfMapUnits");
            newDescriptionOfMapUnit.MapUnit                    = MapUnit;
            newDescriptionOfMapUnit.Name                       = Name;
            newDescriptionOfMapUnit.FullName                   = FullName;
            newDescriptionOfMapUnit.Label                      = Label;
            newDescriptionOfMapUnit.Age                        = Age;
            newDescriptionOfMapUnit.Description                = Description;
            newDescriptionOfMapUnit.HierarchyKey               = HierarchyKey;
            newDescriptionOfMapUnit.ParagraphStyle             = ParagraphStyle;
            newDescriptionOfMapUnit.AreaFillRGB                = AreaFillRGB;
            newDescriptionOfMapUnit.AreaFillPatternDescription = AreaFillPatternDescription;
            newDescriptionOfMapUnit.DescriptionSourceID        = DescriptionSourceID;
            newDescriptionOfMapUnit.GeneralLithology           = GeneralLithology;
            newDescriptionOfMapUnit.GeneralLithologyConfidence = GeneralLithologyConfidence;
            newDescriptionOfMapUnit.RequiresUpdate             = false;

            m_DescriptionOfMapUnitsDictionary.Add(newDescriptionOfMapUnit.DescriptionOfMapUnits_ID, newDescriptionOfMapUnit);
            return(newDescriptionOfMapUnit.DescriptionOfMapUnits_ID);
        }
        public sourceLegendItemSelection(IWorkspace theWorkspace)
        {
            InitializeComponent();

            sysInfo sourceSysInfo = new sysInfo(theWorkspace);
            this.grpSourceLegend.Text = sourceSysInfo.ProjName;

            m_theWorkspace = theWorkspace;

            PopulateListbox();
        }
        public string NewGlossary(string Term, string Definition, string DefinitionSourceID)
        {
            Glossary newGlossary = new Glossary();

            sysInfo SysInfoTable = new sysInfo(m_theWorkspace);
            newGlossary.Glossary_ID = SysInfoTable.ProjAbbr + ".Glossary." + SysInfoTable.GetNextIdValue("Glossary");
            newGlossary.Term = Term;
            newGlossary.Definition = Definition;
            newGlossary.DefinitionSourceID = DefinitionSourceID;
            newGlossary.RequiresUpdate = false;

            m_GlossaryDictionary.Add(newGlossary.Glossary_ID, newGlossary);
            return newGlossary.Glossary_ID;
        }
        public string NewGlossary(string Term, string Definition, string DefinitionSourceID)
        {
            Glossary newGlossary = new Glossary();

            sysInfo SysInfoTable = new sysInfo(m_theWorkspace);

            newGlossary.Glossary_ID        = SysInfoTable.ProjAbbr + ".Glossary." + SysInfoTable.GetNextIdValue("Glossary");
            newGlossary.Term               = Term;
            newGlossary.Definition         = Definition;
            newGlossary.DefinitionSourceID = DefinitionSourceID;
            newGlossary.RequiresUpdate     = false;

            m_GlossaryDictionary.Add(newGlossary.Glossary_ID, newGlossary);
            return(newGlossary.Glossary_ID);
        }
示例#6
0
        public string NewDataSourcePoly(string MapUnit, string IdentityConfidence,
                                        string Label, string Notes, string DataSourceID, string Symbol, IPolygon Shape)
        {
            DataSourcePoly newDataSourcePoly = new DataSourcePoly();

            sysInfo SysInfoTable = new sysInfo(m_theWorkspace);

            newDataSourcePoly.DataSourcePolys_ID = SysInfoTable.ProjAbbr + ".DataSourcePolys." + SysInfoTable.GetNextIdValue("DataSourcePolys");
            newDataSourcePoly.Notes          = Notes;
            newDataSourcePoly.DataSourceID   = DataSourceID;
            newDataSourcePoly.Shape          = Shape;
            newDataSourcePoly.RequiresUpdate = false;

            m_DataSourcePolysDictionary.Add(newDataSourcePoly.DataSourcePolys_ID, newDataSourcePoly);
            return(newDataSourcePoly.DataSourcePolys_ID);
        }
        // The NewDatasource method creates a new, blank Datasource Structure with a new ID.
        //  Other parameters are provided by the function call.
        //  Returns the ID of the new DataSource
        public string NewDataSource(string Source, string Notes)
        {
            // Create a Datasource structure
            Datasource newDataSource = new Datasource();

            // Attribute the Datasource structure
            sysInfo SysInfoTable = new sysInfo(m_theWorkspace);

            newDataSource.DataSources_ID = SysInfoTable.ProjAbbr + ".DataSources." + SysInfoTable.GetNextIdValue("DataSources");
            newDataSource.Source         = Source;
            newDataSource.Notes          = Notes;
            newDataSource.RequiresUpdate = false;

            // Add the Datasource to the collection
            m_dataSourceDictionary.Add(newDataSource.DataSources_ID, newDataSource);
            return(newDataSource.DataSources_ID);
        }
        public string NewStandardLithology(string MapUnit, string PartType, string Lithology, string ProportionTerm,
                                           double ProportionValue, string ScientificConfidence, string DataSourceID)
        {
            StandardLithology newStandardLithology = new StandardLithology();

            sysInfo SysInfoTable = new sysInfo(m_theWorkspace);

            newStandardLithology.StandardLithology_ID = SysInfoTable.ProjAbbr + ".StandardLithology." + SysInfoTable.GetNextIdValue("StandardLithology");

            newStandardLithology.MapUnit              = MapUnit;
            newStandardLithology.PartType             = PartType;
            newStandardLithology.Lithology            = Lithology;
            newStandardLithology.ProportionTerm       = ProportionTerm;
            newStandardLithology.ProportionValue      = ProportionValue;
            newStandardLithology.ScientificConfidence = ScientificConfidence;
            newStandardLithology.DataSourceID         = DataSourceID;
            newStandardLithology.RequiresUpdate       = false;

            m_StandardLithologyDictionary.Add(newStandardLithology.StandardLithology_ID, newStandardLithology);
            return(newStandardLithology.StandardLithology_ID);
        }
        private Dictionary<string, TimeScale> m_TimeScaleDictionary = new Dictionary<string, TimeScale>(); /// Timescale dictionary with era term, start time and end time    

        #endregion Fields

        #region Constructors

        // Some logic here which tries to adjust depending on the edit state/ncgmp validity
        public dwnMapUnitLegendEditor(object hook)
        {
            InitializeComponent();
            this.Hook = hook;

            // Check for edit state
            // -------------------------------------------------------------------
            // -------------------------------------------------------------------
            // Note: This seems to be getting called at wierd times, like the first time you save some edits
            // -------------------------------------------------------------------
            // -------------------------------------------------------------------
            IEditor theEditor = ArcMap.Editor;
            if (theEditor.EditState == esriEditState.esriStateEditing)
            {
                m_theWorkspace = theEditor.EditWorkspace;
                if (ncgmpChecks.IsWorkspaceMinNCGMPCompliant(m_theWorkspace) == true)
                {
                    sysInfo SysInfoTable = new sysInfo(m_theWorkspace);
                    this.tlslblLegendName.Text = SysInfoTable.ProjName;
                    PopulateMainLegendTree();
                }
                else
                {
                    this.tlslblLegendName.Text = "Not Editing.";
                    ClearMainLegendTree();
                }
            }
            else
            {
                this.tlslblLegendName.Text = "Not Editing.";
                ClearMainLegendTree();
            }

            if (trvLegendItems.SelectedNode != null)
            {
                initLithListBox(txtMapUnitAbbreviation.Text);
            }

            initEmptyAgeEventTab();
        }
        public string NewStation(string StationID, string Type,
                                 string Label, int PlotAtScale, double LocationConfidenceMeters, double Latitude, double Longitude,
                                 string DataSourceID, IPoint Shape)
        {
            Station newStation = new Station();

            sysInfo SysInfoTable = new sysInfo(m_theWorkspace);

            newStation.Stations_ID = SysInfoTable.ProjAbbr + ".Stations." + SysInfoTable.GetNextIdValue("Stations");
            newStation.FieldID     = StationID;
            newStation.Label       = Label;
            newStation.PlotAtScale = PlotAtScale;
            newStation.LocationConfidenceMeters = LocationConfidenceMeters;
            newStation.Latitude       = Latitude;
            newStation.Longitude      = Longitude;
            newStation.DataSourceID   = DataSourceID;
            newStation.Shape          = Shape;
            newStation.RequiresUpdate = false;

            m_StationsDictionary.Add(newStation.Stations_ID, newStation);
            return(newStation.Stations_ID);
        }
示例#11
0
        public string NewGenericSample(string StationID,
                                       string Label, int PlotAtScale, double LocationConfidenceMeters,
                                       string Notes, string DataSourceID, string RuleID, IPoint Shape)
        {
            GenericSample newGenericSample = new GenericSample();

            sysInfo SysInfoTable = new sysInfo(m_theWorkspace);

            newGenericSample.GenericSamples_ID        = SysInfoTable.ProjAbbr + ".GenericSamples." + SysInfoTable.GetNextIdValue("GenericSamples");
            newGenericSample.FieldID                  = StationID;
            newGenericSample.Label                    = Label;
            newGenericSample.PlotAtScale              = PlotAtScale;
            newGenericSample.LocationConfidenceMeters = LocationConfidenceMeters;
            newGenericSample.Notes                    = Notes;
            newGenericSample.RuleID                   = RuleID;
            newGenericSample.DataSourceID             = DataSourceID;
            newGenericSample.Shape                    = Shape;
            newGenericSample.RequiresUpdate           = false;

            m_GenericSamplesDictionary.Add(newGenericSample.GenericSamples_ID, newGenericSample);
            return(newGenericSample.GenericSamples_ID);
        }
        public string NewExtendedAttributes(string OwnerID, string OwnerTable, string Property, string PropertyValue,
                                            string ValueLinkID, string Qualifier, string DataSourceID, string Notes)
        {
            ExtendedAttributes newExtendedAttributes = new ExtendedAttributes();

            sysInfo SysInfoTable = new sysInfo(m_theWorkspace);

            newExtendedAttributes.ExtendedAttributes_ID = SysInfoTable.ProjAbbr + ".ExtendedAttributes." + SysInfoTable.GetNextIdValue("ExtendedAttributes");

            newExtendedAttributes.OwnerID       = OwnerID;
            newExtendedAttributes.OwnerTable    = OwnerTable;
            newExtendedAttributes.Property      = Property;
            newExtendedAttributes.PropertyValue = PropertyValue;
            newExtendedAttributes.ValueLinkID   = ValueLinkID;
            newExtendedAttributes.Qualifier     = Qualifier;
            newExtendedAttributes.DataSourceID  = DataSourceID;
            newExtendedAttributes.Notes         = Notes;

            m_ExtendedAttributesDictionary.Add(newExtendedAttributes.ExtendedAttributes_ID, newExtendedAttributes);

            return(newExtendedAttributes.ExtendedAttributes_ID);
        }
        public string NewGeologicLine(string Type, double LocationConfidenceMeters, string ExistenceConfidence, string IdentityConfidence,
                                      string Symbol, string Label, string Notes, string DataSourceID, string RuleID, IPolyline Shape)
        {
            GeologicLine newGeologicLine = new GeologicLine();

            sysInfo SysInfoTable = new sysInfo(m_theWorkspace);

            newGeologicLine.GeologicLines_ID         = SysInfoTable.ProjAbbr + ".GeologicLines." + SysInfoTable.GetNextIdValue("GeologicLines");
            newGeologicLine.Type                     = Type;
            newGeologicLine.LocationConfidenceMeters = LocationConfidenceMeters;
            newGeologicLine.ExistenceConfidence      = ExistenceConfidence;
            newGeologicLine.IdentityConfidence       = IdentityConfidence;
            newGeologicLine.Symbol                   = Symbol;
            newGeologicLine.Label                    = Label;
            newGeologicLine.Notes                    = Notes;
            newGeologicLine.DataSourceID             = DataSourceID;
            newGeologicLine.RuleID                   = RuleID;
            newGeologicLine.Shape                    = Shape;
            newGeologicLine.RequiresUpdate           = false;

            m_GeologicLinesDictionary.Add(newGeologicLine.GeologicLines_ID, newGeologicLine);
            return(newGeologicLine.GeologicLines_ID);
        }
        public string NewGeologicEvents(string Event, string AgeDisplay, string AgeYoungerTerm, string AgeOlderTerm, string TimeScale,
                                        string AgeYoungerValue, string AgeOlderValue, string DataSourceID, string Notes)
        {
            GeologicEvents newGeologicEvents = new GeologicEvents();

            sysInfo SysInfoTable = new sysInfo(m_theWorkspace);

            newGeologicEvents.GeologicEvents_ID = SysInfoTable.ProjAbbr + ".GeologicEvents." + SysInfoTable.GetNextIdValue("GeologicEvents");

            newGeologicEvents.Event           = Event;
            newGeologicEvents.AgeDisplay      = AgeDisplay;
            newGeologicEvents.AgeYoungerTerm  = AgeYoungerTerm;
            newGeologicEvents.AgeOlderTerm    = AgeOlderTerm;
            newGeologicEvents.TimeScale       = TimeScale;
            newGeologicEvents.AgeYoungerValue = AgeYoungerValue;
            newGeologicEvents.AgeOlderValue   = AgeOlderValue;
            newGeologicEvents.DataSourceID    = DataSourceID;
            newGeologicEvents.Notes           = Notes;
            newGeologicEvents.RequiresUpdate  = false;

            m_GeologicEventsDictionary.Add(newGeologicEvents.GeologicEvents_ID, newGeologicEvents);
            return(newGeologicEvents.GeologicEvents_ID);
        }
示例#15
0
        public string NewContactsAndFault(string Type, int IsConcealed, double LocationConfidenceMeters, string ExistenceConfidence, string IdentityConfidence,
                                          string Symbol, string Label, string Notes, string DataSourceID, string RuleID, IPolyline Shape)
        {
            ContactsAndFault newContactsAndFault = new ContactsAndFault();

            sysInfo SysInfoTable = new sysInfo(m_theWorkspace);

            newContactsAndFault.ContactsAndFaults_ID = SysInfoTable.ProjAbbr + ".ContactsAndFaults." + SysInfoTable.GetNextIdValue("ContactsAndFaults");
            newContactsAndFault.Type        = Type;
            newContactsAndFault.IsConcealed = IsConcealed;
            newContactsAndFault.LocationConfidenceMeters = LocationConfidenceMeters;
            newContactsAndFault.ExistenceConfidence      = ExistenceConfidence;
            newContactsAndFault.IdentityConfidence       = IdentityConfidence;
            newContactsAndFault.Symbol         = Symbol;
            newContactsAndFault.Label          = Label;
            newContactsAndFault.Notes          = Notes;
            newContactsAndFault.DataSourceID   = DataSourceID;
            newContactsAndFault.RuleID         = RuleID;
            newContactsAndFault.Shape          = Shape;
            newContactsAndFault.RequiresUpdate = false;

            m_ContactsAndFaultsDictionary.Add(newContactsAndFault.ContactsAndFaults_ID, newContactsAndFault);
            return(newContactsAndFault.ContactsAndFaults_ID);
        }
示例#16
0
        public string NewNote(string OwnerID, string Notes, string Type, string DataSourceID)
        {
            Note newNote = new Note();

            sysInfo SysInfoTable = new sysInfo(m_theWorkspace);
            newNote.Notes_ID = SysInfoTable.ProjAbbr + ".Notes." + SysInfoTable.GetNextIdValue("Notes");
            newNote.OwnerID = OwnerID;
            newNote.Notes = Notes;
            newNote.Type = Type;
            newNote.DataSourceID = DataSourceID;
            newNote.RequiresUpdate = false;

            m_NotesDictionary.Add(newNote.Notes_ID, newNote);
            return newNote.Notes_ID;
        }
        // The NewDatasource method creates a new, blank Datasource Structure with a new ID.
        //  Other parameters are provided by the function call.
        //  Returns the ID of the new DataSource
        public string NewDataSource(string Source, string Notes)
        {
            // Create a Datasource structure
            Datasource newDataSource = new Datasource();

            // Attribute the Datasource structure
            sysInfo SysInfoTable = new sysInfo(m_theWorkspace);
            newDataSource.DataSources_ID = SysInfoTable.ProjAbbr + ".DataSources." + SysInfoTable.GetNextIdValue("DataSources");
            newDataSource.Source = Source;
            newDataSource.Notes = Notes;
            newDataSource.RequiresUpdate = false;

            // Add the Datasource to the collection
            m_dataSourceDictionary.Add(newDataSource.DataSources_ID, newDataSource);
            return newDataSource.DataSources_ID;
        }
        public string NewRelatedDocument(string OwnerID, string DocumentPath, string DocumentName, string Notes, string Type, string DataSourceID)
        {
            RelatedDocument newRelatedDocument = new RelatedDocument();

            sysInfo SysInfoTable = new sysInfo(m_theWorkspace);
            newRelatedDocument.RelatedDocuments_ID = SysInfoTable.ProjAbbr + ".RelatedDocuments." + SysInfoTable.GetNextIdValue("RelatedDocuments");
            newRelatedDocument.OwnerID = OwnerID;
            newRelatedDocument.DocumentName = DocumentName;
            newRelatedDocument.DocumentPath = DocumentPath;
            newRelatedDocument.Notes = Notes;
            newRelatedDocument.Type = Type;
            newRelatedDocument.DataSourceID = DataSourceID;
            newRelatedDocument.RequiresUpdate = false;

            m_RelatedDocumentsDictionary.Add(newRelatedDocument.RelatedDocuments_ID, newRelatedDocument);
            return newRelatedDocument.RelatedDocuments_ID;
        }
        private void tlsbtnRefreshLegend_Click(object sender, EventArgs e)
        {
            // Clear Inputs and refresh the Legend Tree
            ClearLithologyInput();
            ClearMapUnitInput();
            PopulateMainLegendTree();

            // Update the Legend title
            sysInfo sysInfoForm = new sysInfo(m_theWorkspace);
            tlslblLegendName.Text = sysInfoForm.ProjName;

            initAgeTab(txtMapUnitAbbreviation.Text);
        }
        public string NewOrientationDataPoint(string StationID, string Type, string IdentityConfidence, 
            string Label, int PlotAtScale, double Azimuth, double Inclination, double OrientationConfidenceDegrees,
            string Notes, string DataSourceID, int SymbolRotation, int Symbol, IPoint Shape)
        {
            OrientationDataPoint newOrientationDataPoint = new OrientationDataPoint();

            sysInfo SysInfoTable = new sysInfo(m_theWorkspace);
            newOrientationDataPoint.OrientationDataPoints_ID = SysInfoTable.ProjAbbr + ".OrientationDataPoints." + SysInfoTable.GetNextIdValue("OrientationDataPoints");
            newOrientationDataPoint.StationID = StationID;
            newOrientationDataPoint.Type = Type;
            newOrientationDataPoint.IdentityConfidence = IdentityConfidence;
            newOrientationDataPoint.Label = Label;
            newOrientationDataPoint.PlotAtScale = PlotAtScale;
            newOrientationDataPoint.Azimuth = Azimuth;
            newOrientationDataPoint.Inclination = Inclination;
            newOrientationDataPoint.OrientationConfidenceDegrees = OrientationConfidenceDegrees;
            newOrientationDataPoint.Notes = Notes;
            newOrientationDataPoint.DataSourceID = DataSourceID;
            newOrientationDataPoint.SymbolRotation = SymbolRotation;
            newOrientationDataPoint.Symbol = Symbol;
            newOrientationDataPoint.Shape = Shape;
            newOrientationDataPoint.RequiresUpdate = false;

            m_OrientationDataPointsDictionary.Add(newOrientationDataPoint.OrientationDataPoints_ID, newOrientationDataPoint);
            return newOrientationDataPoint.OrientationDataPoints_ID;
        }
        void OnStartEditing()
        {
            // Don't do anything if the extension is disabled
            if (IsExtensionEnabled != true) { return; }

            // Check that the workspace being edited is NCGMP-valid.
            m_EditWorkspace = theEditor.EditWorkspace;
            m_DatabaseIsValid = ncgmpChecks.IsWorkspaceMinNCGMPCompliant(m_EditWorkspace);

            // Check that the SysInfo table is present.
            if (m_DatabaseIsValid == true)
            {
                m_DatabaseIsValid = ncgmpChecks.IsSysInfoPresent(m_EditWorkspace);
            }

            // Open the SysInfo Table, Look for ProjectID values
            if (m_DatabaseIsValid == true)
            {
                m_SysInfo = new sysInfo(m_EditWorkspace);

                // If Project Name has not yet been specified, then open the form to set it.
                if (m_SysInfo.ProjName == null)
                {
                    Forms.newDatabaseInfo NewInfoForm = new Forms.newDatabaseInfo();
                    NewInfoForm.ShowDialog();
                    m_SysInfo.ProjName = NewInfoForm.projTitle;
                    m_SysInfo.ProjAbbr = NewInfoForm.projAbbr;
                }

                // Check other Database-validity things
                m_DatabaseUsesRepresentation = ncgmpChecks.AreRepresentationsUsed(m_EditWorkspace);
                m_DatabaseHasStations = ncgmpChecks.IsAzgsStationAddinPresent(m_EditWorkspace);
            }

            // From http://resources.esri.com/help/9.3/ArcGISDesktop/ArcObjects/esrigeodatabase/IWorkspaceEditControl.htm
            //  "By default on simple classes, insert cursors handed out by the geodatabase will internally bypass the CreateRow
            //   and Store mechanisms when creating and updating objects.  Tools that use insert cursors include Planarize,
            //   Create Features and the Object Loader.  When CreateRow and Store are bypassed, subsequent events are not fired
            //   for clients listening to IEditEvents and IObjectClassEvents."
            //
            // I have to do this because the topology tool uses an Insert cursor, bypassing the OnCreate event!
            IWorkspaceEditControl wsEditControl = (IWorkspaceEditControl)m_EditWorkspace;
            wsEditControl.SetStoreEventsRequired();

            // Set the Global variable that notifies other classes that the database is valid NCGMP
            g_EditWorkspaceIsValid = true;
        }
        public string NewDescriptionOfMapUnit(string MapUnit, string Name, string FullName,
            string Label, string Age, string Description, string HierarchyKey, string ParagraphStyle,
            string AreaFillRGB, string AreaFillPatternDescription, string DescriptionSourceID,
            string GeneralLitholgyTerm, string GeneralLithologyConfidence)
        {
            DescriptionOfMapUnit newDescriptionOfMapUnit = new DescriptionOfMapUnit();

            sysInfo SysInfoTable = new sysInfo(m_theWorkspace);
            newDescriptionOfMapUnit.DescriptionOfMapUnits_ID = SysInfoTable.ProjAbbr + ".DescriptionOfMapUnits." + SysInfoTable.GetNextIdValue("DescriptionOfMapUnits");
            newDescriptionOfMapUnit.MapUnit = MapUnit;
            newDescriptionOfMapUnit.Name = Name;
            newDescriptionOfMapUnit.FullName = FullName;
            newDescriptionOfMapUnit.Label = Label;
            newDescriptionOfMapUnit.Age = Age;
            newDescriptionOfMapUnit.Description = Description;
            newDescriptionOfMapUnit.HierarchyKey = HierarchyKey;
            newDescriptionOfMapUnit.ParagraphStyle = ParagraphStyle;
            newDescriptionOfMapUnit.AreaFillRGB = AreaFillRGB;
            newDescriptionOfMapUnit.AreaFillPatternDescription = AreaFillPatternDescription;
            newDescriptionOfMapUnit.DescriptionSourceID = DescriptionSourceID;
            newDescriptionOfMapUnit.GeneralLithologyTerm = GeneralLitholgyTerm;
            newDescriptionOfMapUnit.GeneralLithologyConfidence = GeneralLithologyConfidence;
            newDescriptionOfMapUnit.RequiresUpdate = false;

            m_DescriptionOfMapUnitsDictionary.Add(newDescriptionOfMapUnit.DescriptionOfMapUnits_ID, newDescriptionOfMapUnit);
            return newDescriptionOfMapUnit.DescriptionOfMapUnits_ID;
        }
        void OnStopEditing(bool save)
        {
            // Don't do anything if the extension is disabled
            if (IsExtensionEnabled != true) { return; }

            // Reset the database-validity flag just in case
            m_DatabaseIsValid = false;
            m_DatabaseUsesRepresentation = false;

            // Destroy the SysInfo reference
            m_SysInfo = null;

            // Kill the NCGMP-validity flag
            g_EditWorkspaceIsValid = false;

            // Close the Map Unit Legend Form
            // Mixing UI into the Extension! Balderdash! I should try and make the UserControl listen to edit events...
            UID theUid = new UIDClass();
            theUid.Value = ThisAddIn.IDs.dwnMapUnitLegendEditor;

            IDockableWindow mapUnitForm = ArcMap.DockableWindowManager.GetDockableWindow(theUid);
            if (mapUnitForm.IsVisible() == true) { mapUnitForm.Show(false); }
        }
        public string NewStandardLithology(string MapUnit, string PartType, string Lithology, string ProportionTerm,
            double ProportionValue, string ScientificConfidence, string DataSourceID)
        {
            StandardLithology newStandardLithology = new StandardLithology();

            sysInfo SysInfoTable = new sysInfo(m_theWorkspace);
            newStandardLithology.StandardLithology_ID = SysInfoTable.ProjAbbr + ".StandardLithology." + SysInfoTable.GetNextIdValue("StandardLithology");

            newStandardLithology.MapUnit = MapUnit;
            newStandardLithology.PartType = PartType;
            newStandardLithology.Lithology = Lithology;
            newStandardLithology.ProportionTerm = ProportionTerm;
            newStandardLithology.ProportionValue = ProportionValue;
            newStandardLithology.ScientificConfidence = ScientificConfidence;
            newStandardLithology.DataSourceID = DataSourceID;
            newStandardLithology.RequiresUpdate = false;

            m_StandardLithologyDictionary.Add(newStandardLithology.StandardLithology_ID, newStandardLithology);
            return newStandardLithology.StandardLithology_ID;
        }
        public string NewContactsAndFault(string Type, int IsConcealed, double LocationConfidenceMeters, string ExistenceConfidence, string IdentityConfidence,
            string Label, string Notes, string DataSourceID, string Symbol, IPolyline Shape)
        {
            ContactsAndFault newContactsAndFault = new ContactsAndFault();

            sysInfo SysInfoTable = new sysInfo(m_theWorkspace);
            newContactsAndFault.ContactsAndFaults_ID = SysInfoTable.ProjAbbr + ".ContactsAndFaults." + SysInfoTable.GetNextIdValue("ContactsAndFaults");
            newContactsAndFault.Type = Type;
            newContactsAndFault.IsConcealed = IsConcealed;
            newContactsAndFault.LocationConfidenceMeters = LocationConfidenceMeters;
            newContactsAndFault.ExistenceConfidence = ExistenceConfidence;
            newContactsAndFault.IdentityConfidence = IdentityConfidence;
            newContactsAndFault.Label = Label;
            newContactsAndFault.Notes = Notes;
            newContactsAndFault.DataSourceID = DataSourceID;
            newContactsAndFault.Symbol = Symbol;
            newContactsAndFault.Shape = Shape;
            newContactsAndFault.RequiresUpdate = false;

            m_ContactsAndFaultsDictionary.Add(newContactsAndFault.ContactsAndFaults_ID, newContactsAndFault);
            return newContactsAndFault.ContactsAndFaults_ID;
        }
        public string NewExtendedAttributes(string OwnerID, string OwnerTable, string Property, string PropertyValue,
            string ValueLinkID, string Qualifier, string DataSourceID, string Notes)
        {
            ExtendedAttributes newExtendedAttributes = new ExtendedAttributes();

            sysInfo SysInfoTable = new sysInfo(m_theWorkspace);
            newExtendedAttributes.ExtendedAttributes_ID = SysInfoTable.ProjAbbr + ".ExtendedAttributes." + SysInfoTable.GetNextIdValue("ExtendedAttributes");

            newExtendedAttributes.OwnerID = OwnerID;
            newExtendedAttributes.OwnerTable = OwnerTable;
            newExtendedAttributes.Property = Property;
            newExtendedAttributes.PropertyValue = PropertyValue;
            newExtendedAttributes.ValueLinkID = ValueLinkID;
            newExtendedAttributes.Qualifier = Qualifier;
            newExtendedAttributes.DataSourceID = DataSourceID;
            newExtendedAttributes.Notes = Notes;

            m_ExtendedAttributesDictionary.Add(newExtendedAttributes.ExtendedAttributes_ID, newExtendedAttributes);

            return newExtendedAttributes.ExtendedAttributes_ID;
        }
        public string NewStationPoint(string StationID, string Type, 
            string Label, int PlotAtScale, double LocationConfidenceMeters, double Latitude, double Longitude,
            string DataSourceID, IPoint Shape)
        {
            StationPoint newStationPoint = new StationPoint();

            sysInfo SysInfoTable = new sysInfo(m_theWorkspace);
            newStationPoint.StationPoints_ID = SysInfoTable.ProjAbbr + ".StationPoints." + SysInfoTable.GetNextIdValue("StationPoints");
            newStationPoint.FieldID = StationID;
            newStationPoint.Label = Label;
            newStationPoint.PlotAtScale = PlotAtScale;
            newStationPoint.LocationConfidenceMeters = LocationConfidenceMeters;
            newStationPoint.Latitude = Latitude;
            newStationPoint.Longitude = Longitude;
            newStationPoint.DataSourceID = DataSourceID;
            newStationPoint.Shape = Shape;
            newStationPoint.RequiresUpdate = false;

            m_StationPointsDictionary.Add(newStationPoint.StationPoints_ID, newStationPoint);
            return newStationPoint.StationPoints_ID;
        }
示例#28
0
        public string NewOtherPoly(string MapUnit, string IdentityConfidence,
            string Label, string Notes, string DataSourceID, string Symbol, IPolygon Shape)
        {
            OtherPoly newOtherPoly = new OtherPoly();

            sysInfo SysInfoTable = new sysInfo(m_theWorkspace);
            newOtherPoly.OtherPolys_ID = SysInfoTable.ProjAbbr + ".OtherPolys." + SysInfoTable.GetNextIdValue("OtherPolys");
            newOtherPoly.MapUnit = MapUnit;
            newOtherPoly.IdentityConfidence = IdentityConfidence;
            newOtherPoly.Label = Label;
            newOtherPoly.Notes = Notes;
            newOtherPoly.DataSourceID = DataSourceID;
            newOtherPoly.Symbol = Symbol;
            newOtherPoly.Shape = Shape;
            newOtherPoly.RequiresUpdate = false;

            m_OtherPolysDictionary.Add(newOtherPoly.OtherPolys_ID, newOtherPoly);
            return newOtherPoly.OtherPolys_ID;
        }
        private void RecalculateIdentifiers(Dictionary<string, object> dataAccessClasses)
        {
            // SysInfo reference to calculate new IDs
            sysInfo theSysInfo = new sysInfo(ArcMap.Editor.EditWorkspace);

            // Begin looping through dataAccessClasses
            foreach (KeyValuePair<string, object> anEntry in dataAccessClasses)
            {
                // Parse the table name
                ISQLSyntax nameParser = (ISQLSyntax)m_theWorkspace;
                string parsedDbName, parsedOwnerName, parsedTableName;
                nameParser.ParseTableName(anEntry.Key, out parsedDbName, out parsedOwnerName, out parsedTableName);

                // Build an SQL query for the features/rows passed in
                string sqlWhereClause = parsedTableName + "_ID = '";
                switch(parsedTableName)
                {
                    case "MapUnitPolys":
                        foreach (KeyValuePair<string, MapUnitPolysAccess.MapUnitPoly> aRecord in (anEntry.Value as MapUnitPolysAccess).MapUnitPolysDictionary)
                        {
                            sqlWhereClause += aRecord.Key + "' OR " + parsedTableName + "_ID = '";
                        }
                        break;
                    case "ContactsAndFaults":
                        foreach (KeyValuePair<string, ContactsAndFaultsAccess.ContactsAndFault> aRecord in (anEntry.Value as ContactsAndFaultsAccess).ContactsAndFaultsDictionary)
                        {
                            sqlWhereClause += aRecord.Key + "' OR " + parsedTableName + "_ID = '";
                        }
                        break;
                    case "OtherLines":
                        foreach (KeyValuePair<string, OtherLinesAccess.OtherLine> aRecord in (anEntry.Value as OtherLinesAccess).OtherLinesDictionary)
                        {
                            sqlWhereClause += aRecord.Key + "' OR " + parsedTableName + "_ID = '";
                        }
                        break;
                    case "OverlayPolys":
                        foreach (KeyValuePair<string, OverlayPolysAccess.OverlayPoly> aRecord in (anEntry.Value as OverlayPolysAccess).OverlayPolysDictionary)
                        {
                            sqlWhereClause += aRecord.Key + "' OR " + parsedTableName + "_ID = '";
                        }
                        break;
                    case "OrientationDataPoints":
                        foreach (KeyValuePair<string, OrientationDataPointsAccess.OrientationDataPoint> aRecord in (anEntry.Value as OrientationDataPointsAccess).OrientationDataPointsDictionary)
                        {
                            sqlWhereClause += aRecord.Key + "' OR " + parsedTableName + "_ID = '";
                        }
                        break;
                    case "SamplePoints":
                        foreach (KeyValuePair<string, SamplePointsAccess.SamplePoint> aRecord in (anEntry.Value as SamplePointsAccess).SamplePointsDictionary)
                        {
                            sqlWhereClause += aRecord.Key + "' OR " + parsedTableName + "_ID = '";
                        }
                        break;
                    case "StationPoints":
                        foreach (KeyValuePair<string, StationPointsAccess.StationPoint> aRecord in (anEntry.Value as StationPointsAccess).StationPointsDictionary)
                        {
                            sqlWhereClause += aRecord.Key + "' OR " + parsedTableName + "_ID = '";
                        }
                        break;
                    case "DataSources":
                        foreach (KeyValuePair<string, DataSourcesAccess.Datasource> aRecord in (anEntry.Value as DataSourcesAccess).DataSourceCollection)
                        {
                            sqlWhereClause += aRecord.Key + "' OR " + parsedTableName + "_ID = '";
                        }
                        break;
                    case "DescriptionOfMapUnits":
                        foreach (KeyValuePair<string, DescriptionOfMapUnitsAccess.DescriptionOfMapUnit> aRecord in (anEntry.Value as DescriptionOfMapUnitsAccess).DescriptionOfMapUnitsDictionary)
                        {
                            sqlWhereClause += aRecord.Key + "' OR " + parsedTableName + "_ID = '";
                        }
                        break;
                    case "Glossary":
                        foreach (KeyValuePair<string, GlossaryAccess.Glossary> aRecord in (anEntry.Value as GlossaryAccess).GlossaryDictionary)
                        {
                            sqlWhereClause += aRecord.Key + "' OR " + parsedTableName + "_ID = '";
                        }
                        break;
                    case "Notes":
                        foreach (KeyValuePair<string, NotesAccess.Note> aRecord in (anEntry.Value as NotesAccess).NotesDictionary)
                        {
                            sqlWhereClause += aRecord.Key + "' OR " + parsedTableName + "_ID = '";
                        }
                        break;
                    case "RelatedDocuments":
                        foreach (KeyValuePair<string, RelatedDocumentsAccess.RelatedDocument> aRecord in (anEntry.Value as RelatedDocumentsAccess).RelatedDocumentsDictionary)
                        {
                            sqlWhereClause += aRecord.Key + "' OR " + parsedTableName + "_ID = '";
                        }
                        break;
                }

                // Cleanup the string
                sqlWhereClause = sqlWhereClause.Remove(sqlWhereClause.Length - (11 + parsedTableName.Length));

                // Get the features
                ITable theTable = commonFunctions.OpenTable(m_theWorkspace, parsedTableName);
                IQueryFilter theQF = new QueryFilterClass();
                theQF.WhereClause = sqlWhereClause;

                // Wrap in edit operation
                ArcMap.Editor.StartOperation();
                try
                {
                    ICursor theCursor = theTable.Update(theQF, false);
                    IRow theRow = theCursor.NextRow();
                    int theIdFld = theTable.FindField(parsedTableName + "_ID");

                    while (theRow != null)
                    {
                        // Update the identifier
                        theRow.set_Value(theIdFld, theSysInfo.ProjAbbr + "." + parsedTableName + "." + theSysInfo.GetNextIdValue(parsedTableName));
                        theCursor.UpdateRow(theRow);

                        //Iterate
                        theRow = theCursor.NextRow();
                    }

                    // Close the edit session
                    ArcMap.Editor.StopOperation("Update Identifiers");
                }
                catch
                {
                    ArcMap.Editor.StopOperation("Failed to update identifiers");
                }
            }
        }
        public string NewGeologicLine(string Type, double LocationConfidenceMeters, string ExistenceConfidence, string IdentityConfidence,
            string Symbol, string Label, string Notes, string DataSourceID, string RuleID, IPolyline Shape)
        {
            GeologicLine newGeologicLine = new GeologicLine();

            sysInfo SysInfoTable = new sysInfo(m_theWorkspace);
            newGeologicLine.GeologicLines_ID = SysInfoTable.ProjAbbr + ".GeologicLines." + SysInfoTable.GetNextIdValue("GeologicLines");
            newGeologicLine.Type = Type;
            newGeologicLine.LocationConfidenceMeters = LocationConfidenceMeters;
            newGeologicLine.ExistenceConfidence = ExistenceConfidence;
            newGeologicLine.IdentityConfidence = IdentityConfidence;
            newGeologicLine.Symbol = Symbol;
            newGeologicLine.Label = Label;
            newGeologicLine.Notes = Notes;
            newGeologicLine.DataSourceID = DataSourceID;
            newGeologicLine.RuleID = RuleID;
            newGeologicLine.Shape = Shape;
            newGeologicLine.RequiresUpdate = false;

            m_GeologicLinesDictionary.Add(newGeologicLine.GeologicLines_ID, newGeologicLine);
            return newGeologicLine.GeologicLines_ID;
        }
        public string NewGeologicEvents(string Event, string AgeDisplay, string AgeYoungerTerm, string AgeOlderTerm, string TimeScale,
            string AgeYoungerValue, string AgeOlderValue, string DataSourceID, string Notes)
        {
            GeologicEvents newGeologicEvents = new GeologicEvents();

            sysInfo SysInfoTable = new sysInfo(m_theWorkspace);
            newGeologicEvents.GeologicEvents_ID = SysInfoTable.ProjAbbr + ".GeologicEvents." + SysInfoTable.GetNextIdValue("GeologicEvents");

            newGeologicEvents.Event = Event;
            newGeologicEvents.AgeDisplay = AgeDisplay;
            newGeologicEvents.AgeYoungerTerm = AgeYoungerTerm;
            newGeologicEvents.AgeOlderTerm= AgeOlderTerm;
            newGeologicEvents.TimeScale = TimeScale;
            newGeologicEvents.AgeYoungerValue = AgeYoungerValue;
            newGeologicEvents.AgeOlderValue = AgeOlderValue;
            newGeologicEvents.DataSourceID = DataSourceID;
            newGeologicEvents.Notes = Notes;
            newGeologicEvents.RequiresUpdate = false;

            m_GeologicEventsDictionary.Add(newGeologicEvents.GeologicEvents_ID, newGeologicEvents);
            return newGeologicEvents.GeologicEvents_ID;
        }