public UserLogDialog(UiOptions aUiOptions) { InitializeComponent(); UserLog.AddListener(this); txtUserLog.Text = TruncateText(UserLog.Text); iUiOptions = aUiOptions; this.Loaded += LoadedHandler; }
public DetailsDialog(upnpObject aUpnpObject, upnpObject aParent, UiOptions aUiOptions) { InitializeComponent(); iUpnpObject = aUpnpObject; iParent = aParent; details.Content = new BrowserItem(aUpnpObject, aParent); details.ItemInfo = new ItemInfo(aUpnpObject, aParent); iUiOptions = aUiOptions; this.Loaded += LoadedHandler; }
public OptionsDialog(HelperKinsky aHelperKinsky, UiOptions aUiOptions) { InitializeComponent(); iHelperKinsky = aHelperKinsky; iHelperKinsky.EventOptionPagesChanged += new EventHandler <EventArgs>(aHelperKinsky_EventOptionPagesChanged); LoadOptions(); if (iOptionPages.Count > 0) { iOptionPages[0].IsSelected = true; } iUiOptions = aUiOptions; this.Loaded += LoadedHandler; }
public AboutDialog(HelperKinsky aHelperKinsky, string aSize, UiOptions aUiOptions) { InitializeComponent(); if (aSize == KinskyDesktop.kFontOptionLarge) { Height = 180; Width = 480; } txtProduct.Text = aHelperKinsky.Product; txtVersion.Text = String.Format("Version: {0}", aHelperKinsky.Version); txtCopyright.Text = aHelperKinsky.Copyright; txtCompany.Text = aHelperKinsky.Company; txtDescription.Text = aHelperKinsky.Description; iUiOptions = aUiOptions; this.Loaded += LoadedHandler; }
public PlaylistWidget(DropConverter aDropConverter, IPlaylistSupport aSupport, UiOptions aUiOptions) { InitializeComponent(); iUiOptions = aUiOptions; iDropConverter = aDropConverter; iDragHelper = new DragHelper(lstPlaylist); iDragHelper.EventDragInitiated += new EventHandler <MouseEventArgs>(iDragHelper_EventDragInitiated); lstPlaylist.SelectionMode = SelectionMode.Extended; iSupport = aSupport; DragScroller scroller = new DragScroller(lstPlaylist, delegate(DragEventArgs e) { return(GetEffects(e)); }); scroller.ItemsDropped += new EventHandler <DragScroller.EventArgsItemsDropped>(Scroller_ItemsDropped); }
public KinskyDesktop() { iInstance = this; HttpWebRequest.DefaultWebProxy = WebRequest.GetSystemWebProxy(); HttpWebRequest.DefaultWebProxy.Credentials = CredentialCache.DefaultCredentials; iWindowLoaded = new AutoResetEvent(false); iImageCache = new WpfImageCache(kCacheSize, kDownscaleImageSize, kThreadCount); iIconResolver = new IconResolver(); ResourceDictionary dictionary = App.Current.Resources; string assemblyName = System.Reflection.Assembly.GetExecutingAssembly().FullName; string[] resourceDictionaries = { "Shared", "ControlStyles", "ScrollBar", "ComboBox", "ListBox", "TileViewStyle", "WindowChromeStyle", "MenuItem", "Slider" }; foreach (string resourceDictionary in resourceDictionaries) { dictionary.MergedDictionaries.Add(Application.LoadComponent(new Uri(string.Format("/{0};component/{1}.xaml", assemblyName, resourceDictionary), UriKind.Relative)) as ResourceDictionary); } InitializeComponent(); iUpdateOnExit = false; iHelper = new HelperKinsky(Environment.GetCommandLineArgs(), new Invoker(this.Dispatcher)); ICrashLogDumper d = new CrashLogDumperForm(this, iHelper.Title, iHelper.Product, iHelper.Version); iHelper.AddCrashLogDumper(d); System.Windows.Forms.Application.SetUnhandledExceptionMode(System.Windows.Forms.UnhandledExceptionMode.ThrowException); iUIOptions = new UiOptions(iHelper); InitialiseStack(); WindowChrome.SetIsMiniModeActive(mainWindowChrome, iUIOptions.MiniMode); SetWindowDimensions(); iProcessedOptions = true; AllowsTransparency = iTransparentOption.Native; this.Loaded += new RoutedEventHandler(KinskyDesktop_Loaded); }
public SavePlaylistDialog(ISaveSupport aSaveSupport, UiOptions aUiOptions) { InitializeComponent(); iSaveSupport = aSaveSupport; iSaveSupport.EventImageListChanged += EventImageListChangedHandler; iSaveSupport.EventSaveLocationsChanged += EventSaveLocationsChangedHandler; iSaveSupport.EventSaveLocationChanged += EventSaveLocationChangedHandler; UpdateLocations(); UpdateLocation(); UpdateImages(); txtFilename.Text = iSaveSupport.DefaultName; this.KeyUp += SavePlaylistDialog_KeyUp; CommandBindings.Add(new CommandBinding(ApplicationCommands.Close, new ExecutedRoutedEventHandler(delegate(object sender, ExecutedRoutedEventArgs args) { this.CloseWindow(); }))); iUiOptions = aUiOptions; this.Loaded += LoadedHandler; }
public KinskyDesktop() { iInstance = this; HttpWebRequest.DefaultWebProxy = WebRequest.GetSystemWebProxy(); HttpWebRequest.DefaultWebProxy.Credentials = CredentialCache.DefaultCredentials; iWindowLoaded = new AutoResetEvent(false); iImageCache = new WpfImageCache(kCacheSize, kDownscaleImageSize, kThreadCount); iIconResolver = new IconResolver(); ResourceDictionary dictionary = App.Current.Resources; string assemblyName = System.Reflection.Assembly.GetExecutingAssembly().FullName; string[] resourceDictionaries = { "Shared", "ControlStyles", "ScrollBar", "ComboBox", "ListBox", "TileViewStyle", "WindowChromeStyle", "MenuItem", "Slider" }; foreach (string resourceDictionary in resourceDictionaries) { dictionary.MergedDictionaries.Add(Application.LoadComponent(new Uri(string.Format("/{0};component/Resources/{1}.xaml", assemblyName, resourceDictionary), UriKind.Relative)) as ResourceDictionary); } InitializeComponent(); iUpdateOnExit = false; var invoker = new Invoker(this.Dispatcher); iHelper = new HelperKinsky(Environment.GetCommandLineArgs(), invoker); #if DEBUG Xamarin.Insights.Initialize(kApiKeyDummyProject, iHelper.Version, iHelper.Product); #else Xamarin.Insights.Initialize(kApiKey, iHelper.Version, iHelper.Product); #endif ICrashLogDumper d = new CrashLogDumperForm(this, iHelper.Title, iHelper.Product, iHelper.Version); iHelper.AddCrashLogDumper(d); System.Windows.Forms.Application.SetUnhandledExceptionMode(System.Windows.Forms.UnhandledExceptionMode.ThrowException); iUIOptions = new UiOptions(iHelper); InitialiseStack(); Xamarin.Insights.Identify(iHelper.OptionInstallId.Value, null); WindowChrome.SetIsMiniModeActive(mainWindowChrome, iUIOptions.MiniMode); SetWindowDimensions(); iProcessedOptions = true; AllowsTransparency = iTransparentOption.Native; this.Loaded += new RoutedEventHandler(KinskyDesktop_Loaded); iNotificationController = new NotificationController(invoker, iHelper, new NotificationServerHttp(NotificationServerHttp.DefaultUri(iHelper.Product)), this, NotificationController.DefaultTimespan); viewKinsky.ShowOptionsDialog = () => { ShowOptionsDialog(false); }; Uri iconUri = new Uri("pack://application:,,,/icon.ico", UriKind.RelativeOrAbsolute); //make sure your path is correct, and the icon set as Resource this.Icon = BitmapFrame.Create(iconUri, BitmapCreateOptions.PreservePixelFormat, BitmapCacheOption.OnLoad); }
internal void Initialise(KinskyDesktop aKinskyDesktop, HelperKinsky aHelperKinsky, ContentDirectoryLocator aLocator, IViewSaveSupport aSaveSupport, IPlaylistSupport aPlaylistSupport, DropConverter aBrowseDropConverter, DropConverter aViewDropConverter, ViewMaster aViewMaster, UiOptions aUIOptions, OptionBool aPlaylistGroupingOption, ModelSenders aSenders ) { iHelperKinsky = aHelperKinsky; iLocator = aLocator; iBrowseDropConverter = aBrowseDropConverter; iViewMaster = aViewMaster; iUIOptions = aUIOptions; iSenders = aSenders; iPlaylistSupport = aPlaylistSupport; aPlaylistSupport.EventIsDraggingChanged += new EventHandler <EventArgs>(aPlaylistSupport_EventIsDraggingChanged); iViewDropConverter = aViewDropConverter; iBrowser = new Browser(new Location(iLocator.Root)); ViewWidgetButton upButtonWidgetBrowser = new ViewWidgetButton(buttonUpBrowser); breadcrumbBrowser.SetButtonUpDirectory(upButtonWidgetBrowser); iNavigationController = new NavigationController(iBrowser, iLocator, breadcrumbBrowser, iHelperKinsky); iBookmarks = new ViewWidgetBookmarks(iHelperKinsky, iHelperKinsky.BookmarkManager, lstBookmarks, iBrowser, popupBookmarksList, popupAddBookmark, buttonShowBookmarksList, buttonShowAddBookmark, buttonAddBookmark, buttonCancelAddBookmark, txtTitle, txtBreadcrumb, pnlAddBookmark, iNavigationController); iBrowserWidget = new ViewWidgetBrowser(iPlaylistSupport, iBrowseDropConverter, buttonChangeSize, buttonToggleListView, iUIOptions, sliderSize, iNavigationController, iBookmarks); pnlBrowser.Children.Add(iBrowserWidget); iRoomSelector = new ViewWidgetSelectorRoom(lstRooms, ctlSelectRoom, btnStandbyAll); IPlaylistWidget playlistMediaRenderer = new PlaylistWidget(aViewDropConverter, aPlaylistSupport, iUIOptions); IPlaylistWidget playlistRadio = new PlaylistWidget(aViewDropConverter, aPlaylistSupport, iUIOptions); IPlaylistWidget playlistReceiver = new PlaylistWidget(aViewDropConverter, aPlaylistSupport, iUIOptions); iViewWidgetPlaylistMediaRenderer = new ViewWidgetPlaylistMediaRenderer(pnlPlaylist, playlistMediaRenderer, aSaveSupport, aPlaylistSupport, aPlaylistGroupingOption.Native); iViewWidgetPlaylistRadio = new ViewWidgetPlaylistRadio(pnlPlaylist, playlistRadio, aSaveSupport); iViewWidgetPlaylistAux = new ViewWidgetPlaylistAux(pnlPlaylist); iViewWidgetPlaylistDiscPlayer = new ViewWidgetPlaylistDiscPlayer(pnlPlaylist); iViewWidgetPlaylistReceiver = new ViewWidgetPlaylistReceiver(pnlPlaylist, playlistReceiver, aSaveSupport, iSenders); iViewWidgetButtonStandby = new ViewWidgetButtonStandby(this); iViewWidgetButtonSave = new ViewWidgetButtonSave(buttonSave, aViewDropConverter, aSaveSupport); iViewWidgetButtonWasteBin = new ViewWidgetButtonWasteBin(buttonDelete, aViewDropConverter); iViewWidgetPlayMode = new ViewWidgetPlayMode(buttonRepeat, buttonShuffle); iViewWidgetTransportControl = new ViewWidgetTransportControl(aKinskyDesktop, threeKArray, aViewDropConverter, aPlaylistSupport); iViewWidgetPlayNowNextLater = new ViewWidgetPlayNowNextLater(aViewDropConverter, aPlaylistSupport, buttonPlayNow, buttonPlayNext, buttonPlayLater); iViewWidgetVolumeControl = new ViewWidgetVolumeControl(aKinskyDesktop, rotaryControlVolume, rockerControlVolume); iViewWidgetMediaTime = new ViewWidgetMediaTime(rotaryControlMediaTime, rockerControlMediaTime); iViewWidgetTrack = new ViewWidgetTrack(viewWidgetTrackDisplay, new IPlaylistWidget[] { playlistMediaRenderer, playlistRadio, playlistReceiver }); SplitBarPositionLeft = new GridLength(iUIOptions.BrowserSplitterLocationLeft, GridUnitType.Star); SplitBarPositionRight = new GridLength(iUIOptions.BrowserSplitterLocationRight, GridUnitType.Star); iSourceSelector = new ViewWidgetSelectorSource(lstSources, ctlSelectSource); iMediatorHouse = new MediatorHouse(iRoomSelector, iSourceSelector, pnlPlaylist, lstRooms, lstSources, buttonSelectRoom, buttonSelectSource, popupRoomSelection, popupSourceSelection, btnStandbyAll);; aPlaylistGroupingOption.EventValueChanged += (d, e) => { iViewWidgetPlaylistMediaRenderer.SetGroupByAlbum(aPlaylistGroupingOption.Native); }; iInitialised = true; }