private void frmHistorialMarkerManager_Load(object sender, EventArgs e)
        {
            IEnumHistoricalMarker historicalMarkers = this.m_pHistoricalWorkspace.HistoricalMarkers;

            historicalMarkers.Reset();
            IHistoricalMarker marker2 = historicalMarkers.Next();

            string[]            items = new string[2];
            IVersionedWorkspace pHistoricalWorkspace = this.m_pHistoricalWorkspace as IVersionedWorkspace;

            while (marker2 != null)
            {
                if (marker2.Name != "DEFAULT")
                {
                    items[0] = marker2.Name;
                    items[1] = marker2.TimeStamp.ToString();
                    ListViewItem item = new ListViewItem(items)
                    {
                        Tag = marker2
                    };
                    this.listView1.Items.Add(item);
                }
                marker2 = historicalMarkers.Next();
            }
        }
 private void frmSDEConnectionDetialInfo_Load(object sender, EventArgs e)
 {
     if (this.iworkspace_0 != null)
     {
         IEnumVersionInfo versions = (this.iworkspace_0 as IVersionedWorkspace2).Versions;
         versions.Reset();
         IVersionInfo info2 = versions.Next();
         string[]     items = new string[2];
         while (info2 != null)
         {
             items[0] = info2.VersionName;
             items[1] = info2.Description;
             ListViewItem item = new ListViewItem(items)
             {
                 Tag = info2
             };
             this.lvwVersions.Items.Add(item);
             info2 = versions.Next();
         }
         IHistoricalWorkspace  workspace         = this.iworkspace_0 as IHistoricalWorkspace;
         IEnumHistoricalMarker historicalMarkers = workspace.HistoricalMarkers;
         historicalMarkers.Reset();
         for (IHistoricalMarker marker2 = historicalMarkers.Next();
              marker2 != null;
              marker2 = historicalMarkers.Next())
         {
             this.cboHistoricalMarker.Properties.Items.Add(marker2.Name);
         }
         if (this.cboHistoricalMarker.Properties.Items.Count > 0)
         {
             this.cboHistoricalMarker.SelectedIndex = 0;
         }
     }
 }
        private void AddToList(IHistoricalMarker pHistoricalMarker)
        {
            ListViewItem item =
                new ListViewItem(new string[] { pHistoricalMarker.Name, pHistoricalMarker.TimeStamp.ToString() })
            {
                Tag = pHistoricalMarker
            };

            this.listView1.Items.Add(item);
        }
 private void btnDelete_Click(object sender, EventArgs e)
 {
     for (int i = this.listView1.SelectedItems.Count - 1; i >= 0; i--)
     {
         IHistoricalMarker tag = this.listView1.SelectedItems[i].Tag as IHistoricalMarker;
         try
         {
             this.m_pHistoricalWorkspace.RemoveHistoricalMarker(tag.Name);
             this.listView1.Items.Remove(this.listView1.SelectedItems[i]);
         }
         catch (Exception exception)
         {
             MessageBox.Show(exception.Message);
         }
     }
 }
        private void btnEdit_Click(object sender, EventArgs e)
        {
            ListViewItem        item    = this.listView1.SelectedItems[0];
            IHistoricalMarker   tag     = item.Tag as IHistoricalMarker;
            frmHistoricalMarker marker2 = new frmHistoricalMarker
            {
                HistoricalMarker = tag
            };

            if (marker2.ShowDialog() == DialogResult.OK)
            {
                this.m_pHistoricalWorkspace.RemoveHistoricalMarker(tag.Name);
                tag = this.m_pHistoricalWorkspace.AddHistoricalMarker(marker2.HistoricalMarkerName,
                                                                      marker2.HistoricalMarkerTimeStamp);
                item.Text             = tag.Name;
                item.SubItems[1].Text = tag.TimeStamp.ToString();
            }
        }
        private void btnNew_Click(object sender, EventArgs e)
        {
            frmHistoricalMarker marker = new frmHistoricalMarker
            {
                DatabaseConnectionInfo = this.m_pHistoricalWorkspace as IDatabaseConnectionInfo2
            };

            if (marker.ShowDialog() == DialogResult.OK)
            {
                IHistoricalMarker marker2 = null;
                if (marker2 != null)
                {
                    MessageBox.Show("名称的时间标记以存在!");
                }
                else
                {
                    this.AddToList(this.m_pHistoricalWorkspace.AddHistoricalMarker(marker.HistoricalMarkerName,
                                                                                   marker.HistoricalMarkerTimeStamp));
                }
            }
        }
示例#7
0
 private void method_2()
 {
     if (this.iworkspace_0 != null)
     {
         this.VersionInfolist.Items.Clear();
         IEnumVersionInfo versions = (this.iworkspace_0 as IVersionedWorkspace).Versions;
         versions.Reset();
         IVersionInfo info2 = versions.Next();
         string[]     items = new string[5];
         while (info2 != null)
         {
             string   versionName = info2.VersionName;
             string[] strArray2   = versionName.Split(new char[] { '.' });
             if (strArray2.Length > 1)
             {
                 items[0] = strArray2[1];
                 items[1] = strArray2[0];
             }
             else
             {
                 items[0] = strArray2[0];
                 items[1] = "";
             }
             items[2] = this.method_1(info2.Access);
             items[3] = info2.Created.ToString();
             items[4] = info2.Modified.ToString();
             ListViewItem item = new ListViewItem(items)
             {
                 Tag = info2
             };
             this.VersionInfolist.Items.Add(item);
             if ((this.int_0 == 0) && (versionName == this.object_0.ToString()))
             {
                 item.Selected = true;
             }
             info2 = versions.Next();
         }
         IHistoricalWorkspace  workspace         = this.iworkspace_0 as IHistoricalWorkspace;
         IEnumHistoricalMarker historicalMarkers = workspace.HistoricalMarkers;
         historicalMarkers.Reset();
         for (IHistoricalMarker marker2 = historicalMarkers.Next();
              marker2 != null;
              marker2 = historicalMarkers.Next())
         {
             this.cboHistoricalMarker.Properties.Items.Add(marker2.Name);
             if ((this.int_0 == 1) && (marker2.Name == this.object_0.ToString()))
             {
                 this.cboHistoricalMarker.SelectedIndex = this.cboHistoricalMarker.Properties.Items.Count - 1;
             }
         }
         if ((this.cboHistoricalMarker.Properties.Items.Count > 0) &&
             (this.cboHistoricalMarker.SelectedIndex == -1))
         {
             this.cboHistoricalMarker.SelectedIndex = 0;
         }
         this.dateTimePicker1.Value = DateTime.Now;
         if (this.int_0 == 0)
         {
             this.cboVersionType.SelectedIndex = 0;
             this.panelHistorical.Visible      = false;
         }
         else
         {
             if (this.int_0 == 2)
             {
                 this.dateTimePicker1.Value = (DateTime)this.object_0;
             }
             this.cboVersionType.SelectedIndex = 1;
             this.panelTransaction.Visible     = false;
             this.cboVersionType_SelectedIndexChanged(this, new EventArgs());
             this.rdoHistoryType_SelectedIndexChanged(this, new EventArgs());
         }
     }
 }