StartTransaction() 공개 메소드

public StartTransaction ( ) : void
리턴 void
예제 #1
0
        private void updateNetworkInfo()
        {
            lock (updating) {
                needsRefresh = false;
                removeDevices();
                string[]           devices;
                NetworkInterface[] nics = NetworkInterface.GetAllNetworkInterfaces();
                try
                {
                    devices = devicevif.children;
                }
                catch
                {
                    return; //No children means no devices to store data about
                }
                wmisession.StartTransaction();

                try
                {
                    try
                    {
                        numvif.value = devices.Length.ToString();
                        foreach (string device in devices)
                        {
                            writeDevice(device, nics);
                        }
                    }
                    catch (Exception) {
                        wmisession.AbortTransaction();
                        throw;
                    }
                    wmisession.CommitTransaction();
                }
                catch {
                    needsRefresh = true;
                };
            }
        }