Пример #1
0
        /// <summary>
        /// Start app.
        /// </summary>
        /// <param name="frame">The graphical <see cref="Frame"/>.</param>
        /// <param name="networking">The <see cref="IAppNetworking"/> implementation.</param>
        /// <param name="platformFunctions">The <see cref="IPlatformFunctions"/> implementation.</param>
        /// <param name="platform">The <see cref="Platform"/> type.</param>
        /// <param name="groups">The user's groups.</param>
        public void Initialize(Frame frame, IAppNetworking networking, IPlatformFunctions platformFunctions, Platform platform, string[] groups)
        {
            this.Groups                      = groups;
            this.PlatformFunctions           = platformFunctions;
            this.Frame                       = frame;
            this.Platform                    = platform;
            this.packetManager               = networking.PacketManager();
            this.Networking                  = new AppNetworking(networking);
            this.registeredPacketDefinitions = new List <PacketDefinition>();

            Run();
        }
Пример #2
0
        /// <summary>
        /// Create <see cref="MainApp"/>.
        /// </summary>
        /// <param name="networking">A <see cref="IAppNetworking"/> implementation.</param>
        /// <param name="platformFunctions">A <see cref="IPlatformFunctions"/> implementation.</param>
        /// <param name="platform">The <see cref="Platform"/>.</param>
        public MainApp(IAppNetworking networking, IPlatformFunctions platformFunctions, Platform platform) :
            base(networking, platformFunctions, platform)
        {
            this.drawLogin               = true;
            this.drawAppSelectionView    = false;
            this.waitingForAuthorization = false;
            this.appSelectionView        = new AppSelectionView(this);
            this.loginView               = new LoginView(this);
            this.runningConnectCheck     = false;
            this.IgnoreDisconnect        = false;

            this.downScaleNetworkDisconnectedWindow = 0;

            this.Networking.GroupList         += Networking_GroupList;
            this.Networking.NetworkDisconnect += Networking_NetworkDisconnect;
            this.Networking.UnAuthorized      += Networking_UnAuthorized;
        }
Пример #3
0
Файл: Main.cs Проект: j0nat/JCIW
        /// <summary>
        /// Creates implementation of <see cref="IApp"/>.
        /// </summary>
        /// <param name="networking">A <see cref="IAppNetworking"/> implementation.</param>
        /// <param name="platformFunctions">A <see cref="IPlatformFunctions"/> implementation.</param>
        /// <param name="platform">The <see cref="Platform"/>.</param>
        public Main(IAppNetworking networking, IPlatformFunctions platformFunctions, Platform platform)
        {
            this.CurrentlyRunningAppName = "";
            this.currentApp        = null;
            this.UserGroups        = new List <string>();
            this.Networking        = networking;
            this.PlatformFunctions = platformFunctions;
            this.Platform          = platform;
            this.apps  = new Dictionary <long, ModuleInstance>();
            this.Frame = new Frame(platform, platformFunctions, this);

            if (platform == Platform.Desktop)
            {
                Local.Folder = AppDomain.CurrentDomain.BaseDirectory;
            }
            else
            {
                if (platform == Platform.Android)
                {
                    Local.Folder = Environment.GetFolderPath(Environment.SpecialFolder.Personal);
                }
            }
        }
Пример #4
0
 /// <summary>
 /// Create <see cref="AppNetworking"/>.
 /// </summary>
 /// <param name="appNetworking">The <see cref="IAppNetworking"/> implementation.</param>
 public AppNetworking(IAppNetworking appNetworking)
 {
     this.appNetworking = appNetworking;
 }