public User(string name, string password, ProfileType profileType)
     : base(name, password, profileType)
 {
     this.readItems = new List<IReadable>();
     this.currentlyReadItems = new List<IReadable>();
     this.wishedToReadItems = new List<IReadable>();
 }
        /// <summary>
        /// Setup OpenGL and load resources here.
        /// </summary>
        /// <param name="e">Not used.</param>
        protected override void OnLoad(EventArgs e)
        {
            GL.ClearColor(0.1f, 0.3f, 0.6f, 0.0f); /* Blue background */

            this.CgContext = CgNet.Context.Create();
            CgGL.SetDebugMode(false);
            this.CgContext.ParameterSettingMode = ParameterSettingMode.Deferred;

            vertexProfile = ProfileClass.Vertex.GetLatestProfile();
            vertexProfile.SetOptimalOptions();

            vertexProgram =
                this.CgContext.CreateProgramFromFile(
                    ProgramType.Source, /* Program in human-readable form */
                    VertexProgramFileName, /* Name of file containing program */
                    vertexProfile, /* Profile: OpenGL ARB vertex program */
                    VertexProgramName, /* Entry function name */
                    null); /* No extra compiler options */
            vertexProgram.Load();

            fragmentProfile = ProfileClass.Fragment.GetLatestProfile();
            fragmentProfile.SetOptimalOptions();

            fragmentProgram =
                this.CgContext.CreateProgramFromFile(
                    ProgramType.Source, /* Program in human-readable form */
                    FragmentProgramFileName, /* Name of file containing program */
                    fragmentProfile, /* Profile: OpenGL ARB vertex program */
                    FragmentProgramName, /* Entry function name */
                    null); /* No extra compiler options */
            fragmentProgram.Load();
        }
Beispiel #3
0
 public SEOProfile(string applicationName, string userName, ProfileType profileType)
 {
     LastActivityDate = DateTime.Now;
     LastPropertyChangedDate = DateTime.Now;
     ApplicationName = applicationName;
     Name = userName;
     ProfileType = profileType;
 }
 public ProfilerEntry(ProfileType type, int sequence, int thread, long functionid, long time, string method, string runtime)
 {
     Type = type;
     Sequence = sequence;
     Thread = thread;
     Functionid = functionid;
     Time = time;
     Method = method;
     Runtime = runtime;
 }
Beispiel #5
0
        public static ProfileType SetProfileDefaults(ProfileType profile)
        {
            profile.CustomerName     = "Test User";
            profile.CustomerAddress1 = "101 Main St.";
            profile.CustomerAddress2 = "Apt. 4";
            profile.CustomerCity     = "New York";
            profile.CustomerState    = "NY";
            profile.CustomerZIP      = "10012";
            profile.CustomerEmail    = "*****@*****.**";
            profile.CustomerPhone    = "9089089080";
            profile.CCAccountNum     = "4788250000028291";
            profile.CCExpireDate     = "1120";

            return(profile);
        }
        public override string GetStepParameters()
        {
            var parameters = new List <string>();

            parameters.Add(ProfileType.ToStepValue());
            parameters.Add(ProfileName != null ? ProfileName.ToStepValue() : "$");
            parameters.Add(Position != null ? Position.ToStepValue() : "$");
            parameters.Add(Depth != null ? Depth.ToStepValue() : "$");
            parameters.Add(Width != null ? Width.ToStepValue() : "$");
            parameters.Add(WallThickness != null ? WallThickness.ToStepValue() : "$");
            parameters.Add(Girth != null ? Girth.ToStepValue() : "$");
            parameters.Add(InternalFilletRadius != null ? InternalFilletRadius.ToStepValue() : "$");

            return(string.Join(", ", parameters.ToArray()));
        }
Beispiel #7
0
        public static bool IsProfile(this HtmlHelper helper, ProfileType checkProfile)
        {
            if (HttpContext.Current.User.Identity.IsAuthenticated)
            {
                HttpCookie profileCookie = HttpContext.Current.Request.Cookies["profile"];

                if (profileCookie != null)
                {
                    ProfileType profileType = (ProfileType)Enum.Parse(typeof(ProfileType), profileCookie.Value);
                    return(profileType == checkProfile);
                }
            }

            return(false);
        }
        public override string GetStepParameters()
        {
            var parameters = new List <string>();

            parameters.Add(ProfileType.ToStepValue());
            parameters.Add(ProfileName != null ? ProfileName.ToStepValue() : "$");
            parameters.Add(Position != null ? Position.ToStepValue() : "$");
            parameters.Add(XDim != null ? XDim.ToStepValue() : "$");
            parameters.Add(YDim != null ? YDim.ToStepValue() : "$");
            parameters.Add(WallThickness != null ? WallThickness.ToStepValue() : "$");
            parameters.Add(InnerFilletRadius != null ? InnerFilletRadius.ToStepValue() : "$");
            parameters.Add(OuterFilletRadius != null ? OuterFilletRadius.ToStepValue() : "$");

            return(string.Join(", ", parameters.ToArray()));
        }
Beispiel #9
0
        public Filling(Surface surfaceParent, FillingType fillingType, ProfileType profileType)
            : base()
        {
            if (surfaceParent.ChildrenCount > 0)
            {
                throw new ArgumentException("Invalid surface parent provided.");
            }

            Model = new FillingModel();
            Model.PropertyChanged += Model_PropertyChanged;
            Model.SurfaceParent    = surfaceParent;
            Model.FillingType      = fillingType;
            Model.ProfileType      = profileType;
            BoundsChanged         += Filling_BoundsChanged;
        }
        public async Task <ClientResponse> ProfileAsync(ProfileType profile, string traceNumber = null)
        {
            var item    = profile.CopyToBase();
            var xmlBody = new Request {
                Item = item
            };
            var url     = Endpoint.Url();
            var request = new ClientRequest
            {
                Request     = xmlBody,
                TraceNumber = traceNumber,
            };

            return(await SendRequestAsync(url, request));
        }
Beispiel #11
0
 //********************************************************************************
 /// <summary>
 /// Defines the path of the profile in the registry or as file
 /// </summary>
 /// <param name="path">RegistryKey "Company name\Application" or path of the file</param>
 /// <param name="type">Registry or File</param>
 /// <returns></returns>
 /// <created>UPh,21.09.2006</created>
 /// <changed>UPh,21.09.2006</changed>
 //********************************************************************************
 internal static void SetProfileName(string path, ProfileType type)
 {
     m_Type = type;
     if (type == ProfileType.Registry)
     {
         m_Name = "Software\\" + path;
     }
     else if (type == ProfileType.IniFile)
     {
         m_Name = path;
     }
     else
     {
         throw new ArgumentException("Invalid ProfileType. Only Registry and File is valid.");
     }
 }
Beispiel #12
0
        public override string GetStepParameters()
        {
            var parameters = new List <string>();

            parameters.Add(ProfileType.ToStepValue());
            parameters.Add(ProfileName != null ? ProfileName.ToStepValue() : "$");
            parameters.Add(Position != null ? Position.ToStepValue() : "$");
            parameters.Add(Depth != null ? Depth.ToStepValue() : "$");
            parameters.Add(Width != null ? Width.ToStepValue() : "$");
            parameters.Add(Thickness != null ? Thickness.ToStepValue() : "$");
            parameters.Add(FilletRadius != null ? FilletRadius.ToStepValue() : "$");
            parameters.Add(EdgeRadius != null ? EdgeRadius.ToStepValue() : "$");
            parameters.Add(LegSlope != null ? LegSlope.ToStepValue() : "$");

            return(string.Join(", ", parameters.ToArray()));
        }
Beispiel #13
0
        private Profile NewProfile(Profile oriProfile, ProfileType newProfileType)
        {
            Profile newP;

            switch (newProfileType)
            {
            case ProfileType.T:
                newP = new TT(oriProfile.Name, width: 1, height: 0.8, webThickness: 0.2, flangeThickness: 0.1);
                break;

            default:      //
                newP = new Rectangular(oriProfile.Name, width: 1, height: 0.8);
                break;
            }
            return(newP);
        }
Beispiel #14
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="mobilePhone"></param>
        /// <param name="password"></param>
        /// <param name="selectedProfileType"></param>
        /// <param name="signedUpInfo"></param>
        /// <param name="status"></param>
        /// <returns></returns>
        public static UserPassport SignUp(string mobilePhone, string password, ProfileType selectedProfileType, SignedUpInfo signedUpInfo, out SignStatus status)
        {
            status = SignStatus.None;
            status = CheckMobilePhone(mobilePhone);
            if (status != SignStatus.None)
            {
                return(null);
            }

            status = CheckPassword(password);
            if (status != SignStatus.None)
            {
                return(null);
            }

            return(SignUp(null, mobilePhone, null, password, selectedProfileType, signedUpInfo, out status));
        }
        /// <summary>
        /// Sets (add or overwrite) the content of a specific profile.
        /// </summary>
        /// <param name="interfaceId">Interface ID</param>
        /// <param name="profileType">Profile type</param>
        /// <param name="profileXml">Profile XML</param>
        /// <param name="profileSecurity">Security descriptor for all-user profile</param>
        /// <param name="overwrite">Whether to overwrite an existing profile</param>
        /// <returns>True if successfully set. False if not.</returns>
        /// <remarks>
        /// If the content of the profile XML is not valid, a Win32Exception will be thrown.
        /// In such case, check the reason code in the message and see
        /// https://msdn.microsoft.com/en-us/library/windows/desktop/ms707394.aspx
        /// https://technet.microsoft.com/en-us/library/3ed3d027-5ae8-4cb0-ade5-0a7c446cd4f7#BKMK_AppndxE
        /// </remarks>
        public static bool SetProfile(Guid interfaceId, ProfileType profileType, string profileXml, string profileSecurity, bool overwrite)
        {
            if (interfaceId == Guid.Empty)
            {
                throw new ArgumentException(nameof(interfaceId));
            }

            if (string.IsNullOrWhiteSpace(profileXml))
            {
                throw new ArgumentNullException(nameof(profileXml));
            }

            using (var client = new Base.WlanClient())
            {
                return(Base.SetProfile(client.Handle, interfaceId, profileType, profileXml, profileSecurity, overwrite));
            }
        }
Beispiel #16
0
        public static IProfileParser GetParser(ProfileType type, ILogger logger)
        {
            switch (type)
            {
            case ProfileType.General: return(new GeneralParser(logger));

            case ProfileType.Surge: return(new SurgeParser(logger));

            case ProfileType.SurgeList: return(new SurgeListParser(logger));

            case ProfileType.Clash: return(new ClashParser(logger));

            case ProfileType.Surfboard: return(new SurfboardParser(logger));

            default: return(null);
            }
        }
Beispiel #17
0
        public NewProfile(string auto_name, string format, ProfileType ptype, System.Windows.Window owner)
        {
            this.InitializeComponent();

            Owner = owner;

            textbox_profile.Text = auto_name;
            this.format = format;
            this.ptype = ptype;

            Title = Languages.Translate("New profile");
            button_cancel.Content = Languages.Translate("Cancel");
            button_ok.Content = Languages.Translate("OK");
            text_profile.Content = Languages.Translate("Name of new profile:");

            ShowDialog();
        }
Beispiel #18
0
        public override string GetStepParameters()
        {
            var parameters = new List <string>();

            parameters.Add(ProfileType.ToStepValue());
            parameters.Add(ProfileName != null ? ProfileName.ToStepValue() : "$");
            parameters.Add(Position != null ? Position.ToStepValue() : "$");
            parameters.Add(OverallWidth != null ? OverallWidth.ToStepValue() : "$");
            parameters.Add(OverallDepth != null ? OverallDepth.ToStepValue() : "$");
            parameters.Add(WebThickness != null ? WebThickness.ToStepValue() : "$");
            parameters.Add(FlangeThickness != null ? FlangeThickness.ToStepValue() : "$");
            parameters.Add(FilletRadius != null ? FilletRadius.ToStepValue() : "$");
            parameters.Add(FlangeEdgeRadius != null ? FlangeEdgeRadius.ToStepValue() : "$");
            parameters.Add(FlangeSlope != null ? FlangeSlope.ToStepValue() : "$");

            return(string.Join(", ", parameters.ToArray()));
        }
Beispiel #19
0
 /// <summary>
 /// Constructor
 /// </summary>
 public ProfilePack(
     string name,
     InterfaceInfo interfaceInfo,
     ProfileType profileType,
     string profileXml,
     int position,
     int signalQuality,
     bool isConnected)
 {
     this.Name          = name;
     this.Interface     = interfaceInfo;
     this.ProfileType   = profileType;
     Document           = new ProfileDocument(profileXml);
     this.Position      = position;
     this.SignalQuality = signalQuality;
     this.IsConnected   = isConnected;
 }
        public static string ToKey(this ProfileType profileType)
        {
            switch (profileType)
            {
            case ProfileType.Multiplayer:
                return("mp");

            case ProfileType.Blackout:
                return("blackout");

            case ProfileType.Zombies:
                return("zombies");

            default:
                throw new ArgumentOutOfRangeException(nameof(profileType), profileType, null);
            }
        }
Beispiel #21
0
        public NewProfile(string auto_name, string format, ProfileType ptype, System.Windows.Window owner)
        {
            this.InitializeComponent();

            Owner = owner;

            textbox_profile.Text = auto_name;
            this.format          = format;
            this.ptype           = ptype;

            Title = Languages.Translate("New profile");
            button_cancel.Content = Languages.Translate("Cancel");
            button_ok.Content     = Languages.Translate("OK");
            text_profile.Content  = Languages.Translate("Name of new profile:");

            ShowDialog();
        }
Beispiel #22
0
        //Método estático de conveniencia para generar la url de documento dado un perfil
        public static string GetDefaultRemoteLocation(ProfileType perfil, string perfilPersonalizado, string version)
        {
            string url     = string.Empty;
            string baseUrl = AdministradorPreferencias.Read(PrefsGlobal.SGDDownloadURL);

            try
            {
                Uri baseUri = new Uri(baseUrl);
                Uri docUri  = new Uri(baseUri, Root.BuildFormalFileName(perfil, perfilPersonalizado, Loader.Version));
                url = docUri.AbsoluteUri;
            }
            catch
            {
                //Simplemente devolvemos la cadena vacía
            }
            return(url);
        }
        public Profile(int code = 1)
        {
            type = code > 0 && code < ALL.Length ? ALL[code] : ProfileType.UNKNOWN;
            switch (type)
            {
            case ProfileType.AAC_MAIN:
            case ProfileType.AAC_LC:
            case ProfileType.AAC_LTP:
            case ProfileType.AAC_SBR:
            case ProfileType.AAC_SSR:
            case ProfileType.ER_AAC_LC:
            case ProfileType.ER_AAC_LTP:
            case ProfileType.ER_AAC_LD: supported = true; break;

            default: supported = false; break;
            }
        }
        internal static bool SetProfile(Base.WlanClient client, Guid interfaceId, ProfileType profileType, string profileXml, string profileSecurity, bool overwrite)
        {
            if (interfaceId == Guid.Empty)
            {
                throw new ArgumentException("The specified interface ID is invalid.", nameof(interfaceId));
            }
            if (string.IsNullOrWhiteSpace(profileXml))
            {
                throw new ArgumentNullException(nameof(profileXml));
            }

            using var container = new DisposableContainer <Base.WlanClient>(client);

            var profileTypeFlag = ProfileTypeConverter.ConvertBack(profileType);

            return(Base.SetProfile(container.Content.Handle, interfaceId, profileTypeFlag, profileXml, profileSecurity, overwrite));
        }
Beispiel #25
0
        //attr:profile is optional, set to view a particular public profile
        public Profile(ProfileType type, PublicProfile profile = PublicProfile.SAMUEL_GIBBONS)
        {
            InitializeComponent();
            menu.initIndex(2);
            if (type == ProfileType.publicProfile)
            {
                foreach (UIElement child in detailsGrid.Children)
                {
                    if (child is TextBox)
                    {
                        ((TextBox)child).IsReadOnly = true;
                        MaterialDesignThemes.Wpf.TextFieldAssist.SetDecorationVisibility(child, Visibility.Hidden);
                        ((TextBox)child).BorderThickness = new Thickness(0);
                    }
                }
                detailsGrid.Children.Remove(this.editPhotosBtn);

                name.Text      = publicNames[(int)profile];
                age.Text       = publicAges[(int)profile].ToString();
                gender.Text    = publicGenders[(int)profile];
                job.Text       = publicJobs[(int)profile];
                education.Text = publicEducations[(int)profile];

                bio.Text = Profile.publicLoremIpsum.Aggregate((string a, string b) => { return(a + b); });
            }
            else
            {
                detailsGrid.Children.Remove(messageBtn);
                name.Text       = personalName;
                name.IsReadOnly = false;

                age.Text       = personalAge.ToString();
                gender.Text    = personalGender;
                age.IsReadOnly = true;
                MaterialDesignThemes.Wpf.TextFieldAssist.SetDecorationVisibility(age, Visibility.Hidden);
                age.BorderThickness = new Thickness(0);
                gender.IsReadOnly   = true;
                MaterialDesignThemes.Wpf.TextFieldAssist.SetDecorationVisibility(gender, Visibility.Hidden);
                gender.BorderThickness = new Thickness(0);

                job.Text       = personalJob;
                education.Text = personalEducation;
                bio.Text       = personalBio;
            }
        }
Beispiel #26
0
    public void SetProfileType(ProfileType type)
    {
        if (Application.platform != RuntimePlatform.OSXEditor && Application.platform != RuntimePlatform.WindowsEditor)
        {
#if UNITY_ANDROID
            if (mProfile != null)
            {
                AndroidJavaClass  enumClass = new AndroidJavaClass("com.tendcloud.tenddata.TDGAProfile$ProfileType");
                AndroidJavaObject obj       = enumClass.CallStatic <AndroidJavaObject>("valueOf", type.ToString());
                mProfile.Call("setProfileType", obj);
                enumClass.Dispose();
            }
#endif
#if UNITY_IPHONE
            TDGASetProfileType((int)type);
#endif
        }
    }
        public void OnServiceConnected(ProfileType profile, IBluetoothProfile proxy)
        {
            BluetoothDevice result      = null;
            StringBuilder   deviceNames = new StringBuilder();
            var             devices     = this.bluetoothAdapter.BondedDevices;

            if (null != devices)
            {
                foreach (var bluetoothDevice in devices)
                {
                    deviceNames.Append(bluetoothDevice.Name + ";");
                }
            }

            var allDevices = deviceNames.ToString();

            this.OnServiceConnectComplete();
        }
Beispiel #28
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);
            int version = reader.ReadInt();

            m_GateDirection      = (DirectionType)reader.ReadInt();
            m_ProfileTypeAllowed = (ProfileType)reader.ReadInt();

            //Version 1
            if (version >= 1)
            {
                m_MurdererFriendly = reader.ReadBool();
            }

            //------------

            m_UOACZDestinations.Add(this);
        }
Beispiel #29
0
        public PVCFrame(float width, float height, ProfileType profileType)
            : base()
        {
            Brush = new SolidBrush(Color.White);

            Model = new PVCFrameModel();
            Model.PropertyChanged += Model_PropertyChanged;

            Model.ProfileType         = profileType;     // Setting profile type is done in the very first step always
            Model.Width               = width;
            Model.Height              = height;
            Model.Code                = "A0";
            Surface                   = new Surface();
            Surface.Frame             = this;
            Surface.Model.FrameParent = this;

            Arc arc = new Arc(this);
        }
Beispiel #30
0
        public void OnServiceConnected(ProfileType profile, IBluetoothProfile proxy)
        {
            string msg = "Profile Type : {0}".FormatWith(profile.ToString());

            System.Diagnostics.Debug.WriteLine(msg);

            foreach (BluetoothDevice item in proxy.ConnectedDevices)
            {
                msg = "Connected Device Name:{0}".FormatWith(item.Name);
                System.Diagnostics.Debug.WriteLine(msg);

                var args = new Util.XamariN.BLuetoothEventArgs(new BluetoothDeviceInfo(item.Name, item.Address, (int)item.Type, (int)item.BondState)
                {
                    IsConnected = true
                });
                Util.XamariN.BluetoothEvents.OnUpdateInfo(args);
            }
        }
 public string GetProfileElements(ProfileType profieType, string productId)
 {
     return(this.tryAction(
                createRequest: () => this.getNewRequest("/Companies/UralsibLife/RightDecision/Resources/api.vlib", Method.POST)
                .AddJsonBody(new RpcInput <string[]>()
     {
         tid = 22,
         action = "Profile",
         method = "LoadValue",
         type = "rpc",
         data = new string[]
         {
             profieType.ToString(),
             productId
         }
     }),
                createResponse: request => this.execute(request),
                createResult: response => this.GetRpcDataResult <Dictionary <string, string> >(response)).Values.Single());
 }
Beispiel #32
0
        private ProfileForm(ProfilesFile profiles, bool copy = false)
        {
            Profiles = profiles;

            InitializeComponent();

            if (!copy && CurrentProfile.IsDefault)
            {
                Label_NoEdit.Visible        = true;
                ComboBox_Type.Enabled       = false;
                TextBox_ProfileName.Enabled = false;
                ComboBox_Version.Enabled    = false;
            }

            ComboBox_Type.DataSource    = ProfileType.ToArray();
            ComboBox_Type.SelectedIndex = ProfileType.GetIndex(CurrentProfile.ProfileType);

            if (copy)
            {
                TextBox_ProfileName.Text = $"Copy of {CurrentProfile.Name}";
            }
            else
            {
                TextBox_ProfileName.Text = CurrentProfile.Name;
                OldProfile = CurrentProfile;
            }
            ComboBox_Version.SelectedIndex = ComboBox_Version.Items.IndexOf(CurrentProfile.Version.ToString());
            TextBox_LaunchArgs.Text        = CurrentProfile.LaunchArgs;

            ComboBox_GameMode.Items.AddRange(CurrentProfile.Folder.GameModeFolder.GetGameModes().Select(gm => gm.ModificationInfo.Name).ToArray());


            var chk = new DataGridViewCheckBoxColumn {
                Name = "Enabled"
            };

            DataGridView_Modifications.Columns.Add(chk);
            DataGridView_Modifications.Columns[0].AutoSizeMode = DataGridViewAutoSizeColumnMode.ColumnHeader;

            var list = new BindingList <ModificationInfoTable>(new List <ModificationInfoTable>());

            DataGridView_Modifications.DataSource = list;
        }
Beispiel #33
0
 public void SetValues(ProfileData profileData)
 {
     type   = profileData.type;
     gates  = profileData.gates;
     w      = profileData.w;
     h      = profileData.h;
     n      = profileData.n;
     gamma  = profileData.gamma;
     alpha  = profileData.alpha;
     gammaR = Mathf.Deg2Rad * gamma;
     alphaR = Mathf.Deg2Rad * alpha;
     e      = profileData.e;
     es     = profileData.es;
     t      = profileData.t;
     r1     = profileData.r1;
     betaP  = profileData.betaP;
     beta0  = profileData.beta0;
     betaK  = profileData.betaK;
     betaL  = profileData.betaL;
     beta0R = Mathf.Deg2Rad * beta0;
     betaPR = Mathf.Deg2Rad * betaP;
     betaKR = Mathf.Deg2Rad * betaK;
     betaLR = Mathf.Deg2Rad * betaL;
     s      = profileData.s;
     l1     = profileData.l1;
     l2     = profileData.l2;
     rL     = profileData.rL;
     r2L    = profileData.r2L;
     r2     = profileData.r2;
     a      = profileData.a;
     rA     = profileData.rA;
     betaA  = profileData.betaA;
     betaAR = Mathf.Deg2Rad * betaA;
     b1     = profileData.b1;
     b2     = profileData.b2;
     bK     = profileData.bK;
     bU     = profileData.bU;
     Calculate();
     inrunPoints       = GenerateInrunPoints();
     landingAreaPoints = GenerateLandingAreaPoints();
     inrunData         = profileData.inrunData;
     landingAreaData   = profileData.landingAreaData;
 }
Beispiel #34
0
    public void Register(ProfileType t, string childID, Type childType)
    {
        Debug.Assert(childType.IsSubclassOf(CommonType));

        if (!ChildIDs.Contains(childID))
        {
            ChildIDs.Add(childID);
        }

        if (SelectedChild == null)
        {
            SelectedChild = childID;
        }

        t.SelectedProfileSet += delegate(object _, EventArgs __)
        {
            SelectedChild = childID;
        };
    }
        public MultipleOptionsTemplateViewModel(
            NameSpace session,
            IOptionsViewModelParent parent,
            GeneralOptions generalOptions,
            IServerSettingsTemplateViewModel serverSettingsViewModel,
            ProfileType profileType)

        {
            _parent  = parent;
            _session = session;
            if (session == null)
            {
                throw new ArgumentNullException(nameof(session));
            }
            if (parent == null)
            {
                throw new ArgumentNullException(nameof(parent));
            }
            if (generalOptions == null)
            {
                throw new ArgumentNullException(nameof(generalOptions));
            }

            _discoverResourcesCommand = new DelegateCommandWithoutCanExecuteDelegation(_ =>
            {
                ComponentContainer.EnsureSynchronizationContext();
                DiscoverResourcesAsync();
            });

            _getAccountSettingsCommand = new DelegateCommandWithoutCanExecuteDelegation(_ =>
            {
                ComponentContainer.EnsureSynchronizationContext();
                GetAccountSettings();
            });

            _networkSettingsViewModel = new NetworkSettingsViewModel();

            SubOptions = new[] { _networkSettingsViewModel };

            _serverSettingsViewModel = serverSettingsViewModel;
            _profileType             = profileType;
            _generalOptions          = generalOptions;
        }
Beispiel #36
0
        /// <summary>
        /// Setup OpenGL and load resources here.
        /// </summary>
        /// <param name="e">Not used.</param>
        protected override void OnLoad(EventArgs e)
        {
            GL.ClearColor(0.1f, 0.3f, 0.6f, 0.0f); /* Blue background */

            this.MyCgContext = Cg.CreateContext();

            CgGL.SetDebugMode(false);
            Cg.SetParameterSettingMode(this.MyCgContext, ParameterSettingMode.Deferred);

            myCgVertexProfile = CgGL.GetLatestProfile(ProfileClass.Vertex);
            CgGL.SetOptimalOptions(myCgVertexProfile);

            this.myCgVertexProgram =
                Cg.CreateProgramFromFile(
                    this.MyCgContext, /* Cg runtime context */
                    ProgramType.Source, /* Program in human-readable form */
                    MyVertexProgramFileName, /* Name of file containing program */
                    myCgVertexProfile, /* Profile: OpenGL ARB vertex program */
                    MyVertexProgramName, /* Entry function name */
                    null); /* No extra compiler options */
            CgGL.LoadProgram(myCgVertexProgram);
        }
        /// <summary>
        /// Setup OpenGL and load resources here.
        /// </summary>
        /// <param name="e">Not used.</param>
        protected override void OnLoad(EventArgs e)
        {
            GL.ClearColor(0.1f, 0.3f, 0.6f, 0.0f); /* Blue background */

            this.CgContext = CgNet.Context.Create();

            CgGL.SetDebugMode(false);
            this.CgContext.ParameterSettingMode = ParameterSettingMode.Deferred;

            vertexProfile = ProfileClass.Vertex.GetLatestProfile();
            vertexProfile.SetOptimalOptions();

            this.CgContext.SetCompilerIncludeString("shader/output.cg",
            @"
            struct Output {
                float4 position : POSITION;
                float3 color    : COLOR;
            };");

            this.CgContext.SetCompilerIncludeString("shader/vertexProgram.cg",
            @"
            #include ""output.cg""
            Output vertexProgram(float2 position : POSITION)
            {
                Output OUT;
                OUT.position = float4(position,0,1);
                OUT.color = float3(0,1,0);
                return OUT;
            }");

            vertexProgram =
              this.CgContext.CreateProgram(
                ProgramType.Source,                 /* Program in human-readable form */
               "#include \"vertexProgram.cg\"\n",
                vertexProfile,         /* Profile: OpenGL ARB vertex program */
                "vertexProgram",           /* Entry function name */
                Args);                    /* Include path options */
            vertexProgram.Load();
        }
    public MultipleOptionsTemplateViewModel (
        IOptionsViewModelParent parent,
        GeneralOptions generalOptions,
        IServerSettingsTemplateViewModel serverSettingsViewModel,
        ProfileType profileType,
        IOptionTasks optionTasks)

    {
      _parent = parent;
      if (parent == null)
        throw new ArgumentNullException (nameof (parent));
      if (generalOptions == null)
        throw new ArgumentNullException (nameof (generalOptions));
      if (optionTasks == null) throw new ArgumentNullException(nameof(optionTasks));

      _discoverResourcesCommand = new DelegateCommandWithoutCanExecuteDelegation (_ =>
      {
        ComponentContainer.EnsureSynchronizationContext();
        DiscoverResourcesAsync();
      });

      _getAccountSettingsCommand = new DelegateCommandWithoutCanExecuteDelegation(_ =>
      {
        ComponentContainer.EnsureSynchronizationContext();
        GetAccountSettings();
      });

      _networkSettingsViewModel = new NetworkSettingsViewModel();

      Items = new[] { _networkSettingsViewModel };

      _serverSettingsViewModel = serverSettingsViewModel;
      _profileType = profileType;
      _optionTasks = optionTasks;
      _generalOptions = generalOptions;
    }
 public static string[] GetOptimalOptions(this Context context, ProfileType profile)
 {
     return Utils.IntPtrToStringArray(NativeMethods.cgGLGetContextOptimalOptions(context.Handle, profile));
 }
Beispiel #40
0
 public Profile(ProfileType profileType=ProfileType.School_Student)
 {
     init(profileType);
 }
Beispiel #41
0
 internal static extern void cgGLDisableProfile(ProfileType profile);
        /// <summary>
        /// Setup OpenGL and load resources here.
        /// </summary>
        /// <param name="e">Not used.</param>
        protected override void OnLoad(EventArgs e)
        {
            GL.ClearColor(0.1f, 0.3f, 0.6f, 0.0f); /* Blue background */
            GL.Enable(EnableCap.DepthTest);
            this.CgContext = CgNet.Context.Create();

            CgGL.SetDebugMode(false);
            this.CgContext.ParameterSettingMode = ParameterSettingMode.Deferred;

            vertexProfile = ProfileClass.Vertex.GetLatestProfile();
            vertexProfile.SetOptimalOptions();

            vertexProgram =
                this.CgContext.CreateProgramFromFile(
                    ProgramType.Source, /* Program in human-readable form */
                    vertexProgramFileName, /* Name of file containing program */
                    vertexProfile, /* Profile: OpenGL ARB vertex program */
                    vertexProgramName, /* Entry function name */
                    null); /* No extra compiler options */
            vertexProgram.Load();

            this.myCgVertexParam_modelViewProj = vertexProgram.GetNamedParameter("modelViewProj");

            fragmentProfile = ProfileClass.Fragment.GetLatestProfile();
            fragmentProfile.SetOptimalOptions();

            /* Specify "color passthrough" fragment program with a string. */
            fragmentProgram =
                this.CgContext.CreateProgramFromFile(
                    ProgramType.Source, /* Program in human-readable form */
                    fragmentProgramFileName,
                    fragmentProfile, /* Profile: latest fragment profile */
                    fragmentProgramName, /* Entry function name */
                    null); /* No extra compiler options */
            fragmentProgram.Load();

            this.myCgFragmentParam_globalAmbient = fragmentProgram.GetNamedParameter("globalAmbient");
            this.myCgFragmentParam_lightColor = fragmentProgram.GetNamedParameter("lightColor");
            this.myCgFragmentParam_lightPosition = fragmentProgram.GetNamedParameter("lightPosition");
            this.myCgFragmentParam_eyePosition = fragmentProgram.GetNamedParameter("eyePosition");
            this.myCgFragmentParam_Ke = fragmentProgram.GetNamedParameter("Ke");
            this.myCgFragmentParam_Ka = fragmentProgram.GetNamedParameter("Ka");
            this.myCgFragmentParam_Kd = fragmentProgram.GetNamedParameter("Kd");
            this.myCgFragmentParam_Ks = fragmentProgram.GetNamedParameter("Ks");
            this.myCgFragmentParam_shininess = fragmentProgram.GetNamedParameter("shininess");

            /* Set light source color parameters once. */
            this.myCgFragmentParam_globalAmbient.Set(this.myGlobalAmbient);
            this.myCgFragmentParam_lightColor.Set(this.myLightColor);
        }
Beispiel #43
0
 private void init(ProfileType type)
 {
     Standards = new ObservableCollection<Standard>();
     Name = "";
     InstituteName = "";
     Address = "";
     Interests = "";
     WayOfStudy = "";
     Gender = 0;
     _lastAccessed = DateTime.Now;
     FileName = "";
     Type = type;
 }
Beispiel #44
0
 //********************************************************************************
 /// <summary>
 /// Defines the path of the profile in the registry or as file 
 /// </summary>
 /// <param name="path">RegistryKey "Company name\Application" or path of the file</param>
 /// <param name="type">Registry or File</param>
 /// <returns></returns>
 /// <created>UPh,21.09.2006</created>
 /// <changed>UPh,21.09.2006</changed>
 //********************************************************************************
 internal static void SetProfileName(string path, ProfileType type)
 {
     m_Type = type;
     if (type == ProfileType.Registry)
     {
         m_Name = "Software\\" + path;
     }
     else if (type == ProfileType.IniFile)
     {
         m_Name = path;
     }
     else
     {
         throw new ArgumentException("Invalid ProfileType. Only Registry and File is valid.");
     }
 }
 public static void SetOptimalOptions(this Context context, ProfileType profile)
 {
     NativeMethods.cgGLSetContextOptimalOptions(context.Handle, profile);
 }
 public static extern void cgSetStateLatestProfile(IntPtr state, ProfileType profile);
 public Profile(string name, string password, ProfileType profileType)
 {
     this.Name = name;
     this.Password = password;
     this.ProfileType = profileType;
 }
Beispiel #48
0
        /// <summary>
        /// Setup OpenGL and load resources here.
        /// </summary>
        /// <param name="e">Not used.</param>
        protected override void OnLoad(EventArgs e)
        {
            this.ResetParticles();

            GL.ClearColor(0.2f, 0.6f, 1.0f, 1); /* Blue background */
            GL.PointSize(6.0f);
            GL.BlendFunc(BlendingFactorSrc.SrcAlpha, BlendingFactorDest.OneMinusSrcAlpha);
            GL.Enable(EnableCap.PointSmooth);
            GL.Enable(EnableCap.Blend);
            GL.Enable(EnableCap.Texture1D);
            this.CgContext = CgNet.Context.Create();
            CgGL.SetDebugMode(false);

            vertexProfile = ProfileClass.Vertex.GetLatestProfile();
            vertexProfile.SetOptimalOptions();

            vertexProgram =
                this.CgContext.CreateProgramFromFile(
                    ProgramType.Source, /* Program in human-readable form */
                    VertexProgramFileName, /* Name of file containing program */
                    vertexProfile, /* Profile: OpenGL ARB vertex program */
                    VertexProgramName, /* Entry function name */
                    null); /* No extra compiler options */

            vertexProgram.Load();

            this.vertexParamGlobalTime =
                vertexProgram.GetNamedParameter("globalTime");

            this.vertexParamAcceleration =
                vertexProgram.GetNamedParameter("acceleration");

            this.vertexParamModelViewProj =
                vertexProgram.GetNamedParameter("modelViewProj");

            fragmentProfile = ProfileClass.Fragment.GetLatestProfile();
            fragmentProfile.SetOptimalOptions();

            fragmentProgram =
                this.CgContext.CreateProgramFromFile(
                    ProgramType.Source, /* Program in human-readable form */
                    FragmentProgramFileName, /* Name of file containing program */
                    fragmentProfile, /* Profile: OpenGL ARB vertex program */
                    FragmentProgramName, /* Entry function name */
                    null); /* No extra compiler options */
            fragmentProgram.Load();
        }
Beispiel #49
0
        public Program CreateProgram(ProfileType profile, string entry, params string[] args)
        {
            if (args != null && args.Length == 0)
            {
                args = null;
            }

            var ptr = NativeMethods.cgCreateProgramFromEffect(this.Handle, profile, entry, args);
            return ptr == IntPtr.Zero ? null : new Program(ptr, true);
        }
Beispiel #50
0
 public static extern void cgGLSetContextOptimalOptions(IntPtr handle, ProfileType profile);
Beispiel #51
0
 public Program CreateProgramFromFile(ProgramType type, string file, ProfileType profile, string entry, params string[] args)
 {
     Utils.CheckArgs(ref args);
     var ptr = NativeMethods.cgCreateProgramFromFile(this.Handle, type, file, profile, entry, args);
     return ptr == IntPtr.Zero ? null : new Program(ptr, true)
     {
         Type = type,
     };
 }
Beispiel #52
0
 public Obj CreateObjFromFile(ProgramType programType, string sourceFile, ProfileType profile, params string[] args)
 {
     Utils.CheckArgs(ref args);
     var ptr = NativeMethods.cgCreateObjFromFile(this.Handle, programType, sourceFile, profile, args);
     return ptr == IntPtr.Zero ? null : new Obj(ptr, true);
 }
Beispiel #53
0
 internal static extern bool cgGLIsProfileSupported(ProfileType profile);
Beispiel #54
0
 internal static extern void cgGLSetOptimalOptions(ProfileType profile);
 public IOptionsViewModel CreateTemplate (Contracts.Options options, GeneralOptions generalOptions, ProfileType type)
 {
   throw new NotSupportedException();
 }
Beispiel #56
0
 internal static extern IntPtr cgGLGetOptimalOptions(ProfileType profile);
Beispiel #57
0
        /// <summary>
        /// Setup OpenGL and load resources here.
        /// </summary>
        /// <param name="e">Not used.</param>
        protected override void OnLoad(EventArgs e)
        {
            GL.ClearColor(0.1f, 0.3f, 0.6f, 0.0f); /* Blue background */

            GL.PixelStore(PixelStoreParameter.UnpackAlignment, 1); /* Tightly packed texture data. */
            GL.Enable(EnableCap.Texture2D);
            GL.BindTexture(TextureTarget.Texture2D, 666);

            GL.TexImage2D(TextureTarget.Texture2D, 0, PixelInternalFormat.Rgb8, 128, 128, 0,
                          PixelFormat.Rgb, PixelType.UnsignedByte, ImageDemon.Array);

            GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureMinFilter, (int)TextureMinFilter.Linear);

            this.CgContext = CgNet.Context.Create();

            CgGL.SetDebugMode(false);
            this.CgContext.ParameterSettingMode = ParameterSettingMode.Deferred;

            vertexProfile = ProfileClass.Vertex.GetLatestProfile();
            vertexProfile.SetOptimalOptions();

            vertexProgram =
                this.CgContext.CreateProgramFromFile(
                    ProgramType.Source, /* Program in human-readable form */
                    VertexProgramFileName, /* Name of file containing program */
                    vertexProfile, /* Profile: OpenGL ARB vertex program */
                    VertexProgramName, /* Entry function name */
                    null); /* No extra compiler options */

            vertexProgram.Load();

            /* No uniform vertex program parameters expected. */
            fragmentProfile = ProfileClass.Fragment.GetLatestProfile();
            fragmentProfile.SetOptimalOptions();

            fragmentProgram =
                this.CgContext.CreateProgramFromFile(
                    ProgramType.Source, /* Program in human-readable form */
                    FragmentProgramFileName, /* Name of file containing program */
                    fragmentProfile, /* Profile: OpenGL ARB vertex program */
                    FragmentProgramName, /* Entry function name */
                    null); /* No extra compiler options */

            fragmentProgram.Load();

            this.fragmentParamDecal = fragmentProgram.GetNamedParameter("decal");

            this.fragmentParamDecal.SetTexture(666);
        }
Beispiel #58
0
 internal static extern void cgGLUnbindProgram(ProfileType profile);
        /// <summary>
        /// Setup OpenGL and load resources here.
        /// </summary>
        /// <param name="e">Not used.</param>
        protected override void OnLoad(EventArgs e)
        {
            GL.ClearColor(0.1f, 0.3f, 0.6f, 0.0f); /* Blue background */
            GL.Enable(EnableCap.DepthTest);
            GL.Enable(EnableCap.Texture2D);
            GL.PixelStore(PixelStoreParameter.UnpackAlignment, 1); /* Tightly packed texture data. */

            GL.GenTextures(2, texObj);

            GL.BindTexture(TextureTarget.Texture2D, texObj[1]);
            /* Load each mipmap level of range-compressed 128x128 brick normal
               map texture. */
            unsafe
            {
                fixed (byte* b = ImageBrick.Array)
                {
                    byte* image = b;

                    int size;
                    int level;
                    for (size = 128, level = 0;
                         size > 0;
                         image += 3 * size * size, size /= 2, level++)
                    {
                        GL.TexImage2D(TextureTarget.Texture2D, level,
                                      PixelInternalFormat.Rgba8, size, size, 0,
                                      PixelFormat.Rgb, PixelType.UnsignedByte, new IntPtr(image));
                    }
                }
            }

            GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureMinFilter, (int)All.LinearMipmapLinear);

            GL.BindTexture(TextureTarget.TextureCubeMap, texObj[0]);
            /* Load each 32x32 face (without mipmaps) of range-compressed "normalize
               vector" cube map. */
            unsafe
            {
                fixed (byte* b = ImageNormcm.Array)
                {
                    byte* image = b;

                    int face;
                    for (face = 0;
                         face < 6;
                         face++, image += 3 * 32 * 32)
                    {
                        GL.TexImage2D(TextureTarget.TextureCubeMapPositiveX + face, 0,
                                      PixelInternalFormat.Rgba8, 32, 32, 0,
                                      PixelFormat.Rgb, PixelType.UnsignedByte, new IntPtr(image));
                    }
                }
            }

            GL.TexParameter(TextureTarget.TextureCubeMap, TextureParameterName.TextureMinFilter, (int)All.Linear);
            GL.TexParameter(TextureTarget.TextureCubeMap, TextureParameterName.TextureWrapS, (int)All.ClampToEdge);
            GL.TexParameter(TextureTarget.TextureCubeMap, TextureParameterName.TextureWrapT, (int)All.ClampToEdge);

            this.CgContext = CgNet.Context.Create();
            CgGL.SetDebugMode(false);
            this.CgContext.ParameterSettingMode = ParameterSettingMode.Deferred;
            this.CgContext.SetManageTextureParameters(true);

            vertexProfile = ProfileClass.Vertex.GetLatestProfile();
            vertexProfile.SetOptimalOptions();

            vertexProgram =
                this.CgContext.CreateProgramFromFile(
                    ProgramType.Source, /* Program in human-readable form */
                    VertexProgramFileName, /* Name of file containing program */
                    vertexProfile, /* Profile: OpenGL ARB vertex program */
                    VertexProgramName, /* Entry function name */
                    null); /* No extra compiler options */
            vertexProgram.Load();

            this.myCgVertexParam_lightPosition =
                vertexProgram.GetNamedParameter("lightPosition");

            this.myCgVertexParam_eyePosition =
                vertexProgram.GetNamedParameter("eyePosition");

            this.myCgVertexParam_modelViewProj =
                vertexProgram.GetNamedParameter("modelViewProj");

            fragmentProfile = ProfileClass.Fragment.GetLatestProfile();
            fragmentProfile.SetOptimalOptions();

            fragmentProgram =
                this.CgContext.CreateProgramFromFile(
                    ProgramType.Source, /* Program in human-readable form */
                    FragmentProgramFileName, /* Name of file containing program */
                    fragmentProfile, /* Profile: OpenGL ARB vertex program */
                    FragmentProgramName, /* Entry function name */
                    null); /* No extra compiler options */
            fragmentProgram.Load();

            myCgFragmentParam_ambient =
                fragmentProgram.GetNamedParameter("ambient");
            myCgFragmentParam_ambient.Set(0.2f);

            myCgFragmentParam_LMd =
                fragmentProgram.GetNamedParameter("LMd");
            myCgFragmentParam_LMd.Set(0.8f, 0.7f, 0.2f);

            myCgFragmentParam_LMs =
                fragmentProgram.GetNamedParameter("LMs");
            myCgFragmentParam_LMs.Set(0.5f, 0.5f, 0.8f);

            myCgFragmentParam_normalMap =
                fragmentProgram.GetNamedParameter("normalMap");

            myCgFragmentParam_normalizeCube =
                fragmentProgram.GetNamedParameter("normalizeCube");

            myCgFragmentParam_normalizeCube2 =
                fragmentProgram.GetNamedParameter("normalizeCube2");

            myCgFragmentParam_normalMap.SetTexture(texObj[1]);
            myCgFragmentParam_normalizeCube.SetTexture(texObj[0]);
            myCgFragmentParam_normalizeCube2.SetTexture(texObj[0]);
        }
Beispiel #60
0
 public static Obj CreateFromFile(Context context, ProgramType programType, string sourceFile, ProfileType profile, params string[] args)
 {
     return context.CreateObjFromFile(programType, sourceFile, profile, args);
 }