Modify variable name 80/282580/1
authorWootak Jung <wootak.jung@samsung.com>
Thu, 6 Oct 2022 06:50:20 +0000 (15:50 +0900)
committerWootak Jung <wootak.jung@samsung.com>
Thu, 6 Oct 2022 06:50:20 +0000 (15:50 +0900)
Change-Id: Ifca9fcdae0c9c78a9a0edf633e8e16588846f1e6
Signed-off-by: Wootak Jung <wootak.jung@samsung.com>
SettingBluetooth/SettingBluetooth/Model/BtDevice.cs
SettingBluetooth/SettingBluetooth/Model/BtEventArgs.cs
SettingBluetooth/SettingBluetooth/Model/BtModelImpl.cs
SettingBluetooth/SettingBluetooth/View/BtDeviceView.cs
SettingBluetooth/SettingBluetooth/View/BtMainView.cs
packaging/org.tizen.cssetting-bluetooth-1.0.0.tpk

index 4e20024aeafe1509d3314d0c151c44bc31158a72..c941cb2d2e3d7e4e1e1769778a3e55223b32b4d3 100644 (file)
@@ -8,34 +8,34 @@ namespace SettingBluetooth.Model
 {
     internal class BtDevice
     {
-        private string address;
-        private string name;
-        private bool isPaired;
-        private BtDeviceState deviceState;
-        private BluetoothDevice bluetoothDevice;
+        private string mAddress;
+        private string mName;
+        private bool mIsPaired;
+        private BtDeviceState mDeviceState;
+        private BluetoothDevice mBluetoothDevice;
         // TODO
 
         internal BtDevice(BluetoothDevice device, BtDeviceState state)
         {
-            bluetoothDevice = device;
-            address = bluetoothDevice.Address;
-            name = bluetoothDevice.Name;
-            isPaired = bluetoothDevice.IsPaired;
-            deviceState = state;
+            mAddress = device.Address;
+            mName = device.Name;
+            mIsPaired = device.IsPaired;
+            mDeviceState = state;
+            mBluetoothDevice = device;
         }
 
         // for dummy instance (No devices found, Paired device)
-        internal BtDevice(string addr)
+        internal BtDevice(string address)
         {
-            address = addr;
-            name = addr;
+            mAddress = address;
+            mName = address;
         }
 
         internal string Address
         {
             get
             {
-                return address;
+                return mAddress;
             }
         }
 
@@ -43,7 +43,7 @@ namespace SettingBluetooth.Model
         {
             get
             {
-                return name;
+                return mName;
             }
         }
 
@@ -51,7 +51,7 @@ namespace SettingBluetooth.Model
         {
             get
             {
-                return isPaired;
+                return mIsPaired;
             }
         }
 
@@ -59,7 +59,7 @@ namespace SettingBluetooth.Model
         {
             get
             {
-                return deviceState;
+                return mDeviceState;
             }
         }
 
@@ -68,12 +68,12 @@ namespace SettingBluetooth.Model
             Log.Info(Program.LogTag, "BluetoothDeviceBondCreated. Address: " + ev.Device.Address + ", IsPaired: " + ev.Device.IsPaired);
             if (ev.Device.IsPaired)
             {
-                isPaired = true;
-                deviceState = BtDeviceState.Paired;
+                mIsPaired = true;
+                mDeviceState = BtDeviceState.Paired;
                 BtModel.NotifyDeviceChanged(this);
                 //BtModel.NotifyOperationStateChanged(BtOperationState.Activated);
             }
-            bluetoothDevice.BondCreated -= BluetoothDeviceBondCreated;
+            mBluetoothDevice.BondCreated -= BluetoothDeviceBondCreated;
         }
 
         // TODO
@@ -88,9 +88,9 @@ namespace SettingBluetooth.Model
         // 5. Set BT Operation state as Activated
         internal void Pair()
         {
-            bluetoothDevice.BondCreated += BluetoothDeviceBondCreated;
-            bluetoothDevice.CreateBond();
-            deviceState = BtDeviceState.Pairing;
+            mBluetoothDevice.BondCreated += BluetoothDeviceBondCreated;
+            mBluetoothDevice.CreateBond();
+            mDeviceState = BtDeviceState.Pairing;
             BtModel.NotifyDeviceChanged(this);
             BtModel.NotifyOperationStateChanged(BtOperationState.Pairing);
         }
@@ -100,12 +100,12 @@ namespace SettingBluetooth.Model
             Log.Info(Program.LogTag, "BluetoothDeviceBondDestroyed. Address: " + ev.DeviceAddress + ", Result: " + ev.Result);
             if (ev.Result == BluetoothError.None)
             {
-                isPaired = false;
-                deviceState = BtDeviceState.Unpaired;
+                mIsPaired = false;
+                mDeviceState = BtDeviceState.Unpaired;
                 BtModel.NotifyDeviceChanged(this);
                 //BtModel.NotifyOperationStateChanged(BtOperationState.Activated);
             }
-            bluetoothDevice.BondDestroyed -= BluetoothDeviceBondDestroyed;
+            mBluetoothDevice.BondDestroyed -= BluetoothDeviceBondDestroyed;
         }
 
         // TODO
@@ -118,9 +118,9 @@ namespace SettingBluetooth.Model
         // 5. Set BT Operation state as Activated
         internal void Unpair()
         {
-            bluetoothDevice.BondDestroyed += BluetoothDeviceBondDestroyed;
-            bluetoothDevice.DestroyBond();
-            deviceState = BtDeviceState.Unpairing;
+            mBluetoothDevice.BondDestroyed += BluetoothDeviceBondDestroyed;
+            mBluetoothDevice.DestroyBond();
+            mDeviceState = BtDeviceState.Unpairing;
             BtModel.NotifyDeviceChanged(this);
             BtModel.NotifyOperationStateChanged(BtOperationState.Pairing);
         }
index 3bbfb1fd350abd7491e6696990dfbae120034dd6..b20cfa5a9c4f196cbc1e62a0d0db7cae667b09b2 100644 (file)
@@ -8,36 +8,36 @@ namespace SettingBluetooth.Model
 {
     internal class BtOperationStateChangedEventArgs : EventArgs
     {
-        private BtOperationState operationState;
+        private BtOperationState mOperationState;
 
         internal BtOperationStateChangedEventArgs(BtOperationState state)
         {
-            operationState = state;
+            mOperationState = state;
         }
 
         internal BtOperationState OperationState
         {
             get
             {
-                return operationState;
+                return mOperationState;
             }
         }
     }
 
     internal class BtDeviceChangedEventArgs : EventArgs
     {
-        private BtDevice btDevice;
+        private BtDevice mBtDevice;
 
         internal BtDeviceChangedEventArgs(BtDevice device)
         {
-            btDevice = device;
+            mBtDevice = device;
         }
 
         internal BtDevice BtDevice
         {
             get
             {
-                return btDevice;
+                return mBtDevice;
             }
         }
     }
index 3d6c3fc0381d3bf0df03e3d9b23a312c30ce11ba..5d3c041d8c701113a363ead3ccfb9ef3b74b14ae 100644 (file)
@@ -8,10 +8,10 @@ namespace SettingBluetooth.Model
 {
     internal class BtModelImpl
     {
-        static readonly BtModelImpl instance = new BtModelImpl();
-        static bool isScanning = false;
-        static event EventHandler<BtOperationStateChangedEventArgs> operationStateChanged = null;
-        static event EventHandler<BtDeviceChangedEventArgs> deviceChanged = null;
+        static readonly BtModelImpl mInstance = new BtModelImpl();
+        static bool mIsScanning = false;
+        static event EventHandler<BtOperationStateChangedEventArgs> mOperationStateChanged = null;
+        static event EventHandler<BtDeviceChangedEventArgs> mDeviceChanged = null;
 
         internal bool IsEnabled
         {
@@ -25,45 +25,45 @@ namespace SettingBluetooth.Model
         {
             get
             {
-                return isScanning;
+                return mIsScanning;
             }
         }
 
         internal void Enable()
         {
             BluetoothAdapter.Enable();
-            operationStateChanged?.Invoke(null, new BtOperationStateChangedEventArgs(BtOperationState.Activating));
+            mOperationStateChanged?.Invoke(null, new BtOperationStateChangedEventArgs(BtOperationState.Activating));
         }
 
         internal void Disable()
         {
             BluetoothAdapter.Disable();
-            operationStateChanged?.Invoke(null, new BtOperationStateChangedEventArgs(BtOperationState.Deactivating));
+            mOperationStateChanged?.Invoke(null, new BtOperationStateChangedEventArgs(BtOperationState.Deactivating));
         }
 
         internal void StartDiscovery()
         {
             BluetoothAdapter.StartDiscovery();
-            isScanning = true;
-            operationStateChanged?.Invoke(null, new BtOperationStateChangedEventArgs(BtOperationState.Searching));
+            mIsScanning = true;
+            mOperationStateChanged?.Invoke(null, new BtOperationStateChangedEventArgs(BtOperationState.Searching));
         }
 
         internal void StopDiscovery()
         {
             BluetoothAdapter.StopDiscovery();
-            isScanning = false;
-            operationStateChanged?.Invoke(null, new BtOperationStateChangedEventArgs(BtOperationState.Searched));
+            mIsScanning = false;
+            mOperationStateChanged?.Invoke(null, new BtOperationStateChangedEventArgs(BtOperationState.Searched));
         }
 
         private void AdapterStateChanged(object obj, StateChangedEventArgs ev)
         {
             if (ev.BTState == BluetoothState.Enabled)
             {
-                operationStateChanged?.Invoke(null, new BtOperationStateChangedEventArgs(BtOperationState.Activated));
+                mOperationStateChanged?.Invoke(null, new BtOperationStateChangedEventArgs(BtOperationState.Activated));
             }
             else
             {
-                operationStateChanged?.Invoke(null, new BtOperationStateChangedEventArgs(BtOperationState.Deactivated));
+                mOperationStateChanged?.Invoke(null, new BtOperationStateChangedEventArgs(BtOperationState.Deactivated));
             }
         }
 
@@ -84,12 +84,12 @@ namespace SettingBluetooth.Model
                 }
 
                 BtDeviceChangedEventArgs args = new BtDeviceChangedEventArgs(btDevice);
-                deviceChanged?.Invoke(null, args);
+                mDeviceChanged?.Invoke(null, args);
             }
             else if (ev.DiscoveryState == BluetoothDeviceDiscoveryState.Finished)
             {
-                isScanning = false;
-                operationStateChanged?.Invoke(null, new BtOperationStateChangedEventArgs(BtOperationState.Searched));
+                mIsScanning = false;
+                mOperationStateChanged?.Invoke(null, new BtOperationStateChangedEventArgs(BtOperationState.Searched));
             }
         }
 
@@ -97,11 +97,11 @@ namespace SettingBluetooth.Model
         {
             add
             {
-                operationStateChanged += value;
+                mOperationStateChanged += value;
             }
             remove
             {
-                operationStateChanged -= value;
+                mOperationStateChanged -= value;
             }
         }
 
@@ -109,22 +109,22 @@ namespace SettingBluetooth.Model
         {
             add
             {
-                deviceChanged += value;
+                mDeviceChanged += value;
             }
             remove
             {
-                deviceChanged -= value;
+                mDeviceChanged -= value;
             }
         }
 
         internal void NotifyOperationStateChanged(BtOperationState state)
         {
-            operationStateChanged?.Invoke(null, new BtOperationStateChangedEventArgs(state));
+            mOperationStateChanged?.Invoke(null, new BtOperationStateChangedEventArgs(state));
         }
 
         internal void NotifyDeviceChanged(BtDevice btDevice)
         {
-            deviceChanged?.Invoke(null, new BtDeviceChangedEventArgs(btDevice));
+            mDeviceChanged?.Invoke(null, new BtDeviceChangedEventArgs(btDevice));
         }
 
         private void Initialize()
@@ -137,7 +137,7 @@ namespace SettingBluetooth.Model
         {
             get
             {
-                return instance;
+                return mInstance;
             }
         }
 
index f2c82193e897e8862a6909f3e3433e95c9b00667..58c8b144e6c4d39cda63c9a4a5f1237fb3085fb3 100644 (file)
@@ -13,13 +13,13 @@ namespace SettingBluetooth
 {
     public class Device : INotifyPropertyChanged
     {
-        string iconDir = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "icon.png";
-        private string address;
-        private string name;
+        string mIconDir = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "icon.png";
+        private string mAddress;
+        private string mName;
         //private bool connected;
         //private bool registered;
         public event PropertyChangedEventHandler PropertyChanged;
-        BtDevice btItem;
+        BtDevice mBtItem;
 
         private void OnPropertyChanged(string propertyName)
         {
@@ -28,23 +28,23 @@ namespace SettingBluetooth
 
         public Device(string deviceName, bool con, bool reg)
         {
-            name = deviceName;
+            mName = deviceName;
             //connected = con;
             //registered = reg;
         }
 
         internal Device(BtDevice btDevice)
         {
-            address = btDevice.Address;
-            name = btDevice.Name;
-            btItem = btDevice;
+            mAddress = btDevice.Address;
+            mName = btDevice.Name;
+            mBtItem = btDevice;
         }
 
         internal BtDevice BtItem
         {
             get
             {
-                return btItem;
+                return mBtItem;
             }
         }
 
@@ -52,7 +52,7 @@ namespace SettingBluetooth
         {
             get
             {
-                return address;
+                return mAddress;
             }
         }
 
@@ -60,11 +60,11 @@ namespace SettingBluetooth
         {
             get
             {
-                return name;
+                return mName;
             }
             set
             {
-                name = value;
+                mName = value;
                 OnPropertyChanged("Name");
             }
         }
@@ -73,7 +73,7 @@ namespace SettingBluetooth
         {
             get
             {
-                return iconDir;
+                return mIconDir;
             }
         }
 
index 3c1daf7494518a774e7e759e9949e37a907308e4..f2782be44691f24556fbb7bef56246ddadf18a93 100644 (file)
@@ -16,13 +16,13 @@ namespace SettingBluetooth
 {
     class BtMainView : Widget
     {
-        static ContentPage mainPage;
-        static View mainView;
-        static CollectionView pairedDeviceView = null;
-        static CollectionView searchedDeviceView = null;
-        static Button scanButton = null;
-        static DeviceSource searchedDevice = null;
-        static DeviceSource pairedDevice = null;
+        static ContentPage mMainPage;
+        static View mMainView;
+        static CollectionView mPairedDeviceView = null;
+        static CollectionView mSearchedDeviceView = null;
+        static Button mScanButton = null;
+        static DeviceSource mSearchedDevice = null;
+        static DeviceSource mPairedDevice = null;
 
         public BtMainView() : base()
         {
@@ -92,26 +92,26 @@ namespace SettingBluetooth
 
         private static void AddPairedDeviceView()
         {
-            pairedDevice = new DeviceSource();
-            pairedDeviceView = CreateCollectionView(pairedDevice, false);
-            pairedDevice.AddDevice(new BtDevice("dummy paired device")); // temporary device
-            pairedDevice.UpdateTitle(Resources.IDS_BT_BODY_PAIRED_DEVICES);
-            mainView.Add(pairedDeviceView);
+            mPairedDevice = new DeviceSource();
+            mPairedDeviceView = CreateCollectionView(mPairedDevice, false);
+            mPairedDevice.AddDevice(new BtDevice("dummy paired device")); // temporary device
+            mPairedDevice.UpdateTitle(Resources.IDS_BT_BODY_PAIRED_DEVICES);
+            mMainView.Add(mPairedDeviceView);
         }
 
         private static void AddSearchedDeviceView()
         {
-            searchedDevice = new DeviceSource();
-            searchedDeviceView = CreateCollectionView(searchedDevice);
-            searchedDevice.AddDevice(new BtDevice("dummy searched device")); // temporary device
-            mainView.Add(searchedDeviceView);
+            mSearchedDevice = new DeviceSource();
+            mSearchedDeviceView = CreateCollectionView(mSearchedDevice);
+            mSearchedDevice.AddDevice(new BtDevice("dummy searched device")); // temporary device
+            mMainView.Add(mSearchedDeviceView);
 
-            scanButton = new Button
+            mScanButton = new Button
             {
                 Text = Resources.IDS_BT_SK_SCAN,
             };
-            scanButton.Clicked += AdapterController.ScanButtonClicked;
-            mainView.Add(scanButton);
+            mScanButton.Clicked += AdapterController.ScanButtonClicked;
+            mMainView.Add(mScanButton);
         }
 
         //internal static void AddDeviceView()
@@ -122,26 +122,26 @@ namespace SettingBluetooth
 
         private static void UpdateSearchedViewTitle(string title)
         {
-            searchedDevice.UpdateTitle(title);
+            mSearchedDevice.UpdateTitle(title);
         }
 
         private static void UpdateScanButtonText(string text)
         {
-            scanButton.Text = text;
+            mScanButton.Text = text;
         }
 
         private static void RemoveSearchedDeviceView()
         {
-            if (searchedDeviceView)
+            if (mSearchedDeviceView)
             {
-                mainView.Remove(searchedDeviceView);
-                searchedDeviceView = null;
+                mMainView.Remove(mSearchedDeviceView);
+                mSearchedDeviceView = null;
             }
 
-            if (scanButton)
+            if (mScanButton)
             {
-                mainView.Remove(scanButton);
-                scanButton = null;
+                mMainView.Remove(mScanButton);
+                mScanButton = null;
             }
         }
 
@@ -149,10 +149,10 @@ namespace SettingBluetooth
         {
             RemoveSearchedDeviceView();
 
-            if (pairedDeviceView)
+            if (mPairedDeviceView)
             {
-                mainView.Remove(pairedDeviceView);
-                pairedDeviceView = null;
+                mMainView.Remove(mPairedDeviceView);
+                mPairedDeviceView = null;
             }
         }
 
@@ -167,7 +167,7 @@ namespace SettingBluetooth
                 case BtOperationState.Deactivating:
                     break;
                 case BtOperationState.Activated:
-                    if (pairedDeviceView == null && searchedDeviceView == null)
+                    if (mPairedDeviceView == null && mSearchedDeviceView == null)
                     {
                         Log.Info(Program.LogTag, "Add initial view");
                         AddPairedDeviceView();
@@ -203,48 +203,48 @@ namespace SettingBluetooth
             switch (ev.BtDevice.DeviceState)
             {
                 case BtDeviceState.Idle:
-                    //if (searchedDevice.FindDevice("dummy searched device") != null)
+                    //if (mSearchedDevice.FindDevice("dummy searched device") != null)
                     //{
-                    //    searchedDevice.RemoveDevice("dummy searched device");
+                    //    mSearchedDevice.RemoveDevice("dummy searched device");
                     //}
 
                     if (ev.BtDevice.IsPaired)
                     {
-                        pairedDevice.AddDevice(ev.BtDevice);
+                        mPairedDevice.AddDevice(ev.BtDevice);
                     }
                     else
                     {
-                        searchedDevice.AddDevice(ev.BtDevice);
+                        mSearchedDevice.AddDevice(ev.BtDevice);
                     }
                     break;
                 case BtDeviceState.Pairing:
                     break;
                 case BtDeviceState.Unpairing:
-                    //pairedDevice.RemoveDevice(ev.BtDevice.Address);
+                    //mPairedDevice.RemoveDevice(ev.BtDevice.Address);
                     break;
                 case BtDeviceState.Paired:
-                    //if (pairedDevice.FindDevice("dummy paired device") != null)
+                    //if (mPairedDevice.FindDevice("dummy paired device") != null)
                     //{
-                    //    pairedDevice.RemoveDevice("dummy paired device");
+                    //    mPairedDevice.RemoveDevice("dummy paired device");
                     //}
 
-                    if (searchedDevice.FindDevice(ev.BtDevice.Address) != null)
+                    if (mSearchedDevice.FindDevice(ev.BtDevice.Address) != null)
                     {
-                        searchedDevice.RemoveDevice(ev.BtDevice.Address);
+                        mSearchedDevice.RemoveDevice(ev.BtDevice.Address);
                     }
-                    if (pairedDevice.FindDevice(ev.BtDevice.Address) == null)
+                    if (mPairedDevice.FindDevice(ev.BtDevice.Address) == null)
                     {
-                        pairedDevice.AddDevice(ev.BtDevice);
+                        mPairedDevice.AddDevice(ev.BtDevice);
                     }
                     break;
                 case BtDeviceState.Unpaired:
-                    if (searchedDevice.FindDevice(ev.BtDevice.Address) == null)
+                    if (mSearchedDevice.FindDevice(ev.BtDevice.Address) == null)
                     {
-                        searchedDevice.AddDevice(ev.BtDevice);
+                        mSearchedDevice.AddDevice(ev.BtDevice);
                     }
-                    if (pairedDevice.FindDevice(ev.BtDevice.Address) != null)
+                    if (mPairedDevice.FindDevice(ev.BtDevice.Address) != null)
                     {
-                        pairedDevice.RemoveDevice(ev.BtDevice.Address);
+                        mPairedDevice.RemoveDevice(ev.BtDevice.Address);
                     }
                     break;
                 case BtDeviceState.Connecting:
@@ -265,7 +265,7 @@ namespace SettingBluetooth
                 Title = Resources.IDS_BT_BODY_BLUETOOTH,
             };
 
-            mainView = new View()
+            mMainView = new View()
             {
                 Layout = new LinearLayout()
                 {
@@ -289,18 +289,18 @@ namespace SettingBluetooth
             };
             onOffSwitch.SelectedChanged += AdapterController.OnOffSwitchSelectedChanged;
             onOffItem.Extra = onOffSwitch;
-            mainView.Add(onOffItem);
+            mMainView.Add(onOffItem);
 
             BtModel.OperationStateChanged += BtModelOperationStateChanged;
             BtModel.DeviceChanged += BtModelDeviceChanged;
 
-            mainPage = new ContentPage()
+            mMainPage = new ContentPage()
             {
                 AppBar = appBar,
-                Content = mainView,
+                Content = mMainView,
             };
 
-            window.GetDefaultNavigator().Push(mainPage);
+            window.GetDefaultNavigator().Push(mMainPage);
         }
     }
 }
index 33a339897b02a4e4f7afbf10f4dd925aeeff096b..c697ae8fa9b06c6620f8c85c0eb29c30c617e34a 100644 (file)
Binary files a/packaging/org.tizen.cssetting-bluetooth-1.0.0.tpk and b/packaging/org.tizen.cssetting-bluetooth-1.0.0.tpk differ