Пример #1
0
        public static ViewSettings Load(string path)
        {
            ViewSettings vs = new ViewSettings();

            if (System.IO.File.Exists(path))
            {
                System.Xml.Serialization.XmlSerializer xs = new System.Xml.Serialization.XmlSerializer(vs.GetType());

                using (System.IO.StreamReader s = new System.IO.StreamReader(path))
                {
                    vs = (ViewSettings)xs.Deserialize(s);
                    return(vs);
                }
            }
            else
            {
                return(null);
            }
        }
Пример #2
0
        public static void Launch(ViewSettings vs)
        {
            if (System.IO.File.Exists(vs.ViewerPath))
            {
                Logger.Log("Starting NTRViewer.");
                StringBuilder args = new StringBuilder();

                args.Append("-l ");
                args.Append(((vs.ViewMode == Orientations.Vertical) ? "1" : "0") + " ");
                args.Append("-t " + vs.TopScale.ToString() + " ");
                args.Append("-b " + vs.BottomScale.ToString());

                System.Diagnostics.ProcessStartInfo p = new System.Diagnostics.ProcessStartInfo(vs.ViewerPath);
                p.Verb      = "runas";
                p.Arguments = args.ToString().Replace(',', '.');
                System.Diagnostics.Process.Start(p);
            }
            else
            {
                Logger.Log("NTRViewer not found. Config -> Define NTR Viewer path");
            }
        }
Пример #3
0
 public ClientManager(ViewSettings vs)
 {
     Client            = new NtrClient();
     _ViewSettings     = vs;
     Client.Connected += onClientConnected;
 }