Skip to content
Permalink
Browse files

Replaced all "var" with type

  • Loading branch information...
COM8 committed Sep 20, 2019
1 parent 5fe6069 commit 60c5917e23de4b4b13d5da808265b16e4ffb8d26
Showing with 155 additions and 155 deletions.
  1. +2 −2 BackgroundSocket/Classes/BackgroundSocketHandler.cs
  2. +1 −1 Component_Tests/UnitTestApp.xaml.cs
  3. +1 −1 Data_Manager2/Classes/DBManager/MUCDBManager.cs
  4. +1 −1 Data_Manager2/Classes/Vault.cs
  5. +1 −1 UWP XMPP Client/Classes/Collections/CustomObservableCollection.cs
  6. +26 −26 UWP XMPP Client/Classes/Collections/MyAdvancedCollectionView.cs
  7. +4 −4 UWP XMPP Client/Classes/Collections/ObservableChatDictionaryList.cs
  8. +1 −1 UWP XMPP Client/Classes/UIUtils.cs
  9. +2 −2 UWP XMPP Client/Controls/Omemo/QRCodeReaderControl.xaml.cs
  10. +2 −2 UWP XMPP Client/Dialogs/InviteUserMUCDialog.xaml.cs
  11. +13 −13 UWPX_UI/Controls/Toolkit/MasterDetailsView/MasterDetailsView.cs
  12. +6 −6 UWPX_UI/Controls/Toolkit/SlidableListItem/SlidableListItem.cs
  13. +17 −17 UWPX_UI/Controls/Toolkit/VisualTree.cs
  14. +26 −26 UWPX_UI_Context/Classes/Collections/Toolkit/AdvancedCollectionView.cs
  15. +2 −2 UWPX_UI_Context/Classes/DataTemplates/Controls/FolderSizeControlDataTemplate.cs
  16. +10 −10 Unicode/Classes/Codepoint.cs
  17. +2 −2 Unicode/Classes/Emoji.cs
  18. +5 −5 Unicode/Classes/Range.cs
  19. +9 −9 Unicode/Classes/UnicodeSequence.cs
  20. +1 −1 XMPP_API/Classes/Network/ConnectionInformation.cs
  21. +1 −1 XMPP_API/Classes/Network/XML/Messages/Features/SASL/AbstractSASLMechanism.cs
  22. +1 −1 XMPP_API/Classes/Network/XML/Messages/XEP-0048/StorageItem.cs
  23. +4 −4 XMPP_API/Classes/Network/XML/Messages/XEP-0384/OmemoDevices.cs
  24. +17 −17 XMPP_API/Classes/Network/XML/Messages/XEP-0392/HsluvConverter.cs
@@ -115,8 +115,8 @@ private async Task readFromSocket(StreamSocket socket)
#region --Misc Methods (Private)--
private void showToast(string text)
{
var tost = ToastNotificationManager.GetTemplateContent(ToastTemplateType.ToastImageAndText01);
var childUpdate = tost?.GetElementsByTagName("text");
Windows.Data.Xml.Dom.XmlDocument tost = ToastNotificationManager.GetTemplateContent(ToastTemplateType.ToastImageAndText01);
Windows.Data.Xml.Dom.XmlNodeList childUpdate = tost?.GetElementsByTagName("text");
if (childUpdate != null) childUpdate[0].InnerText = text;
ToastNotification titleNotification = new ToastNotification(tost) { Group = "NetUpdate" };
ToastNotificationManager.CreateToastNotifier().Show(titleNotification);
@@ -94,7 +94,7 @@ void OnNavigationFailed(object sender, NavigationFailedEventArgs e)
/// <param name="e">Details about the suspend request.</param>
private void OnSuspending(object sender, SuspendingEventArgs e)
{
var deferral = e.SuspendingOperation.GetDeferral();
SuspendingDeferral deferral = e.SuspendingOperation.GetDeferral();
//TODO: Save application state and stop any background activity
deferral.Complete();
}
@@ -54,7 +54,7 @@ public List<ConferenceItem> getXEP0048ConferenceItemsForAccount(string userAccou
{
IList<MUCChatInfoTable> list = dB.Query<MUCChatInfoTable>(true, "SELECT i.*, c.chatJabberId AS chatId FROM " + DBTableConsts.MUC_CHAT_INFO_TABLE + " i JOIN " + DBTableConsts.CHAT_TABLE + " c ON i.chatId = c.id WHERE c.inRoster = ? AND c.userAccountId = ?;", true, userAccountId);
List<ConferenceItem> conferences = new List<ConferenceItem>();
foreach (var mucInfo in list)
foreach (MUCChatInfoTable mucInfo in list)
{
conferences.Add(mucInfo.toConferenceItem());
}
@@ -123,7 +123,7 @@ public static void deletePassword(PasswordCredential passwordCredential)
/// </summary>
public static void deleteAllVaults()
{
foreach (var item in PASSWORD_VAULT.RetrieveAll())
foreach (PasswordCredential item in PASSWORD_VAULT.RetrieveAll())
{
PASSWORD_VAULT.Remove(item);
}
@@ -62,7 +62,7 @@ public void AddRange(IEnumerable<T> collection)
CheckReentrancy();

int startIndex = Count;
foreach (var i in collection)
foreach (T i in collection)
{
Items.Add(i);
}
@@ -273,7 +273,7 @@ public void Insert(int index, object item)
/// <exception cref="NotImplementedException">Not implemented yet...</exception>
public IAsyncOperation<LoadMoreItemsResult> LoadMoreItemsAsync(uint count)
{
var sil = _source as ISupportIncrementalLoading;
ISupportIncrementalLoading sil = _source as ISupportIncrementalLoading;
return sil?.LoadMoreItemsAsync(count);
}

@@ -384,8 +384,8 @@ int IComparer<object>.Compare(object x, object y)
{
if (!_sortProperties.Any())
{
var type = x.GetType();
foreach (var sd in _sortDescriptions)
Type type = x.GetType();
foreach (SortDescription sd in _sortDescriptions)
{
if (!string.IsNullOrEmpty(sd.PropertyName))
{
@@ -394,7 +394,7 @@ int IComparer<object>.Compare(object x, object y)
}
}

foreach (var sd in _sortDescriptions)
foreach (SortDescription sd in _sortDescriptions)
{
object cx, cy;

@@ -405,13 +405,13 @@ int IComparer<object>.Compare(object x, object y)
}
else
{
var pi = _sortProperties[sd.PropertyName];
PropertyInfo pi = _sortProperties[sd.PropertyName];

cx = pi.GetValue(x);
cy = pi.GetValue(y);
}

var cmp = sd.Comparer.Compare(cx, cy);
int cmp = sd.Comparer.Compare(cx, cy);

if (cmp != 0)
{
@@ -455,25 +455,25 @@ private void ItemOnPropertyChanged(object item, PropertyChangedEventArgs e)
return;
}

var filterResult = _filter?.Invoke(item);
bool? filterResult = _filter?.Invoke(item);

if (filterResult.HasValue && _observedFilterProperties.Contains(e.PropertyName))
{
var viewIndex = _view.IndexOf(item);
int viewIndex = _view.IndexOf(item);
if (viewIndex != -1 && !filterResult.Value)
{
RemoveFromView(viewIndex, item);
}
else if (viewIndex == -1 && filterResult.Value)
{
var index = _source.IndexOf(item);
int index = _source.IndexOf(item);
HandleItemAdded(index, item);
}
}

if ((filterResult ?? true) && SortDescriptions.Any(sd => sd.PropertyName == e.PropertyName))
{
var oldIndex = _view.IndexOf(item);
int oldIndex = _view.IndexOf(item);

// Check if item is in view:
if (oldIndex < 0)
@@ -482,7 +482,7 @@ private void ItemOnPropertyChanged(object item, PropertyChangedEventArgs e)
}

_view.RemoveAt(oldIndex);
var targetIndex = _view.BinarySearch(item, this);
int targetIndex = _view.BinarySearch(item, this);
if (targetIndex < 0)
{
targetIndex = ~targetIndex;
@@ -515,7 +515,7 @@ private void AttachPropertyChangedHandler(IEnumerable items)
return;
}

foreach (var item in items.OfType<INotifyPropertyChanged>())
foreach (INotifyPropertyChanged item in items.OfType<INotifyPropertyChanged>())
{
item.PropertyChanged += ItemOnPropertyChanged;
}
@@ -528,7 +528,7 @@ private void DetachPropertyChangedHandler(IEnumerable items)
return;
}

foreach (var item in items.OfType<INotifyPropertyChanged>())
foreach (INotifyPropertyChanged item in items.OfType<INotifyPropertyChanged>())
{
item.PropertyChanged -= ItemOnPropertyChanged;
}
@@ -546,9 +546,9 @@ private void HandleFilterChanged()
{
if (_filter != null)
{
for (var index = 0; index < _view.Count; index++)
for (int index = 0; index < _view.Count; index++)
{
var item = _view.ElementAt(index);
object item = _view.ElementAt(index);
if (_filter(item))
{
continue;
@@ -559,11 +559,11 @@ private void HandleFilterChanged()
}
}

var viewHash = new HashSet<object>(_view);
var viewIndex = 0;
for (var index = 0; index < _source.Count; index++)
HashSet<object> viewHash = new HashSet<object>(_view);
int viewIndex = 0;
for (int index = 0; index < _source.Count; index++)
{
var item = _source[index];
object item = _source[index];
if (viewHash.Contains(item))
{
viewIndex++;
@@ -580,9 +580,9 @@ private void HandleFilterChanged()
private void HandleSourceChanged()
{
_sortProperties.Clear();
var currentItem = CurrentItem;
object currentItem = CurrentItem;
_view.Clear();
foreach (var item in Source)
foreach (object item in Source)
{
if (_filter != null && !_filter(item))
{
@@ -591,7 +591,7 @@ private void HandleSourceChanged()

if (_sortDescriptions.Any())
{
var targetIndex = _view.BinarySearch(item, this);
int targetIndex = _view.BinarySearch(item, this);
if (targetIndex < 0)
{
targetIndex = ~targetIndex;
@@ -664,7 +664,7 @@ private bool HandleItemAdded(int newStartingIndex, object newItem, int? viewInde
return false;
}

var newViewIndex = _view.Count;
int newViewIndex = _view.Count;

if (_sortDescriptions.Any())
{
@@ -719,7 +719,7 @@ private bool HandleItemAdded(int newStartingIndex, object newItem, int? viewInde
CurrentPosition++;
}

var e = new VectorChangedEventArgs(CollectionChange.ItemInserted, newViewIndex, newItem);
VectorChangedEventArgs e = new VectorChangedEventArgs(CollectionChange.ItemInserted, newViewIndex, newItem);
OnVectorChanged(e);
return true;
}
@@ -752,7 +752,7 @@ private void RemoveFromView(int itemIndex, object item)
CurrentPosition--;
}

var e = new VectorChangedEventArgs(CollectionChange.ItemRemoved, itemIndex, item);
VectorChangedEventArgs e = new VectorChangedEventArgs(CollectionChange.ItemRemoved, itemIndex, item);
OnVectorChanged(e);
}

@@ -778,7 +778,7 @@ private bool MoveCurrentToIndex(int i)
return false;
}

var e = new CurrentChangingEventArgs();
CurrentChangingEventArgs e = new CurrentChangingEventArgs();
OnCurrentChanging(e);
if (e.Cancel)
{
@@ -108,7 +108,7 @@ public void AddRange(IList<ChatTemplate> list, bool callCollectionReset)
return;
}

foreach (var i in list)
foreach (ChatTemplate i in list)
{
int index = InternalAdd(i);
if(!callCollectionReset)
@@ -124,15 +124,15 @@ public void AddRange(IList<ChatTemplate> list, bool callCollectionReset)

public void CopyTo(Array array, int index)
{
foreach (var item in LIST)
foreach (ChatTemplate item in LIST)
{
array.SetValue(item, index);
}
}

public void Dispose()
{
foreach (var item in LIST)
foreach (ChatTemplate item in LIST)
{
item.PropertyChanged -= Item_PropertyChanged;
}
@@ -148,7 +148,7 @@ public int Add(object value)
public void Clear()
{
DICTIONARY.Clear();
foreach (var item in LIST)
foreach (ChatTemplate item in LIST)
{
item.PropertyChanged -= Item_PropertyChanged;
}
@@ -54,7 +54,7 @@ public static async Task<ContentDialogResult> showDialogAsyncQueue(ContentDialog
}

contentDialogShowRequest = new TaskCompletionSource<ContentDialog>();
var result = await dialog.ShowAsync();
ContentDialogResult result = await dialog.ShowAsync();
contentDialogShowRequest.SetResult(dialog);
contentDialogShowRequest = null;

@@ -76,7 +76,7 @@ private async Task startCameraAsync()
return;
}

var settings = new MediaCaptureInitializationSettings()
MediaCaptureInitializationSettings settings = new MediaCaptureInitializationSettings()
{
MemoryPreference = MediaCaptureMemoryPreference.Cpu,
StreamingCaptureMode = StreamingCaptureMode.Video
@@ -183,7 +183,7 @@ private async void UserControl_Unloaded(object sender, RoutedEventArgs e)

private async void Current_Suspending(object sender, Windows.ApplicationModel.SuspendingEventArgs e)
{
var deferral = e.SuspendingOperation.GetDeferral();
Windows.ApplicationModel.SuspendingDeferral deferral = e.SuspendingOperation.GetDeferral();
await stopCameraAsync();
deferral.Complete();
}
@@ -134,10 +134,10 @@ private void ContentDialog_Loaded(object sender, RoutedEventArgs e)
// Get TextBox from AutoSuggestBox:
// Source: https://github.com/Koopakiller/Samples/blob/master/UWP%20AutoSuggestBox%20set%20SelectionStart/UWP%20AutoSuggestBox%20set%20SelectionStart/MainPage.xaml.cs
// Get the type of the control:
var type = typeof(AutoSuggestBox);
Type type = typeof(AutoSuggestBox);

// Get Method from Type:
var method = type.GetMethod("GetTemplateChild", BindingFlags.Instance | BindingFlags.NonPublic);
MethodInfo method = type.GetMethod("GetTemplateChild", BindingFlags.Instance | BindingFlags.NonPublic);

// Call method of the object "Asb" and pass parameter "TextBox" (name of the control to obtain):
tbx = (TextBox)method.Invoke(user_asbox, new object[] { "TextBox" });

0 comments on commit 60c5917

Please sign in to comment.
You can’t perform that action at this time.