예제 #1
0
        public void RefreshList(GCInterfaceCollection ilist)
        {
            RefreshDetail(null);
            this.listViewInterface.Items.Clear();

            interfaceList = ilist;
            if (interfaceList == null)
            {
                return;
            }

            bool res = false;

            foreach (GCInterface gcInterface in interfaceList)
            {
                InterfaceRec ic          = gcInterface.InterfaceRec;
                string       statusInfor = gcInterface.Status.ToString();
                if (gcInterface.Status == AdapterStatus.Unknown)
                {
                    res = true;
                }
                ListViewItem i = this.listViewInterface.Items.Add(statusInfor);
                i.SubItems.Add(ic.Name);
                i.SubItems.Add(ic.DeviceName);
                i.SubItems.Add(DataHelper.GetDirectionName(ic.Direction));
                i.SubItems.Add(DataHelper.GetTypeName(ic.Type));
                i.SubItems.Add(ic.Folder);
                i.SubItems.Add(ic.LastBackupDateTime);
                i.SubItems.Add(ic.LastBackupDir);
                i.Tag = gcInterface;
            }

            if (res)
            {
                Program.Log.Write(LogType.Warning, "{Interface} Some interface in the list don't have a NT service.");
                Program.Log.Write(LogType.Error, GCError.LastErrorInfor);
                Program.Log.Write(GCError.LastError);
            }

            NotifySelectionChange(this, EventArgs.Empty);
            listCtrl.Refresh();
        }
예제 #2
0
 public GCInterface(InterfaceRec rec)
 {
     _interfaceRec = rec;
 }
예제 #3
0
 internal GCInterface()
 {
     _interfaceRec = new InterfaceRec();
 }
예제 #4
0
        private void RefreshDetail(GCInterface gcInterface)
        {
            try
            {
                this.labelName.Text        = "";
                this.labelType.Text        = "";
                this.labelDevice.Text      = "";
                this.labelVersion.Text     = "";
                this.labelDirection.Text   = "";
                this.labelDescription.Text = "";
                this.listViewCombination.Items.Clear();
                if (gcInterface == null)
                {
                    return;
                }

                DeviceDir dir = gcInterface.Directory;
                if (dir == null)
                {
                    MessageBox.Show(this, "Invalid device index file in : " + gcInterface.FolderPath,
                                    "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    return;
                }

                string       deviceInfor = "";
                InterfaceRec rec         = gcInterface.InterfaceRec;
                if (rec != null)
                {
                    deviceInfor = /*rec.DeviceID + " " + */ rec.DeviceName;
                }

                this.labelDevice.Text    = deviceInfor;
                this.labelName.Text      = dir.Header.Name;
                this.labelType.Text      = dir.Header.Type.ToString();
                this.labelVersion.Text   = dir.Header.Version;
                this.labelDirection.Text = dir.Header.Direction.ToString();
                //this.labelDescription.Text = dir.Header.Description;

                string desc = dir.Header.Description;
                if (desc.Length < 1)
                {
                    desc = dir.Header.ConfigurationSummary;
                }
                else
                {
                    desc += " (" + dir.Header.ConfigurationSummary + ")";
                }
                this.labelDescription.Text = desc;

                DObjectCollection olist = combinationMgt.GetCombinedInterfaces(dir.Header.Name, dir.Header.Direction);
                this.listViewCombination.Items.Clear();
                if (olist == null)
                {
                    MessageBox.Show(this, "Access combination table failed.",
                                    "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    return;
                }

                int index = 1;
                foreach (InterfaceRec o in olist)
                {
                    ListViewItem item = this.listViewCombination.Items.Add((index++).ToString());
                    item.SubItems.Add(o.Name);
                    item.SubItems.Add(DataHelper.GetDirection(o.Direction).ToString());
                    item.SubItems.Add(DataHelper.GetType(o.Type).ToString());
                    item.SubItems.Add(o.Description);
                    item.Tag = o;
                }
            }
            catch (Exception ex)
            {
            }
        }