Here are the examples of the csharp api System.Collections.Generic.Dictionary.GetEnumerator() taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
700 Examples
19
View Source File : BssomMap.cs
License : MIT License
Project Creator : 1996v
License : MIT License
Project Creator : 1996v
public IEnumerator<KeyValuePair<object, object>> GetEnumerator()
{
return _dict.GetEnumerator();
}
19
View Source File : IDictionaryResolverTest_CustomTypeImpl.cs
License : MIT License
Project Creator : 1996v
License : MIT License
Project Creator : 1996v
public IEnumerator<KeyValuePair<K, V>> GetEnumerator()
{
return _dict.GetEnumerator();
}
19
View Source File : SerializableDictionary.cs
License : MIT License
Project Creator : 39M
License : MIT License
Project Creator : 39M
public void OnBeforeSerialize() {
if (_keys == null) {
_keys = new List<TKey>();
}
if (_values == null) {
_values = new List<TValue>();
}
#if UNITY_EDITOR
for (int i = _keys.Count; i-- != 0;) {
TKey key = _keys[i];
if (key == null) continue;
if (!ContainsKey(key)) {
_keys.RemoveAt(i);
_values.RemoveAt(i);
}
}
#endif
Enumerator enumerator = GetEnumerator();
while (enumerator.MoveNext()) {
var pair = enumerator.Current;
#if UNITY_EDITOR
if (!_keys.Contains(pair.Key)) {
_keys.Add(pair.Key);
_values.Add(pair.Value);
}
#else
_keys.Add(pair.Key);
_values.Add(pair.Value);
#endif
}
}
19
View Source File : LeapHandController.cs
License : MIT License
Project Creator : 39M
License : MIT License
Project Creator : 39M
protected virtual void UpdateHandRepresentations(Dictionary<int, HandRepresentation> all_hand_reps, ModelType modelType, Frame frame) {
for (int i = 0; i < frame.Hands.Count; i++) {
var curHand = frame.Hands[i];
HandRepresentation rep;
if (!all_hand_reps.TryGetValue(curHand.Id, out rep)) {
rep = factory.MakeHandRepresentation(curHand, modelType);
if (rep != null) {
all_hand_reps.Add(curHand.Id, rep);
}
}
if (rep != null) {
rep.IsMarked = true;
rep.UpdateRepresentation(curHand);
rep.LastUpdatedTime = (int)frame.Timestamp;
}
}
/** Mark-and-sweep to finish unused HandRepresentations */
HandRepresentation toBeDeleted = null;
for (var it = all_hand_reps.GetEnumerator(); it.MoveNext();) {
var r = it.Current;
if (r.Value != null) {
if (r.Value.IsMarked) {
r.Value.IsMarked = false;
} else {
/** Initialize toBeDeleted with a value to be deleted */
//Debug.Log("Finishing");
toBeDeleted = r.Value;
}
}
}
/**Inform the representation that we will no longer be giving it any hand updates
* because the corresponding hand has gone away */
if (toBeDeleted != null) {
all_hand_reps.Remove(toBeDeleted.HandID);
toBeDeleted.Finish();
}
}
19
View Source File : StringEnumDictionary.cs
License : MIT License
Project Creator : 5minlab
License : MIT License
Project Creator : 5minlab
public IEnumerator<KeyValuePair<string, T>> GetEnumerator() {
return table.GetEnumerator();
}
19
View Source File : StringEnumDictionary.cs
License : MIT License
Project Creator : 5minlab
License : MIT License
Project Creator : 5minlab
IEnumerator IEnumerable.GetEnumerator() {
return table.GetEnumerator();
}
19
View Source File : SimpleJSON.cs
License : MIT License
Project Creator : 71
License : MIT License
Project Creator : 71
public override Enumerator GetEnumerator() { return new Enumerator(m_Dict.GetEnumerator()); }
19
View Source File : UMARenderTextureManager.cs
License : Apache License 2.0
Project Creator : A7ocin
License : Apache License 2.0
Project Creator : A7ocin
public void Update()
{
if (updatingCount > 0) return;
if (anyRT == null)
{
if (allUMACharacters != null && allUMACharacters.Count > 0)
{
var enumerator = allUMACharacters.GetEnumerator();
while (enumerator.MoveNext())
{
anyRT = enumerator.Current.Value;
if (anyRT != null) break;
}
if (anyRT == null)
{
enabled = false;
return;
}
}
else
{
enabled = false;
return;
}
}
if( !anyRT.IsCreated() )
{
RebuildAllTextures();
}
}
19
View Source File : ReanimatorState.cs
License : MIT License
Project Creator : aarthificial
License : MIT License
Project Creator : aarthificial
public IEnumerator<KeyValuePair<string, int>> GetEnumerator()
{
return _drivers.GetEnumerator();
}
19
View Source File : BaseInputDeviceManager.cs
License : Apache License 2.0
Project Creator : abist-co-ltd
License : Apache License 2.0
Project Creator : abist-co-ltd
private void CleanActivePointers()
{
using (CleanActivePointersPerfMarker.Auto())
{
var removal = new List<IMixedRealityPointer>();
var enumerator = activePointersToConfig.GetEnumerator();
while (enumerator.MoveNext())
{
var pointer = enumerator.Current.Key as MonoBehaviour;
if (UnityObjectExtensions.IsNull(pointer))
{
removal.Add(enumerator.Current.Key);
}
}
for (int i = 0; i < removal.Count; i++)
{
activePointersToConfig.Remove(removal[i]);
}
}
}
19
View Source File : NodeComponentDictionary.cs
License : GNU General Public License v3.0
Project Creator : Adam-Wilkinson
License : GNU General Public License v3.0
Project Creator : Adam-Wilkinson
IEnumerator<KeyValuePair<object, INodeComponent>> IEnumerable<KeyValuePair<object, INodeComponent>>.GetEnumerator() => _subComponents.GetEnumerator();
19
View Source File : LaminarValueStore.cs
License : GNU General Public License v3.0
Project Creator : Adam-Wilkinson
License : GNU General Public License v3.0
Project Creator : Adam-Wilkinson
public IEnumerator<KeyValuePair<object, ILaminarValue>> GetEnumerator() => _coreDictionary.GetEnumerator();
19
View Source File : LaminarValueStore.cs
License : GNU General Public License v3.0
Project Creator : Adam-Wilkinson
License : GNU General Public License v3.0
Project Creator : Adam-Wilkinson
IEnumerator IEnumerable.GetEnumerator() => _coreDictionary.GetEnumerator();
19
View Source File : MaterialFactory.cs
License : MIT License
Project Creator : AdultLink
License : MIT License
Project Creator : AdultLink
public void Dispose()
{
var enumerator = m_Materials.GetEnumerator();
while (enumerator.MoveNext())
{
var material = enumerator.Current.Value;
GraphicsUtils.Destroy(material);
}
m_Materials.Clear();
}
19
View Source File : GrantTypes.cs
License : Apache License 2.0
Project Creator : Aguafrommars
License : Apache License 2.0
Project Creator : Aguafrommars
public IEnumerator<KeyValuePair<string, string>> GetEnumerator()
=> _grantTypes.GetEnumerator();
19
View Source File : RandomOrgClient.cs
License : MIT License
Project Creator : alexanderkozlenko
License : MIT License
Project Creator : alexanderkozlenko
private static JsonRpcContractResolver CreateJsonRpcContractResolver()
{
var resolver = new JsonRpcContractResolver();
var enumerator = s_responseContracts.GetEnumerator();
while (enumerator.MoveNext())
{
resolver.AddResponseContract(enumerator.Current.Key, enumerator.Current.Value);
}
return resolver;
}
19
View Source File : PaletteParent.cs
License : MIT License
Project Creator : alexismorin
License : MIT License
Project Creator : alexismorin
public override void Draw( Rect parentPosition, Vector2 mousePosition, int mouseButtonId, bool hasKeyboadFocus )
{
base.Draw( parentPosition, mousePosition, mouseButtonId, hasKeyboadFocus );
if( m_previousWindowIsFunction != ParentWindow.IsShaderFunctionWindow )
{
m_forceUpdate = true;
}
m_previousWindowIsFunction = ParentWindow.IsShaderFunctionWindow;
List<ContextMenuItem> allItems = ParentWindow.ContextMenuInstance.MenuItems;
if( m_searchLabelSize < 0 )
{
m_searchLabelSize = GUI.skin.label.CalcSize( new GUIContent( m_searchFilterStr ) ).x;
}
if( m_foldoutStyle == null )
{
m_foldoutStyle = new GUIStyle( GUI.skin.GetStyle( "foldout" ) );
m_foldoutStyle.fontStyle = FontStyle.Bold;
}
if( m_buttonStyle == null )
{
m_buttonStyle = UIUtils.Label;
}
Event currenEvent = Event.current;
GUILayout.BeginArea( m_transformedArea, m_content, m_style );
{
for( int i = 0; i < m_initialSeparatorAmount; i++ )
{
EditorGUILayout.Separator();
}
if( currenEvent.type == EventType.KeyDown )
{
KeyCode key = currenEvent.keyCode;
//if ( key == KeyCode.Return || key == KeyCode.KeypadEnter )
// OnEnterPressed();
if( ( currenEvent.keyCode == KeyCode.KeypadEnter || currenEvent.keyCode == KeyCode.Return ) && currenEvent.type == EventType.KeyDown )
{
int index = m_currenreplacedems.FindIndex( x => GUI.GetNameOfFocusedControl().Equals( x.ItemUIContent.text + m_resizable ) );
if( index > -1 )
OnEnterPressed( index );
else
OnEnterPressed();
}
if( key == KeyCode.Escape )
OnEscapePressed();
if( m_isMouseInside || hasKeyboadFocus )
{
if( key == ShortcutsManager.ScrollUpKey )
{
m_currentScrollPos.y -= 10;
if( m_currentScrollPos.y < 0 )
{
m_currentScrollPos.y = 0;
}
currenEvent.Use();
}
if( key == ShortcutsManager.ScrollDownKey )
{
m_currentScrollPos.y += 10;
currenEvent.Use();
}
}
}
float width = EditorGUIUtility.labelWidth;
EditorGUIUtility.labelWidth = m_searchLabelSize;
EditorGUI.BeginChangeCheck();
{
GUI.SetNextControlName( m_searchFilterControl + m_resizable );
m_searchFilter = EditorGUILayout.TextField( m_searchFilterStr, m_searchFilter );
if( m_focusOnSearch )
{
m_focusOnSearch = false;
EditorGUI.FocusTextInControl( m_searchFilterControl + m_resizable );
}
}
if( EditorGUI.EndChangeCheck() )
m_forceUpdate = true;
EditorGUIUtility.labelWidth = width;
bool usingSearchFilter = ( m_searchFilter.Length == 0 );
m_currScrollBarDims.x = m_transformedArea.width;
m_currScrollBarDims.y = m_transformedArea.height - 2 - 16 - 2 - 7 * m_initialSeparatorAmount - 2;
m_currentScrollPos = EditorGUILayout.BeginScrollView( m_currentScrollPos/*, GUILayout.Width( 242 ), GUILayout.Height( 250 - 2 - 16 - 2 - 7 - 2) */);
{
if( m_forceUpdate )
{
m_forceUpdate = false;
//m_currenreplacedems.Clear();
m_currentCategories.Clear();
if( usingSearchFilter )
{
for( int i = 0; i < allItems.Count; i++ )
{
//m_currenreplacedems.Add( allItems[ i ] );
if( !m_currentCategories.ContainsKey( allItems[ i ].Category ) )
{
m_currentCategories.Add( allItems[ i ].Category, new PaletteFilterData( m_defaultCategoryVisible ) );
//m_currentCategories[ allItems[ i ].Category ].HasCommunityData = allItems[ i ].NodeAttributes.FromCommunity || m_currentCategories[ allItems[ i ].Category ].HasCommunityData;
}
m_currentCategories[ allItems[ i ].Category ].Contents.Add( allItems[ i ] );
}
}
else
{
for( int i = 0; i < allItems.Count; i++ )
{
if( allItems[ i ].Name.IndexOf( m_searchFilter, StringComparison.InvariantCultureIgnoreCase ) >= 0 ||
allItems[ i ].Category.IndexOf( m_searchFilter, StringComparison.InvariantCultureIgnoreCase ) >= 0
)
{
//m_currenreplacedems.Add( allItems[ i ] );
if( !m_currentCategories.ContainsKey( allItems[ i ].Category ) )
{
m_currentCategories.Add( allItems[ i ].Category, new PaletteFilterData( m_defaultCategoryVisible ) );
//m_currentCategories[ allItems[ i ].Category ].HasCommunityData = allItems[ i ].NodeAttributes.FromCommunity || m_currentCategories[ allItems[ i ].Category ].HasCommunityData;
}
m_currentCategories[ allItems[ i ].Category ].Contents.Add( allItems[ i ] );
}
}
}
var categoryEnumerator = m_currentCategories.GetEnumerator();
while( categoryEnumerator.MoveNext() )
{
categoryEnumerator.Current.Value.Contents.Sort( ( x, y ) => x.CompareTo( y, usingSearchFilter ) );
}
//sort current list respecting categories
m_currenreplacedems.Clear();
foreach( var item in m_currentCategories )
{
for( int i = 0; i < item.Value.Contents.Count; i++ )
{
m_currenreplacedems.Add( item.Value.Contents[ i ] );
}
}
}
string watching = string.Empty;
// unselect the main search field so it can focus list elements next
if( ( currenEvent.keyCode == KeyCode.DownArrow || currenEvent.keyCode == KeyCode.UpArrow ) && m_searchFilter.Length > 0 )
{
if( GUI.GetNameOfFocusedControl().Equals( m_searchFilterControl + m_resizable ) )
{
EditorGUI.FocusTextInControl( null );
}
}
if( currenEvent.keyCode == KeyCode.DownArrow && currenEvent.type == EventType.KeyDown )
{
currenEvent.Use();
int nextIndex = m_currenreplacedems.FindIndex( x => GUI.GetNameOfFocusedControl().Equals( x.ItemUIContent.text + m_resizable ) ) + 1;
if( nextIndex == m_currenreplacedems.Count )
nextIndex = 0;
watching = m_currenreplacedems[ nextIndex ].ItemUIContent.text + m_resizable;
GUI.FocusControl( watching );
}
if( currenEvent.keyCode == KeyCode.UpArrow && currenEvent.type == EventType.KeyDown )
{
currenEvent.Use();
int nextIndex = m_currenreplacedems.FindIndex( x => GUI.GetNameOfFocusedControl().Equals( x.ItemUIContent.text + m_resizable ) ) - 1;
if( nextIndex < 0 )
nextIndex = m_currenreplacedems.Count - 1;
watching = m_currenreplacedems[ nextIndex ].ItemUIContent.text + m_resizable;
GUI.FocusControl( watching );
}
if( currenEvent.keyCode == KeyCode.Tab )
{
ContextMenuItem item = m_currenreplacedems.Find( x => GUI.GetNameOfFocusedControl().Equals( x.ItemUIContent.text + m_resizable ) );
if( item != null )
{
watching = item.ItemUIContent.text + m_resizable;
}
}
float currPos = 0;
var enumerator = m_currentCategories.GetEnumerator();
float cache = EditorGUIUtility.labelWidth;
while( enumerator.MoveNext() )
{
var current = enumerator.Current;
bool visible = GUILayout.Toggle( current.Value.Visible, current.Key, m_foldoutStyle );
if( m_validButtonId == mouseButtonId )
{
current.Value.Visible = visible;
}
currPos += ItemSize;
if( m_searchFilter.Length > 0 || current.Value.Visible )
{
for( int i = 0; i < current.Value.Contents.Count; i++ )
{
//if ( !IsItemVisible( currPos ) )
//{
// // Invisible
// GUILayout.Space( ItemSize );
//}
//else
{
currPos += ItemSize;
// Visible
EditorGUILayout.BeginHorizontal();
GUILayout.Space( 16 );
//if ( m_isMouseInside )
//{
// //GUI.SetNextControlName( current.Value.Contents[ i ].ItemUIContent.text );
// if ( CheckButton( current.Value.Contents[ i ].ItemUIContent, m_buttonStyle, mouseButtonId ) )
// {
// int controlID = GUIUtility.GetControlID( FocusType.Preplacedive );
// GUIUtility.hotControl = controlID;
// OnPaletteNodeCreateEvt( current.Value.Contents[ i ].NodeType, current.Value.Contents[ i ].Name, current.Value.Contents[ i ].Function );
// }
//}
//else
{
Rect thisRect = EditorGUILayout.GetControlRect( false, 16f, EditorStyles.label );
//if ( m_resizable )
{
if( GUI.RepeatButton( thisRect, string.Empty, EditorStyles.label ) )
{
int controlID = GUIUtility.GetControlID( FocusType.Preplacedive );
GUIUtility.hotControl = controlID;
OnPaletteNodeCreateEvt( current.Value.Contents[ i ].NodeType, current.Value.Contents[ i ].Name, current.Value.Contents[ i ].Function );
//unfocus to make it focus the next text field correctly
GUI.FocusControl( null );
}
}
GUI.SetNextControlName( current.Value.Contents[ i ].ItemUIContent.text + m_resizable );
//EditorGUI.SelectableLabel( thisRect, current.Value.Contents[ i ].ItemUIContent.text, EditorStyles.label );
//float cache = EditorGUIUtility.labelWidth;
EditorGUIUtility.labelWidth = thisRect.width;
EditorGUI.Toggle( thisRect, current.Value.Contents[ i ].ItemUIContent.text, false, EditorStyles.label );
EditorGUIUtility.labelWidth = cache;
if( watching == current.Value.Contents[ i ].ItemUIContent.text + m_resizable )
{
bool boundBottom = currPos - m_currentScrollPos.y > m_currScrollBarDims.y;
bool boundTop = currPos - m_currentScrollPos.y - 4 <= 0;
if( boundBottom )
m_currentScrollPos.y = currPos - m_currScrollBarDims.y + 2;
else if( boundTop )
m_currentScrollPos.y = currPos - 18;
//else if ( boundBottom && !downDirection )
// m_currentScrollPos.y = currPos - m_currScrollBarDims.y + 2;
//else if ( boundTop && downDirection )
// m_currentScrollPos.y = currPos - 18;
}
}
EditorGUILayout.EndHorizontal();
}
//currPos += ItemSize;
}
}
}
EditorGUIUtility.labelWidth = cache;
}
EditorGUILayout.EndScrollView();
}
GUILayout.EndArea();
}
19
View Source File : PaletteParent.cs
License : MIT License
Project Creator : alexismorin
License : MIT License
Project Creator : alexismorin
public void CheckCommunityNodes()
{
var enumerator = m_currentCategories.GetEnumerator();
while( enumerator.MoveNext() )
{
var current = enumerator.Current;
current.Value.HasCommunityData = false;
int count = current.Value.Contents.Count;
for( int i = 0; i < count; i++ )
{
if( current.Value.Contents[ i ].NodeAttributes.FromCommunity )
{
current.Value.HasCommunityData = true;
break;
}
}
}
}
19
View Source File : PaletteParent.cs
License : MIT License
Project Creator : alexismorin
License : MIT License
Project Creator : alexismorin
public void DumpAvailableNodes( bool fromCommunity, string pathname )
{
string noTOCHeader = "__NOTOC__\n";
string nodesHeader = "== Available Node Categories ==\n";
string InitialCategoriesFormat = "[[#{0}|{0}]]<br>\n";
string InitialCategories = string.Empty;
string CurrentCategoryFormat = "\n== {0} ==\n\n";
//string NodesFootFormat = "[[Unity Products:Amplify Shader Editor/{0} | Learn More]] -\n[[#Top|Back to Categories]]\n";
string NodesFootFormatSep = "[[#Top|Back to Top]]\n----\n";
string OverallFoot = "[[Category:Nodes]]";
string NodeInfoBeginFormat = "<div clreplaced=\"nodecard\">\n";
string nodeInfoBodyFormat = "{{| id=\"{2}\" clreplaced=\"wikitable\" |\n" +
"|- \n" +
"| <div>[[Unity Products:Amplify Shader Editor/{1}|<img clreplaced=\"responsive-img\" src=\"http://amplify.pt/Nodes/{0}.jpg\">]]</div>\n" +
"<div>\n" +
"{{| style=\"width: 100%; height: 150px;\"\n" +
"|-\n" +
"| [[Unity Products:Amplify Shader Editor/{1}|'''{2}''']]\n" +
"|- style=\"vertical-align:top; height: 100%;\" |\n" +
"|<p clreplaced=\"cardtext\">{3}</p>\n" +
"|- style=\"text-align:right;\" |\n" +
"|{4}[[Unity Products:Amplify Shader Editor/{1} | Learn More]]\n" +
"|}}</div>\n" +
"|}}\n";
string NodeInfoEndFormat = "</div>\n";
//string NodeInfoBeginFormat = "<span style=\"color:#c00;display:block;\">This page is under construction!</span>\n\n";
//string nodeInfoBodyFormat = "<img style=\"float:left; margin-right:10px;\" src=\"http://amplify.pt/Nodes/{0}.jpg\">\n[[Unity Products:Amplify Shader Editor/{1}|'''{2}''']]\n\n{3}";
//string NodeInfoEndFormat = "\n\n[[Unity_Products:Amplify_Shader_Editor/Nodes | Back to Node List ]]\n[[Category:Nodes]][[Category:{0}]]\n\n\n";
//string NodeInfoBeginFormat = "{| cellpadding=\"10\"\n";
//string nodeInfoBodyFormat = "|- style=\"vertical-align:top;\"\n| http://amplify.pt/Nodes/{0}.jpg\n| [[Unity Products:Amplify Shader Editor/{1} | <span style=\"font-size: 120%;\"><span id=\"{2}\"></span>'''{2}'''<span> ]] <br> {3}\n";
//string NodeInfoEndFormat = "|}\n";
string nodesInfo = string.Empty;
BuildFullList( true );
CheckCommunityNodes();
var enumerator = m_currentCategories.GetEnumerator();
while( enumerator.MoveNext() )
{
var current = enumerator.Current;
if( fromCommunity && current.Value.HasCommunityData || !fromCommunity )
{
InitialCategories += string.Format( InitialCategoriesFormat, current.Key );
nodesInfo += string.Format( CurrentCategoryFormat, current.Key );
int count = current.Value.Contents.Count;
for( int i = 0; i < count; i++ )
{
if( ( fromCommunity && current.Value.Contents[ i ].NodeAttributes.FromCommunity )
|| !fromCommunity
//|| ( !fromCommunity && !current.Value.Contents[ i ].NodeAttributes.FromCommunity )
)
{
string nodeFullName = current.Value.Contents[ i ].Name;
string pictureFilename = UIUtils.ReplaceInvalidStrings( nodeFullName );
string pageFilename = UIUtils.RemoveWikiInvalidCharacters( pictureFilename );
pictureFilename = UIUtils.RemoveInvalidCharacters( pictureFilename );
string nodeDescription = current.Value.Contents[ i ].ItemUIContent.tooltip;
string communityText = string.Empty;
if( current.Value.Contents[ i ].NodeAttributes.FromCommunity )
communityText = "<small clreplaced=\"cardauthor\">( originally by "+ current.Value.Contents[ i ].NodeAttributes.Community + " )</small> ";
string nodeInfoBody = string.Format( nodeInfoBodyFormat, pictureFilename, pageFilename, nodeFullName, nodeDescription, communityText );
//string nodeInfoFoot = string.Format( NodesFootFormat, pageFilename );
nodesInfo += ( NodeInfoBeginFormat + nodeInfoBody + NodeInfoEndFormat );
//nodesInfo += ( NodeInfoBeginFormat + nodeInfoBody + string.Format( NodeInfoEndFormat, current.Key ) );
//if ( i != ( count - 1 ) )
//{
// nodesInfo += NodesFootFormatSep;
//}
}
}
nodesInfo += NodesFootFormatSep;
}
}
string finalText = noTOCHeader + nodesHeader + InitialCategories + nodesInfo + OverallFoot;
if( !System.IO.Directory.Exists( pathname ) )
{
System.IO.Directory.CreateDirectory( pathname );
}
// Save file
string nodesPathname = pathname + ( fromCommunity ? "AvailableNodesFromCommunity.txt" : "AvailableNodes.txt" );
Debug.Log( " Creating nodes file at " + nodesPathname );
IOUtils.SaveTextfileToDisk( finalText, nodesPathname, false );
BuildFullList( false );
}
19
View Source File : PaletteParent.cs
License : MIT License
Project Creator : alexismorin
License : MIT License
Project Creator : alexismorin
public Dictionary<string, PaletteFilterData> BuildFullList( bool forceAllNodes = false )
{
//Only need to build if search filter is active and list is set according to it
if( m_searchFilter.Length > 0 || !m_isActive || m_currentCategories.Count == 0 )
{
m_currenreplacedems.Clear();
m_currentCategories.Clear();
List<ContextMenuItem> allItems = forceAllNodes ? ParentWindow.ContextMenuInstance.ItemFunctions : ParentWindow.ContextMenuInstance.MenuItems;
for( int i = 0; i < allItems.Count; i++ )
{
if( allItems[ i ].Name.IndexOf( m_searchFilter, StringComparison.InvariantCultureIgnoreCase ) >= 0 ||
allItems[ i ].Category.IndexOf( m_searchFilter, StringComparison.InvariantCultureIgnoreCase ) >= 0
)
{
m_currenreplacedems.Add( allItems[ i ] );
if( !m_currentCategories.ContainsKey( allItems[ i ].Category ) )
{
m_currentCategories.Add( allItems[ i ].Category, new PaletteFilterData( m_defaultCategoryVisible ) );
//m_currentCategories[ allItems[ i ].Category ].HasCommunityData = allItems[ i ].NodeAttributes.FromCommunity || m_currentCategories[ allItems[ i ].Category ].HasCommunityData;
}
m_currentCategories[ allItems[ i ].Category ].Contents.Add( allItems[ i ] );
}
}
var categoryEnumerator = m_currentCategories.GetEnumerator();
while( categoryEnumerator.MoveNext() )
{
categoryEnumerator.Current.Value.Contents.Sort( ( x, y ) => x.CompareTo( y, false ) );
}
//mark to force update and take search filter into account
m_forceUpdate = true;
}
return m_currentCategories;
}
19
View Source File : PortLegendInfo.cs
License : MIT License
Project Creator : alexismorin
License : MIT License
Project Creator : alexismorin
public void DrawNodeDescriptions()
{
AmplifyShaderEditorWindow window = UIUtils.CurrentWindow;
if ( window != null )
{
if ( m_nodeDescriptionsInfo == null )
{
//fetch node info
m_nodeDescriptionsInfo = new List<NodeDescriptionInfo>();
Dictionary<string, PaletteFilterData> nodeData = window.CurrentPaletteWindow.BuildFullList();
var enumerator = nodeData.GetEnumerator();
while ( enumerator.MoveNext() )
{
List<ContextMenuItem> nodes = enumerator.Current.Value.Contents;
int count = nodes.Count;
NodeDescriptionInfo currInfo = new NodeDescriptionInfo();
currInfo.Contents = new string[ count, 2 ];
currInfo.Category = enumerator.Current.Key;
for ( int i = 0; i < count; i++ )
{
currInfo.Contents[ i, 0 ] = nodes[ i ].Name + ':';
currInfo.Contents[ i, 1 ] = nodes[ i ].Description;
}
m_nodeDescriptionsInfo.Add( currInfo );
}
}
//draw
{
GUILayout.Space( 5 );
int count = m_nodeDescriptionsInfo.Count;
EditorGUI.indentLevel--;
for ( int i = 0; i < count; i++ )
{
m_nodeDescriptionsInfo[ i ].FoldoutValue = EditorGUILayout.Foldout( m_nodeDescriptionsInfo[ i ].FoldoutValue, m_nodeDescriptionsInfo[ i ].Category, m_nodeInfoFoldoutStyle );
if ( m_nodeDescriptionsInfo[ i ].FoldoutValue )
{
EditorGUI.indentLevel++;
int nodeCount = m_nodeDescriptionsInfo[ i ].Contents.GetLength( 0 );
for ( int j = 0; j < nodeCount; j++ )
{
GUILayout.Label( m_nodeDescriptionsInfo[ i ].Contents[ j, 0 ], m_nodeInfoLabelStyleBold );
GUILayout.Label( m_nodeDescriptionsInfo[ i ].Contents[ j, 1 ], m_nodeInfoLabelStyle );
GUILayout.Space( PixelSeparator );
}
EditorGUI.indentLevel--;
}
GUILayout.Space( PixelSeparator );
}
EditorGUI.indentLevel++;
}
}
else
{
EditorGUILayout.LabelField( NoASEWindowWarning );
}
}
19
View Source File : PreMadeShaders.cs
License : MIT License
Project Creator : alexismorin
License : MIT License
Project Creator : alexismorin
public void Destroy()
{
var items = m_actionLib.GetEnumerator();
while ( items.MoveNext() )
{
items.Current.Value.Destroy();
}
m_actionLib.Clear();
m_actionLib = null;
}
19
View Source File : EnhancedExpandoObeject.cs
License : MIT License
Project Creator : AliFlux
License : MIT License
Project Creator : AliFlux
public IEnumerator<KeyValuePair<string, object>> GetEnumerator()
{
return Properties.GetEnumerator();
}
19
View Source File : EnhancedExpandoObeject.cs
License : MIT License
Project Creator : AliFlux
License : MIT License
Project Creator : AliFlux
IEnumerator IEnumerable.GetEnumerator()
{
return Properties.GetEnumerator();
}
19
View Source File : DictionaryFormatter.cs
License : Apache License 2.0
Project Creator : allenai
License : Apache License 2.0
Project Creator : allenai
protected override Dictionary<TKey, TValue>.Enumerator GetSourceEnumerator(Dictionary<TKey, TValue> source)
{
return source.GetEnumerator();
}
19
View Source File : Visualization.cs
License : MIT License
Project Creator : AmigoCap
License : MIT License
Project Creator : AmigoCap
void FindDistrictBoundaries() {
if (districts.Count == 0) {
_lowerDistrict = new int[] { 0, 0, 0 };
_upperDistrict = new int[] { 0, 0, 0 };
return;
}
var e = districts.GetEnumerator();
e.MoveNext();
_lowerDistrict = (int[])e.Current.Key.Clone();
_upperDistrict = (int[])e.Current.Key.Clone();
while (e.MoveNext()) {
for (int i = 0; i < 3; i++) {
_lowerDistrict[i] = Math.Min(_lowerDistrict[i], e.Current.Key[i]);
_upperDistrict[i] = Math.Max(_upperDistrict[i], e.Current.Key[i]);
}
}
}
19
View Source File : AmplifyMotionObjectBase.cs
License : MIT License
Project Creator : AmplifyCreations
License : MIT License
Project Creator : AmplifyCreations
void TryInitializeStates()
{
var enumerator = m_states.GetEnumerator();
while ( enumerator.MoveNext() )
{
AmplifyMotion.MotionState state = enumerator.Current.Value;
if ( state.Owner.Initialized && !state.Error && !state.Initialized )
state.Initialize();
}
}
19
View Source File : ParticleState.cs
License : MIT License
Project Creator : AmplifyCreations
License : MIT License
Project Creator : AmplifyCreations
void RemoveDeadParticles()
{
m_listToRemove.Clear();
var enumerator = m_particleDict.GetEnumerator();
while ( enumerator.MoveNext() )
{
KeyValuePair<uint, Particle> pair = enumerator.Current;
if ( pair.Value.refCount <= 0 )
{
m_particleStack.Push( pair.Value );
if(!m_listToRemove.Contains(pair.Key))
m_listToRemove.Add( pair.Key );
}
else
pair.Value.refCount = 0;
}
for ( int i = 0; i < m_listToRemove.Count; i++ )
m_particleDict.Remove( m_listToRemove[ i ] );
}
19
View Source File : ParticleState.cs
License : MIT License
Project Creator : AmplifyCreations
License : MIT License
Project Creator : AmplifyCreations
internal override void UpdateTransform( CommandBuffer updateCB, bool starting )
{
#if UNITY_5_5_OR_NEWER
int particleCount = m_particleSystem.main.maxParticles;
#else
int particleCount = m_particleSystem.maxParticles;
#endif
if ( !m_initialized || m_capacity != particleCount )
{
Initialize();
return;
}
Profiler.BeginSample( "Particle.Update" );
if ( !starting && m_wasVisible )
{
var enumerator = m_particleDict.GetEnumerator();
while ( enumerator.MoveNext() )
{
Particle particle = enumerator.Current.Value;
particle.prevLocalToWorld = particle.currLocalToWorld;
}
}
m_moved = true;
int numAlive = m_particleSystem.GetParticles( m_particles );
Matrix4x4 transformLocalToWorld = Matrix4x4.TRS( m_transform.position, m_transform.rotation, Vector3.one );
bool separateAxes = ( rotationOverLifetime.enabled && rotationOverLifetime.separateAxes ) ||
( rotationBySpeed.enabled && rotationBySpeed.separateAxes );
for ( int i = 0; i < numAlive; i++ )
{
uint seed = m_particles[ i ].randomSeed;
Particle particle;
bool justSpawned = false;
if ( !m_particleDict.TryGetValue( seed, out particle ) && m_particleStack.Count > 0 )
{
m_particleDict[ seed ] = particle = m_particleStack.Pop();
justSpawned = true;
}
if ( particle == null )
continue;
float currentSize = m_particles[ i ].GetCurrentSize( m_particleSystem );
Vector3 size = new Vector3( currentSize, currentSize, currentSize );
Matrix4x4 particleCurrLocalToWorld;
if ( m_renderer.renderMode == ParticleSystemRenderMode.Mesh )
{
Quaternion rotation;
if ( separateAxes )
rotation = Quaternion.Euler( m_particles[ i ].rotation3D );
else
rotation = Quaternion.AngleAxis( m_particles[ i ].rotation, m_particles[ i ].axisOfRotation );
Matrix4x4 particleMatrix = Matrix4x4.TRS( m_particles[ i ].position, rotation, size );
#if UNITY_5_5_OR_NEWER
if ( m_particleSystem.main.simulationSpace == ParticleSystemSimulationSpace.World )
#else
if ( m_particleSystem.simulationSpace == ParticleSystemSimulationSpace.World )
#endif
particleCurrLocalToWorld = particleMatrix;
else
particleCurrLocalToWorld = transformLocalToWorld * particleMatrix;
}
else if ( m_renderer.renderMode == ParticleSystemRenderMode.Billboard )
{
#if UNITY_5_5_OR_NEWER
if ( m_particleSystem.main.simulationSpace == ParticleSystemSimulationSpace.Local )
#else
if ( m_particleSystem.simulationSpace == ParticleSystemSimulationSpace.Local )
#endif
m_particles[ i ].position = transformLocalToWorld.MultiplyPoint( m_particles[ i ].position );
Quaternion rotation;
if ( separateAxes )
rotation = Quaternion.Euler( -m_particles[ i ].rotation3D.x, -m_particles[ i ].rotation3D.y, m_particles[ i ].rotation3D.z );
else
rotation = Quaternion.AngleAxis( m_particles[ i ].rotation, Vector3.back );
particleCurrLocalToWorld = Matrix4x4.TRS( m_particles[ i ].position, m_owner.Transform.rotation * rotation, size );
}
else
{
// unsupported
particleCurrLocalToWorld = Matrix4x4.idenreplacedy;
}
particle.refCount = 1;
particle.currLocalToWorld = particleCurrLocalToWorld;
if ( justSpawned )
particle.prevLocalToWorld = particle.currLocalToWorld;
}
if ( starting || !m_wasVisible )
{
var enumerator = m_particleDict.GetEnumerator();
while ( enumerator.MoveNext() )
{
Particle particle = enumerator.Current.Value;
particle.prevLocalToWorld = particle.currLocalToWorld;
}
}
RemoveDeadParticles();
m_wasVisible = m_renderer.isVisible;
Profiler.EndSample();
}
19
View Source File : ParticleState.cs
License : MIT License
Project Creator : AmplifyCreations
License : MIT License
Project Creator : AmplifyCreations
internal override void RenderVectors( Camera camera, CommandBuffer renderCB, float scale, AmplifyMotion.Quality quality )
{
Profiler.BeginSample( "Particle.Render" );
// TODO: batch
if ( m_initialized && !m_error && m_renderer.isVisible )
{
bool mask = ( m_owner.Instance.CullingMask & ( 1 << m_obj.gameObject.layer ) ) != 0;
if ( !mask || ( mask && m_moved ) )
{
const float rcp255 = 1 / 255.0f;
int objectId = mask ? m_owner.Instance.GenerateObjectId( m_obj.gameObject ) : 255;
renderCB.SetGlobalFloat( "_AM_OBJECT_ID", objectId * rcp255 );
renderCB.SetGlobalFloat( "_AM_MOTION_SCALE", mask ? scale : 0 );
int qualityPreplaced = ( quality == AmplifyMotion.Quality.Mobile ) ? 0 : 2;
for ( int i = 0; i < m_sharedMaterials.Length; i++ )
{
MaterialDesc matDesc = m_sharedMaterials[ i ];
int preplaced = qualityPreplaced + ( matDesc.coverage ? 1 : 0 );
if ( matDesc.coverage )
{
Texture mainTex = matDesc.material.mainTexture;
if ( mainTex != null )
matDesc.propertyBlock.SetTexture( "_MainTex", mainTex );
if ( matDesc.cutoff )
matDesc.propertyBlock.SetFloat( "_Cutoff", matDesc.material.GetFloat( "_Cutoff" ) );
}
var enumerator = m_particleDict.GetEnumerator();
while ( enumerator.MoveNext() )
{
KeyValuePair<uint, Particle> pair = enumerator.Current;
Matrix4x4 prevModelViewProj = m_owner.PrevViewProjMatrixRT * ( Matrix4x4 ) pair.Value.prevLocalToWorld;
renderCB.SetGlobalMatrix( "_AM_MATRIX_PREV_MVP", prevModelViewProj );
renderCB.DrawMesh( m_mesh, pair.Value.currLocalToWorld, m_owner.Instance.SolidVectorsMaterial, i, preplaced, matDesc.propertyBlock );
}
}
}
}
Profiler.EndSample();
}
19
View Source File : LayoutAwarePage.cs
License : GNU General Public License v3.0
Project Creator : andysal
License : GNU General Public License v3.0
Project Creator : andysal
public IEnumerator<KeyValuePair<K, V>> GetEnumerator()
{
return this._dictionary.GetEnumerator();
}
19
View Source File : LayoutAwarePage.cs
License : GNU General Public License v3.0
Project Creator : andysal
License : GNU General Public License v3.0
Project Creator : andysal
System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
{
return this._dictionary.GetEnumerator();
}
19
View Source File : PatriciaTrie.cs
License : Apache License 2.0
Project Creator : AnkiUniversal
License : Apache License 2.0
Project Creator : AnkiUniversal
public IEnumerator<KeyValuePair<string, V>> GetEnumerator()
{
Dictionary<string, V> entries = new Dictionary<string, V>();
EntriesR(root.Left, -1, entries);
return entries.GetEnumerator();
}
19
View Source File : ReadOnlyDictionary.cs
License : MIT License
Project Creator : ansel86castro
License : MIT License
Project Creator : ansel86castro
IEnumerator<KeyValuePair<TKey, TValue>> IEnumerable<KeyValuePair<TKey, TValue>>.GetEnumerator()
{
return ItemLookup.GetEnumerator();
}
19
View Source File : ReadOnlyDictionary.cs
License : MIT License
Project Creator : ansel86castro
License : MIT License
Project Creator : ansel86castro
System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
{
return ItemLookup.GetEnumerator();
}
19
View Source File : MapImplementation.cs
License : MIT License
Project Creator : apexsharp
License : MIT License
Project Creator : apexsharp
public IEnumerator<KeyValuePair<T1, T2>> GetEnumerator() => map.GetEnumerator();
19
View Source File : MapImplementation.cs
License : MIT License
Project Creator : apexsharp
License : MIT License
Project Creator : apexsharp
IEnumerator IEnumerable.GetEnumerator() => map.GetEnumerator();
19
View Source File : XmlDictionary.cs
License : MIT License
Project Creator : araditc
License : MIT License
Project Creator : araditc
public IEnumerator<KeyValuePair<string, string>> GetEnumerator() {
var dict = new Dictionary<string, string>();
foreach (string k in Keys)
dict.Add(k, this[k]);
return dict.GetEnumerator();
}
19
View Source File : Style.cs
License : MIT License
Project Creator : arbelatech
License : MIT License
Project Creator : arbelatech
public IEnumerator<KeyValuePair<TokenType, StyleData>> GetEnumerator()
{
return _styles.GetEnumerator();
}
19
View Source File : ObservableDictionary.cs
License : GNU General Public License v3.0
Project Creator : Artentus
License : GNU General Public License v3.0
Project Creator : Artentus
public IEnumerator<KeyValuePair<TKey, TValue>> GetEnumerator() => _dictionary.GetEnumerator();
19
View Source File : ResourceCache.cs
License : Apache License 2.0
Project Creator : ascora
License : Apache License 2.0
Project Creator : ascora
public Dictionary<string, object>.Enumerator GetEnumerator()
{
return resources.GetEnumerator();
}
19
View Source File : AttributeTable.cs
License : GNU General Public License v3.0
Project Creator : askeladdk
License : GNU General Public License v3.0
Project Creator : askeladdk
public IEnumerator<KeyValuePair<string, object>> GetEnumerator()
{
return attrs.GetEnumerator();
}
19
View Source File : DynamicJsonResponse.cs
License : Apache License 2.0
Project Creator : Autodesk-Forge
License : Apache License 2.0
Project Creator : Autodesk-Forge
public IEnumerator<KeyValuePair<string, object>> GetEnumerator () {
return (_dictionary.Dictionary.GetEnumerator ()) ;
}
19
View Source File : DynamicJsonResponse.cs
License : Apache License 2.0
Project Creator : Autodesk-Forge
License : Apache License 2.0
Project Creator : Autodesk-Forge
IEnumerator IEnumerable.GetEnumerator () {
return (_dictionary.Dictionary.GetEnumerator ()) ;
}
19
View Source File : ListDictionary.cs
License : MIT License
Project Creator : AvaloniaCommunity
License : MIT License
Project Creator : AvaloniaCommunity
IEnumerator<KeyValuePair<TKey, IList<TValue>>> IEnumerable<KeyValuePair<TKey, IList<TValue>>>.GetEnumerator()
{
return innerValues.GetEnumerator();
}
19
View Source File : ListDictionary.cs
License : MIT License
Project Creator : AvaloniaCommunity
License : MIT License
Project Creator : AvaloniaCommunity
System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
{
return innerValues.GetEnumerator();
}
19
View Source File : RegionBehaviorCollection.cs
License : MIT License
Project Creator : AvaloniaCommunity
License : MIT License
Project Creator : AvaloniaCommunity
public IEnumerator<KeyValuePair<string, IRegionBehavior>> GetEnumerator()
{
return behaviors.GetEnumerator();
}
19
View Source File : RegionBehaviorCollection.cs
License : MIT License
Project Creator : AvaloniaCommunity
License : MIT License
Project Creator : AvaloniaCommunity
IEnumerator IEnumerable.GetEnumerator()
{
return behaviors.GetEnumerator();
}
19
View Source File : MockRegionBehaviorCollection.cs
License : MIT License
Project Creator : AvaloniaCommunity
License : MIT License
Project Creator : AvaloniaCommunity
IEnumerator IEnumerable.GetEnumerator()
{
return GetEnumerator();
}
19
View Source File : PersistentConfigFileIdMap.cs
License : Apache License 2.0
Project Creator : awslabs
License : Apache License 2.0
Project Creator : awslabs
public IEnumerator<KeyValuePair<string, int>> GetEnumerator() => _memoryMap.GetEnumerator();
See More Examples