本文整理汇总了C#中NavigationData类的典型用法代码示例。如果您正苦于以下问题:C# NavigationData类的具体用法?C# NavigationData怎么用?C# NavigationData使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
NavigationData类属于命名空间,在下文中一共展示了NavigationData类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: NavigatePersonMaximumRowsLinkTest
public void NavigatePersonMaximumRowsLinkTest()
{
NavigationData data = new NavigationData();
data["maximumRows"] = 20;
string link = StateController.GetNavigationLink("Person", data);
Assert.AreEqual("/List/0/20", link);
}
开发者ID:ericziko,项目名称:navigation,代码行数:7,代码来源:StateInfoTest.cs
示例2: NavigateHistory
/// <summary>
/// Responds to a <see cref="System.Web.UI.ScriptManager"/> history navigation handler and restores the
/// <paramref name="data"/> saved by <see cref="AddHistoryPoint(System.Web.UI.Page, Navigation.NavigationData, string)"/>
/// method to the <see cref="Navigation.StateContext"/>
/// </summary>
/// <param name="data">Saved <see cref="Navigation.StateContext"/> to restore</param>
/// <exception cref="System.ArgumentNullException"><paramref name="data"/> is null</exception>
/// <exception cref="Navigation.UrlException">There is data that cannot be converted from a <see cref="System.String"/>;
/// or the <see cref="Navigation.NavigationShield"/> detects tampering</exception>
public static void NavigateHistory(NameValueCollection data)
{
if (data == null)
throw new ArgumentNullException("data");
if (data.Count == 0)
{
NavigationData derivedData = new NavigationData(StateContext.State.Derived);
#if NET40Plus
SetStateContext(StateContext.State.Id, new HttpContextWrapper(HttpContext.Current));
#else
SetStateContext(StateContext.State.Id, HttpContext.Current.Request.QueryString);
#endif
StateContext.Data.Add(derivedData);
}
else
{
RemoveDefaultsAndDerived(data);
data = StateContext.ShieldDecode(data, true, StateContext.State);
data.Remove(NavigationSettings.Config.StateIdKey);
NavigationData derivedData = new NavigationData(StateContext.State.Derived);
StateContext.Data.Clear();
StateContext.Data.Add(derivedData);
foreach (string key in data)
{
StateContext.Data[key] = CrumbTrailManager.ParseURLString(key, data[key], StateContext.State);
}
}
}
开发者ID:ericziko,项目名称:navigation,代码行数:37,代码来源:StateController.cs
示例3: NavigateMvcPersonStartRowIndexLinkTest
public void NavigateMvcPersonStartRowIndexLinkTest()
{
NavigationData data = new NavigationData();
data["startRowIndex"] = 10;
string link = StateController.GetNavigationLink("MvcPerson", data);
Assert.AreEqual("/MvcList/10", link);
}
开发者ID:ericziko,项目名称:navigation,代码行数:7,代码来源:StateInfoTest.cs
示例4: Start
// Use this for initialization
void Start () {
Debug.Log("Start");
// initialize data array
data = new byte[width*height*3];
// set textures
MainRenderer.material.mainTexture = cameraTexture;
SecondaryRenderer.material.mainTexture = blackTexture;
cameraTexture = new Texture2D (width, height);
blackTexture = new Texture2D (1, 1);
blackTexture.SetPixel (0, 0, Color.black);
blackTexture.Apply ();
// Initialize drone
videoPacketDecoderWorker = new VideoPacketDecoderWorker(PixelFormat.BGR24, true, OnVideoPacketDecoded);
videoPacketDecoderWorker.Start();
droneClient = new DroneClient("192.168.1.1");
droneClient.UnhandledException += HandleUnhandledException;
droneClient.VideoPacketAcquired += OnVideoPacketAcquired;
droneClient.NavigationDataAcquired += navData => navigationData = navData;
videoPacketDecoderWorker.UnhandledException += HandleUnhandledException;
droneClient.Start ();
// activate main drone camera
switchDroneCamera (AR.Drone.Client.Configuration.VideoChannelType.Vertical);
// determine connection
client = new WlanClient();
}
开发者ID:denlittlstar,项目名称:RiftDrone,代码行数:30,代码来源:DroneController.cs
示例5: CreateScreenData
public override void CreateScreenData(NavigationData navigationData)
{
base.CreateScreenData(navigationData);
if (!_presentsBaseView)
return;
ReloadMediaItems(navigationData.BaseViewSpecification.BuildView(), true);
}
开发者ID:HAF-Blade,项目名称:MediaPortal-2,代码行数:7,代码来源:AbstractItemsScreenData.cs
示例6: DroneClient
public DroneClient(string hostname)
{
_networkConfiguration = new NetworkConfiguration(hostname);
_commandQueue = new ConcurrentQueue<AtCommand>();
_navigationData = new NavigationData();
_commandSender = new CommandSender(NetworkConfiguration, _commandQueue);
_navdataAcquisition = new NavdataAcquisition(NetworkConfiguration, OnNavdataPacketAcquired, OnNavdataAcquisitionStarted, OnNavdataAcquisitionStopped);
_videoAcquisition = new VideoAcquisition(NetworkConfiguration, OnVideoPacketAcquired);
}
开发者ID:edmundo096,项目名称:LeapRiftDrone,代码行数:10,代码来源:DroneClient.cs
示例7: UpdateData
private static void UpdateData(NameValueCollection queryString, NavigationData toData)
{
if (queryString["navigation"] != "history")
{
var toDataKeys = GetDataKeyEnumerator(queryString["tokeys"]);
foreach (var toDataKey in toDataKeys)
StateContext.Data[toDataKey] = toData[toDataKey];
}
else
StateContext.Data.Add(toData);
}
开发者ID:ericziko,项目名称:navigation,代码行数:11,代码来源:MvcStateRouteHandler.cs
示例8: NavigationDataValueProviderTest
public void NavigationDataValueProviderTest()
{
NavigationData data = new NavigationData() {
{ "string", "Hello" }, {"int", 1 }
};
StateController.Navigate("d0", data);
ModelBindingExecutionContext context = new ModelBindingExecutionContext(new MockHttpContext(), new ModelStateDictionary());
NavigationDataValueProvider provider = new NavigationDataValueProvider(context, false, null);
Assert.AreEqual("Hello", provider.GetValue("string").RawValue);
Assert.AreEqual(1, provider.GetValue("int").RawValue);
Assert.AreEqual("1", provider.GetValue("int").AttemptedValue);
}
开发者ID:ericziko,项目名称:navigation,代码行数:12,代码来源:NavigationDataBindingTest.cs
示例9: AddHistoryPoint
/// <summary>
/// Wraps the ASP.NET <see cref="System.Web.UI.ScriptManager"/> history point functionality.
/// </summary>
/// <param name="page">Current <see cref="System.Web.UI.Page"/></param>
/// <param name="toData">The <see cref="Navigation.NavigationData"/> used to create the history point</param>
/// <param name="title">Title for history point</param>
/// <exception cref="System.ArgumentNullException"><paramref name="page"/> is null</exception>
/// <exception cref="System.ArgumentException">There is <see cref="Navigation.NavigationData"/> that cannot be converted to a <see cref="System.String"/></exception>
public static void AddHistoryPoint(Page page, NavigationData toData, string title)
{
if (page == null)
throw new ArgumentNullException("page");
NameValueCollection coll = new NameValueCollection();
coll[NavigationSettings.Config.StateIdKey] = StateContext.StateId;
foreach (NavigationDataItem item in toData)
{
if (!item.Value.Equals(string.Empty) && !StateContext.State.DefaultOrDerived(item.Key, item.Value))
coll[item.Key] = CrumbTrailManager.FormatURLObject(item.Key, item.Value, StateContext.State);
}
coll = StateContext.ShieldEncode(coll, true, StateContext.State);
ScriptManager.GetCurrent(page).AddHistoryPoint(coll, title);
ScriptManager.RegisterClientScriptBlock(page, typeof(StateController), "historyUrl", string.Format(CultureInfo.InvariantCulture, HISTORY_URL_VAR, HISTORY_URL, new JavaScriptSerializer().Serialize(GetRefreshLink(toData))), true);
}
开发者ID:ericziko,项目名称:navigation,代码行数:23,代码来源:StateController.cs
示例10: GenerateSorter
private static MvcHtmlString GenerateSorter(this HtmlHelper htmlHelper, string linkText, string sortBy, string sortExpressionKey, object htmlAttributes)
{
if (string.IsNullOrEmpty(linkText))
throw new ArgumentException(Resources.NullOrEmpty, "linkText");
if (string.IsNullOrEmpty(sortBy))
throw new ArgumentException(Resources.NullOrEmpty, "sortBy");
string sortExpression = (string)StateContext.Data[sortExpressionKey];
if (sortExpression != sortBy + " DESC")
sortExpression = sortBy + " DESC";
else
sortExpression = sortBy;
NavigationData toData = new NavigationData();
toData[sortExpressionKey] = sortExpression;
return htmlHelper.RefreshLink(linkText, toData, true, htmlAttributes);
}
开发者ID:ericziko,项目名称:navigation,代码行数:15,代码来源:SorterExtensions.cs
示例11: InitMediaNavigation
public void InitMediaNavigation(out string mediaNavigationMode, out NavigationData navigationData)
{
IEnumerable<Guid> skinDependentOptionalMIATypeIDs = MediaNavigationModel.GetMediaSkinOptionalMIATypes(MediaNavigationMode);
AbstractItemsScreenData.PlayableItemCreatorDelegate picd = mi => new VideoItem(mi)
{
Command = new MethodDelegateCommand(() => PlayItemsModel.CheckQueryPlayAction(mi))
};
ViewSpecification rootViewSpecification = new MediaLibraryQueryViewSpecification(Consts.RES_VIDEOS_VIEW_NAME,
null, Consts.NECESSARY_VIDEO_MIAS, skinDependentOptionalMIATypeIDs, true)
{
MaxNumItems = Consts.MAX_NUM_ITEMS_VISIBLE
};
AbstractScreenData filterByGenre = new VideosFilterByGenreScreenData();
ICollection<AbstractScreenData> availableScreens = new List<AbstractScreenData>
{
new VideosShowItemsScreenData(picd),
new VideosFilterByLanguageScreenData(),
new VideosFilterByActorScreenData(),
new VideosFilterByDirectorScreenData(),
new VideosFilterByWriterScreenData(),
filterByGenre,
// C# doesn't like it to have an assignment inside a collection initializer
new VideosFilterByYearScreenData(),
new VideosFilterBySystemScreenData(),
new VideosSimpleSearchScreenData(picd),
};
Sorting.Sorting sortByTitle = new SortByTitle();
ICollection<Sorting.Sorting> availableSortings = new List<Sorting.Sorting>
{
sortByTitle,
new SortByYear(),
new VideoSortByFirstGenre(),
new VideoSortByDuration(),
new VideoSortByFirstActor(),
new VideoSortByFirstDirector(),
new VideoSortByFirstWriter(),
new VideoSortBySize(),
new VideoSortByAspectRatio(),
new SortBySystem(),
};
navigationData = new NavigationData(null, Consts.RES_VIDEOS_VIEW_NAME, MediaNavigationRootState,
MediaNavigationRootState, rootViewSpecification, filterByGenre, availableScreens, sortByTitle)
{
AvailableSortings = availableSortings
};
mediaNavigationMode = MediaNavigationMode;
}
开发者ID:jgauffin,项目名称:MediaPortal-2,代码行数:48,代码来源:VideosNavigation.cs
示例12: RaisePostBackEvent
/// <summary>
/// Updates <see cref="Navigation.StateContext.Data">State Context</see> when the
/// <see cref="System.Web.UI.WebControls.HyperLink"/> posts back to the server
/// </summary>
/// <param name="eventArgument">The argument for the event</param>
public void RaisePostBackEvent(string eventArgument)
{
if (StringComparer.OrdinalIgnoreCase.Compare(eventArgument, REFRESH_POST_BACK) == 0)
{
Page.ClientScript.ValidateEvent(HyperLink.UniqueID, REFRESH_POST_BACK);
NavigationData derivedData = new NavigationData(StateContext.State.Derived);
NavigationData toData = StateInfoConfig.ParseNavigationDataExpression(HyperLink.Attributes["__ToData"], StateContext.State, true);
StateContext.Data.Clear();
StateContext.Data.Add(toData);
StateContext.Data.Add(derivedData);
}
else
{
((IPostBackEventHandler)HyperLink).RaisePostBackEvent(eventArgument);
}
}
开发者ID:ericziko,项目名称:navigation,代码行数:21,代码来源:RefreshHyperLinkAdapter.cs
示例13: GetHref
internal static string GetHref(string nextState, NavigationData navigationData, NavigationData returnData)
{
string previousState = StateContext.StateId;
string crumbTrail = StateContext.CrumbTrailKey;
State state = StateContext.GetState(nextState);
NameValueCollection coll = new NameValueCollection();
coll[NavigationSettings.Config.StateIdKey] = nextState;
if (previousState != null && state.TrackCrumbTrail)
{
coll[NavigationSettings.Config.PreviousStateIdKey] = previousState;
}
if (navigationData != null)
{
foreach (NavigationDataItem item in navigationData)
{
if (!item.Value.Equals(string.Empty) && !state.DefaultOrDerived(item.Key, item.Value))
coll[item.Key] = FormatURLObject(item.Key, item.Value, state);
}
}
if (returnData != null && state.TrackCrumbTrail && StateContext.State != null)
{
var returnDataBuilder = FormatReturnData(null, StateContext.State, returnData);
if (returnDataBuilder.Length > 0)
coll[NavigationSettings.Config.ReturnDataKey] = returnDataBuilder.ToString();
}
if (crumbTrail != null && state.TrackCrumbTrail)
{
coll[NavigationSettings.Config.CrumbTrailKey] = crumbTrail;
}
#if NET35Plus
coll = StateContext.ShieldEncode(coll, false, state);
#else
coll = StateContext.ShieldEncode(coll, state);
#endif
#if NET40Plus
HttpContextBase context = null;
if (HttpContext.Current != null)
context = new HttpContextWrapper(HttpContext.Current);
else
context = new MockNavigationContext(null, state);
return state.StateHandler.GetNavigationLink(state, coll, context);
#else
return state.StateHandler.GetNavigationLink(state, coll);
#endif
}
开发者ID:ericziko,项目名称:navigation,代码行数:45,代码来源:CrumbTrailManager.cs
示例14: DeterminePostBackMode
/// <summary>
/// Validates the incoming Url and if no <see cref="Navigation.NavigationSettings.StateIdKey"/>
/// found will navigate to the <see cref="Navigation.Dialog"/> whose path property matches the Url
/// </summary>
/// <returns>A <see cref="System.Collections.Specialized.NameValueCollection"/> of the
/// postback variables, if any; otherwise null</returns>
/// <exception cref="Navigation.UrlException">The <see cref="Navigation.NavigationSettings.StateIdKey"/>
/// is not found and the Url does not match the path of any <see cref="Navigation.Dialog"/>; the page of
/// the <see cref="Navigation.State"/> does not match the Url path</exception>
public override NameValueCollection DeterminePostBackMode()
{
if (IsLogin() || !HttpContext.Current.Handler.GetType().IsSubclassOf(typeof(Page))
|| StateInfoConfig.Dialogs == null || StateInfoConfig.Dialogs.Count == 0)
return base.DeterminePostBackMode();
#if NET40Plus
StateContext.StateId = Page.Request.QueryString[NavigationSettings.Config.StateIdKey] ?? (string)Page.RouteData.DataTokens[NavigationSettings.Config.StateIdKey];
#else
StateContext.StateId = Page.Request.QueryString[NavigationSettings.Config.StateIdKey];
#endif
if (StateContext.StateId == null)
{
if (_DialogPaths.ContainsKey(Page.AppRelativeVirtualPath.ToUpperInvariant()))
{
NavigationData data = new NavigationData();
foreach (string key in Page.Request.QueryString)
data.Add(key, Page.Request.QueryString[key]);
StateController.Navigate(_DialogPaths[Page.AppRelativeVirtualPath.ToUpperInvariant()].Key, data);
}
#if NET40Plus
if (Page.RouteData.Route != null)
return base.DeterminePostBackMode();
#endif
throw new UrlException(Resources.InvalidUrl);
}
if (StateContext.State == null)
{
StateContext.StateId = null;
throw new UrlException(Resources.InvalidUrl);
}
#if NET40Plus
Route route = Page.RouteData.Route as Route;
if (StringComparer.OrdinalIgnoreCase.Compare(StateContext.State.Page, Page.AppRelativeVirtualPath) != 0
&& StringComparer.OrdinalIgnoreCase.Compare(StateContext.State.MobilePage, Page.AppRelativeVirtualPath) != 0
&& (route == null || StringComparer.OrdinalIgnoreCase.Compare(StateContext.State.Route, route.Url) != 0))
#else
if (StringComparer.OrdinalIgnoreCase.Compare(StateContext.State.Page, Page.AppRelativeVirtualPath) != 0
&& StringComparer.OrdinalIgnoreCase.Compare(StateContext.State.MobilePage, Page.AppRelativeVirtualPath) != 0)
#endif
{
throw new UrlException(Resources.InvalidUrl);
}
Page.PreInit += Page_PreInit;
return base.DeterminePostBackMode();
}
开发者ID:ericziko,项目名称:navigation,代码行数:54,代码来源:StateAdapter.cs
示例15: GetHttpHandler
/// <summary>
/// Returns the object that processes the request
/// </summary>
/// <param name="requestContext">An object that encapsulates information about the request</param>
/// <returns>The object that processes the request</returns>
protected override IHttpHandler GetHttpHandler(RequestContext requestContext)
{
StateController.SetStateContext(State.Id, requestContext.HttpContext);
var queryString = requestContext.HttpContext.Request.QueryString;
var link = queryString["refreshajax"];
if (link != null)
{
var toData = new NavigationData(true);
StateController.NavigateLink(State, link, NavigationMode.Mock);
RefreshAjaxInfo.GetInfo(requestContext.HttpContext).Data = new NavigationData(true);
var includeCurrentData = false;
bool.TryParse(queryString["includecurrent"], out includeCurrentData);
if (!includeCurrentData)
{
var currentDataKeys = GetDataKeyEnumerator(queryString["currentkeys"]);
var currentData = new NavigationData(currentDataKeys);
StateContext.Data.Clear();
StateContext.Data.Add(currentData);
}
UpdateData(queryString, toData);
}
return base.GetHttpHandler(requestContext);
}
开发者ID:ericziko,项目名称:navigation,代码行数:28,代码来源:MvcStateRouteHandler.cs
示例16: ToNavigationData
public static NavigationData ToNavigationData(NavdataBag navdataBag)
{
var navigationData = new NavigationData();
var ardroneState = (def_ardrone_state_mask_t)navdataBag.navigationDataHeader.ardrone_state;
UpdateStateUsing(ardroneState, ref navigationData.State);
navigationData.Masks = ardroneState;
var ctrlState = (CTRL_STATES)(navdataBag.demo.ctrl_state >> 0x10);
UpdateStateUsing(ctrlState, ref navigationData.State);
navigationData.Yaw = DegreeToRadian * (navdataBag.demo.psi / 1000.0f);
navigationData.Pitch = DegreeToRadian * (navdataBag.demo.theta / 1000.0f);
navigationData.Roll = DegreeToRadian * (navdataBag.demo.phi / 1000.0f);
navigationData.Altitude = navdataBag.demo.altitude / 1000.0f;
navigationData.Time = navdataBag.time.time;
DateTime date = new DateTime(navdataBag.time.time);
navigationData.Velocity.X = navdataBag.demo.vx / 1000.0f;
navigationData.Velocity.Y = navdataBag.demo.vy / 1000.0f;
navigationData.Velocity.Z = navdataBag.demo.vz / 1000.0f;
Battery bat = new Battery();
bat.Low = ardroneState.HasFlag(def_ardrone_state_mask_t.ARDRONE_VBAT_LOW);
bat.Percentage = navdataBag.demo.vbat_flying_percentage;
bat.Voltage = navdataBag.raw_measures.vbat_raw / 1000.0f;
navigationData.Battery = bat;
navigationData.Wifi.LinkQuality = 1.0f - ConversionHelper.ToSingle(navdataBag.wifi.link_quality);
navigationData.Video.FrameNumber = navdataBag.video_stream.frame_number;
return navigationData;
}
开发者ID:Eggies,项目名称:SDK,代码行数:36,代码来源:NavdataConverter.cs
示例17: ParseNavigationDataExpression
/// <summary>
/// Creates <see cref="Navigation.NavigationData"/> that corresponds to the key/value pairs
/// specified by the <paramref name="expression"/></summary>
/// <param name="expression">The key/value pairs with types optional. Values are optional if
/// <paramref name="useCurrentData"/> is true</param>
/// <param name="state">Holds the <see cref="Navigation.State.DefaultTypes"/> of the keys</param>
/// <param name="useCurrentData">Indicates whether values can be retrieved from the current
/// <see cref="Navigation.StateContext.Data"/></param>
/// <returns>The <see cref="Navigation.NavigationData"/> that corresponds to the specified
/// key/value pairs</returns>
/// <exception cref="System.ArgumentNullException"><paramref name="expression"/> is null</exception>
/// <exception cref="System.FormatException">Either the <paramref name="expression"/> was not
/// in a recognised format or it contained an unrecognised type or a value was not in a format
/// recognised by its corresponding type</exception>
/// <exception cref="System.InvalidCastException">The <paramref name="expression"/> specifies types
/// of guid or timespan</exception>
/// <exception cref="System.OverflowException">A value represents a number that is out of the
/// range of its corresponding type</exception>
public static NavigationData ParseNavigationDataExpression(string expression, State state, bool useCurrentData)
{
if (expression == null)
throw new ArgumentNullException("expression");
string[] keyTypeValue;
expression = expression.Trim();
bool includeCurrentData = useCurrentData && expression.StartsWith("&", StringComparison.Ordinal);
NavigationData navigationData = new NavigationData(includeCurrentData);
if (includeCurrentData)
{
expression = expression.Substring(1);
if (expression.Length == 0)
return navigationData;
}
foreach (string dataItem in expression.Split(new char[] { ',' }))
{
keyTypeValue = dataItem.Split(new char[] { '=' });
if (keyTypeValue.Length == 2)
SetNavigationKeyValue(navigationData, keyTypeValue, state);
else
SetNavigationKey(navigationData, keyTypeValue, useCurrentData, includeCurrentData);
}
return navigationData;
}
开发者ID:ericziko,项目名称:navigation,代码行数:42,代码来源:StateInfoConfig.cs
示例18: PushToStack
private NavigationData PushToStack(UIViewController controller, string param)
{
NavigationData data = new NavigationData(controller, param);
if (controller.StackPushable)
{
controllerStacks.Push(data);
}
return data;
}
开发者ID:azanium,项目名称:Klumbi-Unity,代码行数:10,代码来源:UINavigationController.cs
示例19: CreateScreenData
/// <summary>
/// Updates all data which is needed by the skin. That is all properties in the region "Lazy initialized properties"
/// and all properties from sub classes. After calling this method, the UI screen will be shown.
/// </summary>
public virtual void CreateScreenData(NavigationData navigationData)
{
if (IsEnabled)
throw new IllegalCallException("Screen data is already initialized");
_navigationData = navigationData;
_numItemsStrProperty = new WProperty(typeof(string), string.Empty);
_isItemsValidProperty = new WProperty(typeof(bool), true);
_isItemsEmptyProperty = new WProperty(typeof(bool), true);
_tooManyItemsProperty = new WProperty(typeof(bool), false);
_showListProperty = new WProperty(typeof(bool), true);
_showListHintProperty = new WProperty(typeof(bool), false);
_listHintProperty = new WProperty(typeof(string), string.Empty);
}
开发者ID:BigGranu,项目名称:MediaPortal-2,代码行数:17,代码来源:AbstractScreenData.cs
示例20: ResetNavigationData
private void ResetNavigationData()
{
_navigationData = new NavigationData();
}
开发者ID:Eggies,项目名称:SDK,代码行数:4,代码来源:DroneClient.cs
注:本文中的NavigationData类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论