Context
How do I use Context
Below are practical examples compiled from projects for learning and reference purposes
Featured Snippets
File name: crBaoCao.cs
Copy
145 public virtual string GetCustomizedCacheKey(RequestContext request) {
146 String key = null;
147 // // The following is the code used to generate the default
148 // // cache key for caching report jobs in the ASP.NET Cache.
149 // // Feel free to modify this code to suit your needs.
150 // // Returning key == null causes the default cache key to
151 // // be generated.
152 //
153 // key = RequestContext.BuildCompleteCacheKey(
154 // request,
155 // null, // sReportFilename
156 // this.GetType(),
157 // this.ShareDBLogonInfo );
158 return key;
159 }
File name: rptThisinh.cs
Copy
137 public virtual string GetCustomizedCacheKey(RequestContext request) {
138 String key = null;
139 // // The following is the code used to generate the default
140 // // cache key for caching report jobs in the ASP.NET Cache.
141 // // Feel free to modify this code to suit your needs.
142 // // Returning key == null causes the default cache key to
143 // // be generated.
144 //
145 // key = RequestContext.BuildCompleteCacheKey(
146 // request,
147 // null, // sReportFilename
148 // this.GetType(),
149 // this.ShareDBLogonInfo );
150 return key;
151 }
File name: SortingLayerExposedEditor.cs
Copy
15 public override void OnInspectorGUI()
16 {
17 // Get the renderer from the target object
18 var renderer = (target as SortingLayerExposed).gameObject.GetComponent
19
20 // If there is no renderer, we can't do anything
21 if (!renderer)
22 {
23 return;
24 }
25
26 // Expose the sorting layer name
27 //string newSortingLayerName = EditorGUILayout.TextField("Sorting Layer", renderer.sortingLayerName);
28 //if (newSortingLayerName != renderer.sortingLayerName)
29 //{
30 // Undo.RecordObject(renderer, "Edit Sorting Layer Name");
31 // renderer.sortingLayerName = newSortingLayerName;
32 // EditorUtility.SetDirty(renderer);
33 //}
34
35 // Expose the sorting layer ID
36 //int newSortingLayerId = EditorGUILayout.IntField("Sorting Layer ID", renderer.sortingLayerID);
37 //if (newSortingLayerId != renderer.sortingLayerID)
38 //{
39 // Undo.RecordObject(renderer, "Edit Sorting Layer ID");
40 // renderer.sortingLayerID = newSortingLayerId;
41 // EditorUtility.SetDirty(renderer);
42 //}
43
44 // Seanba: Use a popup that is populated with the acceptable sorting layers for the renderer
45 // Also allow the player to bring up the Tag/Layers inspector if they choose so
46 string[] sortLayerNames = GetSortingLayerNames();
47 //int[] sortLayerIds = GetSortingLayerUniqueIDs();
48 //{
49 // StringBuilder builder = new StringBuilder("Sorting Layers = ");
50 // for (int i = 0; i < sortLayerNames.Length; ++i)
51 // {
52 // builder.AppendFormat("({0} = {1},{2}) ", i, sortLayerIds[i], sortLayerNames[i]);
53 // }
54 // Debug.Log(builder.ToString());
55 //}
56
57 int sortLayerSelection = GetSortingLayerIndex(renderer, sortLayerNames);
58
59 GUIContent[] sortingLayerContexts = GetSortingLayerContexts();
60 int newSortingLayerIndex = EditorGUILayout.Popup(new GUIContent("Sorting Layer"), sortLayerSelection, sortingLayerContexts);
61 if (newSortingLayerIndex == sortingLayerContexts.Length - 1)
62 {
63 EditorApplication.ExecuteMenuItem("Edit/Project Settings/Tags and Layers");
64 }
65 else if (newSortingLayerIndex != sortLayerSelection)
66 {
67 //int newSortingLayerId = sortLayerIds[newSortingLayerIndex];
68 string newSortingLayerName = sortLayerNames[newSortingLayerIndex];
69
70 Undo.RecordObject(renderer, "Edit Sorting Layer ID");
71 renderer.sortingLayerName = newSortingLayerName;
72 //renderer.sortingLayerID = newSortingLayerId;
73
74 EditorUtility.SetDirty(renderer);
75 }
76
77 // Expose the manual sorting order within a sort layer
78 int newSortingLayerOrder = EditorGUILayout.IntField("Order in Layer", renderer.sortingOrder);
79 if (newSortingLayerOrder != renderer.sortingOrder)
80 {
81 Undo.RecordObject(renderer, "Edit Sorting Order");
82 renderer.sortingOrder = newSortingLayerOrder;
83 EditorUtility.SetDirty(renderer);
84 }
85 }
File name: SortingLayerExposedEditor.cs
Copy
87 public static GUIContent[] GetSortingLayerContexts()
88 {
89 List
90
91 foreach (string layerName in GetSortingLayerNames())
92 {
93 contexts.Add(new GUIContent(layerName));
94 }
95
96 contexts.Add(GUIContent.none);
97 contexts.Add(new GUIContent("Edit Layers..."));
98
99 return contexts.ToArray();
100 }
File name: rptCustomers.cs
Copy
137 public virtual string GetCustomizedCacheKey(RequestContext request) {
138 String key = null;
139 // // The following is the code used to generate the default
140 // // cache key for caching report jobs in the ASP.NET Cache.
141 // // Feel free to modify this code to suit your needs.
142 // // Returning key == null causes the default cache key to
143 // // be generated.
144 //
145 // key = RequestContext.BuildCompleteCacheKey(
146 // request,
147 // null, // sReportFilename
148 // this.GetType(),
149 // this.ShareDBLogonInfo );
150 return key;
151 }
File name: rptInvoice.cs
Copy
137 public virtual string GetCustomizedCacheKey(RequestContext request) {
138 String key = null;
139 // // The following is the code used to generate the default
140 // // cache key for caching report jobs in the ASP.NET Cache.
141 // // Feel free to modify this code to suit your needs.
142 // // Returning key == null causes the default cache key to
143 // // be generated.
144 //
145 // key = RequestContext.BuildCompleteCacheKey(
146 // request,
147 // null, // sReportFilename
148 // this.GetType(),
149 // this.ShareDBLogonInfo );
150 return key;
151 }
File name: rptLowStock.cs
Copy
153 public virtual string GetCustomizedCacheKey(RequestContext request) {
154 String key = null;
155 // // The following is the code used to generate the default
156 // // cache key for caching report jobs in the ASP.NET Cache.
157 // // Feel free to modify this code to suit your needs.
158 // // Returning key == null causes the default cache key to
159 // // be generated.
160 //
161 // key = RequestContext.BuildCompleteCacheKey(
162 // request,
163 // null, // sReportFilename
164 // this.GetType(),
165 // this.ShareDBLogonInfo );
166 return key;
167 }
File name: rptSales.cs
Copy
137 public virtual string GetCustomizedCacheKey(RequestContext request) {
138 String key = null;
139 // // The following is the code used to generate the default
140 // // cache key for caching report jobs in the ASP.NET Cache.
141 // // Feel free to modify this code to suit your needs.
142 // // Returning key == null causes the default cache key to
143 // // be generated.
144 //
145 // key = RequestContext.BuildCompleteCacheKey(
146 // request,
147 // null, // sReportFilename
148 // this.GetType(),
149 // this.ShareDBLogonInfo );
150 return key;
151 }
File name: rptStock.cs
Copy
137 public virtual string GetCustomizedCacheKey(RequestContext request) {
138 String key = null;
139 // // The following is the code used to generate the default
140 // // cache key for caching report jobs in the ASP.NET Cache.
141 // // Feel free to modify this code to suit your needs.
142 // // Returning key == null causes the default cache key to
143 // // be generated.
144 //
145 // key = RequestContext.BuildCompleteCacheKey(
146 // request,
147 // null, // sReportFilename
148 // this.GetType(),
149 // this.ShareDBLogonInfo );
150 return key;
151 }
File name: rptSuppliers.cs
Copy
137 public virtual string GetCustomizedCacheKey(RequestContext request) {
138 String key = null;
139 // // The following is the code used to generate the default
140 // // cache key for caching report jobs in the ASP.NET Cache.
141 // // Feel free to modify this code to suit your needs.
142 // // Returning key == null causes the default cache key to
143 // // be generated.
144 //
145 // key = RequestContext.BuildCompleteCacheKey(
146 // request,
147 // null, // sReportFilename
148 // this.GetType(),
149 // this.ShareDBLogonInfo );
150 return key;
151 }
Download file with original file name:Context
Context 114 lượt xem
Gõ tìm kiếm nhanh...