From: Wootak Jung Date: Thu, 6 Oct 2022 06:50:20 +0000 (+0900) Subject: Modify variable name X-Git-Tag: accepted/tizen/unified/20221111.105330~11 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=79d346bc788d8c6286325f9db2acb7b2606b55e8;p=profile%2Fiot%2Fapps%2Fdotnet%2Fsetting-bluetooth.git Modify variable name Change-Id: Ifca9fcdae0c9c78a9a0edf633e8e16588846f1e6 Signed-off-by: Wootak Jung --- diff --git a/SettingBluetooth/SettingBluetooth/Model/BtDevice.cs b/SettingBluetooth/SettingBluetooth/Model/BtDevice.cs index 4e20024..c941cb2 100644 --- a/SettingBluetooth/SettingBluetooth/Model/BtDevice.cs +++ b/SettingBluetooth/SettingBluetooth/Model/BtDevice.cs @@ -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); } diff --git a/SettingBluetooth/SettingBluetooth/Model/BtEventArgs.cs b/SettingBluetooth/SettingBluetooth/Model/BtEventArgs.cs index 3bbfb1f..b20cfa5 100644 --- a/SettingBluetooth/SettingBluetooth/Model/BtEventArgs.cs +++ b/SettingBluetooth/SettingBluetooth/Model/BtEventArgs.cs @@ -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; } } } diff --git a/SettingBluetooth/SettingBluetooth/Model/BtModelImpl.cs b/SettingBluetooth/SettingBluetooth/Model/BtModelImpl.cs index 3d6c3fc..5d3c041 100644 --- a/SettingBluetooth/SettingBluetooth/Model/BtModelImpl.cs +++ b/SettingBluetooth/SettingBluetooth/Model/BtModelImpl.cs @@ -8,10 +8,10 @@ namespace SettingBluetooth.Model { internal class BtModelImpl { - static readonly BtModelImpl instance = new BtModelImpl(); - static bool isScanning = false; - static event EventHandler operationStateChanged = null; - static event EventHandler deviceChanged = null; + static readonly BtModelImpl mInstance = new BtModelImpl(); + static bool mIsScanning = false; + static event EventHandler mOperationStateChanged = null; + static event EventHandler 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; } } diff --git a/SettingBluetooth/SettingBluetooth/View/BtDeviceView.cs b/SettingBluetooth/SettingBluetooth/View/BtDeviceView.cs index f2c8219..58c8b14 100644 --- a/SettingBluetooth/SettingBluetooth/View/BtDeviceView.cs +++ b/SettingBluetooth/SettingBluetooth/View/BtDeviceView.cs @@ -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; } } diff --git a/SettingBluetooth/SettingBluetooth/View/BtMainView.cs b/SettingBluetooth/SettingBluetooth/View/BtMainView.cs index 3c1daf7..f2782be 100644 --- a/SettingBluetooth/SettingBluetooth/View/BtMainView.cs +++ b/SettingBluetooth/SettingBluetooth/View/BtMainView.cs @@ -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); } } } diff --git a/packaging/org.tizen.cssetting-bluetooth-1.0.0.tpk b/packaging/org.tizen.cssetting-bluetooth-1.0.0.tpk index 33a3398..c697ae8 100644 Binary files a/packaging/org.tizen.cssetting-bluetooth-1.0.0.tpk and b/packaging/org.tizen.cssetting-bluetooth-1.0.0.tpk differ